VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/EmbeddedPkg/Include/Library/TimeBaseLib.h@ 85788

Last change on this file since 85788 was 85718, checked in by vboxsync, 4 years ago

Devices/EFI: Merge edk-stable202005 and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1/** @file
2*
3* Copyright (c) 2016, Hisilicon Limited. All rights reserved.
4* Copyright (c) 2016-2019, Linaro Limited. All rights reserved.
5*
6* SPDX-License-Identifier: BSD-2-Clause-Patent
7*
8**/
9
10#ifndef _TIME_BASE_LIB_H_
11#define _TIME_BASE_LIB_H_
12
13#include <Uefi/UefiBaseType.h>
14
15// Define EPOCH (1970-JANUARY-01) in the Julian Date representation
16#define EPOCH_JULIAN_DATE 2440588
17
18// Seconds per unit
19#define SEC_PER_MIN ((UINTN) 60)
20#define SEC_PER_HOUR ((UINTN) 3600)
21#define SEC_PER_DAY ((UINTN) 86400)
22#define SEC_PER_MONTH ((UINTN) 2,592,000)
23#define SEC_PER_YEAR ((UINTN) 31,536,000)
24
25BOOLEAN
26EFIAPI
27IsLeapYear (
28 IN EFI_TIME *Time
29 );
30
31BOOLEAN
32EFIAPI
33IsDayValid (
34 IN EFI_TIME *Time
35 );
36
37BOOLEAN
38EFIAPI
39IsTimeValid (
40 IN EFI_TIME *Time
41 );
42
43/**
44 Converts Epoch seconds (elapsed since 1970 JANUARY 01, 00:00:00 UTC) to EFI_TIME
45 **/
46VOID
47EFIAPI
48EpochToEfiTime (
49 IN UINTN EpochSeconds,
50 OUT EFI_TIME *Time
51 );
52
53/**
54 Converts EFI_TIME to Epoch seconds (elapsed since 1970 JANUARY 01, 00:00:00 UTC)
55 **/
56UINT32
57EFIAPI
58EfiTimeToEpoch (
59 IN EFI_TIME *Time
60 );
61
62/**
63 returns Day of the week [0-6] 0=Sunday
64 **/
65UINTN
66EfiTimeToWday (
67 IN EFI_TIME *Time
68 );
69
70#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette