\r
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+ Copyright (c) 2014, ARM Ltd. All rights reserved.\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
}\r
}\r
\r
+/**\r
+ Check the validity of all the fields of a data structure of type EFI_TIME\r
+\r
+ @param[in] Time Pointer to a data structure of type EFI_TIME that defines a date and time\r
+\r
+ @retval EFI_SUCCESS All date and time fields are valid\r
+ @retval EFI_INVALID_PARAMETER At least one date or time field is not valid\r
+**/\r
EFI_STATUS\r
RtcTimeFieldsValid (\r
IN EFI_TIME *Time\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Arguments:\r
-\r
- Returns:\r
---*/\r
-// TODO: Time - add argument and description to function comment\r
-// TODO: EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO: EFI_SUCCESS - add return value to function comment\r
{\r
- if (Time->Year < 1998 ||\r
- Time->Year > 2099 ||\r
- Time->Month < 1 ||\r
- Time->Month > 12 ||\r
- (!DayValid (Time)) ||\r
- Time->Hour > 23 ||\r
- Time->Minute > 59 ||\r
- Time->Second > 59 ||\r
- Time->Nanosecond > 999999999 ||\r
- (!(Time->TimeZone == EFI_UNSPECIFIED_TIMEZONE || (Time->TimeZone >= -1440 && Time->TimeZone <= 1440))) ||\r
- (Time->Daylight & (~(EFI_TIME_ADJUST_DAYLIGHT | EFI_TIME_IN_DAYLIGHT)))\r
+ if ((Time->Year < 1998 ) ||\r
+ (Time->Year > 2099 ) ||\r
+ (Time->Month < 1 ) ||\r
+ (Time->Month > 12 ) ||\r
+ (!DayValid (Time)) ||\r
+ (Time->Hour > 23 ) ||\r
+ (Time->Minute > 59 ) ||\r
+ (Time->Second > 59 ) ||\r
+ (Time->Nanosecond > 999999999) ||\r
+ ((Time->TimeZone != EFI_UNSPECIFIED_TIMEZONE) &&\r
+ ((Time->TimeZone < -1440) ||\r
+ (Time->TimeZone > 1440 ) ) ) ||\r
+ (Time->Daylight & (~(EFI_TIME_ADJUST_DAYLIGHT |\r
+ EFI_TIME_IN_DAYLIGHT )))\r
) {\r
return EFI_INVALID_PARAMETER;\r
}\r
UINT8 Century;\r
\r
//\r
- // Check paramters for null pointers\r
+ // Check parameters for null pointers\r
//\r
if ((Enabled == NULL) || (Pending == NULL) || (Time == NULL)) {\r
return EFI_INVALID_PARAMETER;\r