Set RTC initial time to be BIOS Release time.
[mirror_edk2.git] / Vlv2TbltDevicePkg / PlatformDxe / Platform.c
index 0f3a414c5b049652a16dbdc712f72dbe9537ae35..760b8b00b47e53eebf9d7f66c2a24a88ea39c5e7 100644 (file)
@@ -1,15 +1,24 @@
 /** @file\r
 \r
-  Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>\r
-                                                                                   \r\r
-  This program and the accompanying materials are licensed and made available under\r\r
-  the terms and conditions of the BSD License that accompanies this distribution.  \r\r
-  The full text of the license may be found at                                     \r\r
-  http://opensource.org/licenses/bsd-license.php.                                  \r\r
-                                                                                   \r\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,            \r\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.    \r\r
-                                                                                   \r\r
+  Copyright (c) 2004  - 2015, Intel Corporation. All rights reserved.<BR>\r
+                                                                                   \r
+\r
+  This program and the accompanying materials are licensed and made available under\r
+\r
+  the terms and conditions of the BSD License that accompanies this distribution.  \r
+\r
+  The full text of the license may be found at                                     \r
+\r
+  http://opensource.org/licenses/bsd-license.php.                                  \r
+\r
+                                                                                   \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,            \r
+\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.    \r
+\r
+                                                                                   \r
+\r
 \r
 Module Name:\r
 \r
@@ -613,11 +622,11 @@ InitializePlatform (
   EFI_STATUS                          Status;\r
   UINTN                               VarSize;\r
   EFI_HANDLE                          Handle = NULL;\r
-\r
   EFI_EVENT                           mEfiExitBootServicesEvent;\r
-\r
-  //\r
-mImageHandle = ImageHandle;\r
+  EFI_EVENT                           RtcEvent;\r
+  VOID                                *RtcCallbackReg = NULL;\r
+  \r
+  mImageHandle = ImageHandle;\r
 \r
   Status = gBS->InstallProtocolInterface (\r
                   &Handle,\r
@@ -789,13 +798,24 @@ mImageHandle = ImageHandle;
                   &mEfiExitBootServicesEvent\r
                   );\r
 \r
+  //\r
+  // Adjust RTC deafult time to be BIOS-built time.\r
+  //\r
+  Status = gBS->CreateEvent (\r
+                    EVT_NOTIFY_SIGNAL,\r
+                    TPL_CALLBACK,\r
+                    AdjustDefaultRtcTimeCallback,\r
+                    NULL,\r
+                    &RtcEvent\r
+                    );\r
+  if (!EFI_ERROR (Status)) {\r
+      Status = gBS->RegisterProtocolNotify (\r
+                      &gExitPmAuthProtocolGuid,\r
+                      RtcEvent,\r
+                      &RtcCallbackReg\r
+                      );\r
 \r
-//\r
-// Tristae Lpc pins at last moment\r
-//\r
-if (mSystemConfiguration.TristateLpc == 1)\r
-{\r
-}\r
+  }\r
 \r
   return EFI_SUCCESS;\r
 }\r