]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.c
EmbeddedPkg/TimeBaseLib: Update comment blocks for API functions
[mirror_edk2.git] / EmbeddedPkg / Library / TimeBaseLib / TimeBaseLib.c
index 78fc7b6cd2e5377202ddf5af8249248bea194cbc..c9048d76596087802655a430d0b892953cc40816 100644 (file)
@@ -2,6 +2,7 @@
 *\r
 *  Copyright (c) 2016, Hisilicon Limited. All rights reserved.\r
 *  Copyright (c) 2016-2019, Linaro Limited. All rights reserved.\r
+*  Copyright (c) 2021, Ampere Computing LLC. All rights reserved.\r
 *\r
 *  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 *\r
 #include <Library/TimeBaseLib.h>\r
 \r
 /**\r
-  Converts Epoch seconds (elapsed since 1970 JANUARY 01, 00:00:00 UTC) to EFI_TIME\r
- **/\r
+  Converts Epoch seconds (elapsed since 1970 JANUARY 01, 00:00:00 UTC) to EFI_TIME.\r
+\r
+  @param  EpochSeconds   Epoch seconds.\r
+  @param  Time           The time converted to UEFI format.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 EpochToEfiTime (\r
@@ -71,8 +76,13 @@ EpochToEfiTime (
 }\r
 \r
 /**\r
-  Calculate Epoch days\r
- **/\r
+  Calculate Epoch days.\r
+\r
+  @param    Time  The UEFI time to be calculated.\r
+\r
+  @return   Number of days.\r
+\r
+**/\r
 UINTN\r
 EFIAPI\r
 EfiGetEpochDays (\r
@@ -96,9 +106,15 @@ EfiGetEpochDays (
 \r
   return EpochDays;\r
 }\r
+\r
 /**\r
-  Converts EFI_TIME to Epoch seconds (elapsed since 1970 JANUARY 01, 00:00:00 UTC)\r
- **/\r
+  Converts EFI_TIME to Epoch seconds (elapsed since 1970 JANUARY 01, 00:00:00 UTC).\r
+\r
+  @param    Time  The UEFI time to be converted.\r
+\r
+  @return   Number of seconds.\r
+\r
+**/\r
 UINTN\r
 EFIAPI\r
 EfiTimeToEpoch (\r
@@ -116,8 +132,13 @@ EfiTimeToEpoch (
 }\r
 \r
 /**\r
-  returns Day of the week [0-6] 0=Sunday\r
- **/\r
+  Get the day of the week from the UEFI time.\r
+\r
+  @param    Time  The UEFI time to be calculated.\r
+\r
+  @return   The day of the week: Sunday=0, Monday=1, ... Saturday=6\r
+\r
+**/\r
 UINTN\r
 EfiTimeToWday (\r
   IN  EFI_TIME  *Time\r
@@ -132,6 +153,15 @@ EfiTimeToWday (
   return (EpochDays + 4) % 7;\r
 }\r
 \r
+/**\r
+  Check if it is a leap year.\r
+\r
+  @param    Time  The UEFI time to be checked.\r
+\r
+  @retval   TRUE  It is a leap year.\r
+  @retval   FALSE It is NOT a leap year.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 IsLeapYear (\r
@@ -153,6 +183,15 @@ IsLeapYear (
   }\r
 }\r
 \r
+/**\r
+  Check if the day in the UEFI time is valid.\r
+\r
+  @param    Time    The UEFI time to be checked.\r
+\r
+  @retval   TRUE    Valid.\r
+  @retval   FALSE   Invalid.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 IsDayValid (\r
@@ -171,6 +210,15 @@ IsDayValid (
   return TRUE;\r
 }\r
 \r
+/**\r
+  Check if the UEFI time is valid.\r
+\r
+  @param    Time    The UEFI time to be checked.\r
+\r
+  @retval   TRUE    Valid.\r
+  @retval   FALSE   Invalid.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 IsTimeValid(\r