*\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
}\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
\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
}\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
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
}\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
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