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