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