X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EmbeddedPkg%2FLibrary%2FHalRuntimeServicesExampleLib%2FRtc.c;h=9e2b2e38054ccb6cd2ddd3a6ffe251affd69966b;hp=bb87ba82be56aa86099ea4c9c673a17097344656;hb=4f0624e87a89afce8408a87997482b383e7ba131;hpb=2ef2b01e07c02db339f34004445734a2dbdd80e1 diff --git a/EmbeddedPkg/Library/HalRuntimeServicesExampleLib/Rtc.c b/EmbeddedPkg/Library/HalRuntimeServicesExampleLib/Rtc.c index bb87ba82be..9e2b2e3805 100644 --- a/EmbeddedPkg/Library/HalRuntimeServicesExampleLib/Rtc.c +++ b/EmbeddedPkg/Library/HalRuntimeServicesExampleLib/Rtc.c @@ -1,10 +1,11 @@ /** @file Simple PC RTC - Copyright (c) 2007, Intel Corporation
- Portions copyright (c) 2008-2009, Apple Inc. All rights reserved. + Copyright (c) 2007, Intel Corporation. All rights reserved.
+ Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+ Copyright (c) 2014, ARM Ltd. All rights reserved. - All rights reserved. This program and the accompanying materials + 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 http://opensource.org/licenses/bsd-license.php @@ -14,7 +15,7 @@ **/ - + typedef struct { @@ -246,33 +247,33 @@ ConvertEfiTimeToRtcTime ( } } +/** + Check the validity of all the fields of a data structure of type EFI_TIME + + @param[in] Time Pointer to a data structure of type EFI_TIME that defines a date and time + + @retval EFI_SUCCESS All date and time fields are valid + @retval EFI_INVALID_PARAMETER At least one date or time field is not valid +**/ EFI_STATUS RtcTimeFieldsValid ( IN EFI_TIME *Time ) -/*++ - -Routine Description: - - Arguments: - - Returns: ---*/ -// TODO: Time - add argument and description to function comment -// TODO: EFI_INVALID_PARAMETER - add return value to function comment -// TODO: EFI_SUCCESS - add return value to function comment { - if (Time->Year < 1998 || - Time->Year > 2099 || - Time->Month < 1 || - Time->Month > 12 || - (!DayValid (Time)) || - Time->Hour > 23 || - Time->Minute > 59 || - Time->Second > 59 || - Time->Nanosecond > 999999999 || - (!(Time->TimeZone == EFI_UNSPECIFIED_TIMEZONE || (Time->TimeZone >= -1440 && Time->TimeZone <= 1440))) || - (Time->Daylight & (~(EFI_TIME_ADJUST_DAYLIGHT | EFI_TIME_IN_DAYLIGHT))) + if ((Time->Year < 1998 ) || + (Time->Year > 2099 ) || + (Time->Month < 1 ) || + (Time->Month > 12 ) || + (!DayValid (Time)) || + (Time->Hour > 23 ) || + (Time->Minute > 59 ) || + (Time->Second > 59 ) || + (Time->Nanosecond > 999999999) || + ((Time->TimeZone != EFI_UNSPECIFIED_TIMEZONE) && + ((Time->TimeZone < -1440) || + (Time->TimeZone > 1440 ) ) ) || + (Time->Daylight & (~(EFI_TIME_ADJUST_DAYLIGHT | + EFI_TIME_IN_DAYLIGHT ))) ) { return EFI_INVALID_PARAMETER; } @@ -583,7 +584,7 @@ libGetWakeupTime ( UINT8 Century; // - // Check paramters for null pointers + // Check parameters for null pointers // if ((Enabled == NULL) || (Pending == NULL) || (Time == NULL)) { return EFI_INVALID_PARAMETER;