summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Include/Library/TimeBaseLib.h
diff options
context:
space:
mode:
Diffstat (limited to 'EmbeddedPkg/Include/Library/TimeBaseLib.h')
-rw-r--r--EmbeddedPkg/Include/Library/TimeBaseLib.h54
1 files changed, 48 insertions, 6 deletions
diff --git a/EmbeddedPkg/Include/Library/TimeBaseLib.h b/EmbeddedPkg/Include/Library/TimeBaseLib.h
index 90853c3f4b..a9f3c6588b 100644
--- a/EmbeddedPkg/Include/Library/TimeBaseLib.h
+++ b/EmbeddedPkg/Include/Library/TimeBaseLib.h
@@ -2,6 +2,7 @@
*
* Copyright (c) 2016, Hisilicon Limited. All rights reserved.
* Copyright (c) 2016-2019, Linaro Limited. All rights reserved.
+* Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
@@ -52,18 +53,45 @@
#define SEC_PER_HOUR ((UINTN) 3600)
#define SEC_PER_DAY ((UINTN) 86400)
+/**
+ Check if it is a leap year.
+
+ @param Time The UEFI time to be checked.
+
+ @retval TRUE It is a leap year.
+ @retval FALSE It is NOT a leap year.
+
+**/
BOOLEAN
EFIAPI
IsLeapYear (
IN EFI_TIME *Time
);
+/**
+ Check if the day in the UEFI time is valid.
+
+ @param Time The UEFI time to be checked.
+
+ @retval TRUE Valid.
+ @retval FALSE Invalid.
+
+**/
BOOLEAN
EFIAPI
IsDayValid (
IN EFI_TIME *Time
);
+/**
+ Check if the UEFI time is valid.
+
+ @param Time The UEFI time to be checked.
+
+ @retval TRUE Valid.
+ @retval FALSE Invalid.
+
+**/
BOOLEAN
EFIAPI
IsTimeValid (
@@ -71,8 +99,12 @@ IsTimeValid (
);
/**
- Converts Epoch seconds (elapsed since 1970 JANUARY 01, 00:00:00 UTC) to EFI_TIME
- **/
+ Converts Epoch seconds (elapsed since 1970 JANUARY 01, 00:00:00 UTC) to EFI_TIME.
+
+ @param EpochSeconds Epoch seconds.
+ @param Time The time converted to UEFI format.
+
+**/
VOID
EFIAPI
EpochToEfiTime (
@@ -81,8 +113,13 @@ EpochToEfiTime (
);
/**
- Converts EFI_TIME to Epoch seconds (elapsed since 1970 JANUARY 01, 00:00:00 UTC)
- **/
+ Converts EFI_TIME to Epoch seconds (elapsed since 1970 JANUARY 01, 00:00:00 UTC).
+
+ @param Time The UEFI time to be converted.
+
+ @return Number of seconds.
+
+**/
UINTN
EFIAPI
EfiTimeToEpoch (
@@ -90,8 +127,13 @@ EfiTimeToEpoch (
);
/**
- returns Day of the week [0-6] 0=Sunday
- **/
+ Get the day of the week from the UEFI time.
+
+ @param Time The UEFI time to be calculated.
+
+ @return The day of the week: Sunday=0, Monday=1, ... Saturday=6
+
+**/
UINTN
EfiTimeToWday (
IN EFI_TIME *Time