]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Library/HalRuntimeServicesExampleLib/Rtc.c
EmbeddedPkg: drop unused Pcds from package .dsc
[mirror_edk2.git] / EmbeddedPkg / Library / HalRuntimeServicesExampleLib / Rtc.c
index 59c8cd16b0a955cc5020811b931f4a4cfe49f7c2..9e2b2e38054ccb6cd2ddd3a6ffe251affd69966b 100644 (file)
@@ -3,6 +3,7 @@
 \r
   Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
   Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 \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
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -14,7 +15,7 @@
 \r
 \r
 **/\r
 \r
 \r
 **/\r
\r
+\r
 \r
 \r
 typedef struct {\r
 \r
 \r
 typedef struct {\r
@@ -246,33 +247,33 @@ ConvertEfiTimeToRtcTime (
   }\r
 }\r
 \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
 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
 {\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
       ) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -583,7 +584,7 @@ libGetWakeupTime (
   UINT8           Century;\r
 \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
   //\r
   if ((Enabled == NULL) || (Pending == NULL) || (Time == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r