]>
Commit | Line | Data |
---|---|---|
fb3df220 | 1 | /** @file\r |
2 | Library to abstract runtime services\r | |
3 | \r | |
3b89de63 | 4 | Copyright (c) 2006, Intel Corporation\r |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
fb3df220 | 9 | \r |
3b89de63 | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
fb3df220 | 12 | \r |
fb3df220 | 13 | **/\r |
14 | \r | |
15 | #ifndef __UEFI_RUNTIME_LIB__\r | |
16 | #define __UEFI_RUNTIME_LIB__\r | |
17 | \r | |
18 | \r | |
19 | extern const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[];\r | |
20 | \r | |
21 | extern const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[];\r | |
22 | \r | |
23 | /**\r | |
24 | Check to see if the execute context is in Runtime phase or not.\r | |
25 | \r | |
26 | @param None.\r | |
27 | \r | |
28 | @retval TRUE The driver is in SMM.\r | |
29 | @retval FALSE The driver is not in SMM.\r | |
30 | \r | |
31 | **/\r | |
32 | BOOLEAN\r | |
33 | EFIAPI\r | |
34 | EfiAtRuntime (\r | |
3b89de63 | 35 | VOID\r |
fb3df220 | 36 | );\r |
37 | \r | |
38 | /**\r | |
39 | Check to see if the SetVirtualAddressMsp() is invoked or not.\r | |
40 | \r | |
41 | @retval TRUE SetVirtualAddressMsp() has been called.\r | |
42 | @retval FALSE SetVirtualAddressMsp() has not been called.\r | |
43 | \r | |
44 | **/\r | |
45 | BOOLEAN\r | |
46 | EFIAPI\r | |
47 | EfiGoneVirtual (\r | |
3b89de63 | 48 | VOID\r |
fb3df220 | 49 | );\r |
50 | \r | |
51 | /**\r | |
3b89de63 | 52 | Return current time and date information, and time-keeping\r |
fb3df220 | 53 | capabilities of hardware platform.\r |
54 | \r | |
55 | @param Time A pointer to storage to receive a snapshot of the current time.\r | |
56 | @param Capabilities An optional pointer to a buffer to receive the real time clock device's\r | |
57 | capabilities.\r | |
3b89de63 | 58 | \r |
fb3df220 | 59 | @retval EFI_SUCCESS Success to execute the function.\r |
60 | @retval !EFI_SUCCESS Failed to e3xecute the function.\r | |
61 | \r | |
62 | **/\r | |
63 | EFI_STATUS\r | |
64 | EFIAPI\r | |
65 | EfiGetTime (\r | |
66 | OUT EFI_TIME *Time,\r | |
67 | OUT EFI_TIME_CAPABILITIES *Capabilities\r | |
68 | );\r | |
69 | \r | |
70 | /**\r | |
71 | Set current time and date information.\r | |
72 | \r | |
73 | @param Time A pointer to cache of time setting.\r | |
3b89de63 | 74 | \r |
fb3df220 | 75 | @retval EFI_SUCCESS Success to execute the function.\r |
76 | @retval !EFI_SUCCESS Failed to execute the function.\r | |
77 | \r | |
78 | **/\r | |
79 | EFI_STATUS\r | |
80 | EFIAPI\r | |
81 | EfiSetTime (\r | |
82 | IN EFI_TIME *Time\r | |
83 | );\r | |
84 | \r | |
85 | /**\r | |
86 | Return current wakeup alarm clock setting.\r | |
87 | \r | |
88 | @param Enabled Indicate if the alarm clock is enabled or disabled.\r | |
89 | @param Pending Indicate if the alarm signal is pending and requires acknowledgement.\r | |
90 | @param Time Current alarm clock setting.\r | |
3b89de63 | 91 | \r |
fb3df220 | 92 | @retval EFI_SUCCESS Success to execute the function.\r |
93 | @retval !EFI_SUCCESS Failed to e3xecute the function.\r | |
94 | \r | |
95 | **/\r | |
96 | EFI_STATUS\r | |
97 | EFIAPI\r | |
98 | EfiGetWakeupTime (\r | |
99 | OUT BOOLEAN *Enabled,\r | |
100 | OUT BOOLEAN *Pending,\r | |
101 | OUT EFI_TIME *Time\r | |
102 | );\r | |
103 | \r | |
104 | /**\r | |
105 | Set current wakeup alarm clock.\r | |
106 | \r | |
107 | @param Enable Enable or disable current alarm clock..\r | |
108 | @param Time Point to alarm clock setting.\r | |
3b89de63 | 109 | \r |
fb3df220 | 110 | @retval EFI_SUCCESS Success to execute the function.\r |
111 | @retval !EFI_SUCCESS Failed to e3xecute the function.\r | |
112 | \r | |
113 | **/\r | |
114 | EFI_STATUS\r | |
115 | EFIAPI\r | |
116 | EfiSetWakeupTime (\r | |
117 | IN BOOLEAN Enable,\r | |
118 | IN EFI_TIME *Time\r | |
119 | );\r | |
120 | \r | |
121 | /**\r | |
122 | Return value of variable.\r | |
123 | \r | |
3b89de63 | 124 | @param VariableName the name of the vendor's variable, it's a\r |
fb3df220 | 125 | Null-Terminated Unicode String\r |
126 | @param VendorGuid Unify identifier for vendor.\r | |
3b89de63 | 127 | @param Attributes Point to memory location to return the attributes of variable. If the point\r |
fb3df220 | 128 | is NULL, the parameter would be ignored.\r |
129 | @param DataSize As input, point to the maxinum size of return Data-Buffer.\r | |
130 | As output, point to the actual size of the returned Data-Buffer.\r | |
131 | @param Data Point to return Data-Buffer.\r | |
3b89de63 | 132 | \r |
fb3df220 | 133 | @retval EFI_SUCCESS Success to execute the function.\r |
134 | @retval !EFI_SUCCESS Failed to e3xecute the function.\r | |
135 | \r | |
136 | **/\r | |
137 | EFI_STATUS\r | |
138 | EFIAPI\r | |
139 | EfiGetVariable (\r | |
140 | IN CHAR16 *VariableName,\r | |
141 | IN EFI_GUID *VendorGuid,\r | |
201c7668 | 142 | OUT UINT32 *Attributes OPTIONAL,\r |
fb3df220 | 143 | IN OUT UINTN *DataSize,\r |
144 | OUT VOID *Data\r | |
bf231ea6 | 145 | );\r |
fb3df220 | 146 | \r |
147 | /**\r | |
148 | Enumerates variable's name.\r | |
149 | \r | |
150 | @param VariableNameSize As input, point to maxinum size of variable name.\r | |
151 | As output, point to actual size of varaible name.\r | |
3b89de63 | 152 | @param VariableName As input, supplies the last VariableName that was returned by\r |
fb3df220 | 153 | GetNextVariableName().\r |
3b89de63 | 154 | As output, returns the name of variable. The name\r |
fb3df220 | 155 | string is Null-Terminated Unicode string.\r |
3b89de63 | 156 | @param VendorGuid As input, supplies the last VendorGuid that was returned by\r |
fb3df220 | 157 | GetNextVriableName().\r |
158 | As output, returns the VendorGuid of the current variable.\r | |
3b89de63 | 159 | \r |
fb3df220 | 160 | @retval EFI_SUCCESS Success to execute the function.\r |
161 | @retval !EFI_SUCCESS Failed to e3xecute the function.\r | |
162 | \r | |
163 | **/\r | |
164 | EFI_STATUS\r | |
165 | EFIAPI\r | |
166 | EfiGetNextVariableName (\r | |
167 | IN OUT UINTN *VariableNameSize,\r | |
168 | IN OUT CHAR16 *VariableName,\r | |
169 | IN OUT EFI_GUID *VendorGuid\r | |
170 | );\r | |
171 | \r | |
172 | /**\r | |
173 | Sets value of variable.\r | |
174 | \r | |
3b89de63 | 175 | @param VariableName the name of the vendor's variable, it's a\r |
fb3df220 | 176 | Null-Terminated Unicode String\r |
177 | @param VendorGuid Unify identifier for vendor.\r | |
3b89de63 | 178 | @param Attributes Point to memory location to return the attributes of variable. If the point\r |
fb3df220 | 179 | is NULL, the parameter would be ignored.\r |
180 | @param DataSize The size in bytes of Data-Buffer.\r | |
181 | @param Data Point to the content of the variable.\r | |
182 | \r | |
183 | @retval EFI_SUCCESS Success to execute the function.\r | |
184 | @retval !EFI_SUCCESS Failed to e3xecute the function.\r | |
185 | \r | |
186 | **/\r | |
187 | EFI_STATUS\r | |
188 | EFIAPI\r | |
189 | EfiSetVariable (\r | |
190 | IN CHAR16 *VariableName,\r | |
191 | IN EFI_GUID *VendorGuid,\r | |
192 | IN UINT32 Attributes,\r | |
193 | IN UINTN DataSize,\r | |
194 | IN VOID *Data\r | |
195 | );\r | |
196 | \r | |
197 | /**\r | |
198 | Returns the next high 32 bits of platform's monotonic counter.\r | |
199 | \r | |
200 | @param HighCount Pointer to returned value.\r | |
201 | \r | |
202 | @retval EFI_SUCCESS Success to execute the function.\r | |
203 | @retval !EFI_SUCCESS Failed to e3xecute the function.\r | |
204 | \r | |
205 | **/\r | |
206 | EFI_STATUS\r | |
207 | EFIAPI\r | |
208 | EfiGetNextHighMonotonicCount (\r | |
209 | OUT UINT32 *HighCount\r | |
210 | );\r | |
211 | \r | |
212 | /**\r | |
213 | Resets the entire platform.\r | |
214 | \r | |
215 | @param ResetType The type of reset to perform.\r | |
216 | @param ResetStatus The status code for reset.\r | |
217 | @param DataSize The size in bytes of reset data.\r | |
3b89de63 | 218 | @param ResetData Pointer to data buffer that includes\r |
fb3df220 | 219 | Null-Terminated Unicode string.\r |
220 | \r | |
fb3df220 | 221 | **/\r |
222 | VOID\r | |
201c7668 | 223 | EFIAPI\r |
fb3df220 | 224 | EfiResetSystem (\r |
225 | IN EFI_RESET_TYPE ResetType,\r | |
226 | IN EFI_STATUS ResetStatus,\r | |
227 | IN UINTN DataSize,\r | |
228 | IN CHAR16 *ResetData\r | |
229 | );\r | |
230 | \r | |
231 | /**\r | |
232 | Determines the new virtual address that is to be used on subsequent memory accesses.\r | |
233 | \r | |
234 | @param DebugDisposition Supplies type information for the pointer being converted.\r | |
3b89de63 | 235 | @param Address The pointer to a pointer that is to be fixed to be the\r |
236 | value needed for the new virtual address mapping being\r | |
fb3df220 | 237 | applied.\r |
238 | \r | |
239 | @retval EFI_SUCCESS Success to execute the function.\r | |
240 | @retval !EFI_SUCCESS Failed to e3xecute the function.\r | |
241 | \r | |
242 | **/\r | |
243 | EFI_STATUS\r | |
244 | EFIAPI\r | |
245 | EfiConvertPointer (\r | |
246 | IN UINTN DebugDisposition,\r | |
247 | IN OUT VOID **Address\r | |
248 | );\r | |
249 | \r | |
250 | \r | |
251 | /**\r | |
252 | Change the runtime addressing mode of EFI firmware from physical to virtual.\r | |
253 | \r | |
254 | @param MemoryMapSize The size in bytes of VirtualMap.\r | |
255 | @param DescriptorSize The size in bytes of an entry in the VirtualMap.\r | |
256 | @param DescriptorVersion The version of the structure entries in VirtualMap.\r | |
257 | @param VirtualMap An array of memory descriptors which contain new virtual\r | |
258 | address mapping information for all runtime ranges. Type\r | |
259 | EFI_MEMORY_DESCRIPTOR is defined in the\r | |
260 | GetMemoryMap() function description.\r | |
261 | \r | |
262 | @retval EFI_SUCCESS The virtual address map has been applied.\r | |
263 | @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in\r | |
264 | virtual address mapped mode.\r | |
265 | @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is\r | |
266 | invalid.\r | |
267 | @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory\r | |
268 | map that requires a mapping.\r | |
269 | @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found\r | |
270 | in the memory map.\r | |
271 | **/\r | |
272 | EFI_STATUS\r | |
273 | EFIAPI\r | |
274 | EfiSetVirtualAddressMap (\r | |
275 | IN UINTN MemoryMapSize,\r | |
276 | IN UINTN DescriptorSize,\r | |
277 | IN UINT32 DescriptorVersion,\r | |
278 | IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap\r | |
279 | );\r | |
280 | \r | |
281 | \r | |
282 | /**\r | |
bf231ea6 | 283 | Convert the standard Lib double linked list to a virtual mapping.\r |
fb3df220 | 284 | \r |
285 | @param DebugDisposition Supplies type information for the pointer being converted.\r | |
286 | @param ListHead Head of linked list to convert.\r | |
287 | \r | |
288 | @retval EFI_SUCCESS Success to execute the function.\r | |
289 | @retval !EFI_SUCCESS Failed to e3xecute the function.\r | |
290 | \r | |
291 | **/\r | |
292 | EFI_STATUS\r | |
293 | EFIAPI\r | |
294 | EfiConvertList (\r | |
295 | IN UINTN DebugDisposition,\r | |
296 | IN OUT LIST_ENTRY *ListHead\r | |
297 | );\r | |
298 | \r | |
299 | /**\r | |
3b89de63 | 300 | Passes capsules to the firmware with both virtual and physical mapping.\r |
fb3df220 | 301 | Depending on the intended consumption, the firmware may\r |
302 | process the capsule immediately. If the payload should persist across a\r | |
303 | system reset, the reset value returned from EFI_QueryCapsuleCapabilities must\r | |
3b89de63 | 304 | be passed into ResetSystem() and will cause the capsule to be processed by\r |
fb3df220 | 305 | the firmware as part of the reset process.\r |
3b89de63 | 306 | \r |
fb3df220 | 307 | @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules\r |
308 | being passed into update capsule. Each capsules is assumed to\r | |
309 | stored in contiguous virtual memory. The capsules in the\r | |
310 | CapsuleHeaderArray must be the same capsules as the\r | |
311 | ScatterGatherList. The CapsuleHeaderArray must\r | |
312 | have the capsules in the same order as the ScatterGatherList.\r | |
313 | @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r | |
314 | CaspuleHeaderArray.\r | |
315 | @param ScatterGatherList Physical pointer to a set of\r | |
316 | EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the\r | |
317 | location in physical memory of a set of capsules. See Related\r | |
318 | Definitions for an explanation of how more than one capsule is\r | |
319 | passed via this interface. The capsules in the\r | |
320 | ScatterGatherList must be in the same order as the\r | |
321 | CapsuleHeaderArray. This parameter is only referenced if\r | |
322 | the capsules are defined to persist across system reset.\r | |
323 | \r | |
324 | @retval EFI_SUCCESS Valid capsule was passed. I Valid capsule was passed. If\r | |
325 | CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the\r | |
326 | capsule has been successfully processed by the firmware.\r | |
327 | @retval EFI_INVALID_PARAMETER CapsuleSize is NULL or ResetTye is NULL.\r | |
328 | @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error.\r | |
329 | \r | |
330 | **/\r | |
331 | EFI_STATUS\r | |
332 | EFIAPI\r | |
333 | EfiUpdateCapsule (\r | |
3b89de63 | 334 | IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,\r |
fb3df220 | 335 | IN UINTN CapsuleCount,\r |
d27e363b | 336 | IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL\r |
fb3df220 | 337 | );\r |
338 | \r | |
339 | \r | |
340 | /**\r | |
fb3df220 | 341 | The QueryCapsuleCapabilities() function allows a caller to test to see if a capsule or\r |
342 | capsules can be updated via UpdateCapsule(). The Flags values in the capsule header and\r | |
343 | size of the entire capsule is checked.\r | |
344 | If the caller needs to query for generic capsule capability a fake EFI_CAPSULE_HEADER can be\r | |
345 | constructed where CapsuleImageSize is equal to HeaderSize that is equal to sizeof\r | |
346 | (EFI_CAPSULE_HEADER). To determine reset requirements,\r | |
347 | CAPSULE_FLAGS_PERSIST_ACROSS_RESET should be set in the Flags field of the\r | |
348 | EFI_CAPSULE_HEADER.\r | |
349 | The firmware must support any capsule that has the\r | |
350 | CAPSULE_FLAGS_PERSIST_ACROSS_RESET flag set in EFI_CAPSULE_HEADER. The\r | |
351 | firmware sets the policy for what capsules are supported that do not have the\r | |
352 | CAPSULE_FLAGS_PERSIST_ACROSS_RESET flag set.\r | |
3b89de63 | 353 | \r |
fb3df220 | 354 | @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules\r |
355 | being passed into update capsule. The capsules are assumed to\r | |
356 | stored in contiguous virtual memory.\r | |
357 | @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r | |
358 | CaspuleHeaderArray.\r | |
42eedea9 | 359 | @param MaximumCapsuleSize On output the maximum size that UpdateCapsule() can\r |
fb3df220 | 360 | support as an argument to UpdateCapsule() via\r |
361 | CapsuleHeaderArray and ScatterGatherList.\r | |
362 | Undefined on input.\r | |
363 | @param ResetType Returns the type of reset required for the capsule update.\r | |
364 | \r | |
365 | @retval EFI_SUCCESS Valid answer returned..\r | |
366 | @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.\r | |
367 | @retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and\r | |
368 | MaximumCapsuleSize and ResetType are undefined.\r | |
369 | \r | |
370 | **/\r | |
371 | EFI_STATUS\r | |
372 | EFIAPI\r | |
373 | EfiQueryCapsuleCapabilities (\r | |
3b89de63 | 374 | IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,\r |
375 | IN UINTN CapsuleCount,\r | |
fb3df220 | 376 | OUT UINT64 *MaximumCapsuleSize,\r |
377 | OUT EFI_RESET_TYPE *ResetType\r | |
378 | );\r | |
379 | \r | |
380 | \r | |
381 | /**\r | |
fb3df220 | 382 | The QueryVariableInfo() function allows a caller to obtain the information about the\r |
383 | maximum size of the storage space available for the EFI variables, the remaining size of the storage\r | |
384 | space available for the EFI variables and the maximum size of each individual EFI variable,\r | |
385 | associated with the attributes specified.\r | |
386 | The returned MaximumVariableStorageSize, RemainingVariableStorageSize,\r | |
387 | MaximumVariableSize information may change immediately after the call based on other\r | |
388 | runtime activities including asynchronous error events. Also, these values associated with different\r | |
389 | attributes are not additive in nature.\r | |
3b89de63 | 390 | \r |
fb3df220 | 391 | @param Attributes Attributes bitmask to specify the type of variables on\r |
392 | which to return information. Refer to the\r | |
393 | GetVariable() function description.\r | |
3b89de63 | 394 | @param MaximumVariableStorageSize\r |
fb3df220 | 395 | On output the maximum size of the storage space\r |
396 | available for the EFI variables associated with the\r | |
397 | attributes specified.\r | |
3b89de63 | 398 | @param RemainingVariableStorageSize\r |
fb3df220 | 399 | Returns the remaining size of the storage space\r |
400 | available for the EFI variables associated with the\r | |
401 | attributes specified..\r | |
402 | @param MaximumVariableSize Returns the maximum size of the individual EFI\r | |
403 | variables associated with the attributes specified.\r | |
404 | \r | |
405 | @retval EFI_SUCCESS Valid answer returned.\r | |
406 | @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied.\r | |
407 | @retval EFI_UNSUPPORTED EFI_UNSUPPORTED The attribute is not supported on this platform, and the\r | |
408 | MaximumVariableStorageSize,\r | |
409 | RemainingVariableStorageSize, MaximumVariableSize\r | |
410 | are undefined.\r | |
411 | **/\r | |
412 | EFI_STATUS\r | |
413 | EFIAPI\r | |
414 | EfiQueryVariableInfo (\r | |
42eedea9 | 415 | IN UINT32 Attributes,\r |
fb3df220 | 416 | OUT UINT64 *MaximumVariableStorageSize,\r |
417 | OUT UINT64 *RemainingVariableStorageSize,\r | |
418 | OUT UINT64 *MaximumVariableSize\r | |
419 | );\r | |
420 | \r | |
421 | #endif\r | |
422 | \r |