EmbeddedPkg/TimeBaseLib: Update comment blocks for API functions

This updates Doxygen comment blocks for API library functions.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
This commit is contained in:
Nhi Pham 2021-01-06 23:09:00 +07:00 committed by mergify[bot]
parent 8015f3f6d4
commit 48de23e548
2 changed files with 104 additions and 14 deletions

View File

@ -2,6 +2,7 @@
* *
* Copyright (c) 2016, Hisilicon Limited. All rights reserved. * Copyright (c) 2016, Hisilicon Limited. All rights reserved.
* Copyright (c) 2016-2019, Linaro 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 * SPDX-License-Identifier: BSD-2-Clause-Patent
* *
@ -52,18 +53,45 @@
#define SEC_PER_HOUR ((UINTN) 3600) #define SEC_PER_HOUR ((UINTN) 3600)
#define SEC_PER_DAY ((UINTN) 86400) #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 BOOLEAN
EFIAPI EFIAPI
IsLeapYear ( IsLeapYear (
IN EFI_TIME *Time 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 BOOLEAN
EFIAPI EFIAPI
IsDayValid ( IsDayValid (
IN EFI_TIME *Time 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 BOOLEAN
EFIAPI EFIAPI
IsTimeValid ( IsTimeValid (
@ -71,7 +99,11 @@ 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 VOID
EFIAPI EFIAPI
@ -81,7 +113,12 @@ 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 UINTN
EFIAPI EFIAPI
@ -90,7 +127,12 @@ 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 UINTN
EfiTimeToWday ( EfiTimeToWday (

View File

@ -2,6 +2,7 @@
* *
* Copyright (c) 2016, Hisilicon Limited. All rights reserved. * Copyright (c) 2016, Hisilicon Limited. All rights reserved.
* Copyright (c) 2016-2019, Linaro 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 * SPDX-License-Identifier: BSD-2-Clause-Patent
* *
@ -13,7 +14,11 @@
#include <Library/TimeBaseLib.h> #include <Library/TimeBaseLib.h>
/** /**
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 VOID
EFIAPI EFIAPI
@ -71,7 +76,12 @@ EpochToEfiTime (
} }
/** /**
Calculate Epoch days Calculate Epoch days.
@param Time The UEFI time to be calculated.
@return Number of days.
**/ **/
UINTN UINTN
EFIAPI EFIAPI
@ -96,8 +106,14 @@ EfiGetEpochDays (
return EpochDays; return EpochDays;
} }
/** /**
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 UINTN
EFIAPI EFIAPI
@ -116,7 +132,12 @@ 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 UINTN
EfiTimeToWday ( EfiTimeToWday (
@ -132,6 +153,15 @@ EfiTimeToWday (
return (EpochDays + 4) % 7; return (EpochDays + 4) % 7;
} }
/**
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 BOOLEAN
EFIAPI EFIAPI
IsLeapYear ( IsLeapYear (
@ -153,6 +183,15 @@ IsLeapYear (
} }
} }
/**
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 BOOLEAN
EFIAPI EFIAPI
IsDayValid ( IsDayValid (
@ -171,6 +210,15 @@ IsDayValid (
return TRUE; return TRUE;
} }
/**
Check if the UEFI time is valid.
@param Time The UEFI time to be checked.
@retval TRUE Valid.
@retval FALSE Invalid.
**/
BOOLEAN BOOLEAN
EFIAPI EFIAPI
IsTimeValid( IsTimeValid(