summaryrefslogtreecommitdiffstats
path: root/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2015-12-22 13:52:47 +0000
committerniruiyu <niruiyu@Edk2>2015-12-22 13:52:47 +0000
commit41628cbc7cb267f35db4ba2efca833aa39198cba (patch)
tree3a8c0c5deecf46be8ac1d53bc856677f8db16e69 /PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
parent1b43162d70e8b09297b9cbba2fa7d041e3bc7113 (diff)
downloadedk2-41628cbc7cb267f35db4ba2efca833aa39198cba.tar.gz
edk2-41628cbc7cb267f35db4ba2efca833aa39198cba.tar.bz2
edk2-41628cbc7cb267f35db4ba2efca833aa39198cba.zip
PcAtChipsetPkg/Rtc: Fix a UEFI Win7 boot hang issue
The patch updates the Century value in CMOS location specified by FADT.Century to avoid UEFI Win7 hang during booting. Per the ACPI spec if the FADT.Century is zero, it's not needed to store the century value in CMOS. But UEFI Win7 treats the Century storage is optional only when FADT.Century is 0x80. While Linux strictly follows the ACPI spec and treats Century storage is optional when FADT.Century is 0. So if a platform wants to support both UEFI Win7 and Linux, it needs to report FADT.Century to a traditional value which doesn't equal to 0 or 0x80 (0x32 mostly). And RTC driver is enhanced to save the century value to the location specified by FADT.Century. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19442 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c')
-rw-r--r--PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
index 9cf3988705..6f2a987f22 100644
--- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
+++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
@@ -1,7 +1,7 @@
/** @file
Provides Set/Get time operations.
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -14,11 +14,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "PcRtc.h"
-PC_RTC_MODULE_GLOBALS mModuleGlobal;
+PC_RTC_MODULE_GLOBALS mModuleGlobal = { 0 };
EFI_HANDLE mHandle = NULL;
-
/**
Returns the current time and date information, and the time-keeping capabilities
of the hardware platform.
@@ -133,11 +132,32 @@ InitializePcRtc (
)
{
EFI_STATUS Status;
+ EFI_EVENT Event;
EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_CALLBACK);
Status = PcRtcInit (&mModuleGlobal);
ASSERT_EFI_ERROR (Status);
+
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ PcRtcAcpiTableChangeCallback,
+ NULL,
+ &gEfiAcpi10TableGuid,
+ &Event
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ PcRtcAcpiTableChangeCallback,
+ NULL,
+ &gEfiAcpiTableGuid,
+ &Event
+ );
+ ASSERT_EFI_ERROR (Status);
gRT->GetTime = PcRtcEfiGetTime;
gRT->SetTime = PcRtcEfiSetTime;