summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-27 09:00:41 +0000
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-27 09:00:41 +0000
commit2ba53a4f23b0e5cbd0f9195ac23c813ac085a27f (patch)
tree16ca0a40055d424a2ece93bb87ac3ac7f271565f
parentef73b4a8540a457c18e3a67c61466a53769db8ed (diff)
downloadedk2-platforms-2ba53a4f23b0e5cbd0f9195ac23c813ac085a27f.tar.xz
Add Nanosecond initialize when CMOS clear for ConvertRtcTimeToEfiTime can not initialize it.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9014 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c41
1 files changed, 10 insertions, 31 deletions
diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
index a2a20c8e1c..4a7fca3299 100644
--- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
+++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
@@ -205,14 +205,18 @@ PcRtcInit (
Time.Day = RTC_INIT_DAY;
Time.Month = RTC_INIT_MONTH;
Time.Year = RTC_INIT_YEAR;
+ Time.Nanosecond = 0;
}
//
// Reset time value according to new RTC configuration
//
- PcRtcSetTime (&Time, Global);
-
- return EFI_SUCCESS;
+ Status = PcRtcSetTime (&Time, Global);
+ if(!EFI_ERROR (Status)) {
+ return EFI_SUCCESS;
+ } else {
+ return EFI_DEVICE_ERROR;
+ }
}
/**
@@ -826,20 +830,8 @@ DayValid (
IN EFI_TIME *Time
)
{
- INTN DayOfMonth[12];
-
- DayOfMonth[0] = 31;
- DayOfMonth[1] = 29;
- DayOfMonth[2] = 31;
- DayOfMonth[3] = 30;
- DayOfMonth[4] = 31;
- DayOfMonth[5] = 30;
- DayOfMonth[6] = 31;
- DayOfMonth[7] = 31;
- DayOfMonth[8] = 30;
- DayOfMonth[9] = 31;
- DayOfMonth[10] = 30;
- DayOfMonth[11] = 31;
+
+ INTN DayOfMonth[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
//
// The validity of Time->Month field should be checked before
@@ -988,22 +980,9 @@ IsWithinOneDay (
IN EFI_TIME *To
)
{
- UINT8 DayOfMonth[12];
+ UINT8 DayOfMonth[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
BOOLEAN Adjacent;
- DayOfMonth[0] = 31;
- DayOfMonth[1] = 29;
- DayOfMonth[2] = 31;
- DayOfMonth[3] = 30;
- DayOfMonth[4] = 31;
- DayOfMonth[5] = 30;
- DayOfMonth[6] = 31;
- DayOfMonth[7] = 31;
- DayOfMonth[8] = 30;
- DayOfMonth[9] = 31;
- DayOfMonth[10] = 30;
- DayOfMonth[11] = 31;
-
Adjacent = FALSE;
//