]>
Commit | Line | Data |
---|---|---|
2ef2b01e A |
1 | /** @file\r |
2 | Implement EFI RealTimeClock runtime services via RTC Lib.\r | |
3 | \r | |
4 | Currently this driver does not support runtime virtual calling.\r | |
5 | \r | |
60274cca | 6 | Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r |
2ef2b01e | 7 | \r |
60274cca | 8 | This program and the accompanying materials\r |
2ef2b01e A |
9 | are licensed and made available under the terms and conditions of the BSD License\r |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #include <PiDxe.h>\r | |
19 | #include <Library/BaseLib.h>\r | |
20 | #include <Library/DebugLib.h>\r | |
21 | #include <Library/IoLib.h>\r | |
22 | #include <Library/RealTimeClockLib.h>\r | |
23 | \r | |
24 | \r | |
25 | /**\r | |
26 | Returns the current time and date information, and the time-keeping capabilities\r | |
27 | of the hardware platform.\r | |
28 | \r | |
29 | @param Time A pointer to storage to receive a snapshot of the current time.\r | |
30 | @param Capabilities An optional pointer to a buffer to receive the real time clock\r | |
31 | device's capabilities.\r | |
32 | \r | |
33 | @retval EFI_SUCCESS The operation completed successfully.\r | |
34 | @retval EFI_INVALID_PARAMETER Time is NULL.\r | |
35 | @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.\r | |
36 | \r | |
37 | **/\r | |
38 | EFI_STATUS\r | |
39 | EFIAPI\r | |
40 | LibGetTime (\r | |
41 | OUT EFI_TIME *Time,\r | |
42 | OUT EFI_TIME_CAPABILITIES *Capabilities\r | |
43 | )\r | |
44 | {\r | |
45 | //\r | |
46 | // Fill in Time and Capabilities via data from you RTC\r | |
47 | //\r | |
48 | return EFI_DEVICE_ERROR;\r | |
49 | }\r | |
50 | \r | |
51 | \r | |
52 | /**\r | |
53 | Sets the current local time and date information.\r | |
54 | \r | |
55 | @param Time A pointer to the current time.\r | |
56 | \r | |
57 | @retval EFI_SUCCESS The operation completed successfully.\r | |
58 | @retval EFI_INVALID_PARAMETER A time field is out of range.\r | |
59 | @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error.\r | |
60 | \r | |
61 | **/\r | |
62 | EFI_STATUS\r | |
63 | EFIAPI\r | |
64 | LibSetTime (\r | |
65 | IN EFI_TIME *Time\r | |
66 | )\r | |
67 | {\r | |
68 | //\r | |
69 | // Use Time, to set the time in your RTC hardware\r | |
70 | //\r | |
71 | return EFI_DEVICE_ERROR;\r | |
72 | }\r | |
73 | \r | |
74 | \r | |
75 | /**\r | |
76 | Returns the current wakeup alarm clock setting.\r | |
77 | \r | |
78 | @param Enabled Indicates if the alarm is currently enabled or disabled.\r | |
79 | @param Pending Indicates if the alarm signal is pending and requires acknowledgement.\r | |
80 | @param Time The current alarm setting.\r | |
81 | \r | |
82 | @retval EFI_SUCCESS The alarm settings were returned.\r | |
83 | @retval EFI_INVALID_PARAMETER Any parameter is NULL.\r | |
84 | @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.\r | |
85 | \r | |
86 | **/\r | |
87 | EFI_STATUS\r | |
88 | EFIAPI\r | |
89 | LibGetWakeupTime (\r | |
90 | OUT BOOLEAN *Enabled,\r | |
91 | OUT BOOLEAN *Pending,\r | |
92 | OUT EFI_TIME *Time\r | |
93 | )\r | |
94 | {\r | |
95 | // Not a required feature\r | |
96 | return EFI_UNSUPPORTED;\r | |
97 | }\r | |
98 | \r | |
99 | \r | |
100 | /**\r | |
101 | Sets the system wakeup alarm clock time.\r | |
102 | \r | |
103 | @param Enabled Enable or disable the wakeup alarm.\r | |
104 | @param Time If Enable is TRUE, the time to set the wakeup alarm for.\r | |
105 | \r | |
106 | @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If\r | |
107 | Enable is FALSE, then the wakeup alarm was disabled.\r | |
108 | @retval EFI_INVALID_PARAMETER A time field is out of range.\r | |
109 | @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.\r | |
110 | @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.\r | |
111 | \r | |
112 | **/\r | |
113 | EFI_STATUS\r | |
114 | EFIAPI\r | |
115 | LibSetWakeupTime (\r | |
116 | IN BOOLEAN Enabled,\r | |
117 | OUT EFI_TIME *Time\r | |
118 | )\r | |
119 | {\r | |
120 | // Not a required feature\r | |
121 | return EFI_UNSUPPORTED;\r | |
122 | }\r | |
123 | \r | |
124 | \r | |
125 | \r | |
126 | /**\r | |
127 | This is the declaration of an EFI image entry point. This can be the entry point to an application\r | |
128 | written to this specification, an EFI boot service driver, or an EFI runtime driver.\r | |
129 | \r | |
130 | @param ImageHandle Handle that identifies the loaded image.\r | |
131 | @param SystemTable System Table for this image.\r | |
132 | \r | |
133 | @retval EFI_SUCCESS The operation completed successfully.\r | |
134 | \r | |
135 | **/\r | |
136 | EFI_STATUS\r | |
137 | EFIAPI\r | |
138 | LibRtcInitialize (\r | |
139 | IN EFI_HANDLE ImageHandle,\r | |
140 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
141 | )\r | |
142 | {\r | |
143 | //\r | |
144 | // Do some initialization if reqruied to turn on the RTC\r | |
145 | //\r | |
146 | return EFI_SUCCESS;\r | |
147 | }\r | |
148 | \r | |
149 | \r | |
150 | /**\r | |
151 | Fixup internal data so that EFI can be call in virtual mode.\r | |
152 | Call the passed in Child Notify event and convert any pointers in\r | |
153 | lib to virtual mode.\r | |
154 | \r | |
155 | @param[in] Event The Event that is being processed\r | |
156 | @param[in] Context Event Context\r | |
157 | **/\r | |
158 | VOID\r | |
159 | EFIAPI\r | |
160 | LibRtcVirtualNotifyEvent (\r | |
161 | IN EFI_EVENT Event,\r | |
162 | IN VOID *Context\r | |
163 | )\r | |
164 | {\r | |
165 | //\r | |
166 | // Only needed if you are going to support the OS calling RTC functions in virtual mode.\r | |
167 | // You will need to call EfiConvertPointer (). To convert any stored physical addresses \r | |
168 | // to virtual address. After the OS transistions to calling in virtual mode, all future\r | |
169 | // runtime calls will be made in virtual mode.\r | |
170 | //\r | |
171 | return;\r | |
172 | }\r | |
173 | \r | |
174 | \r | |
175 | \r |