]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c
Fix date/time not work for the return value of RtcRead not need type convert.
[mirror_edk2.git] / MdeModulePkg / Universal / PcatRealTimeClockRuntimeDxe / PcRtc.c
index c6b58b394e417f480ec22c75532b271b495e83b9..cf5ed0bf5a7d2870c64e551e59dec2b524508d97 100644 (file)
@@ -158,8 +158,9 @@ PcRtcInit (
   Time.Month  = RtcRead (RTC_ADDRESS_MONTH);\r
   Time.Year   = RtcRead (RTC_ADDRESS_YEAR);\r
 \r
-  Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));\r
-\r
+  Century = RtcRead (RTC_ADDRESS_CENTURY);\r
+  Time.Year = (UINT16) (Century * 100 + Time.Year);\r
+  \r
   //\r
   // Set RTC configuration after get original time\r
   // The value of bit AIE should be reserved.\r
@@ -281,8 +282,9 @@ PcRtcGetTime (
   Time->Month   = RtcRead (RTC_ADDRESS_MONTH);\r
   Time->Year    = RtcRead (RTC_ADDRESS_YEAR);\r
 \r
-  Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));\r
-\r
+  Century = RtcRead (RTC_ADDRESS_CENTURY);\r
+  Time->Year = (UINT16) (Century * 100 + Time->Year);\r
+  \r
   //\r
   // Release RTC Lock.\r
   //\r
@@ -508,8 +510,9 @@ PcRtcGetWakeupTime (
     Time->Year    = RtcRead (RTC_ADDRESS_YEAR);\r
   }\r
 \r
-  Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));\r
-\r
+  Century = RtcRead (RTC_ADDRESS_CENTURY);\r
+  Time->Year = (UINT16) (Century * 100 + Time->Year);\r
+  \r
   //\r
   // Release RTC Lock.\r
   //\r