summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-01 06:05:41 +0000
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-01 06:05:41 +0000
commit9a1eee23398a27389a2bc35f51cf0ec72710a7e0 (patch)
treedba6441d811cd8813cd6ed49dd0d67b60b705474 /MdeModulePkg
parentd6321d6ef9a37eae0d257143b5f4e1809e8a3d6b (diff)
downloadedk2-platforms-9a1eee23398a27389a2bc35f51cf0ec72710a7e0.tar.xz
Fix date/time not work for the return value of RtcRead not need type convert.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8698 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c b/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c
index c6b58b394e..cf5ed0bf5a 100644
--- a/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c
+++ b/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c
@@ -158,8 +158,9 @@ PcRtcInit (
Time.Month = RtcRead (RTC_ADDRESS_MONTH);
Time.Year = RtcRead (RTC_ADDRESS_YEAR);
- Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));
-
+ Century = RtcRead (RTC_ADDRESS_CENTURY);
+ Time.Year = (UINT16) (Century * 100 + Time.Year);
+
//
// Set RTC configuration after get original time
// The value of bit AIE should be reserved.
@@ -281,8 +282,9 @@ PcRtcGetTime (
Time->Month = RtcRead (RTC_ADDRESS_MONTH);
Time->Year = RtcRead (RTC_ADDRESS_YEAR);
- Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));
-
+ Century = RtcRead (RTC_ADDRESS_CENTURY);
+ Time->Year = (UINT16) (Century * 100 + Time->Year);
+
//
// Release RTC Lock.
//
@@ -508,8 +510,9 @@ PcRtcGetWakeupTime (
Time->Year = RtcRead (RTC_ADDRESS_YEAR);
}
- Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));
-
+ Century = RtcRead (RTC_ADDRESS_CENTURY);
+ Time->Year = (UINT16) (Century * 100 + Time->Year);
+
//
// Release RTC Lock.
//