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