]> git.proxmox.com Git - mirror_edk2.git/blob - EmbeddedPkg/Include/Library/RealTimeClockLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / EmbeddedPkg / Include / Library / RealTimeClockLib.h
1 /** @file
2 Implement EFI RealTimeClock runtime services via Lib.
3
4 Currently this driver does not support runtime virtual calling.
5
6 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
7
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10 **/
11
12 #ifndef __REAL_TIME_CLOCK_LIB__
13 #define __REAL_TIME_CLOCK_LIB__
14
15 /**
16 Returns the current time and date information, and the time-keeping capabilities
17 of the hardware platform.
18
19 @param Time A pointer to storage to receive a snapshot of the current time.
20 @param Capabilities An optional pointer to a buffer to receive the real time clock
21 device's capabilities.
22
23 @retval EFI_SUCCESS The operation completed successfully.
24 @retval EFI_INVALID_PARAMETER Time is NULL.
25 @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.
26
27 **/
28 EFI_STATUS
29 EFIAPI
30 LibGetTime (
31 OUT EFI_TIME *Time,
32 OUT EFI_TIME_CAPABILITIES *Capabilities
33 );
34
35 /**
36 Sets the current local time and date information.
37
38 @param Time A pointer to the current time.
39
40 @retval EFI_SUCCESS The operation completed successfully.
41 @retval EFI_INVALID_PARAMETER A time field is out of range.
42 @retval EFI_DEVICE_ERROR The time could not be set due to hardware error.
43
44 **/
45 EFI_STATUS
46 EFIAPI
47 LibSetTime (
48 IN EFI_TIME *Time
49 );
50
51 /**
52 Returns the current wakeup alarm clock setting.
53
54 @param Enabled Indicates if the alarm is currently enabled or disabled.
55 @param Pending Indicates if the alarm signal is pending and requires acknowledgement.
56 @param Time The current alarm setting.
57
58 @retval EFI_SUCCESS The alarm settings were returned.
59 @retval EFI_INVALID_PARAMETER Any parameter is NULL.
60 @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.
61
62 **/
63 EFI_STATUS
64 EFIAPI
65 LibGetWakeupTime (
66 OUT BOOLEAN *Enabled,
67 OUT BOOLEAN *Pending,
68 OUT EFI_TIME *Time
69 );
70
71 /**
72 Sets the system wakeup alarm clock time.
73
74 @param Enabled Enable or disable the wakeup alarm.
75 @param Time If Enable is TRUE, the time to set the wakeup alarm for.
76
77 @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If
78 Enable is FALSE, then the wakeup alarm was disabled.
79 @retval EFI_INVALID_PARAMETER A time field is out of range.
80 @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.
81 @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.
82
83 **/
84 EFI_STATUS
85 EFIAPI
86 LibSetWakeupTime (
87 IN BOOLEAN Enabled,
88 OUT EFI_TIME *Time
89 );
90
91 /**
92 This is the declaration of an EFI image entry point. This can be the entry point to an application
93 written to this specification, an EFI boot service driver, or an EFI runtime driver.
94
95 @param ImageHandle Handle that identifies the loaded image.
96 @param SystemTable System Table for this image.
97
98 @retval EFI_SUCCESS The operation completed successfully.
99
100 **/
101 EFI_STATUS
102 EFIAPI
103 LibRtcInitialize (
104 IN EFI_HANDLE ImageHandle,
105 IN EFI_SYSTEM_TABLE *SystemTable
106 );
107
108 /**
109 Fixup internal data so that EFI can be call in virtual mode.
110 Call the passed in Child Notify event and convert any pointers in
111 lib to virtual mode.
112
113 @param[in] Event The Event that is being processed
114 @param[in] Context Event Context
115 **/
116 VOID
117 EFIAPI
118 LibRtcVirtualNotifyEvent (
119 IN EFI_EVENT Event,
120 IN VOID *Context
121 );
122
123 #endif