]>
Commit | Line | Data |
---|---|---|
959ccb23 | 1 | /** @file\r |
e0c047a0 | 2 | Include file that supports UEFI.\r |
959ccb23 | 3 | \r |
9095e76b LG |
4 | This include file must contain things defined in the UEFI 2.3 specification.\r |
5 | If a code construct is defined in the UEFI 2.3 specification it must be included\r | |
959ccb23 | 6 | by this include file.\r |
7 | \r | |
3e058701 | 8 | Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r |
af2dc6a7 | 9 | This program and the accompanying materials are licensed and made available under \r |
10 | the terms and conditions of the BSD License that accompanies this distribution. \r | |
11 | The full text of the license may be found at\r | |
12 | http://opensource.org/licenses/bsd-license.php. \r | |
13 | \r | |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
15 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
959ccb23 | 16 | \r |
959ccb23 | 17 | **/\r |
18 | \r | |
19 | #ifndef __UEFI_SPEC_H__\r | |
20 | #define __UEFI_SPEC_H__\r | |
21 | \r | |
22 | #include <Uefi/UefiMultiPhase.h>\r | |
23 | \r | |
24 | #include <Protocol/DevicePath.h>\r | |
25 | #include <Protocol/SimpleTextIn.h>\r | |
2be21afb | 26 | #include <Protocol/SimpleTextInEx.h>\r |
959ccb23 | 27 | #include <Protocol/SimpleTextOut.h>\r |
28 | \r | |
8b13229b | 29 | ///\r |
2a3f6a21 | 30 | /// Enumeration of EFI memory allocation types.\r |
8b13229b | 31 | ///\r |
959ccb23 | 32 | typedef enum {\r |
2a3f6a21 | 33 | ///\r |
af2dc6a7 | 34 | /// Allocate any available range of pages that satisfies the request.\r |
2a3f6a21 | 35 | ///\r |
959ccb23 | 36 | AllocateAnyPages,\r |
2a3f6a21 | 37 | ///\r |
38 | /// Allocate any available range of pages whose uppermost address is less than \r | |
af2dc6a7 | 39 | /// or equal to a specified maximum address.\r |
2a3f6a21 | 40 | ///\r |
959ccb23 | 41 | AllocateMaxAddress,\r |
2a3f6a21 | 42 | ///\r |
af2dc6a7 | 43 | /// Allocate pages at a specified address.\r |
2a3f6a21 | 44 | ///\r |
959ccb23 | 45 | AllocateAddress,\r |
2a3f6a21 | 46 | ///\r |
af2dc6a7 | 47 | /// Maximum enumeration value that may be used for bounds checking.\r |
2a3f6a21 | 48 | ///\r |
959ccb23 | 49 | MaxAllocateType\r |
50 | } EFI_ALLOCATE_TYPE;\r | |
51 | \r | |
5413e8e8 | 52 | //\r |
53 | // Bit definitions for EFI_TIME.Daylight\r | |
54 | //\r | |
55 | #define EFI_TIME_ADJUST_DAYLIGHT 0x01\r | |
56 | #define EFI_TIME_IN_DAYLIGHT 0x02\r | |
57 | \r | |
8b13229b | 58 | ///\r |
af2dc6a7 | 59 | /// Value definition for EFI_TIME.TimeZone.\r |
8b13229b | 60 | ///\r |
5413e8e8 | 61 | #define EFI_UNSPECIFIED_TIMEZONE 0x07FF\r |
959ccb23 | 62 | \r |
63 | //\r | |
e0c047a0 | 64 | // Memory cacheability attributes\r |
959ccb23 | 65 | //\r |
66 | #define EFI_MEMORY_UC 0x0000000000000001ULL\r | |
67 | #define EFI_MEMORY_WC 0x0000000000000002ULL\r | |
68 | #define EFI_MEMORY_WT 0x0000000000000004ULL\r | |
69 | #define EFI_MEMORY_WB 0x0000000000000008ULL\r | |
70 | #define EFI_MEMORY_UCE 0x0000000000000010ULL\r | |
959ccb23 | 71 | //\r |
e0c047a0 | 72 | // Physical memory protection attributes\r |
959ccb23 | 73 | //\r |
00edb218 A |
74 | #define EFI_MEMORY_WP 0x0000000000001000ULL\r |
75 | #define EFI_MEMORY_RP 0x0000000000002000ULL\r | |
76 | #define EFI_MEMORY_XP 0x0000000000004000ULL\r | |
e0c047a0 | 77 | //\r |
78 | // Runtime memory attribute\r | |
79 | //\r | |
80 | #define EFI_MEMORY_RUNTIME 0x8000000000000000ULL\r | |
959ccb23 | 81 | \r |
8b13229b | 82 | ///\r |
af2dc6a7 | 83 | /// Memory descriptor version number.\r |
8b13229b | 84 | ///\r |
959ccb23 | 85 | #define EFI_MEMORY_DESCRIPTOR_VERSION 1\r |
e0c047a0 | 86 | \r |
87 | ///\r | |
af2dc6a7 | 88 | /// Definition of an EFI memory descriptor.\r |
e0c047a0 | 89 | ///\r |
959ccb23 | 90 | typedef struct {\r |
2a3f6a21 | 91 | ///\r |
af2dc6a7 | 92 | /// Type of the memory region. See EFI_MEMORY_TYPE.\r |
2a3f6a21 | 93 | ///\r |
00edb218 | 94 | UINT32 Type;\r |
2a3f6a21 | 95 | ///\r |
96 | /// Physical address of the first byte of the memory region. Must aligned \r | |
97 | /// on a 4 KB boundary.\r | |
98 | ///\r | |
00edb218 | 99 | EFI_PHYSICAL_ADDRESS PhysicalStart;\r |
2a3f6a21 | 100 | ///\r |
101 | /// Virtual address of the first byte of the memory region. Must aligned \r | |
102 | /// on a 4 KB boundary.\r | |
103 | ///\r | |
00edb218 | 104 | EFI_VIRTUAL_ADDRESS VirtualStart;\r |
2a3f6a21 | 105 | ///\r |
106 | /// Number of 4KB pages in the memory region.\r | |
107 | ///\r | |
00edb218 | 108 | UINT64 NumberOfPages;\r |
2a3f6a21 | 109 | ///\r |
110 | /// Attributes of the memory region that describe the bit mask of capabilities\r | |
111 | /// for that memory region, and not necessarily the current settings for that \r | |
112 | /// memory region.\r | |
113 | ///\r | |
00edb218 | 114 | UINT64 Attribute;\r |
959ccb23 | 115 | } EFI_MEMORY_DESCRIPTOR;\r |
116 | \r | |
959ccb23 | 117 | /**\r |
118 | Allocates memory pages from the system.\r | |
119 | \r | |
120 | @param Type The type of allocation to perform.\r | |
121 | @param MemoryType The type of memory to allocate.\r | |
122 | @param Pages The number of contiguous 4 KB pages to allocate.\r | |
af2dc6a7 | 123 | @param Memory The pointer to a physical address. On input, the way in which the address is\r |
959ccb23 | 124 | used depends on the value of Type.\r |
125 | \r | |
126 | @retval EFI_SUCCESS The requested pages were allocated.\r | |
127 | @retval EFI_INVALID_PARAMETER 1) Type is not AllocateAnyPages or\r | |
128 | AllocateMaxAddress or AllocateAddress.\r | |
129 | 2) MemoryType is in the range\r | |
3e058701 | 130 | 3) Memory is NULL.\r |
959ccb23 | 131 | EfiMaxMemoryType..0x7FFFFFFF.\r |
132 | @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.\r | |
133 | @retval EFI_NOT_FOUND The requested pages could not be found.\r | |
134 | \r | |
135 | **/\r | |
136 | typedef\r | |
137 | EFI_STATUS\r | |
8b13229b | 138 | (EFIAPI *EFI_ALLOCATE_PAGES)(\r |
959ccb23 | 139 | IN EFI_ALLOCATE_TYPE Type,\r |
140 | IN EFI_MEMORY_TYPE MemoryType,\r | |
141 | IN UINTN Pages,\r | |
142 | IN OUT EFI_PHYSICAL_ADDRESS *Memory\r | |
143 | );\r | |
144 | \r | |
145 | /**\r | |
146 | Frees memory pages.\r | |
147 | \r | |
148 | @param Memory The base physical address of the pages to be freed.\r | |
149 | @param Pages The number of contiguous 4 KB pages to free.\r | |
150 | \r | |
151 | @retval EFI_SUCCESS The requested pages were freed.\r | |
152 | @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.\r | |
153 | @retval EFI_NOT_FOUND The requested memory pages were not allocated with\r | |
154 | AllocatePages().\r | |
155 | \r | |
156 | **/\r | |
157 | typedef\r | |
158 | EFI_STATUS\r | |
8b13229b | 159 | (EFIAPI *EFI_FREE_PAGES)(\r |
959ccb23 | 160 | IN EFI_PHYSICAL_ADDRESS Memory,\r |
161 | IN UINTN Pages\r | |
162 | );\r | |
163 | \r | |
164 | /**\r | |
165 | Returns the current memory map.\r | |
166 | \r | |
167 | @param MemoryMapSize A pointer to the size, in bytes, of the MemoryMap buffer.\r | |
e0c047a0 | 168 | On input, this is the size of the buffer allocated by the caller.\r |
169 | On output, it is the size of the buffer returned by the firmware if\r | |
170 | the buffer was large enough, or the size of the buffer needed to contain\r | |
171 | the map if the buffer was too small.\r | |
959ccb23 | 172 | @param MemoryMap A pointer to the buffer in which firmware places the current memory\r |
173 | map.\r | |
174 | @param MapKey A pointer to the location in which firmware returns the key for the\r | |
175 | current memory map.\r | |
176 | @param DescriptorSize A pointer to the location in which firmware returns the size, in bytes, of\r | |
177 | an individual EFI_MEMORY_DESCRIPTOR.\r | |
178 | @param DescriptorVersion A pointer to the location in which firmware returns the version number\r | |
179 | associated with the EFI_MEMORY_DESCRIPTOR.\r | |
180 | \r | |
181 | @retval EFI_SUCCESS The memory map was returned in the MemoryMap buffer.\r | |
182 | @retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current buffer size\r | |
183 | needed to hold the memory map is returned in MemoryMapSize.\r | |
184 | @retval EFI_INVALID_PARAMETER 1) MemoryMapSize is NULL.\r | |
185 | 2) The MemoryMap buffer is not too small and MemoryMap is\r | |
186 | NULL.\r | |
187 | \r | |
188 | **/\r | |
189 | typedef\r | |
190 | EFI_STATUS\r | |
8b13229b | 191 | (EFIAPI *EFI_GET_MEMORY_MAP)(\r |
959ccb23 | 192 | IN OUT UINTN *MemoryMapSize,\r |
193 | IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,\r | |
194 | OUT UINTN *MapKey,\r | |
195 | OUT UINTN *DescriptorSize,\r | |
196 | OUT UINT32 *DescriptorVersion\r | |
197 | );\r | |
198 | \r | |
199 | /**\r | |
200 | Allocates pool memory.\r | |
201 | \r | |
202 | @param PoolType The type of pool to allocate.\r | |
203 | @param Size The number of bytes to allocate from the pool.\r | |
204 | @param Buffer A pointer to a pointer to the allocated buffer if the call succeeds;\r | |
205 | undefined otherwise.\r | |
206 | \r | |
207 | @retval EFI_SUCCESS The requested number of bytes was allocated.\r | |
208 | @retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated.\r | |
3e058701 | 209 | @retval EFI_INVALID_PARAMETER PoolType was invalid or Buffer is NULL.\r |
959ccb23 | 210 | \r |
211 | **/\r | |
212 | typedef\r | |
213 | EFI_STATUS\r | |
8b13229b | 214 | (EFIAPI *EFI_ALLOCATE_POOL)(\r |
959ccb23 | 215 | IN EFI_MEMORY_TYPE PoolType,\r |
216 | IN UINTN Size,\r | |
217 | OUT VOID **Buffer\r | |
218 | );\r | |
219 | \r | |
220 | /**\r | |
221 | Returns pool memory to the system.\r | |
222 | \r | |
af2dc6a7 | 223 | @param Buffer The pointer to the buffer to free.\r |
959ccb23 | 224 | \r |
225 | @retval EFI_SUCCESS The memory was returned to the system.\r | |
226 | @retval EFI_INVALID_PARAMETER Buffer was invalid.\r | |
227 | \r | |
228 | **/\r | |
229 | typedef\r | |
230 | EFI_STATUS\r | |
8b13229b | 231 | (EFIAPI *EFI_FREE_POOL)(\r |
959ccb23 | 232 | IN VOID *Buffer\r |
233 | );\r | |
234 | \r | |
235 | /**\r | |
236 | Changes the runtime addressing mode of EFI firmware from physical to virtual.\r | |
237 | \r | |
238 | @param MemoryMapSize The size in bytes of VirtualMap.\r | |
239 | @param DescriptorSize The size in bytes of an entry in the VirtualMap.\r | |
240 | @param DescriptorVersion The version of the structure entries in VirtualMap.\r | |
241 | @param VirtualMap An array of memory descriptors which contain new virtual\r | |
242 | address mapping information for all runtime ranges.\r | |
243 | \r | |
244 | @retval EFI_SUCCESS The virtual address map has been applied.\r | |
245 | @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in\r | |
246 | virtual address mapped mode.\r | |
247 | @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.\r | |
248 | @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory\r | |
249 | map that requires a mapping.\r | |
250 | @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found\r | |
251 | in the memory map.\r | |
252 | \r | |
253 | **/\r | |
254 | typedef\r | |
255 | EFI_STATUS\r | |
8b13229b | 256 | (EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP)(\r |
959ccb23 | 257 | IN UINTN MemoryMapSize,\r |
258 | IN UINTN DescriptorSize,\r | |
259 | IN UINT32 DescriptorVersion,\r | |
260 | IN EFI_MEMORY_DESCRIPTOR *VirtualMap\r | |
261 | );\r | |
262 | \r | |
263 | /**\r | |
264 | Connects one or more drivers to a controller.\r | |
265 | \r | |
266 | @param ControllerHandle The handle of the controller to which driver(s) are to be connected.\r | |
267 | @param DriverImageHandle A pointer to an ordered list handles that support the\r | |
268 | EFI_DRIVER_BINDING_PROTOCOL.\r | |
269 | @param RemainingDevicePath A pointer to the device path that specifies a child of the\r | |
270 | controller specified by ControllerHandle.\r | |
271 | @param Recursive If TRUE, then ConnectController() is called recursively\r | |
272 | until the entire tree of controllers below the controller specified\r | |
273 | by ControllerHandle have been created. If FALSE, then\r | |
274 | the tree of controllers is only expanded one level.\r | |
275 | \r | |
276 | @retval EFI_SUCCESS 1) One or more drivers were connected to ControllerHandle.\r | |
277 | 2) No drivers were connected to ControllerHandle, but\r | |
278 | RemainingDevicePath is not NULL, and it is an End Device\r | |
279 | Path Node.\r | |
18bd7e85 | 280 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
959ccb23 | 281 | @retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances\r |
282 | present in the system.\r | |
283 | 2) No drivers were connected to ControllerHandle.\r | |
284 | \r | |
285 | **/\r | |
286 | typedef\r | |
287 | EFI_STATUS\r | |
8b13229b | 288 | (EFIAPI *EFI_CONNECT_CONTROLLER)(\r |
959ccb23 | 289 | IN EFI_HANDLE ControllerHandle,\r |
290 | IN EFI_HANDLE *DriverImageHandle, OPTIONAL\r | |
291 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath, OPTIONAL\r | |
292 | IN BOOLEAN Recursive\r | |
293 | );\r | |
294 | \r | |
295 | /**\r | |
296 | Disconnects one or more drivers from a controller.\r | |
297 | \r | |
298 | @param ControllerHandle The handle of the controller from which driver(s) are to be disconnected.\r | |
299 | @param DriverImageHandle The driver to disconnect from ControllerHandle.\r | |
e0c047a0 | 300 | If DriverImageHandle is NULL, then all the drivers currently managing\r |
301 | ControllerHandle are disconnected from ControllerHandle.\r | |
959ccb23 | 302 | @param ChildHandle The handle of the child to destroy.\r |
e0c047a0 | 303 | If ChildHandle is NULL, then all the children of ControllerHandle are\r |
304 | destroyed before the drivers are disconnected from ControllerHandle.\r | |
959ccb23 | 305 | \r |
306 | @retval EFI_SUCCESS 1) One or more drivers were disconnected from the controller.\r | |
307 | 2) On entry, no drivers are managing ControllerHandle.\r | |
308 | 3) DriverImageHandle is not NULL, and on entry\r | |
309 | DriverImageHandle is not managing ControllerHandle.\r | |
d9de7921 | 310 | @retval EFI_INVALID_PARAMETER 1) ControllerHandle is NULL.\r |
e0c047a0 | 311 | 2) DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.\r |
312 | 3) ChildHandle is not NULL, and it is not a valid EFI_HANDLE.\r | |
313 | 4) DriverImageHandle does not support the EFI_DRIVER_BINDING_PROTOCOL.\r | |
959ccb23 | 314 | @retval EFI_OUT_OF_RESOURCES There are not enough resources available to disconnect any drivers from\r |
315 | ControllerHandle.\r | |
316 | @retval EFI_DEVICE_ERROR The controller could not be disconnected because of a device error.\r | |
317 | \r | |
318 | **/\r | |
319 | typedef\r | |
320 | EFI_STATUS\r | |
8b13229b | 321 | (EFIAPI *EFI_DISCONNECT_CONTROLLER)(\r |
959ccb23 | 322 | IN EFI_HANDLE ControllerHandle,\r |
323 | IN EFI_HANDLE DriverImageHandle, OPTIONAL\r | |
324 | IN EFI_HANDLE ChildHandle OPTIONAL\r | |
325 | );\r | |
326 | \r | |
327 | \r | |
328 | \r | |
329 | //\r | |
330 | // ConvertPointer DebugDisposition type.\r | |
331 | //\r | |
332 | #define EFI_OPTIONAL_PTR 0x00000001\r | |
959ccb23 | 333 | \r |
334 | /**\r | |
335 | Determines the new virtual address that is to be used on subsequent memory accesses.\r | |
336 | \r | |
337 | @param DebugDisposition Supplies type information for the pointer being converted.\r | |
338 | @param Address A pointer to a pointer that is to be fixed to be the value needed\r | |
339 | for the new virtual address mappings being applied.\r | |
340 | \r | |
341 | @retval EFI_SUCCESS The pointer pointed to by Address was modified.\r | |
342 | @retval EFI_INVALID_PARAMETER 1) Address is NULL.\r | |
343 | 2) *Address is NULL and DebugDisposition does\r | |
344 | not have the EFI_OPTIONAL_PTR bit set.\r | |
345 | @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part\r | |
346 | of the current memory map. This is normally fatal.\r | |
347 | \r | |
348 | **/\r | |
349 | typedef\r | |
350 | EFI_STATUS\r | |
8b13229b | 351 | (EFIAPI *EFI_CONVERT_POINTER)(\r |
959ccb23 | 352 | IN UINTN DebugDisposition,\r |
353 | IN OUT VOID **Address\r | |
354 | );\r | |
355 | \r | |
356 | \r | |
357 | //\r | |
ac644614 | 358 | // These types can be ORed together as needed - for example,\r |
93ce5aca | 359 | // EVT_TIMER might be Ored with EVT_NOTIFY_WAIT or\r |
959ccb23 | 360 | // EVT_NOTIFY_SIGNAL.\r |
361 | //\r | |
00edb218 A |
362 | #define EVT_TIMER 0x80000000\r |
363 | #define EVT_RUNTIME 0x40000000\r | |
00edb218 A |
364 | #define EVT_NOTIFY_WAIT 0x00000100\r |
365 | #define EVT_NOTIFY_SIGNAL 0x00000200\r | |
93ce5aca | 366 | \r |
00edb218 | 367 | #define EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201\r |
93ce5aca | 368 | #define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202\r |
959ccb23 | 369 | \r |
370 | //\r | |
ac644614 | 371 | // The event's NotifyContext pointer points to a runtime memory\r |
d0c64728 | 372 | // address.\r |
959ccb23 | 373 | // The event is deprecated in UEFI2.0 and later specifications.\r |
d0c64728 | 374 | //\r |
959ccb23 | 375 | #define EVT_RUNTIME_CONTEXT 0x20000000\r |
376 | \r | |
377 | \r | |
378 | /**\r | |
379 | Invoke a notification event\r | |
380 | \r | |
381 | @param Event Event whose notification function is being invoked.\r | |
af2dc6a7 | 382 | @param Context The pointer to the notification function's context,\r |
959ccb23 | 383 | which is implementation-dependent.\r |
384 | \r | |
385 | **/\r | |
386 | typedef\r | |
387 | VOID\r | |
8b13229b | 388 | (EFIAPI *EFI_EVENT_NOTIFY)(\r |
959ccb23 | 389 | IN EFI_EVENT Event,\r |
390 | IN VOID *Context\r | |
391 | );\r | |
392 | \r | |
393 | /**\r | |
394 | Creates an event.\r | |
395 | \r | |
396 | @param Type The type of event to create and its mode and attributes.\r | |
e0c047a0 | 397 | @param NotifyTpl The task priority level of event notifications, if needed.\r |
af2dc6a7 | 398 | @param NotifyFunction The pointer to the event's notification function, if any.\r |
399 | @param NotifyContext The pointer to the notification function's context; corresponds to parameter\r | |
959ccb23 | 400 | Context in the notification function.\r |
af2dc6a7 | 401 | @param Event The pointer to the newly created event if the call succeeds; undefined\r |
959ccb23 | 402 | otherwise.\r |
403 | \r | |
404 | @retval EFI_SUCCESS The event structure was created.\r | |
405 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
406 | @retval EFI_OUT_OF_RESOURCES The event could not be allocated.\r | |
407 | \r | |
408 | **/\r | |
409 | typedef\r | |
410 | EFI_STATUS\r | |
8b13229b | 411 | (EFIAPI *EFI_CREATE_EVENT)(\r |
959ccb23 | 412 | IN UINT32 Type,\r |
413 | IN EFI_TPL NotifyTpl,\r | |
414 | IN EFI_EVENT_NOTIFY NotifyFunction,\r | |
415 | IN VOID *NotifyContext,\r | |
416 | OUT EFI_EVENT *Event\r | |
417 | );\r | |
418 | \r | |
419 | /**\r | |
420 | Creates an event in a group.\r | |
421 | \r | |
422 | @param Type The type of event to create and its mode and attributes.\r | |
e0c047a0 | 423 | @param NotifyTpl The task priority level of event notifications,if needed.\r |
af2dc6a7 | 424 | @param NotifyFunction The pointer to the event's notification function, if any.\r |
425 | @param NotifyContext The pointer to the notification function's context; corresponds to parameter\r | |
959ccb23 | 426 | Context in the notification function.\r |
af2dc6a7 | 427 | @param EventGroup The pointer to the unique identifier of the group to which this event belongs.\r |
e0c047a0 | 428 | If this is NULL, then the function behaves as if the parameters were passed\r |
429 | to CreateEvent.\r | |
af2dc6a7 | 430 | @param Event The pointer to the newly created event if the call succeeds; undefined\r |
959ccb23 | 431 | otherwise.\r |
432 | \r | |
433 | @retval EFI_SUCCESS The event structure was created.\r | |
434 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
435 | @retval EFI_OUT_OF_RESOURCES The event could not be allocated.\r | |
436 | \r | |
437 | **/\r | |
438 | typedef\r | |
439 | EFI_STATUS\r | |
8b13229b | 440 | (EFIAPI *EFI_CREATE_EVENT_EX)(\r |
959ccb23 | 441 | IN UINT32 Type,\r |
e0c047a0 | 442 | IN EFI_TPL NotifyTpl,\r |
959ccb23 | 443 | IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,\r |
444 | IN CONST VOID *NotifyContext OPTIONAL,\r | |
445 | IN CONST EFI_GUID *EventGroup OPTIONAL,\r | |
446 | OUT EFI_EVENT *Event\r | |
447 | );\r | |
448 | \r | |
e0c047a0 | 449 | ///\r |
450 | /// Timer delay types\r | |
451 | ///\r | |
959ccb23 | 452 | typedef enum {\r |
2a3f6a21 | 453 | ///\r |
af2dc6a7 | 454 | /// An event's timer settings is to be cancelled and not trigger time is to be set/\r |
2a3f6a21 | 455 | ///\r |
959ccb23 | 456 | TimerCancel,\r |
2a3f6a21 | 457 | ///\r |
458 | /// An event is to be signalled periodically at a specified interval from the current time.\r | |
459 | ///\r | |
959ccb23 | 460 | TimerPeriodic,\r |
2a3f6a21 | 461 | ///\r |
462 | /// An event is to be signalled once at a specified interval from the current time.\r | |
463 | ///\r | |
959ccb23 | 464 | TimerRelative\r |
465 | } EFI_TIMER_DELAY;\r | |
466 | \r | |
467 | /**\r | |
468 | Sets the type of timer and the trigger time for a timer event.\r | |
469 | \r | |
470 | @param Event The timer event that is to be signaled at the specified time.\r | |
471 | @param Type The type of time that is specified in TriggerTime.\r | |
472 | @param TriggerTime The number of 100ns units until the timer expires.\r | |
e0c047a0 | 473 | A TriggerTime of 0 is legal.\r |
474 | If Type is TimerRelative and TriggerTime is 0, then the timer\r | |
475 | event will be signaled on the next timer tick.\r | |
476 | If Type is TimerPeriodic and TriggerTime is 0, then the timer\r | |
477 | event will be signaled on every timer tick.\r | |
959ccb23 | 478 | \r |
479 | @retval EFI_SUCCESS The event has been set to be signaled at the requested time.\r | |
480 | @retval EFI_INVALID_PARAMETER Event or Type is not valid.\r | |
481 | \r | |
482 | **/\r | |
483 | typedef\r | |
484 | EFI_STATUS\r | |
8b13229b | 485 | (EFIAPI *EFI_SET_TIMER)(\r |
959ccb23 | 486 | IN EFI_EVENT Event,\r |
487 | IN EFI_TIMER_DELAY Type,\r | |
488 | IN UINT64 TriggerTime\r | |
489 | );\r | |
490 | \r | |
491 | /**\r | |
492 | Signals an event.\r | |
493 | \r | |
494 | @param Event The event to signal.\r | |
495 | \r | |
496 | @retval EFI_SUCCESS The event has been signaled.\r | |
497 | \r | |
498 | **/\r | |
499 | typedef\r | |
500 | EFI_STATUS\r | |
8b13229b | 501 | (EFIAPI *EFI_SIGNAL_EVENT)(\r |
959ccb23 | 502 | IN EFI_EVENT Event\r |
503 | );\r | |
504 | \r | |
505 | /**\r | |
506 | Stops execution until an event is signaled.\r | |
507 | \r | |
508 | @param NumberOfEvents The number of events in the Event array.\r | |
509 | @param Event An array of EFI_EVENT.\r | |
af2dc6a7 | 510 | @param Index The pointer to the index of the event which satisfied the wait condition.\r |
959ccb23 | 511 | \r |
512 | @retval EFI_SUCCESS The event indicated by Index was signaled.\r | |
513 | @retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0.\r | |
514 | 2) The event indicated by Index is of type\r | |
515 | EVT_NOTIFY_SIGNAL.\r | |
516 | @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION.\r | |
517 | \r | |
518 | **/\r | |
519 | typedef\r | |
520 | EFI_STATUS\r | |
8b13229b | 521 | (EFIAPI *EFI_WAIT_FOR_EVENT)(\r |
959ccb23 | 522 | IN UINTN NumberOfEvents,\r |
523 | IN EFI_EVENT *Event,\r | |
524 | OUT UINTN *Index\r | |
525 | );\r | |
526 | \r | |
527 | /**\r | |
528 | Closes an event.\r | |
529 | \r | |
530 | @param Event The event to close.\r | |
531 | \r | |
532 | @retval EFI_SUCCESS The event has been closed.\r | |
533 | \r | |
534 | **/\r | |
535 | typedef\r | |
536 | EFI_STATUS\r | |
8b13229b | 537 | (EFIAPI *EFI_CLOSE_EVENT)(\r |
959ccb23 | 538 | IN EFI_EVENT Event\r |
539 | );\r | |
540 | \r | |
541 | /**\r | |
542 | Checks whether an event is in the signaled state.\r | |
543 | \r | |
544 | @param Event The event to check.\r | |
545 | \r | |
546 | @retval EFI_SUCCESS The event is in the signaled state.\r | |
547 | @retval EFI_NOT_READY The event is not in the signaled state.\r | |
548 | @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL.\r | |
549 | \r | |
550 | **/\r | |
551 | typedef\r | |
552 | EFI_STATUS\r | |
8b13229b | 553 | (EFIAPI *EFI_CHECK_EVENT)(\r |
959ccb23 | 554 | IN EFI_EVENT Event\r |
555 | );\r | |
556 | \r | |
557 | \r | |
558 | //\r | |
e0c047a0 | 559 | // Task priority level\r |
959ccb23 | 560 | //\r |
561 | #define TPL_APPLICATION 4\r | |
562 | #define TPL_CALLBACK 8\r | |
563 | #define TPL_NOTIFY 16\r | |
564 | #define TPL_HIGH_LEVEL 31\r | |
565 | \r | |
566 | \r | |
567 | /**\r | |
568 | Raises a task's priority level and returns its previous level.\r | |
569 | \r | |
570 | @param NewTpl The new task priority level.\r | |
571 | \r | |
e0c047a0 | 572 | @return Previous task priority level\r |
959ccb23 | 573 | \r |
574 | **/\r | |
575 | typedef\r | |
576 | EFI_TPL\r | |
8b13229b | 577 | (EFIAPI *EFI_RAISE_TPL)(\r |
959ccb23 | 578 | IN EFI_TPL NewTpl\r |
579 | );\r | |
580 | \r | |
581 | /**\r | |
582 | Restores a task's priority level to its previous value.\r | |
583 | \r | |
e0c047a0 | 584 | @param OldTpl The previous task priority level to restore.\r |
959ccb23 | 585 | \r |
586 | **/\r | |
587 | typedef\r | |
588 | VOID\r | |
8b13229b | 589 | (EFIAPI *EFI_RESTORE_TPL)(\r |
959ccb23 | 590 | IN EFI_TPL OldTpl\r |
591 | );\r | |
592 | \r | |
593 | /**\r | |
594 | Returns the value of a variable.\r | |
595 | \r | |
fbf926ad | 596 | @param VariableName A Null-terminated string that is the name of the vendor's\r |
597 | variable.\r | |
959ccb23 | 598 | @param VendorGuid A unique identifier for the vendor.\r |
599 | @param Attributes If not NULL, a pointer to the memory location to return the\r | |
600 | attributes bitmask for the variable.\r | |
601 | @param DataSize On input, the size in bytes of the return Data buffer.\r | |
602 | On output the size of data returned in Data.\r | |
603 | @param Data The buffer to return the contents of the variable.\r | |
604 | \r | |
e0c047a0 | 605 | @retval EFI_SUCCESS The function completed successfully.\r |
606 | @retval EFI_NOT_FOUND The variable was not found.\r | |
607 | @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result.\r | |
608 | @retval EFI_INVALID_PARAMETER VariableName is NULL.\r | |
609 | @retval EFI_INVALID_PARAMETER VendorGuid is NULL.\r | |
610 | @retval EFI_INVALID_PARAMETER DataSize is NULL.\r | |
611 | @retval EFI_INVALID_PARAMETER The DataSize is not too small and Data is NULL.\r | |
612 | @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r | |
613 | @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.\r | |
959ccb23 | 614 | \r |
615 | **/\r | |
616 | typedef\r | |
617 | EFI_STATUS\r | |
8b13229b | 618 | (EFIAPI *EFI_GET_VARIABLE)(\r |
959ccb23 | 619 | IN CHAR16 *VariableName,\r |
620 | IN EFI_GUID *VendorGuid,\r | |
621 | OUT UINT32 *Attributes, OPTIONAL\r | |
622 | IN OUT UINTN *DataSize,\r | |
623 | OUT VOID *Data\r | |
624 | );\r | |
625 | \r | |
626 | /**\r | |
627 | Enumerates the current variable names.\r | |
628 | \r | |
629 | @param VariableNameSize The size of the VariableName buffer.\r | |
630 | @param VariableName On input, supplies the last VariableName that was returned\r | |
631 | by GetNextVariableName(). On output, returns the Nullterminated\r | |
fbf926ad | 632 | string of the current variable.\r |
959ccb23 | 633 | @param VendorGuid On input, supplies the last VendorGuid that was returned by\r |
634 | GetNextVariableName(). On output, returns the\r | |
635 | VendorGuid of the current variable.\r | |
636 | \r | |
637 | @retval EFI_SUCCESS The function completed successfully.\r | |
638 | @retval EFI_NOT_FOUND The next variable was not found.\r | |
639 | @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.\r | |
e0c047a0 | 640 | @retval EFI_INVALID_PARAMETER VariableNameSize is NULL.\r |
641 | @retval EFI_INVALID_PARAMETER VariableName is NULL.\r | |
642 | @retval EFI_INVALID_PARAMETER VendorGuid is NULL.\r | |
959ccb23 | 643 | @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r |
644 | \r | |
645 | **/\r | |
646 | typedef\r | |
647 | EFI_STATUS\r | |
8b13229b | 648 | (EFIAPI *EFI_GET_NEXT_VARIABLE_NAME)(\r |
959ccb23 | 649 | IN OUT UINTN *VariableNameSize,\r |
650 | IN OUT CHAR16 *VariableName,\r | |
651 | IN OUT EFI_GUID *VendorGuid\r | |
652 | );\r | |
653 | \r | |
654 | /**\r | |
655 | Sets the value of a variable.\r | |
656 | \r | |
db27cda5 | 657 | @param VariableName A Null-terminated string that is the name of the vendor's variable.\r |
658 | Each VariableName is unique for each VendorGuid. VariableName must\r | |
659 | contain 1 or more characters. If VariableName is an empty string,\r | |
660 | then EFI_INVALID_PARAMETER is returned.\r | |
661 | @param VendorGuid A unique identifier for the vendor.\r | |
662 | @param Attributes Attributes bitmask to set for the variable.\r | |
663 | @param DataSize The size in bytes of the Data buffer. A size of zero causes the\r | |
664 | variable to be deleted.\r | |
665 | @param Data The contents for the variable.\r | |
959ccb23 | 666 | \r |
e0c047a0 | 667 | @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as\r |
668 | defined by the Attributes.\r | |
669 | @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied, or the\r | |
670 | DataSize exceeds the maximum allowed.\r | |
db27cda5 | 671 | @retval EFI_INVALID_PARAMETER VariableName is an empty string.\r |
e0c047a0 | 672 | @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r |
673 | @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r | |
674 | @retval EFI_WRITE_PROTECTED The variable in question is read-only.\r | |
675 | @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.\r | |
db27cda5 | 676 | @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\r |
677 | set but the AuthInfo does NOT pass the validation check carried out\r | |
678 | by the firmware.\r | |
e0c047a0 | 679 | @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.\r |
959ccb23 | 680 | \r |
681 | **/\r | |
682 | typedef\r | |
683 | EFI_STATUS\r | |
8b13229b | 684 | (EFIAPI *EFI_SET_VARIABLE)(\r |
959ccb23 | 685 | IN CHAR16 *VariableName,\r |
686 | IN EFI_GUID *VendorGuid,\r | |
687 | IN UINT32 Attributes,\r | |
688 | IN UINTN DataSize,\r | |
689 | IN VOID *Data\r | |
690 | );\r | |
691 | \r | |
692 | \r | |
e0c047a0 | 693 | ///\r |
694 | /// This provides the capabilities of the\r | |
695 | /// real time clock device as exposed through the EFI interfaces.\r | |
696 | ///\r | |
959ccb23 | 697 | typedef struct {\r |
1bf79370 LG |
698 | ///\r |
699 | /// Provides the reporting resolution of the real-time clock device in\r | |
700 | /// counts per second. For a normal PC-AT CMOS RTC device, this\r | |
701 | /// value would be 1 Hz, or 1, to indicate that the device only reports\r | |
702 | /// the time to the resolution of 1 second.\r | |
703 | ///\r | |
00edb218 | 704 | UINT32 Resolution;\r |
1bf79370 LG |
705 | ///\r |
706 | /// Provides the timekeeping accuracy of the real-time clock in an\r | |
707 | /// error rate of 1E-6 parts per million. For a clock with an accuracy\r | |
708 | /// of 50 parts per million, the value in this field would be\r | |
709 | /// 50,000,000.\r | |
710 | ///\r | |
00edb218 | 711 | UINT32 Accuracy;\r |
1bf79370 | 712 | ///\r |
de2314f8 | 713 | /// A TRUE indicates that a time set operation clears the device's\r |
1bf79370 LG |
714 | /// time below the Resolution reporting level. A FALSE\r |
715 | /// indicates that the state below the Resolution level of the\r | |
716 | /// device is not cleared when the time is set. Normal PC-AT CMOS\r | |
717 | /// RTC devices set this value to FALSE.\r | |
718 | ///\r | |
00edb218 | 719 | BOOLEAN SetsToZero;\r |
959ccb23 | 720 | } EFI_TIME_CAPABILITIES;\r |
721 | \r | |
722 | /**\r | |
723 | Returns the current time and date information, and the time-keeping capabilities\r | |
724 | of the hardware platform.\r | |
725 | \r | |
726 | @param Time A pointer to storage to receive a snapshot of the current time.\r | |
727 | @param Capabilities An optional pointer to a buffer to receive the real time clock\r | |
728 | device's capabilities.\r | |
729 | \r | |
730 | @retval EFI_SUCCESS The operation completed successfully.\r | |
731 | @retval EFI_INVALID_PARAMETER Time is NULL.\r | |
732 | @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.\r | |
733 | \r | |
734 | **/\r | |
735 | typedef\r | |
736 | EFI_STATUS\r | |
8b13229b | 737 | (EFIAPI *EFI_GET_TIME)(\r |
959ccb23 | 738 | OUT EFI_TIME *Time,\r |
739 | OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL\r | |
740 | );\r | |
741 | \r | |
742 | /**\r | |
743 | Sets the current local time and date information.\r | |
744 | \r | |
745 | @param Time A pointer to the current time.\r | |
746 | \r | |
747 | @retval EFI_SUCCESS The operation completed successfully.\r | |
748 | @retval EFI_INVALID_PARAMETER A time field is out of range.\r | |
749 | @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error.\r | |
750 | \r | |
751 | **/\r | |
752 | typedef\r | |
753 | EFI_STATUS\r | |
8b13229b | 754 | (EFIAPI *EFI_SET_TIME)(\r |
959ccb23 | 755 | IN EFI_TIME *Time\r |
756 | );\r | |
757 | \r | |
758 | /**\r | |
759 | Returns the current wakeup alarm clock setting.\r | |
760 | \r | |
761 | @param Enabled Indicates if the alarm is currently enabled or disabled.\r | |
762 | @param Pending Indicates if the alarm signal is pending and requires acknowledgement.\r | |
763 | @param Time The current alarm setting.\r | |
764 | \r | |
765 | @retval EFI_SUCCESS The alarm settings were returned.\r | |
e0c047a0 | 766 | @retval EFI_INVALID_PARAMETER Enabled is NULL.\r |
767 | @retval EFI_INVALID_PARAMETER Pending is NULL.\r | |
768 | @retval EFI_INVALID_PARAMETER Time is NULL.\r | |
959ccb23 | 769 | @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.\r |
e0c047a0 | 770 | @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.\r |
959ccb23 | 771 | \r |
772 | **/\r | |
773 | typedef\r | |
774 | EFI_STATUS\r | |
8b13229b | 775 | (EFIAPI *EFI_GET_WAKEUP_TIME)(\r |
959ccb23 | 776 | OUT BOOLEAN *Enabled,\r |
777 | OUT BOOLEAN *Pending,\r | |
778 | OUT EFI_TIME *Time\r | |
779 | );\r | |
780 | \r | |
781 | /**\r | |
782 | Sets the system wakeup alarm clock time.\r | |
783 | \r | |
784 | @param Enabled Enable or disable the wakeup alarm.\r | |
785 | @param Time If Enable is TRUE, the time to set the wakeup alarm for.\r | |
e0c047a0 | 786 | If Enable is FALSE, then this parameter is optional, and may be NULL.\r |
959ccb23 | 787 | \r |
788 | @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If\r | |
789 | Enable is FALSE, then the wakeup alarm was disabled.\r | |
790 | @retval EFI_INVALID_PARAMETER A time field is out of range.\r | |
791 | @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.\r | |
792 | @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.\r | |
793 | \r | |
794 | **/\r | |
795 | typedef\r | |
796 | EFI_STATUS\r | |
8b13229b | 797 | (EFIAPI *EFI_SET_WAKEUP_TIME)(\r |
959ccb23 | 798 | IN BOOLEAN Enable,\r |
799 | IN EFI_TIME *Time OPTIONAL\r | |
800 | );\r | |
801 | \r | |
959ccb23 | 802 | /**\r |
803 | Loads an EFI image into memory.\r | |
804 | \r | |
805 | @param BootPolicy If TRUE, indicates that the request originates from the boot\r | |
806 | manager, and that the boot manager is attempting to load\r | |
807 | FilePath as a boot selection. Ignored if SourceBuffer is\r | |
808 | not NULL.\r | |
809 | @param ParentImageHandle The caller's image handle.\r | |
e0c047a0 | 810 | @param DevicePath The DeviceHandle specific file path from which the image is\r |
959ccb23 | 811 | loaded.\r |
812 | @param SourceBuffer If not NULL, a pointer to the memory location containing a copy\r | |
813 | of the image to be loaded.\r | |
e0c047a0 | 814 | @param SourceSize The size in bytes of SourceBuffer. Ignored if SourceBuffer is NULL.\r |
af2dc6a7 | 815 | @param ImageHandle The pointer to the returned image handle that is created when the\r |
959ccb23 | 816 | image is successfully loaded.\r |
817 | \r | |
818 | @retval EFI_SUCCESS Image was loaded into memory correctly.\r | |
e0c047a0 | 819 | @retval EFI_NOT_FOUND Both SourceBuffer and DevicePath are NULL.\r |
959ccb23 | 820 | @retval EFI_INVALID_PARAMETER One or more parametes are invalid.\r |
821 | @retval EFI_UNSUPPORTED The image type is not supported.\r | |
822 | @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient resources.\r | |
823 | @retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not\r | |
824 | understood.\r | |
825 | @retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.\r | |
9095e76b LG |
826 | @retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the \r |
827 | image from being loaded. NULL is returned in *ImageHandle.\r | |
828 | @retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a \r | |
829 | valid EFI_LOADED_IMAGE_PROTOCOL. However, the current \r | |
830 | platform policy specifies that the image should not be started.\r | |
959ccb23 | 831 | **/\r |
832 | typedef\r | |
833 | EFI_STATUS\r | |
8b13229b | 834 | (EFIAPI *EFI_IMAGE_LOAD)(\r |
959ccb23 | 835 | IN BOOLEAN BootPolicy,\r |
836 | IN EFI_HANDLE ParentImageHandle,\r | |
e0c047a0 | 837 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r |
959ccb23 | 838 | IN VOID *SourceBuffer OPTIONAL,\r |
839 | IN UINTN SourceSize,\r | |
840 | OUT EFI_HANDLE *ImageHandle\r | |
841 | );\r | |
842 | \r | |
843 | /**\r | |
844 | Transfers control to a loaded image's entry point.\r | |
845 | \r | |
846 | @param ImageHandle Handle of image to be started.\r | |
af2dc6a7 | 847 | @param ExitDataSize The pointer to the size, in bytes, of ExitData.\r |
848 | @param ExitData The pointer to a pointer to a data buffer that includes a Null-terminated\r | |
fbf926ad | 849 | string, optionally followed by additional binary data.\r |
959ccb23 | 850 | \r |
851 | @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image\r | |
af2dc6a7 | 852 | has already been initialized with StartImage.\r |
e0c047a0 | 853 | @return Exit code from image\r |
959ccb23 | 854 | \r |
855 | **/\r | |
856 | typedef\r | |
857 | EFI_STATUS\r | |
8b13229b | 858 | (EFIAPI *EFI_IMAGE_START)(\r |
959ccb23 | 859 | IN EFI_HANDLE ImageHandle,\r |
860 | OUT UINTN *ExitDataSize,\r | |
861 | OUT CHAR16 **ExitData OPTIONAL\r | |
862 | );\r | |
863 | \r | |
864 | /**\r | |
865 | Terminates a loaded EFI image and returns control to boot services.\r | |
866 | \r | |
fbf926ad | 867 | @param ImageHandle Handle that identifies the image. This parameter is passed to the \r |
868 | image on entry.\r | |
959ccb23 | 869 | @param ExitStatus The image's exit code.\r |
fbf926ad | 870 | @param ExitDataSize The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS.\r |
af2dc6a7 | 871 | @param ExitData The pointer to a data buffer that includes a Null-terminated string,\r |
fbf926ad | 872 | optionally followed by additional binary data. The string is a \r |
873 | description that the caller may use to further indicate the reason \r | |
874 | for the image's exit. ExitData is only valid if ExitStatus \r | |
875 | is something other than EFI_SUCCESS. The ExitData buffer \r | |
876 | must be allocated by calling AllocatePool().\r | |
959ccb23 | 877 | \r |
878 | @retval EFI_SUCCESS The image specified by ImageHandle was unloaded.\r | |
879 | @retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and\r | |
880 | started with LoadImage() and StartImage(), but the\r | |
881 | image is not the currently executing image.\r | |
882 | \r | |
883 | **/\r | |
884 | typedef\r | |
885 | EFI_STATUS\r | |
8b13229b | 886 | (EFIAPI *EFI_EXIT)(\r |
959ccb23 | 887 | IN EFI_HANDLE ImageHandle,\r |
888 | IN EFI_STATUS ExitStatus,\r | |
889 | IN UINTN ExitDataSize,\r | |
890 | IN CHAR16 *ExitData OPTIONAL\r | |
891 | );\r | |
892 | \r | |
893 | /**\r | |
894 | Unloads an image.\r | |
895 | \r | |
896 | @param ImageHandle Handle that identifies the image to be unloaded.\r | |
897 | \r | |
898 | @retval EFI_SUCCESS The image has been unloaded.\r | |
899 | @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.\r | |
959ccb23 | 900 | \r |
901 | **/\r | |
902 | typedef\r | |
903 | EFI_STATUS\r | |
8b13229b | 904 | (EFIAPI *EFI_IMAGE_UNLOAD)(\r |
959ccb23 | 905 | IN EFI_HANDLE ImageHandle\r |
906 | );\r | |
907 | \r | |
908 | /**\r | |
909 | Terminates all boot services.\r | |
910 | \r | |
911 | @param ImageHandle Handle that identifies the exiting image.\r | |
912 | @param MapKey Key to the latest memory map.\r | |
913 | \r | |
914 | @retval EFI_SUCCESS Boot services have been terminated.\r | |
915 | @retval EFI_INVALID_PARAMETER MapKey is incorrect.\r | |
916 | \r | |
917 | **/\r | |
918 | typedef\r | |
919 | EFI_STATUS\r | |
8b13229b | 920 | (EFIAPI *EFI_EXIT_BOOT_SERVICES)(\r |
959ccb23 | 921 | IN EFI_HANDLE ImageHandle,\r |
922 | IN UINTN MapKey\r | |
923 | );\r | |
924 | \r | |
925 | /**\r | |
926 | Induces a fine-grained stall.\r | |
927 | \r | |
928 | @param Microseconds The number of microseconds to stall execution.\r | |
929 | \r | |
930 | @retval EFI_SUCCESS Execution was stalled at least the requested number of\r | |
931 | Microseconds.\r | |
932 | \r | |
933 | **/\r | |
934 | typedef\r | |
935 | EFI_STATUS\r | |
8b13229b | 936 | (EFIAPI *EFI_STALL)(\r |
959ccb23 | 937 | IN UINTN Microseconds\r |
938 | );\r | |
939 | \r | |
940 | /**\r | |
941 | Sets the system's watchdog timer.\r | |
942 | \r | |
943 | @param Timeout The number of seconds to set the watchdog timer to.\r | |
944 | @param WatchdogCode The numeric code to log on a watchdog timer timeout event.\r | |
945 | @param DataSize The size, in bytes, of WatchdogData.\r | |
fbf926ad | 946 | @param WatchdogData A data buffer that includes a Null-terminated string, optionally\r |
959ccb23 | 947 | followed by additional binary data.\r |
948 | \r | |
949 | @retval EFI_SUCCESS The timeout has been set.\r | |
950 | @retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid.\r | |
951 | @retval EFI_UNSUPPORTED The system does not have a watchdog timer.\r | |
af2dc6a7 | 952 | @retval EFI_DEVICE_ERROR The watchdog timer could not be programmed due to a hardware\r |
959ccb23 | 953 | error.\r |
954 | \r | |
955 | **/\r | |
956 | typedef\r | |
957 | EFI_STATUS\r | |
8b13229b | 958 | (EFIAPI *EFI_SET_WATCHDOG_TIMER)(\r |
959ccb23 | 959 | IN UINTN Timeout,\r |
960 | IN UINT64 WatchdogCode,\r | |
961 | IN UINTN DataSize,\r | |
962 | IN CHAR16 *WatchdogData OPTIONAL\r | |
963 | );\r | |
964 | \r | |
e0c047a0 | 965 | ///\r |
966 | /// Enumeration of reset types.\r | |
967 | ///\r | |
959ccb23 | 968 | typedef enum {\r |
2a3f6a21 | 969 | ///\r |
970 | /// Used to induce a system-wide reset. This sets all circuitry within the \r | |
971 | /// system to its initial state. This type of reset is asynchronous to system\r | |
972 | /// operation and operates withgout regard to cycle boundaries. EfiColdReset \r | |
973 | /// is tantamount to a system power cycle.\r | |
974 | ///\r | |
959ccb23 | 975 | EfiResetCold,\r |
2a3f6a21 | 976 | ///\r |
977 | /// Used to induce a system-wide initialization. The processors are set to their\r | |
978 | /// initial state, and pending cycles are not corrupted. If the system does \r | |
979 | /// not support this reset type, then an EfiResetCold must be performed.\r | |
980 | ///\r | |
959ccb23 | 981 | EfiResetWarm,\r |
2a3f6a21 | 982 | ///\r |
f754f721 | 983 | /// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3\r |
2a3f6a21 | 984 | /// state. If the system does not support this reset type, then when the system\r |
985 | /// is rebooted, it should exhibit the EfiResetCold attributes.\r | |
986 | ///\r | |
987 | EfiResetShutdown\r | |
959ccb23 | 988 | } EFI_RESET_TYPE;\r |
989 | \r | |
990 | /**\r | |
991 | Resets the entire platform.\r | |
992 | \r | |
993 | @param ResetType The type of reset to perform.\r | |
994 | @param ResetStatus The status code for the reset.\r | |
995 | @param DataSize The size, in bytes, of WatchdogData.\r | |
996 | @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or\r | |
997 | EfiResetShutdown the data buffer starts with a Null-terminated\r | |
fbf926ad | 998 | string, optionally followed by additional binary data.\r |
959ccb23 | 999 | \r |
1000 | **/\r | |
1001 | typedef\r | |
1002 | VOID\r | |
8b13229b | 1003 | (EFIAPI *EFI_RESET_SYSTEM)(\r |
959ccb23 | 1004 | IN EFI_RESET_TYPE ResetType,\r |
1005 | IN EFI_STATUS ResetStatus,\r | |
1006 | IN UINTN DataSize,\r | |
b058028b | 1007 | IN VOID *ResetData OPTIONAL\r |
959ccb23 | 1008 | );\r |
1009 | \r | |
1010 | /**\r | |
1011 | Returns a monotonically increasing count for the platform.\r | |
1012 | \r | |
af2dc6a7 | 1013 | @param Count The pointer to returned value.\r |
959ccb23 | 1014 | \r |
1015 | @retval EFI_SUCCESS The next monotonic count was returned.\r | |
1016 | @retval EFI_INVALID_PARAMETER Count is NULL.\r | |
1017 | @retval EFI_DEVICE_ERROR The device is not functioning properly.\r | |
1018 | \r | |
1019 | **/\r | |
1020 | typedef\r | |
1021 | EFI_STATUS\r | |
8b13229b | 1022 | (EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT)(\r |
959ccb23 | 1023 | OUT UINT64 *Count\r |
1024 | );\r | |
1025 | \r | |
1026 | /**\r | |
1027 | Returns the next high 32 bits of the platform's monotonic counter.\r | |
1028 | \r | |
af2dc6a7 | 1029 | @param HighCount The pointer to returned value.\r |
959ccb23 | 1030 | \r |
1031 | @retval EFI_SUCCESS The next high monotonic count was returned.\r | |
1032 | @retval EFI_INVALID_PARAMETER HighCount is NULL.\r | |
1033 | @retval EFI_DEVICE_ERROR The device is not functioning properly.\r | |
1034 | \r | |
1035 | **/\r | |
1036 | typedef\r | |
1037 | EFI_STATUS\r | |
8b13229b | 1038 | (EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT)(\r |
959ccb23 | 1039 | OUT UINT32 *HighCount\r |
1040 | );\r | |
1041 | \r | |
1042 | /**\r | |
1043 | Computes and returns a 32-bit CRC for a data buffer.\r | |
1044 | \r | |
1045 | @param Data A pointer to the buffer on which the 32-bit CRC is to be computed.\r | |
1046 | @param DataSize The number of bytes in the buffer Data.\r | |
1047 | @param Crc32 The 32-bit CRC that was computed for the data buffer specified by Data\r | |
1048 | and DataSize.\r | |
1049 | \r | |
1050 | @retval EFI_SUCCESS The 32-bit CRC was computed for the data buffer and returned in\r | |
1051 | Crc32.\r | |
e0c047a0 | 1052 | @retval EFI_INVALID_PARAMETER Data is NULL.\r |
1053 | @retval EFI_INVALID_PARAMETER Crc32 is NULL.\r | |
1054 | @retval EFI_INVALID_PARAMETER DataSize is 0.\r | |
959ccb23 | 1055 | \r |
1056 | **/\r | |
1057 | typedef\r | |
1058 | EFI_STATUS\r | |
8b13229b | 1059 | (EFIAPI *EFI_CALCULATE_CRC32)(\r |
959ccb23 | 1060 | IN VOID *Data,\r |
1061 | IN UINTN DataSize,\r | |
1062 | OUT UINT32 *Crc32\r | |
1063 | );\r | |
1064 | \r | |
1065 | /**\r | |
1066 | Copies the contents of one buffer to another buffer.\r | |
1067 | \r | |
af2dc6a7 | 1068 | @param Destination The pointer to the destination buffer of the memory copy.\r |
1069 | @param Source The pointer to the source buffer of the memory copy.\r | |
959ccb23 | 1070 | @param Length Number of bytes to copy from Source to Destination.\r |
1071 | \r | |
1072 | **/\r | |
1073 | typedef\r | |
1074 | VOID\r | |
8b13229b | 1075 | (EFIAPI *EFI_COPY_MEM)(\r |
959ccb23 | 1076 | IN VOID *Destination,\r |
1077 | IN VOID *Source,\r | |
1078 | IN UINTN Length\r | |
1079 | );\r | |
1080 | \r | |
1081 | /**\r | |
1082 | The SetMem() function fills a buffer with a specified value.\r | |
1083 | \r | |
af2dc6a7 | 1084 | @param Buffer The pointer to the buffer to fill.\r |
959ccb23 | 1085 | @param Size Number of bytes in Buffer to fill.\r |
1086 | @param Value Value to fill Buffer with.\r | |
1087 | \r | |
1088 | **/\r | |
1089 | typedef\r | |
1090 | VOID\r | |
8b13229b | 1091 | (EFIAPI *EFI_SET_MEM)(\r |
959ccb23 | 1092 | IN VOID *Buffer,\r |
1093 | IN UINTN Size,\r | |
1094 | IN UINT8 Value\r | |
1095 | );\r | |
1096 | \r | |
2a3f6a21 | 1097 | ///\r |
1098 | /// Enumeration of EFI Interface Types\r | |
1099 | ///\r | |
959ccb23 | 1100 | typedef enum {\r |
2a3f6a21 | 1101 | ///\r |
1102 | /// Indicates that the supplied protocol interface is supplied in native form.\r | |
1103 | ///\r | |
959ccb23 | 1104 | EFI_NATIVE_INTERFACE\r |
1105 | } EFI_INTERFACE_TYPE;\r | |
1106 | \r | |
1107 | /**\r | |
1108 | Installs a protocol interface on a device handle. If the handle does not exist, it is created and added\r | |
1109 | to the list of handles in the system. InstallMultipleProtocolInterfaces() performs\r | |
1110 | more error checking than InstallProtocolInterface(), so it is recommended that\r | |
1111 | InstallMultipleProtocolInterfaces() be used in place of\r | |
1112 | InstallProtocolInterface()\r | |
1113 | \r | |
1114 | @param Handle A pointer to the EFI_HANDLE on which the interface is to be installed.\r | |
1115 | @param Protocol The numeric ID of the protocol interface.\r | |
1116 | @param InterfaceType Indicates whether Interface is supplied in native form.\r | |
1117 | @param Interface A pointer to the protocol interface.\r | |
1118 | \r | |
1119 | @retval EFI_SUCCESS The protocol interface was installed.\r | |
1120 | @retval EFI_OUT_OF_RESOURCES Space for a new handle could not be allocated.\r | |
e0c047a0 | 1121 | @retval EFI_INVALID_PARAMETER Handle is NULL.\r |
1122 | @retval EFI_INVALID_PARAMETER Protocol is NULL.\r | |
1123 | @retval EFI_INVALID_PARAMETER InterfaceType is not EFI_NATIVE_INTERFACE.\r | |
1124 | @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.\r | |
959ccb23 | 1125 | \r |
1126 | **/\r | |
1127 | typedef\r | |
1128 | EFI_STATUS\r | |
8b13229b | 1129 | (EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE)(\r |
959ccb23 | 1130 | IN OUT EFI_HANDLE *Handle,\r |
1131 | IN EFI_GUID *Protocol,\r | |
1132 | IN EFI_INTERFACE_TYPE InterfaceType,\r | |
1133 | IN VOID *Interface\r | |
1134 | );\r | |
1135 | \r | |
1136 | /**\r | |
1137 | Installs one or more protocol interfaces into the boot services environment.\r | |
1138 | \r | |
4a23eaa9 RN |
1139 | @param Handle The pointer to a handle to install the new protocol interfaces on,\r |
1140 | or a pointer to NULL if a new handle is to be allocated.\r | |
959ccb23 | 1141 | @param ... A variable argument list containing pairs of protocol GUIDs and protocol\r |
1142 | interfaces.\r | |
1143 | \r | |
1144 | @retval EFI_SUCCESS All the protocol interface was installed.\r | |
1145 | @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.\r | |
1146 | @retval EFI_ALREADY_STARTED A Device Path Protocol instance was passed in that is already present in\r | |
1147 | the handle database.\r | |
1148 | \r | |
1149 | **/\r | |
1150 | typedef\r | |
1151 | EFI_STATUS\r | |
8b13229b | 1152 | (EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES)(\r |
959ccb23 | 1153 | IN OUT EFI_HANDLE *Handle,\r |
1154 | ...\r | |
1155 | );\r | |
1156 | \r | |
1157 | /**\r | |
1158 | Reinstalls a protocol interface on a device handle.\r | |
1159 | \r | |
1160 | @param Handle Handle on which the interface is to be reinstalled.\r | |
1161 | @param Protocol The numeric ID of the interface.\r | |
1162 | @param OldInterface A pointer to the old interface. NULL can be used if a structure is not\r | |
1163 | associated with Protocol.\r | |
1164 | @param NewInterface A pointer to the new interface.\r | |
1165 | \r | |
1166 | @retval EFI_SUCCESS The protocol interface was reinstalled.\r | |
1167 | @retval EFI_NOT_FOUND The OldInterface on the handle was not found.\r | |
1168 | @retval EFI_ACCESS_DENIED The protocol interface could not be reinstalled,\r | |
1169 | because OldInterface is still being used by a\r | |
1170 | driver that will not release it.\r | |
18bd7e85 | 1171 | @retval EFI_INVALID_PARAMETER Handle is NULL.\r |
e0c047a0 | 1172 | @retval EFI_INVALID_PARAMETER Protocol is NULL.\r |
959ccb23 | 1173 | \r |
1174 | **/\r | |
1175 | typedef\r | |
1176 | EFI_STATUS\r | |
8b13229b | 1177 | (EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE)(\r |
959ccb23 | 1178 | IN EFI_HANDLE Handle,\r |
1179 | IN EFI_GUID *Protocol,\r | |
1180 | IN VOID *OldInterface,\r | |
1181 | IN VOID *NewInterface\r | |
1182 | );\r | |
1183 | \r | |
1184 | /**\r | |
1185 | Removes a protocol interface from a device handle. It is recommended that\r | |
1186 | UninstallMultipleProtocolInterfaces() be used in place of\r | |
1187 | UninstallProtocolInterface().\r | |
1188 | \r | |
1189 | @param Handle The handle on which the interface was installed.\r | |
1190 | @param Protocol The numeric ID of the interface.\r | |
1191 | @param Interface A pointer to the interface.\r | |
1192 | \r | |
1193 | @retval EFI_SUCCESS The interface was removed.\r | |
1194 | @retval EFI_NOT_FOUND The interface was not found.\r | |
1195 | @retval EFI_ACCESS_DENIED The interface was not removed because the interface\r | |
1196 | is still being used by a driver.\r | |
18bd7e85 | 1197 | @retval EFI_INVALID_PARAMETER Handle is NULL.\r |
e0c047a0 | 1198 | @retval EFI_INVALID_PARAMETER Protocol is NULL.\r |
959ccb23 | 1199 | \r |
1200 | **/\r | |
1201 | typedef\r | |
1202 | EFI_STATUS\r | |
8b13229b | 1203 | (EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE)(\r |
959ccb23 | 1204 | IN EFI_HANDLE Handle,\r |
1205 | IN EFI_GUID *Protocol,\r | |
1206 | IN VOID *Interface\r | |
1207 | );\r | |
1208 | \r | |
1209 | /**\r | |
1210 | Removes one or more protocol interfaces into the boot services environment.\r | |
1211 | \r | |
1212 | @param Handle The handle to remove the protocol interfaces from.\r | |
1213 | @param ... A variable argument list containing pairs of protocol GUIDs and\r | |
1214 | protocol interfaces.\r | |
1215 | \r | |
1216 | @retval EFI_SUCCESS All the protocol interfaces were removed.\r | |
1217 | @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.\r | |
1218 | \r | |
1219 | **/\r | |
1220 | typedef\r | |
1221 | EFI_STATUS\r | |
8b13229b | 1222 | (EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES)(\r |
959ccb23 | 1223 | IN EFI_HANDLE Handle,\r |
1224 | ...\r | |
1225 | );\r | |
1226 | \r | |
1227 | /**\r | |
1228 | Queries a handle to determine if it supports a specified protocol.\r | |
1229 | \r | |
1230 | @param Handle The handle being queried.\r | |
1231 | @param Protocol The published unique identifier of the protocol.\r | |
1232 | @param Interface Supplies the address where a pointer to the corresponding Protocol\r | |
1233 | Interface is returned.\r | |
e0c047a0 | 1234 | \r |
959ccb23 | 1235 | @retval EFI_SUCCESS The interface information for the specified protocol was returned.\r |
1236 | @retval EFI_UNSUPPORTED The device does not support the specified protocol.\r | |
18bd7e85 | 1237 | @retval EFI_INVALID_PARAMETER Handle is NULL.\r |
e0c047a0 | 1238 | @retval EFI_INVALID_PARAMETER Protocol is NULL.\r |
1239 | @retval EFI_INVALID_PARAMETER Interface is NULL.\r | |
959ccb23 | 1240 | \r |
1241 | **/\r | |
1242 | typedef\r | |
1243 | EFI_STATUS\r | |
8b13229b | 1244 | (EFIAPI *EFI_HANDLE_PROTOCOL)(\r |
959ccb23 | 1245 | IN EFI_HANDLE Handle,\r |
1246 | IN EFI_GUID *Protocol,\r | |
1247 | OUT VOID **Interface\r | |
1248 | );\r | |
1249 | \r | |
1250 | #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001\r | |
1251 | #define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002\r | |
1252 | #define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004\r | |
1253 | #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008\r | |
1254 | #define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010\r | |
1255 | #define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020\r | |
1256 | \r | |
1257 | /**\r | |
1258 | Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the\r | |
1259 | handle, it opens the protocol on behalf of the calling agent.\r | |
1260 | \r | |
1261 | @param Handle The handle for the protocol interface that is being opened.\r | |
1262 | @param Protocol The published unique identifier of the protocol.\r | |
1263 | @param Interface Supplies the address where a pointer to the corresponding Protocol\r | |
1264 | Interface is returned.\r | |
1265 | @param AgentHandle The handle of the agent that is opening the protocol interface\r | |
1266 | specified by Protocol and Interface.\r | |
1267 | @param ControllerHandle If the agent that is opening a protocol is a driver that follows the\r | |
1268 | UEFI Driver Model, then this parameter is the controller handle\r | |
1269 | that requires the protocol interface. If the agent does not follow\r | |
1270 | the UEFI Driver Model, then this parameter is optional and may\r | |
1271 | be NULL.\r | |
1272 | @param Attributes The open mode of the protocol interface specified by Handle\r | |
1273 | and Protocol.\r | |
1274 | \r | |
1275 | @retval EFI_SUCCESS An item was added to the open list for the protocol interface, and the\r | |
1276 | protocol interface was returned in Interface.\r | |
1277 | @retval EFI_UNSUPPORTED Handle does not support Protocol.\r | |
1278 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
1279 | @retval EFI_ACCESS_DENIED Required attributes can't be supported in current environment.\r | |
1280 | @retval EFI_ALREADY_STARTED Item on the open list already has requierd attributes whose agent\r | |
1281 | handle is the same as AgentHandle.\r | |
1282 | \r | |
1283 | **/\r | |
1284 | typedef\r | |
1285 | EFI_STATUS\r | |
8b13229b | 1286 | (EFIAPI *EFI_OPEN_PROTOCOL)(\r |
959ccb23 | 1287 | IN EFI_HANDLE Handle,\r |
1288 | IN EFI_GUID *Protocol,\r | |
e0c047a0 | 1289 | OUT VOID **Interface, OPTIONAL\r |
959ccb23 | 1290 | IN EFI_HANDLE AgentHandle,\r |
e0c047a0 | 1291 | IN EFI_HANDLE ControllerHandle,\r |
959ccb23 | 1292 | IN UINT32 Attributes\r |
1293 | );\r | |
1294 | \r | |
1295 | \r | |
1296 | /**\r | |
1297 | Closes a protocol on a handle that was opened using OpenProtocol().\r | |
1298 | \r | |
1299 | @param Handle The handle for the protocol interface that was previously opened\r | |
1300 | with OpenProtocol(), and is now being closed.\r | |
1301 | @param Protocol The published unique identifier of the protocol.\r | |
959ccb23 | 1302 | @param AgentHandle The handle of the agent that is closing the protocol interface.\r |
1303 | @param ControllerHandle If the agent that opened a protocol is a driver that follows the\r | |
1304 | UEFI Driver Model, then this parameter is the controller handle\r | |
1305 | that required the protocol interface.\r | |
1306 | \r | |
1307 | @retval EFI_SUCCESS The protocol instance was closed.\r | |
d9de7921 RN |
1308 | @retval EFI_INVALID_PARAMETER 1) Handle is NULL.\r |
1309 | 2) AgentHandle is NULL.\r | |
e0c047a0 | 1310 | 3) ControllerHandle is not NULL and ControllerHandle is not a valid EFI_HANDLE.\r |
1311 | 4) Protocol is NULL.\r | |
959ccb23 | 1312 | @retval EFI_NOT_FOUND 1) Handle does not support the protocol specified by Protocol.\r |
1313 | 2) The protocol interface specified by Handle and Protocol is not\r | |
1314 | currently open by AgentHandle and ControllerHandle.\r | |
1315 | \r | |
1316 | **/\r | |
1317 | typedef\r | |
1318 | EFI_STATUS\r | |
8b13229b | 1319 | (EFIAPI *EFI_CLOSE_PROTOCOL)(\r |
959ccb23 | 1320 | IN EFI_HANDLE Handle,\r |
1321 | IN EFI_GUID *Protocol,\r | |
1322 | IN EFI_HANDLE AgentHandle,\r | |
1323 | IN EFI_HANDLE ControllerHandle\r | |
1324 | );\r | |
1325 | \r | |
2a3f6a21 | 1326 | ///\r |
1327 | /// EFI Oprn Protocol Information Entry\r | |
1328 | ///\r | |
959ccb23 | 1329 | typedef struct {\r |
1330 | EFI_HANDLE AgentHandle;\r | |
1331 | EFI_HANDLE ControllerHandle;\r | |
1332 | UINT32 Attributes;\r | |
1333 | UINT32 OpenCount;\r | |
1334 | } EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;\r | |
1335 | \r | |
1336 | /**\r | |
1337 | Retrieves the list of agents that currently have a protocol interface opened.\r | |
1338 | \r | |
1339 | @param Handle The handle for the protocol interface that is being queried.\r | |
1340 | @param Protocol The published unique identifier of the protocol.\r | |
1341 | @param EntryBuffer A pointer to a buffer of open protocol information in the form of\r | |
1342 | EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.\r | |
1343 | @param EntryCount A pointer to the number of entries in EntryBuffer.\r | |
1344 | \r | |
1345 | @retval EFI_SUCCESS The open protocol information was returned in EntryBuffer, and the\r | |
1346 | number of entries was returned EntryCount.\r | |
1347 | @retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate EntryBuffer.\r | |
1348 | @retval EFI_NOT_FOUND Handle does not support the protocol specified by Protocol.\r | |
1349 | \r | |
1350 | **/\r | |
1351 | typedef\r | |
1352 | EFI_STATUS\r | |
8b13229b | 1353 | (EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION)(\r |
959ccb23 | 1354 | IN EFI_HANDLE Handle,\r |
1355 | IN EFI_GUID *Protocol,\r | |
e0c047a0 | 1356 | OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,\r |
959ccb23 | 1357 | OUT UINTN *EntryCount\r |
1358 | );\r | |
1359 | \r | |
1360 | /**\r | |
1361 | Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r | |
1362 | from pool.\r | |
1363 | \r | |
1364 | @param Handle The handle from which to retrieve the list of protocol interface\r | |
1365 | GUIDs.\r | |
1366 | @param ProtocolBuffer A pointer to the list of protocol interface GUID pointers that are\r | |
1367 | installed on Handle.\r | |
1368 | @param ProtocolBufferCount A pointer to the number of GUID pointers present in\r | |
1369 | ProtocolBuffer.\r | |
1370 | \r | |
1371 | @retval EFI_SUCCESS The list of protocol interface GUIDs installed on Handle was returned in\r | |
1372 | ProtocolBuffer. The number of protocol interface GUIDs was\r | |
1373 | returned in ProtocolBufferCount.\r | |
1374 | @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.\r | |
e0c047a0 | 1375 | @retval EFI_INVALID_PARAMETER Handle is NULL.\r |
1376 | @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.\r | |
1377 | @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.\r | |
1378 | @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.\r | |
959ccb23 | 1379 | \r |
1380 | **/\r | |
1381 | typedef\r | |
1382 | EFI_STATUS\r | |
8b13229b | 1383 | (EFIAPI *EFI_PROTOCOLS_PER_HANDLE)(\r |
959ccb23 | 1384 | IN EFI_HANDLE Handle,\r |
1385 | OUT EFI_GUID ***ProtocolBuffer,\r | |
1386 | OUT UINTN *ProtocolBufferCount\r | |
1387 | );\r | |
1388 | \r | |
1389 | /**\r | |
1390 | Creates an event that is to be signaled whenever an interface is installed for a specified protocol.\r | |
1391 | \r | |
1392 | @param Protocol The numeric ID of the protocol for which the event is to be registered.\r | |
1393 | @param Event Event that is to be signaled whenever a protocol interface is registered\r | |
1394 | for Protocol.\r | |
1395 | @param Registration A pointer to a memory location to receive the registration value.\r | |
1396 | \r | |
1397 | @retval EFI_SUCCESS The notification event has been registered.\r | |
1398 | @retval EFI_OUT_OF_RESOURCES Space for the notification event could not be allocated.\r | |
e0c047a0 | 1399 | @retval EFI_INVALID_PARAMETER Protocol is NULL.\r |
1400 | @retval EFI_INVALID_PARAMETER Event is NULL.\r | |
1401 | @retval EFI_INVALID_PARAMETER Registration is NULL.\r | |
959ccb23 | 1402 | \r |
1403 | **/\r | |
1404 | typedef\r | |
1405 | EFI_STATUS\r | |
8b13229b | 1406 | (EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY)(\r |
959ccb23 | 1407 | IN EFI_GUID *Protocol,\r |
1408 | IN EFI_EVENT Event,\r | |
1409 | OUT VOID **Registration\r | |
1410 | );\r | |
1411 | \r | |
2a3f6a21 | 1412 | ///\r |
1413 | /// Enumeration of EFI Locate Search Types\r | |
1414 | ///\r | |
959ccb23 | 1415 | typedef enum {\r |
2a3f6a21 | 1416 | ///\r |
1417 | /// Retrieve all the handles in the handle database.\r | |
1418 | ///\r | |
959ccb23 | 1419 | AllHandles,\r |
2a3f6a21 | 1420 | ///\r |
1421 | /// Retrieve the next handle fron a RegisterProtocolNotify() event.\r | |
1422 | ///\r | |
959ccb23 | 1423 | ByRegisterNotify,\r |
2a3f6a21 | 1424 | ///\r |
1425 | /// Retrieve the set of handles from the handle database that support a \r | |
1426 | /// specified protocol.\r | |
1427 | ///\r | |
959ccb23 | 1428 | ByProtocol\r |
1429 | } EFI_LOCATE_SEARCH_TYPE;\r | |
1430 | \r | |
1431 | /**\r | |
1432 | Returns an array of handles that support a specified protocol.\r | |
1433 | \r | |
1434 | @param SearchType Specifies which handle(s) are to be returned.\r | |
1435 | @param Protocol Specifies the protocol to search by.\r | |
1436 | @param SearchKey Specifies the search key.\r | |
1437 | @param BufferSize On input, the size in bytes of Buffer. On output, the size in bytes of\r | |
1438 | the array returned in Buffer (if the buffer was large enough) or the\r | |
1439 | size, in bytes, of the buffer needed to obtain the array (if the buffer was\r | |
1440 | not large enough).\r | |
1441 | @param Buffer The buffer in which the array is returned.\r | |
1442 | \r | |
1443 | @retval EFI_SUCCESS The array of handles was returned.\r | |
1444 | @retval EFI_NOT_FOUND No handles match the search.\r | |
1445 | @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.\r | |
e0c047a0 | 1446 | @retval EFI_INVALID_PARAMETER SearchType is not a member of EFI_LOCATE_SEARCH_TYPE.\r |
1447 | @retval EFI_INVALID_PARAMETER SearchType is ByRegisterNotify and SearchKey is NULL.\r | |
1448 | @retval EFI_INVALID_PARAMETER SearchType is ByProtocol and Protocol is NULL.\r | |
1449 | @retval EFI_INVALID_PARAMETER One or more matches are found and BufferSize is NULL.\r | |
1450 | @retval EFI_INVALID_PARAMETER BufferSize is large enough for the result and Buffer is NULL.\r | |
959ccb23 | 1451 | \r |
1452 | **/\r | |
1453 | typedef\r | |
1454 | EFI_STATUS\r | |
8b13229b | 1455 | (EFIAPI *EFI_LOCATE_HANDLE)(\r |
959ccb23 | 1456 | IN EFI_LOCATE_SEARCH_TYPE SearchType,\r |
1457 | IN EFI_GUID *Protocol, OPTIONAL\r | |
1458 | IN VOID *SearchKey, OPTIONAL\r | |
1459 | IN OUT UINTN *BufferSize,\r | |
1460 | OUT EFI_HANDLE *Buffer\r | |
1461 | );\r | |
1462 | \r | |
1463 | /**\r | |
1464 | Locates the handle to a device on the device path that supports the specified protocol.\r | |
1465 | \r | |
1466 | @param Protocol Specifies the protocol to search for.\r | |
1467 | @param DevicePath On input, a pointer to a pointer to the device path. On output, the device\r | |
1468 | path pointer is modified to point to the remaining part of the device\r | |
1469 | path.\r | |
1470 | @param Device A pointer to the returned device handle.\r | |
1471 | \r | |
1472 | @retval EFI_SUCCESS The resulting handle was returned.\r | |
1473 | @retval EFI_NOT_FOUND No handles match the search.\r | |
e0c047a0 | 1474 | @retval EFI_INVALID_PARAMETER Protocol is NULL.\r |
1475 | @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r | |
1476 | @retval EFI_INVALID_PARAMETER A handle matched the search and Device is NULL.\r | |
959ccb23 | 1477 | \r |
1478 | **/\r | |
1479 | typedef\r | |
1480 | EFI_STATUS\r | |
8b13229b | 1481 | (EFIAPI *EFI_LOCATE_DEVICE_PATH)(\r |
959ccb23 | 1482 | IN EFI_GUID *Protocol,\r |
1483 | IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,\r | |
1484 | OUT EFI_HANDLE *Device\r | |
1485 | );\r | |
1486 | \r | |
1487 | /**\r | |
1488 | Adds, updates, or removes a configuration table entry from the EFI System Table.\r | |
1489 | \r | |
1490 | @param Guid A pointer to the GUID for the entry to add, update, or remove.\r | |
1491 | @param Table A pointer to the configuration table for the entry to add, update, or\r | |
1492 | remove. May be NULL.\r | |
1493 | \r | |
1494 | @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.\r | |
1495 | @retval EFI_NOT_FOUND An attempt was made to delete a nonexistent entry.\r | |
bfe0572b | 1496 | @retval EFI_INVALID_PARAMETER Guid is NULL.\r |
959ccb23 | 1497 | @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.\r |
1498 | \r | |
1499 | **/\r | |
1500 | typedef\r | |
1501 | EFI_STATUS\r | |
8b13229b | 1502 | (EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE)(\r |
959ccb23 | 1503 | IN EFI_GUID *Guid,\r |
1504 | IN VOID *Table\r | |
1505 | );\r | |
1506 | \r | |
959ccb23 | 1507 | /**\r |
1508 | Returns an array of handles that support the requested protocol in a buffer allocated from pool.\r | |
1509 | \r | |
1510 | @param SearchType Specifies which handle(s) are to be returned.\r | |
e0c047a0 | 1511 | @param Protocol Provides the protocol to search by.\r |
1512 | This parameter is only valid for a SearchType of ByProtocol.\r | |
959ccb23 | 1513 | @param SearchKey Supplies the search key depending on the SearchType.\r |
1514 | @param NoHandles The number of handles returned in Buffer.\r | |
1515 | @param Buffer A pointer to the buffer to return the requested array of handles that\r | |
1516 | support Protocol.\r | |
1517 | \r | |
1518 | @retval EFI_SUCCESS The array of handles was returned in Buffer, and the number of\r | |
1519 | handles in Buffer was returned in NoHandles.\r | |
1520 | @retval EFI_NOT_FOUND No handles match the search.\r | |
1521 | @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the matching results.\r | |
e0c047a0 | 1522 | @retval EFI_INVALID_PARAMETER NoHandles is NULL.\r |
1523 | @retval EFI_INVALID_PARAMETER Buffer is NULL.\r | |
959ccb23 | 1524 | \r |
1525 | **/\r | |
1526 | typedef\r | |
1527 | EFI_STATUS\r | |
8b13229b | 1528 | (EFIAPI *EFI_LOCATE_HANDLE_BUFFER)(\r |
959ccb23 | 1529 | IN EFI_LOCATE_SEARCH_TYPE SearchType,\r |
1530 | IN EFI_GUID *Protocol, OPTIONAL\r | |
1531 | IN VOID *SearchKey, OPTIONAL\r | |
1532 | IN OUT UINTN *NoHandles,\r | |
1533 | OUT EFI_HANDLE **Buffer\r | |
1534 | );\r | |
1535 | \r | |
1536 | /**\r | |
1537 | Returns the first protocol instance that matches the given protocol.\r | |
1538 | \r | |
1539 | @param Protocol Provides the protocol to search for.\r | |
1540 | @param Registration Optional registration key returned from\r | |
1541 | RegisterProtocolNotify().\r | |
1542 | @param Interface On return, a pointer to the first interface that matches Protocol and\r | |
1543 | Registration.\r | |
1544 | \r | |
1545 | @retval EFI_SUCCESS A protocol instance matching Protocol was found and returned in\r | |
1546 | Interface.\r | |
1547 | @retval EFI_NOT_FOUND No protocol instances were found that match Protocol and\r | |
1548 | Registration.\r | |
1549 | @retval EFI_INVALID_PARAMETER Interface is NULL.\r | |
1550 | \r | |
1551 | **/\r | |
1552 | typedef\r | |
1553 | EFI_STATUS\r | |
8b13229b | 1554 | (EFIAPI *EFI_LOCATE_PROTOCOL)(\r |
959ccb23 | 1555 | IN EFI_GUID *Protocol,\r |
1556 | IN VOID *Registration, OPTIONAL\r | |
1557 | OUT VOID **Interface\r | |
1558 | );\r | |
1559 | \r | |
2a3f6a21 | 1560 | ///\r |
1561 | /// EFI Capsule Block Descriptor\r | |
1562 | ///\r | |
959ccb23 | 1563 | typedef struct {\r |
1bf79370 LG |
1564 | ///\r |
1565 | /// Length in bytes of the data pointed to by DataBlock/ContinuationPointer.\r | |
1566 | ///\r | |
2a3f6a21 | 1567 | UINT64 Length;\r |
959ccb23 | 1568 | union {\r |
1bf79370 LG |
1569 | ///\r |
1570 | /// Physical address of the data block. This member of the union is\r | |
1571 | /// used if Length is not equal to zero.\r | |
1572 | ///\r | |
959ccb23 | 1573 | EFI_PHYSICAL_ADDRESS DataBlock;\r |
1bf79370 LG |
1574 | ///\r |
1575 | /// Physical address of another block of\r | |
1576 | /// EFI_CAPSULE_BLOCK_DESCRIPTOR structures. This\r | |
1577 | /// member of the union is used if Length is equal to zero. If\r | |
1578 | /// ContinuationPointer is zero this entry represents the end of the list.\r | |
1579 | ///\r | |
959ccb23 | 1580 | EFI_PHYSICAL_ADDRESS ContinuationPointer;\r |
1581 | } Union;\r | |
45ad5569 | 1582 | } EFI_CAPSULE_BLOCK_DESCRIPTOR;\r |
959ccb23 | 1583 | \r |
2a3f6a21 | 1584 | ///\r |
af2dc6a7 | 1585 | /// EFI Capsule Header.\r |
2a3f6a21 | 1586 | ///\r |
959ccb23 | 1587 | typedef struct {\r |
1bf79370 LG |
1588 | ///\r |
1589 | /// A GUID that defines the contents of a capsule.\r | |
1590 | ///\r | |
959ccb23 | 1591 | EFI_GUID CapsuleGuid;\r |
1bf79370 LG |
1592 | ///\r |
1593 | /// The size of the capsule header. This may be larger than the size of\r | |
1594 | /// the EFI_CAPSULE_HEADER since CapsuleGuid may imply\r | |
1595 | /// extended header entries\r | |
1596 | ///\r | |
959ccb23 | 1597 | UINT32 HeaderSize;\r |
1bf79370 LG |
1598 | ///\r |
1599 | /// Bit-mapped list describing the capsule attributes. The Flag values\r | |
f6d2bcc6 | 1600 | /// of 0x0000 - 0xFFFF are defined by CapsuleGuid. Flag values\r |
a0d58c21 | 1601 | /// of 0x10000 - 0xFFFFFFFF are defined by this specification\r |
1bf79370 | 1602 | ///\r |
959ccb23 | 1603 | UINT32 Flags;\r |
1bf79370 LG |
1604 | ///\r |
1605 | /// Size in bytes of the capsule.\r | |
1606 | ///\r | |
959ccb23 | 1607 | UINT32 CapsuleImageSize;\r |
45ad5569 | 1608 | } EFI_CAPSULE_HEADER;\r |
959ccb23 | 1609 | \r |
1bf79370 LG |
1610 | ///\r |
1611 | /// The EFI System Table entry must point to an array of capsules\r | |
1612 | /// that contain the same CapsuleGuid value. The array must be\r | |
1613 | /// prefixed by a UINT32 that represents the size of the array of capsules.\r | |
1614 | ///\r | |
176a6bb3 | 1615 | typedef struct {\r |
1bf79370 LG |
1616 | ///\r |
1617 | /// the size of the array of capsules.\r | |
1618 | ///\r | |
176a6bb3 | 1619 | UINT32 CapsuleArrayNumber;\r |
1bf79370 LG |
1620 | ///\r |
1621 | /// Point to an array of capsules that contain the same CapsuleGuid value.\r | |
1622 | ///\r | |
176a6bb3 LG |
1623 | VOID* CapsulePtr[1];\r |
1624 | } EFI_CAPSULE_TABLE;\r | |
1625 | \r | |
959ccb23 | 1626 | #define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000\r |
1627 | #define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000\r | |
eaa8a234 | 1628 | #define CAPSULE_FLAGS_INITIATE_RESET 0x00040000\r |
959ccb23 | 1629 | \r |
1630 | /**\r | |
1631 | Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended\r | |
1632 | consumption, the firmware may process the capsule immediately. If the payload should persist\r | |
1633 | across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must\r | |
1634 | be passed into ResetSystem() and will cause the capsule to be processed by the firmware as\r | |
1635 | part of the reset process.\r | |
1636 | \r | |
1637 | @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules\r | |
1638 | being passed into update capsule.\r | |
1639 | @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r | |
1640 | CaspuleHeaderArray.\r | |
1641 | @param ScatterGatherList Physical pointer to a set of\r | |
1642 | EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the\r | |
1643 | location in physical memory of a set of capsules.\r | |
1644 | \r | |
1645 | @retval EFI_SUCCESS Valid capsule was passed. If\r | |
1646 | CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the\r | |
1647 | capsule has been successfully processed by the firmware.\r | |
eaa8a234 | 1648 | @retval EFI_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were\r |
1649 | set in the capsule header.\r | |
a0d58c21 | 1650 | @retval EFI_INVALID_PARAMETER CapsuleCount is 0.\r |
959ccb23 | 1651 | @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error.\r |
e0c047a0 | 1652 | @retval EFI_UNSUPPORTED The capsule type is not supported on this platform.\r |
1653 | @retval EFI_OUT_OF_RESOURCES There were insufficient resources to process the capsule.\r | |
959ccb23 | 1654 | \r |
1655 | **/\r | |
1656 | typedef\r | |
1657 | EFI_STATUS\r | |
8b13229b | 1658 | (EFIAPI *EFI_UPDATE_CAPSULE)(\r |
531febc2 | 1659 | IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,\r |
959ccb23 | 1660 | IN UINTN CapsuleCount,\r |
1661 | IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL\r | |
1662 | );\r | |
1663 | \r | |
1664 | /**\r | |
1665 | Returns if the capsule can be supported via UpdateCapsule().\r | |
1666 | \r | |
1667 | @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules\r | |
1668 | being passed into update capsule.\r | |
1669 | @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r | |
1670 | CaspuleHeaderArray.\r | |
1671 | @param MaxiumCapsuleSize On output the maximum size that UpdateCapsule() can\r | |
1672 | support as an argument to UpdateCapsule() via\r | |
1673 | CapsuleHeaderArray and ScatterGatherList.\r | |
1674 | @param ResetType Returns the type of reset required for the capsule update.\r | |
1675 | \r | |
1676 | @retval EFI_SUCCESS Valid answer returned.\r | |
1677 | @retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and\r | |
1678 | MaximumCapsuleSize and ResetType are undefined.\r | |
1679 | @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.\r | |
e0c047a0 | 1680 | @retval EFI_OUT_OF_RESOURCES There were insufficient resources to process the query request.\r |
959ccb23 | 1681 | \r |
1682 | **/\r | |
1683 | typedef\r | |
1684 | EFI_STATUS\r | |
8b13229b | 1685 | (EFIAPI *EFI_QUERY_CAPSULE_CAPABILITIES)(\r |
531febc2 | 1686 | IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,\r |
959ccb23 | 1687 | IN UINTN CapsuleCount,\r |
1688 | OUT UINT64 *MaximumCapsuleSize,\r | |
1689 | OUT EFI_RESET_TYPE *ResetType\r | |
1690 | );\r | |
1691 | \r | |
1692 | /**\r | |
1693 | Returns information about the EFI variables.\r | |
1694 | \r | |
1695 | @param Attributes Attributes bitmask to specify the type of variables on\r | |
1696 | which to return information.\r | |
1697 | @param MaximumVariableStorageSize On output the maximum size of the storage space\r | |
1698 | available for the EFI variables associated with the\r | |
1699 | attributes specified.\r | |
1700 | @param RemainingVariableStorageSize Returns the remaining size of the storage space\r | |
1701 | available for the EFI variables associated with the\r | |
1702 | attributes specified.\r | |
1703 | @param MaximumVariableSize Returns the maximum size of the individual EFI\r | |
1704 | variables associated with the attributes specified.\r | |
1705 | \r | |
1706 | @retval EFI_SUCCESS Valid answer returned.\r | |
1707 | @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied\r | |
1708 | @retval EFI_UNSUPPORTED The attribute is not supported on this platform, and the\r | |
1709 | MaximumVariableStorageSize,\r | |
1710 | RemainingVariableStorageSize, MaximumVariableSize\r | |
1711 | are undefined.\r | |
1712 | \r | |
1713 | **/\r | |
1714 | typedef\r | |
1715 | EFI_STATUS\r | |
8b13229b | 1716 | (EFIAPI *EFI_QUERY_VARIABLE_INFO)(\r |
959ccb23 | 1717 | IN UINT32 Attributes,\r |
1718 | OUT UINT64 *MaximumVariableStorageSize,\r | |
1719 | OUT UINT64 *RemainingVariableStorageSize,\r | |
1720 | OUT UINT64 *MaximumVariableSize\r | |
1721 | );\r | |
1722 | \r | |
1723 | \r | |
1724 | //\r | |
1725 | // EFI Runtime Services Table\r | |
1726 | //\r | |
07636730 | 1727 | #define EFI_SYSTEM_TABLE_SIGNATURE SIGNATURE_64 ('I','B','I',' ','S','Y','S','T')\r |
aee17e89 | 1728 | #define EFI_2_31_SYSTEM_TABLE_REVISION ((2 << 16) | (31))\r |
add9c350 | 1729 | #define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30))\r |
1730 | #define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20))\r | |
2a3f6a21 | 1731 | #define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | (10))\r |
1732 | #define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00))\r | |
1733 | #define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10))\r | |
1734 | #define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02))\r | |
aee17e89 | 1735 | #define EFI_SYSTEM_TABLE_REVISION EFI_2_31_SYSTEM_TABLE_REVISION\r |
2a3f6a21 | 1736 | \r |
07636730 | 1737 | #define EFI_RUNTIME_SERVICES_SIGNATURE SIGNATURE_64 ('R','U','N','T','S','E','R','V')\r |
aee17e89 | 1738 | #define EFI_RUNTIME_SERVICES_REVISION EFI_2_31_SYSTEM_TABLE_REVISION\r |
959ccb23 | 1739 | \r |
e0c047a0 | 1740 | ///\r |
af2dc6a7 | 1741 | /// EFI Runtime Services Table.\r |
e0c047a0 | 1742 | ///\r |
959ccb23 | 1743 | typedef struct {\r |
e0c047a0 | 1744 | ///\r |
1745 | /// The table header for the EFI Runtime Services Table.\r | |
1746 | ///\r | |
c9a0a0fc | 1747 | EFI_TABLE_HEADER Hdr;\r |
00edb218 A |
1748 | \r |
1749 | //\r | |
1750 | // Time Services\r | |
1751 | //\r | |
1752 | EFI_GET_TIME GetTime;\r | |
1753 | EFI_SET_TIME SetTime;\r | |
1754 | EFI_GET_WAKEUP_TIME GetWakeupTime;\r | |
1755 | EFI_SET_WAKEUP_TIME SetWakeupTime;\r | |
1756 | \r | |
1757 | //\r | |
1758 | // Virtual Memory Services\r | |
1759 | //\r | |
1760 | EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap;\r | |
1761 | EFI_CONVERT_POINTER ConvertPointer;\r | |
1762 | \r | |
1763 | //\r | |
1764 | // Variable Services\r | |
1765 | //\r | |
1766 | EFI_GET_VARIABLE GetVariable;\r | |
1767 | EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName;\r | |
1768 | EFI_SET_VARIABLE SetVariable;\r | |
1769 | \r | |
1770 | //\r | |
1771 | // Miscellaneous Services\r | |
1772 | //\r | |
1773 | EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount;\r | |
1774 | EFI_RESET_SYSTEM ResetSystem;\r | |
1775 | \r | |
1776 | //\r | |
1777 | // UEFI 2.0 Capsule Services\r | |
1778 | //\r | |
1779 | EFI_UPDATE_CAPSULE UpdateCapsule;\r | |
1780 | EFI_QUERY_CAPSULE_CAPABILITIES QueryCapsuleCapabilities;\r | |
1781 | \r | |
1782 | //\r | |
1783 | // Miscellaneous UEFI 2.0 Service\r | |
1784 | //\r | |
1785 | EFI_QUERY_VARIABLE_INFO QueryVariableInfo;\r | |
959ccb23 | 1786 | } EFI_RUNTIME_SERVICES;\r |
1787 | \r | |
1788 | \r | |
07636730 | 1789 | #define EFI_BOOT_SERVICES_SIGNATURE SIGNATURE_64 ('B','O','O','T','S','E','R','V')\r |
aee17e89 | 1790 | #define EFI_BOOT_SERVICES_REVISION EFI_2_31_SYSTEM_TABLE_REVISION\r |
959ccb23 | 1791 | \r |
e0c047a0 | 1792 | ///\r |
af2dc6a7 | 1793 | /// EFI Boot Services Table.\r |
e0c047a0 | 1794 | ///\r |
959ccb23 | 1795 | typedef struct {\r |
e0c047a0 | 1796 | ///\r |
1797 | /// The table header for the EFI Boot Services Table.\r | |
1798 | ///\r | |
c9a0a0fc | 1799 | EFI_TABLE_HEADER Hdr;\r |
d0c64728 | 1800 | \r |
00edb218 A |
1801 | //\r |
1802 | // Task Priority Services\r | |
1803 | //\r | |
1804 | EFI_RAISE_TPL RaiseTPL;\r | |
1805 | EFI_RESTORE_TPL RestoreTPL;\r | |
1806 | \r | |
1807 | //\r | |
1808 | // Memory Services\r | |
1809 | //\r | |
1810 | EFI_ALLOCATE_PAGES AllocatePages;\r | |
1811 | EFI_FREE_PAGES FreePages;\r | |
1812 | EFI_GET_MEMORY_MAP GetMemoryMap;\r | |
1813 | EFI_ALLOCATE_POOL AllocatePool;\r | |
1814 | EFI_FREE_POOL FreePool;\r | |
1815 | \r | |
1816 | //\r | |
1817 | // Event & Timer Services\r | |
1818 | //\r | |
1819 | EFI_CREATE_EVENT CreateEvent;\r | |
1820 | EFI_SET_TIMER SetTimer;\r | |
1821 | EFI_WAIT_FOR_EVENT WaitForEvent;\r | |
1822 | EFI_SIGNAL_EVENT SignalEvent;\r | |
1823 | EFI_CLOSE_EVENT CloseEvent;\r | |
1824 | EFI_CHECK_EVENT CheckEvent;\r | |
1825 | \r | |
1826 | //\r | |
1827 | // Protocol Handler Services\r | |
1828 | //\r | |
1829 | EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;\r | |
1830 | EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;\r | |
1831 | EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;\r | |
1832 | EFI_HANDLE_PROTOCOL HandleProtocol;\r | |
1833 | VOID *Reserved;\r | |
1834 | EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;\r | |
1835 | EFI_LOCATE_HANDLE LocateHandle;\r | |
1836 | EFI_LOCATE_DEVICE_PATH LocateDevicePath;\r | |
1837 | EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;\r | |
1838 | \r | |
1839 | //\r | |
1840 | // Image Services\r | |
1841 | //\r | |
1842 | EFI_IMAGE_LOAD LoadImage;\r | |
1843 | EFI_IMAGE_START StartImage;\r | |
1844 | EFI_EXIT Exit;\r | |
1845 | EFI_IMAGE_UNLOAD UnloadImage;\r | |
1846 | EFI_EXIT_BOOT_SERVICES ExitBootServices;\r | |
1847 | \r | |
1848 | //\r | |
1849 | // Miscellaneous Services\r | |
1850 | //\r | |
1851 | EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;\r | |
1852 | EFI_STALL Stall;\r | |
1853 | EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;\r | |
1854 | \r | |
1855 | //\r | |
1856 | // DriverSupport Services\r | |
1857 | //\r | |
1858 | EFI_CONNECT_CONTROLLER ConnectController;\r | |
1859 | EFI_DISCONNECT_CONTROLLER DisconnectController;\r | |
1860 | \r | |
1861 | //\r | |
1862 | // Open and Close Protocol Services\r | |
1863 | //\r | |
1864 | EFI_OPEN_PROTOCOL OpenProtocol;\r | |
1865 | EFI_CLOSE_PROTOCOL CloseProtocol;\r | |
1866 | EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation;\r | |
1867 | \r | |
1868 | //\r | |
1869 | // Library Services\r | |
1870 | //\r | |
1871 | EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle;\r | |
1872 | EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer;\r | |
1873 | EFI_LOCATE_PROTOCOL LocateProtocol;\r | |
1874 | EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;\r | |
1875 | EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;\r | |
1876 | \r | |
1877 | //\r | |
1878 | // 32-bit CRC Services\r | |
1879 | //\r | |
1880 | EFI_CALCULATE_CRC32 CalculateCrc32;\r | |
1881 | \r | |
1882 | //\r | |
1883 | // Miscellaneous Services\r | |
1884 | //\r | |
1885 | EFI_COPY_MEM CopyMem;\r | |
1886 | EFI_SET_MEM SetMem;\r | |
00edb218 | 1887 | EFI_CREATE_EVENT_EX CreateEventEx;\r |
959ccb23 | 1888 | } EFI_BOOT_SERVICES;\r |
1889 | \r | |
e0c047a0 | 1890 | ///\r |
1891 | /// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the\r | |
1892 | /// EFI System Table.\r | |
1893 | ///\r | |
2a3f6a21 | 1894 | typedef struct {\r |
e0c047a0 | 1895 | ///\r |
1896 | /// The 128-bit GUID value that uniquely identifies the system configuration table.\r | |
1897 | ///\r | |
00edb218 | 1898 | EFI_GUID VendorGuid;\r |
e0c047a0 | 1899 | ///\r |
1900 | /// A pointer to the table associated with VendorGuid.\r | |
1901 | ///\r | |
00edb218 | 1902 | VOID *VendorTable;\r |
959ccb23 | 1903 | } EFI_CONFIGURATION_TABLE;\r |
1904 | \r | |
e0c047a0 | 1905 | ///\r |
1906 | /// EFI System Table\r | |
1907 | ///\r | |
2a3f6a21 | 1908 | typedef struct {\r |
e0c047a0 | 1909 | ///\r |
1910 | /// The table header for the EFI System Table.\r | |
1911 | ///\r | |
c9a0a0fc | 1912 | EFI_TABLE_HEADER Hdr;\r |
e0c047a0 | 1913 | ///\r |
fbf926ad | 1914 | /// A pointer to a null terminated string that identifies the vendor\r |
1915 | /// that produces the system firmware for the platform.\r | |
e0c047a0 | 1916 | ///\r |
00edb218 | 1917 | CHAR16 *FirmwareVendor;\r |
e0c047a0 | 1918 | ///\r |
1919 | /// A firmware vendor specific value that identifies the revision\r | |
1920 | /// of the system firmware for the platform.\r | |
1921 | ///\r | |
00edb218 | 1922 | UINT32 FirmwareRevision;\r |
e0c047a0 | 1923 | ///\r |
eaf75bf4 | 1924 | /// The handle for the active console input device. This handle must support\r |
1925 | /// EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.\r | |
e0c047a0 | 1926 | ///\r |
00edb218 | 1927 | EFI_HANDLE ConsoleInHandle;\r |
e0c047a0 | 1928 | ///\r |
11ca63ec | 1929 | /// A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is\r |
e0c047a0 | 1930 | /// associated with ConsoleInHandle.\r |
1931 | ///\r | |
00edb218 | 1932 | EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ConIn;\r |
e0c047a0 | 1933 | ///\r |
1934 | /// The handle for the active console output device.\r | |
1935 | ///\r | |
00edb218 | 1936 | EFI_HANDLE ConsoleOutHandle;\r |
e0c047a0 | 1937 | ///\r |
11ca63ec | 1938 | /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface\r |
e0c047a0 | 1939 | /// that is associated with ConsoleOutHandle.\r |
1940 | ///\r | |
00edb218 | 1941 | EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;\r |
e0c047a0 | 1942 | ///\r |
1943 | /// The handle for the active standard error console device.\r | |
eaf75bf4 | 1944 | /// This handle must support the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.\r |
e0c047a0 | 1945 | ///\r |
00edb218 | 1946 | EFI_HANDLE StandardErrorHandle;\r |
e0c047a0 | 1947 | ///\r |
11ca63ec | 1948 | /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface\r |
e0c047a0 | 1949 | /// that is associated with StandardErrorHandle.\r |
1950 | ///\r | |
00edb218 | 1951 | EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *StdErr;\r |
e0c047a0 | 1952 | ///\r |
1953 | /// A pointer to the EFI Runtime Services Table.\r | |
1954 | ///\r | |
00edb218 | 1955 | EFI_RUNTIME_SERVICES *RuntimeServices;\r |
e0c047a0 | 1956 | ///\r |
1957 | /// A pointer to the EFI Boot Services Table.\r | |
1958 | ///\r | |
00edb218 | 1959 | EFI_BOOT_SERVICES *BootServices;\r |
e0c047a0 | 1960 | ///\r |
1961 | /// The number of system configuration tables in the buffer ConfigurationTable.\r | |
1962 | ///\r | |
00edb218 | 1963 | UINTN NumberOfTableEntries;\r |
e0c047a0 | 1964 | ///\r |
1965 | /// A pointer to the system configuration tables.\r | |
1966 | /// The number of entries in the table is NumberOfTableEntries.\r | |
1967 | ///\r | |
00edb218 | 1968 | EFI_CONFIGURATION_TABLE *ConfigurationTable;\r |
2a3f6a21 | 1969 | } EFI_SYSTEM_TABLE;\r |
1970 | \r | |
1971 | /**\r | |
1972 | This is the declaration of an EFI image entry point. This entry point is\r | |
1973 | the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r | |
1974 | both device drivers and bus drivers.\r | |
1975 | \r | |
1976 | @param ImageHandle The firmware allocated handle for the UEFI image.\r | |
1977 | @param SystemTable A pointer to the EFI System Table.\r | |
1978 | \r | |
1979 | @retval EFI_SUCCESS The operation completed successfully.\r | |
af2dc6a7 | 1980 | @retval Others An unexpected error occurred.\r |
2a3f6a21 | 1981 | **/\r |
1982 | typedef\r | |
1983 | EFI_STATUS\r | |
1984 | (EFIAPI *EFI_IMAGE_ENTRY_POINT)(\r | |
1985 | IN EFI_HANDLE ImageHandle,\r | |
1986 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
1987 | );\r | |
959ccb23 | 1988 | \r |
95cba3ee A |
1989 | //\r |
1990 | // EFI Load Options Attributes\r | |
1991 | //\r | |
1992 | #define LOAD_OPTION_ACTIVE 0x00000001\r | |
1993 | #define LOAD_OPTION_FORCE_RECONNECT 0x00000002\r | |
95cba3ee A |
1994 | #define LOAD_OPTION_HIDDEN 0x00000008\r |
1995 | #define LOAD_OPTION_CATEGORY 0x00001F00\r | |
1996 | \r | |
1997 | #define LOAD_OPTION_CATEGORY_BOOT 0x00000000\r | |
1998 | #define LOAD_OPTION_CATEGORY_APP 0x00000100\r | |
1999 | \r | |
2000 | #define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001\r | |
2001 | #define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002\r | |
2002 | #define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300\r | |
2003 | \r | |
2a3f6a21 | 2004 | ///\r |
2005 | /// EFI Boot Key Data\r | |
2006 | ///\r | |
95cba3ee A |
2007 | typedef union {\r |
2008 | struct {\r | |
1bf79370 LG |
2009 | ///\r |
2010 | /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.\r | |
2011 | ///\r | |
95cba3ee | 2012 | UINT32 Revision : 8;\r |
1bf79370 LG |
2013 | ///\r |
2014 | /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).\r | |
2015 | ///\r | |
95cba3ee | 2016 | UINT32 ShiftPressed : 1;\r |
1bf79370 LG |
2017 | ///\r |
2018 | /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).\r | |
2019 | ///\r | |
95cba3ee | 2020 | UINT32 ControlPressed : 1;\r |
1bf79370 LG |
2021 | ///\r |
2022 | /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).\r | |
2023 | ///\r | |
95cba3ee | 2024 | UINT32 AltPressed : 1;\r |
1bf79370 LG |
2025 | ///\r |
2026 | /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).\r | |
2027 | ///\r | |
95cba3ee | 2028 | UINT32 LogoPressed : 1;\r |
1bf79370 LG |
2029 | ///\r |
2030 | /// The Menu key must be pressed (1) or must not be pressed (0).\r | |
2031 | ///\r | |
95cba3ee | 2032 | UINT32 MenuPressed : 1;\r |
1bf79370 LG |
2033 | ///\r |
2034 | /// The SysReq key must be pressed (1) or must not be pressed (0).\r | |
2035 | ///\r | |
298530bc | 2036 | UINT32 SysReqPressed : 1;\r |
95cba3ee | 2037 | UINT32 Reserved : 16;\r |
1bf79370 LG |
2038 | ///\r |
2039 | /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If\r | |
2040 | /// zero, then only the shift state is considered. If more than one, then the boot option will\r | |
2041 | /// only be launched if all of the specified keys are pressed with the same shift state.\r | |
2042 | ///\r | |
95cba3ee | 2043 | UINT32 InputKeyCount : 2;\r |
e0c047a0 | 2044 | } Options;\r |
95cba3ee | 2045 | UINT32 PackedValue;\r |
2a3f6a21 | 2046 | } EFI_BOOT_KEY_DATA;\r |
95cba3ee | 2047 | \r |
2a3f6a21 | 2048 | ///\r |
af2dc6a7 | 2049 | /// EFI Key Option.\r |
2a3f6a21 | 2050 | ///\r |
95cba3ee | 2051 | typedef struct {\r |
1bf79370 LG |
2052 | ///\r |
2053 | /// Specifies options about how the key will be processed.\r | |
2054 | ///\r | |
2055 | EFI_BOOT_KEY_DATA KeyData;\r | |
2056 | ///\r | |
2057 | /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to\r | |
2058 | /// which BootOption refers. If the CRC-32s do not match this value, then this key\r | |
2059 | /// option is ignored.\r | |
2060 | ///\r | |
2a3f6a21 | 2061 | UINT32 BootOptionCrc;\r |
1bf79370 LG |
2062 | ///\r |
2063 | /// The Boot#### option which will be invoked if this key is pressed and the boot option\r | |
2064 | /// is active (LOAD_OPTION_ACTIVE is set).\r | |
2065 | ///\r | |
2a3f6a21 | 2066 | UINT16 BootOption;\r |
1bf79370 LG |
2067 | ///\r |
2068 | /// The key codes to compare against those returned by the\r | |
2069 | /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.\r | |
2070 | /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.\r | |
2071 | ///\r | |
2072 | //EFI_INPUT_KEY Keys[];\r | |
95cba3ee A |
2073 | } EFI_KEY_OPTION;\r |
2074 | \r | |
959ccb23 | 2075 | //\r |
2076 | // EFI File location to boot from on removable media devices\r | |
2077 | //\r | |
2078 | #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI"\r | |
2079 | #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI"\r | |
2080 | #define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI"\r | |
ebd04fc2 | 2081 | #define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM L"\\EFI\\BOOT\\BOOTARM.EFI"\r |
959ccb23 | 2082 | \r |
2083 | #if defined (MDE_CPU_IA32)\r | |
2084 | #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA32\r | |
2085 | #elif defined (MDE_CPU_IPF)\r | |
2086 | #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA64\r | |
2087 | #elif defined (MDE_CPU_X64)\r | |
2088 | #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64\r | |
2089 | #elif defined (MDE_CPU_EBC)\r | |
ebd04fc2 | 2090 | #elif defined (MDE_CPU_ARM)\r |
2091 | #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_ARM\r | |
959ccb23 | 2092 | #else\r |
2093 | #error Unknown Processor Type\r | |
2094 | #endif\r | |
2095 | \r | |
959ccb23 | 2096 | #include <Uefi/UefiPxe.h>\r |
2097 | #include <Uefi/UefiGpt.h>\r | |
2098 | #include <Uefi/UefiInternalFormRepresentation.h>\r | |
2099 | \r | |
2100 | #endif\r |