2 Include file that supports UEFI.
4 This include file must contain things defined in the UEFI 2.6 specification.
5 If a code construct is defined in the UEFI 2.6 specification it must be included
8 Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
9 This program and the accompanying materials are licensed and made available under
10 the terms and conditions of the BSD License that accompanies this distribution.
11 The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php.
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #ifndef __UEFI_SPEC_H__
20 #define __UEFI_SPEC_H__
22 #include <Uefi/UefiMultiPhase.h>
24 #include <Protocol/DevicePath.h>
25 #include <Protocol/SimpleTextIn.h>
26 #include <Protocol/SimpleTextInEx.h>
27 #include <Protocol/SimpleTextOut.h>
30 /// Enumeration of EFI memory allocation types.
34 /// Allocate any available range of pages that satisfies the request.
38 /// Allocate any available range of pages whose uppermost address is less than
39 /// or equal to a specified maximum address.
43 /// Allocate pages at a specified address.
47 /// Maximum enumeration value that may be used for bounds checking.
53 // Bit definitions for EFI_TIME.Daylight
55 #define EFI_TIME_ADJUST_DAYLIGHT 0x01
56 #define EFI_TIME_IN_DAYLIGHT 0x02
59 /// Value definition for EFI_TIME.TimeZone.
61 #define EFI_UNSPECIFIED_TIMEZONE 0x07FF
64 // Memory cacheability attributes
66 #define EFI_MEMORY_UC 0x0000000000000001ULL
67 #define EFI_MEMORY_WC 0x0000000000000002ULL
68 #define EFI_MEMORY_WT 0x0000000000000004ULL
69 #define EFI_MEMORY_WB 0x0000000000000008ULL
70 #define EFI_MEMORY_UCE 0x0000000000000010ULL
72 // Physical memory protection attributes
74 // Note: UEFI spec 2.5 and following: use EFI_MEMORY_RO as write-protected physical memory
75 // protection attribute. Also, EFI_MEMORY_WP means cacheability attribute.
77 #define EFI_MEMORY_WP 0x0000000000001000ULL
78 #define EFI_MEMORY_RP 0x0000000000002000ULL
79 #define EFI_MEMORY_XP 0x0000000000004000ULL
80 #define EFI_MEMORY_RO 0x0000000000020000ULL
82 // Physical memory persistence attribute.
83 // The memory region supports byte-addressable non-volatility.
85 #define EFI_MEMORY_NV 0x0000000000008000ULL
87 // The memory region provides higher reliability relative to other memory in the system.
88 // If all memory has the same reliability, then this bit is not used.
90 #define EFI_MEMORY_MORE_RELIABLE 0x0000000000010000ULL
92 // Runtime memory attribute
94 #define EFI_MEMORY_RUNTIME 0x8000000000000000ULL
97 /// Memory descriptor version number.
99 #define EFI_MEMORY_DESCRIPTOR_VERSION 1
102 /// Definition of an EFI memory descriptor.
106 /// Type of the memory region.
107 /// Type EFI_MEMORY_TYPE is defined in the
108 /// AllocatePages() function description.
112 /// Physical address of the first byte in the memory region. PhysicalStart must be
113 /// aligned on a 4 KiB boundary, and must not be above 0xfffffffffffff000. Type
114 /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function description
116 EFI_PHYSICAL_ADDRESS PhysicalStart
;
118 /// Virtual address of the first byte in the memory region.
119 /// VirtualStart must be aligned on a 4 KiB boundary,
120 /// and must not be above 0xfffffffffffff000.
122 EFI_VIRTUAL_ADDRESS VirtualStart
;
124 /// NumberOfPagesNumber of 4 KiB pages in the memory region.
125 /// NumberOfPages must not be 0, and must not be any value
126 /// that would represent a memory page with a start address,
127 /// either physical or virtual, above 0xfffffffffffff000.
129 UINT64 NumberOfPages
;
131 /// Attributes of the memory region that describe the bit mask of capabilities
132 /// for that memory region, and not necessarily the current settings for that
136 } EFI_MEMORY_DESCRIPTOR
;
139 Allocates memory pages from the system.
141 @param[in] Type The type of allocation to perform.
142 @param[in] MemoryType The type of memory to allocate.
143 MemoryType values in the range 0x70000000..0x7FFFFFFF
144 are reserved for OEM use. MemoryType values in the range
145 0x80000000..0xFFFFFFFF are reserved for use by UEFI OS loaders
146 that are provided by operating system vendors.
147 @param[in] Pages The number of contiguous 4 KB pages to allocate.
148 @param[in, out] Memory The pointer to a physical address. On input, the way in which the address is
149 used depends on the value of Type.
151 @retval EFI_SUCCESS The requested pages were allocated.
152 @retval EFI_INVALID_PARAMETER 1) Type is not AllocateAnyPages or
153 AllocateMaxAddress or AllocateAddress.
154 2) MemoryType is in the range
155 EfiMaxMemoryType..0x6FFFFFFF.
157 4) MemoryType is EfiPersistentMemory.
158 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
159 @retval EFI_NOT_FOUND The requested pages could not be found.
164 (EFIAPI
*EFI_ALLOCATE_PAGES
)(
165 IN EFI_ALLOCATE_TYPE Type
,
166 IN EFI_MEMORY_TYPE MemoryType
,
168 IN OUT EFI_PHYSICAL_ADDRESS
*Memory
174 @param[in] Memory The base physical address of the pages to be freed.
175 @param[in] Pages The number of contiguous 4 KB pages to free.
177 @retval EFI_SUCCESS The requested pages were freed.
178 @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.
179 @retval EFI_NOT_FOUND The requested memory pages were not allocated with
185 (EFIAPI
*EFI_FREE_PAGES
)(
186 IN EFI_PHYSICAL_ADDRESS Memory
,
191 Returns the current memory map.
193 @param[in, out] MemoryMapSize A pointer to the size, in bytes, of the MemoryMap buffer.
194 On input, this is the size of the buffer allocated by the caller.
195 On output, it is the size of the buffer returned by the firmware if
196 the buffer was large enough, or the size of the buffer needed to contain
197 the map if the buffer was too small.
198 @param[in, out] MemoryMap A pointer to the buffer in which firmware places the current memory
200 @param[out] MapKey A pointer to the location in which firmware returns the key for the
202 @param[out] DescriptorSize A pointer to the location in which firmware returns the size, in bytes, of
203 an individual EFI_MEMORY_DESCRIPTOR.
204 @param[out] DescriptorVersion A pointer to the location in which firmware returns the version number
205 associated with the EFI_MEMORY_DESCRIPTOR.
207 @retval EFI_SUCCESS The memory map was returned in the MemoryMap buffer.
208 @retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current buffer size
209 needed to hold the memory map is returned in MemoryMapSize.
210 @retval EFI_INVALID_PARAMETER 1) MemoryMapSize is NULL.
211 2) The MemoryMap buffer is not too small and MemoryMap is
217 (EFIAPI
*EFI_GET_MEMORY_MAP
)(
218 IN OUT UINTN
*MemoryMapSize
,
219 IN OUT EFI_MEMORY_DESCRIPTOR
*MemoryMap
,
221 OUT UINTN
*DescriptorSize
,
222 OUT UINT32
*DescriptorVersion
226 Allocates pool memory.
228 @param[in] PoolType The type of pool to allocate.
229 MemoryType values in the range 0x70000000..0x7FFFFFFF
230 are reserved for OEM use. MemoryType values in the range
231 0x80000000..0xFFFFFFFF are reserved for use by UEFI OS loaders
232 that are provided by operating system vendors.
233 @param[in] Size The number of bytes to allocate from the pool.
234 @param[out] Buffer A pointer to a pointer to the allocated buffer if the call succeeds;
237 @retval EFI_SUCCESS The requested number of bytes was allocated.
238 @retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated.
239 @retval EFI_INVALID_PARAMETER Buffer is NULL.
240 PoolType is in the range EfiMaxMemoryType..0x6FFFFFFF.
241 PoolType is EfiPersistentMemory.
246 (EFIAPI
*EFI_ALLOCATE_POOL
)(
247 IN EFI_MEMORY_TYPE PoolType
,
253 Returns pool memory to the system.
255 @param[in] Buffer The pointer to the buffer to free.
257 @retval EFI_SUCCESS The memory was returned to the system.
258 @retval EFI_INVALID_PARAMETER Buffer was invalid.
263 (EFIAPI
*EFI_FREE_POOL
)(
268 Changes the runtime addressing mode of EFI firmware from physical to virtual.
270 @param[in] MemoryMapSize The size in bytes of VirtualMap.
271 @param[in] DescriptorSize The size in bytes of an entry in the VirtualMap.
272 @param[in] DescriptorVersion The version of the structure entries in VirtualMap.
273 @param[in] VirtualMap An array of memory descriptors which contain new virtual
274 address mapping information for all runtime ranges.
276 @retval EFI_SUCCESS The virtual address map has been applied.
277 @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
278 virtual address mapped mode.
279 @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.
280 @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
281 map that requires a mapping.
282 @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
288 (EFIAPI
*EFI_SET_VIRTUAL_ADDRESS_MAP
)(
289 IN UINTN MemoryMapSize
,
290 IN UINTN DescriptorSize
,
291 IN UINT32 DescriptorVersion
,
292 IN EFI_MEMORY_DESCRIPTOR
*VirtualMap
296 Connects one or more drivers to a controller.
298 @param[in] ControllerHandle The handle of the controller to which driver(s) are to be connected.
299 @param[in] DriverImageHandle A pointer to an ordered list handles that support the
300 EFI_DRIVER_BINDING_PROTOCOL.
301 @param[in] RemainingDevicePath A pointer to the device path that specifies a child of the
302 controller specified by ControllerHandle.
303 @param[in] Recursive If TRUE, then ConnectController() is called recursively
304 until the entire tree of controllers below the controller specified
305 by ControllerHandle have been created. If FALSE, then
306 the tree of controllers is only expanded one level.
308 @retval EFI_SUCCESS 1) One or more drivers were connected to ControllerHandle.
309 2) No drivers were connected to ControllerHandle, but
310 RemainingDevicePath is not NULL, and it is an End Device
312 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
313 @retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances
314 present in the system.
315 2) No drivers were connected to ControllerHandle.
316 @retval EFI_SECURITY_VIOLATION
317 The user has no permission to start UEFI device drivers on the device path
318 associated with the ControllerHandle or specified by the RemainingDevicePath.
322 (EFIAPI
*EFI_CONNECT_CONTROLLER
)(
323 IN EFI_HANDLE ControllerHandle
,
324 IN EFI_HANDLE
*DriverImageHandle
, OPTIONAL
325 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
, OPTIONAL
330 Disconnects one or more drivers from a controller.
332 @param[in] ControllerHandle The handle of the controller from which driver(s) are to be disconnected.
333 @param[in] DriverImageHandle The driver to disconnect from ControllerHandle.
334 If DriverImageHandle is NULL, then all the drivers currently managing
335 ControllerHandle are disconnected from ControllerHandle.
336 @param[in] ChildHandle The handle of the child to destroy.
337 If ChildHandle is NULL, then all the children of ControllerHandle are
338 destroyed before the drivers are disconnected from ControllerHandle.
340 @retval EFI_SUCCESS 1) One or more drivers were disconnected from the controller.
341 2) On entry, no drivers are managing ControllerHandle.
342 3) DriverImageHandle is not NULL, and on entry
343 DriverImageHandle is not managing ControllerHandle.
344 @retval EFI_INVALID_PARAMETER 1) ControllerHandle is NULL.
345 2) DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.
346 3) ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
347 4) DriverImageHandle does not support the EFI_DRIVER_BINDING_PROTOCOL.
348 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to disconnect any drivers from
350 @retval EFI_DEVICE_ERROR The controller could not be disconnected because of a device error.
355 (EFIAPI
*EFI_DISCONNECT_CONTROLLER
)(
356 IN EFI_HANDLE ControllerHandle
,
357 IN EFI_HANDLE DriverImageHandle
, OPTIONAL
358 IN EFI_HANDLE ChildHandle OPTIONAL
364 // ConvertPointer DebugDisposition type.
366 #define EFI_OPTIONAL_PTR 0x00000001
369 Determines the new virtual address that is to be used on subsequent memory accesses.
371 @param[in] DebugDisposition Supplies type information for the pointer being converted.
372 @param[in, out] Address A pointer to a pointer that is to be fixed to be the value needed
373 for the new virtual address mappings being applied.
375 @retval EFI_SUCCESS The pointer pointed to by Address was modified.
376 @retval EFI_INVALID_PARAMETER 1) Address is NULL.
377 2) *Address is NULL and DebugDisposition does
378 not have the EFI_OPTIONAL_PTR bit set.
379 @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part
380 of the current memory map. This is normally fatal.
385 (EFIAPI
*EFI_CONVERT_POINTER
)(
386 IN UINTN DebugDisposition
,
387 IN OUT VOID
**Address
392 // These types can be ORed together as needed - for example,
393 // EVT_TIMER might be Ored with EVT_NOTIFY_WAIT or
394 // EVT_NOTIFY_SIGNAL.
396 #define EVT_TIMER 0x80000000
397 #define EVT_RUNTIME 0x40000000
398 #define EVT_NOTIFY_WAIT 0x00000100
399 #define EVT_NOTIFY_SIGNAL 0x00000200
401 #define EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201
402 #define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202
405 // The event's NotifyContext pointer points to a runtime memory
407 // The event is deprecated in UEFI2.0 and later specifications.
409 #define EVT_RUNTIME_CONTEXT 0x20000000
413 Invoke a notification event
415 @param[in] Event Event whose notification function is being invoked.
416 @param[in] Context The pointer to the notification function's context,
417 which is implementation-dependent.
422 (EFIAPI
*EFI_EVENT_NOTIFY
)(
430 @param[in] Type The type of event to create and its mode and attributes.
431 @param[in] NotifyTpl The task priority level of event notifications, if needed.
432 @param[in] NotifyFunction The pointer to the event's notification function, if any.
433 @param[in] NotifyContext The pointer to the notification function's context; corresponds to parameter
434 Context in the notification function.
435 @param[out] Event The pointer to the newly created event if the call succeeds; undefined
438 @retval EFI_SUCCESS The event structure was created.
439 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
440 @retval EFI_OUT_OF_RESOURCES The event could not be allocated.
445 (EFIAPI
*EFI_CREATE_EVENT
)(
447 IN EFI_TPL NotifyTpl
,
448 IN EFI_EVENT_NOTIFY NotifyFunction
,
449 IN VOID
*NotifyContext
,
454 Creates an event in a group.
456 @param[in] Type The type of event to create and its mode and attributes.
457 @param[in] NotifyTpl The task priority level of event notifications,if needed.
458 @param[in] NotifyFunction The pointer to the event's notification function, if any.
459 @param[in] NotifyContext The pointer to the notification function's context; corresponds to parameter
460 Context in the notification function.
461 @param[in] EventGroup The pointer to the unique identifier of the group to which this event belongs.
462 If this is NULL, then the function behaves as if the parameters were passed
464 @param[out] Event The pointer to the newly created event if the call succeeds; undefined
467 @retval EFI_SUCCESS The event structure was created.
468 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
469 @retval EFI_OUT_OF_RESOURCES The event could not be allocated.
474 (EFIAPI
*EFI_CREATE_EVENT_EX
)(
476 IN EFI_TPL NotifyTpl
,
477 IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL
,
478 IN CONST VOID
*NotifyContext OPTIONAL
,
479 IN CONST EFI_GUID
*EventGroup OPTIONAL
,
484 /// Timer delay types
488 /// An event's timer settings is to be cancelled and not trigger time is to be set/
492 /// An event is to be signaled periodically at a specified interval from the current time.
496 /// An event is to be signaled once at a specified interval from the current time.
502 Sets the type of timer and the trigger time for a timer event.
504 @param[in] Event The timer event that is to be signaled at the specified time.
505 @param[in] Type The type of time that is specified in TriggerTime.
506 @param[in] TriggerTime The number of 100ns units until the timer expires.
507 A TriggerTime of 0 is legal.
508 If Type is TimerRelative and TriggerTime is 0, then the timer
509 event will be signaled on the next timer tick.
510 If Type is TimerPeriodic and TriggerTime is 0, then the timer
511 event will be signaled on every timer tick.
513 @retval EFI_SUCCESS The event has been set to be signaled at the requested time.
514 @retval EFI_INVALID_PARAMETER Event or Type is not valid.
519 (EFIAPI
*EFI_SET_TIMER
)(
521 IN EFI_TIMER_DELAY Type
,
522 IN UINT64 TriggerTime
528 @param[in] Event The event to signal.
530 @retval EFI_SUCCESS The event has been signaled.
535 (EFIAPI
*EFI_SIGNAL_EVENT
)(
540 Stops execution until an event is signaled.
542 @param[in] NumberOfEvents The number of events in the Event array.
543 @param[in] Event An array of EFI_EVENT.
544 @param[out] Index The pointer to the index of the event which satisfied the wait condition.
546 @retval EFI_SUCCESS The event indicated by Index was signaled.
547 @retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0.
548 2) The event indicated by Index is of type
550 @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION.
555 (EFIAPI
*EFI_WAIT_FOR_EVENT
)(
556 IN UINTN NumberOfEvents
,
564 @param[in] Event The event to close.
566 @retval EFI_SUCCESS The event has been closed.
571 (EFIAPI
*EFI_CLOSE_EVENT
)(
576 Checks whether an event is in the signaled state.
578 @param[in] Event The event to check.
580 @retval EFI_SUCCESS The event is in the signaled state.
581 @retval EFI_NOT_READY The event is not in the signaled state.
582 @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL.
587 (EFIAPI
*EFI_CHECK_EVENT
)(
593 // Task priority level
595 #define TPL_APPLICATION 4
596 #define TPL_CALLBACK 8
597 #define TPL_NOTIFY 16
598 #define TPL_HIGH_LEVEL 31
602 Raises a task's priority level and returns its previous level.
604 @param[in] NewTpl The new task priority level.
606 @return Previous task priority level
611 (EFIAPI
*EFI_RAISE_TPL
)(
616 Restores a task's priority level to its previous value.
618 @param[in] OldTpl The previous task priority level to restore.
623 (EFIAPI
*EFI_RESTORE_TPL
)(
628 Returns the value of a variable.
630 @param[in] VariableName A Null-terminated string that is the name of the vendor's
632 @param[in] VendorGuid A unique identifier for the vendor.
633 @param[out] Attributes If not NULL, a pointer to the memory location to return the
634 attributes bitmask for the variable.
635 @param[in, out] DataSize On input, the size in bytes of the return Data buffer.
636 On output the size of data returned in Data.
637 @param[out] Data The buffer to return the contents of the variable. May be NULL
638 with a zero DataSize in order to determine the size buffer needed.
640 @retval EFI_SUCCESS The function completed successfully.
641 @retval EFI_NOT_FOUND The variable was not found.
642 @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result.
643 @retval EFI_INVALID_PARAMETER VariableName is NULL.
644 @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
645 @retval EFI_INVALID_PARAMETER DataSize is NULL.
646 @retval EFI_INVALID_PARAMETER The DataSize is not too small and Data is NULL.
647 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
648 @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
653 (EFIAPI
*EFI_GET_VARIABLE
)(
654 IN CHAR16
*VariableName
,
655 IN EFI_GUID
*VendorGuid
,
656 OUT UINT32
*Attributes
, OPTIONAL
657 IN OUT UINTN
*DataSize
,
658 OUT VOID
*Data OPTIONAL
662 Enumerates the current variable names.
664 @param[in, out] VariableNameSize The size of the VariableName buffer. The size must be large
665 enough to fit input string supplied in VariableName buffer.
666 @param[in, out] VariableName On input, supplies the last VariableName that was returned
667 by GetNextVariableName(). On output, returns the Nullterminated
668 string of the current variable.
669 @param[in, out] VendorGuid On input, supplies the last VendorGuid that was returned by
670 GetNextVariableName(). On output, returns the
671 VendorGuid of the current variable.
673 @retval EFI_SUCCESS The function completed successfully.
674 @retval EFI_NOT_FOUND The next variable was not found.
675 @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.
676 VariableNameSize has been updated with the size needed to complete the request.
677 @retval EFI_INVALID_PARAMETER VariableNameSize is NULL.
678 @retval EFI_INVALID_PARAMETER VariableName is NULL.
679 @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
680 @retval EFI_INVALID_PARAMETER The input values of VariableName and VendorGuid are not a name and
681 GUID of an existing variable.
682 @retval EFI_INVALID_PARAMETER Null-terminator is not found in the first VariableNameSize bytes of
683 the input VariableName buffer.
684 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
689 (EFIAPI
*EFI_GET_NEXT_VARIABLE_NAME
)(
690 IN OUT UINTN
*VariableNameSize
,
691 IN OUT CHAR16
*VariableName
,
692 IN OUT EFI_GUID
*VendorGuid
696 Sets the value of a variable.
698 @param[in] VariableName A Null-terminated string that is the name of the vendor's variable.
699 Each VariableName is unique for each VendorGuid. VariableName must
700 contain 1 or more characters. If VariableName is an empty string,
701 then EFI_INVALID_PARAMETER is returned.
702 @param[in] VendorGuid A unique identifier for the vendor.
703 @param[in] Attributes Attributes bitmask to set for the variable.
704 @param[in] DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE,
705 EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, or
706 EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero
707 causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is
708 set, then a SetVariable() call with a DataSize of zero will not cause any change to
709 the variable value (the timestamp associated with the variable may be updated however
710 even if no new data value is provided,see the description of the
711 EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not
712 be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated).
713 @param[in] Data The contents for the variable.
715 @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
716 defined by the Attributes.
717 @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the
718 DataSize exceeds the maximum allowed.
719 @retval EFI_INVALID_PARAMETER VariableName is an empty string.
720 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
721 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
722 @retval EFI_WRITE_PROTECTED The variable in question is read-only.
723 @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
724 @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
725 or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo
726 does NOT pass the validation check carried out by the firmware.
728 @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
733 (EFIAPI
*EFI_SET_VARIABLE
)(
734 IN CHAR16
*VariableName
,
735 IN EFI_GUID
*VendorGuid
,
736 IN UINT32 Attributes
,
743 /// This provides the capabilities of the
744 /// real time clock device as exposed through the EFI interfaces.
748 /// Provides the reporting resolution of the real-time clock device in
749 /// counts per second. For a normal PC-AT CMOS RTC device, this
750 /// value would be 1 Hz, or 1, to indicate that the device only reports
751 /// the time to the resolution of 1 second.
755 /// Provides the timekeeping accuracy of the real-time clock in an
756 /// error rate of 1E-6 parts per million. For a clock with an accuracy
757 /// of 50 parts per million, the value in this field would be
762 /// A TRUE indicates that a time set operation clears the device's
763 /// time below the Resolution reporting level. A FALSE
764 /// indicates that the state below the Resolution level of the
765 /// device is not cleared when the time is set. Normal PC-AT CMOS
766 /// RTC devices set this value to FALSE.
769 } EFI_TIME_CAPABILITIES
;
772 Returns the current time and date information, and the time-keeping capabilities
773 of the hardware platform.
775 @param[out] Time A pointer to storage to receive a snapshot of the current time.
776 @param[out] Capabilities An optional pointer to a buffer to receive the real time clock
777 device's capabilities.
779 @retval EFI_SUCCESS The operation completed successfully.
780 @retval EFI_INVALID_PARAMETER Time is NULL.
781 @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.
786 (EFIAPI
*EFI_GET_TIME
)(
788 OUT EFI_TIME_CAPABILITIES
*Capabilities OPTIONAL
792 Sets the current local time and date information.
794 @param[in] Time A pointer to the current time.
796 @retval EFI_SUCCESS The operation completed successfully.
797 @retval EFI_INVALID_PARAMETER A time field is out of range.
798 @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error.
803 (EFIAPI
*EFI_SET_TIME
)(
808 Returns the current wakeup alarm clock setting.
810 @param[out] Enabled Indicates if the alarm is currently enabled or disabled.
811 @param[out] Pending Indicates if the alarm signal is pending and requires acknowledgement.
812 @param[out] Time The current alarm setting.
814 @retval EFI_SUCCESS The alarm settings were returned.
815 @retval EFI_INVALID_PARAMETER Enabled is NULL.
816 @retval EFI_INVALID_PARAMETER Pending is NULL.
817 @retval EFI_INVALID_PARAMETER Time is NULL.
818 @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.
819 @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.
824 (EFIAPI
*EFI_GET_WAKEUP_TIME
)(
825 OUT BOOLEAN
*Enabled
,
826 OUT BOOLEAN
*Pending
,
831 Sets the system wakeup alarm clock time.
833 @param[in] Enable Enable or disable the wakeup alarm.
834 @param[in] Time If Enable is TRUE, the time to set the wakeup alarm for.
835 If Enable is FALSE, then this parameter is optional, and may be NULL.
837 @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If
838 Enable is FALSE, then the wakeup alarm was disabled.
839 @retval EFI_INVALID_PARAMETER A time field is out of range.
840 @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.
841 @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.
846 (EFIAPI
*EFI_SET_WAKEUP_TIME
)(
848 IN EFI_TIME
*Time OPTIONAL
852 Loads an EFI image into memory.
854 @param[in] BootPolicy If TRUE, indicates that the request originates from the boot
855 manager, and that the boot manager is attempting to load
856 FilePath as a boot selection. Ignored if SourceBuffer is
858 @param[in] ParentImageHandle The caller's image handle.
859 @param[in] DevicePath The DeviceHandle specific file path from which the image is
861 @param[in] SourceBuffer If not NULL, a pointer to the memory location containing a copy
862 of the image to be loaded.
863 @param[in] SourceSize The size in bytes of SourceBuffer. Ignored if SourceBuffer is NULL.
864 @param[out] ImageHandle The pointer to the returned image handle that is created when the
865 image is successfully loaded.
867 @retval EFI_SUCCESS Image was loaded into memory correctly.
868 @retval EFI_NOT_FOUND Both SourceBuffer and DevicePath are NULL.
869 @retval EFI_INVALID_PARAMETER One or more parametes are invalid.
870 @retval EFI_UNSUPPORTED The image type is not supported.
871 @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient resources.
872 @retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not
874 @retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.
875 @retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
876 image from being loaded. NULL is returned in *ImageHandle.
877 @retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
878 valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
879 platform policy specifies that the image should not be started.
883 (EFIAPI
*EFI_IMAGE_LOAD
)(
884 IN BOOLEAN BootPolicy
,
885 IN EFI_HANDLE ParentImageHandle
,
886 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
887 IN VOID
*SourceBuffer OPTIONAL
,
889 OUT EFI_HANDLE
*ImageHandle
893 Transfers control to a loaded image's entry point.
895 @param[in] ImageHandle Handle of image to be started.
896 @param[out] ExitDataSize The pointer to the size, in bytes, of ExitData.
897 @param[out] ExitData The pointer to a pointer to a data buffer that includes a Null-terminated
898 string, optionally followed by additional binary data.
900 @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image
901 has already been initialized with StartImage.
902 @retval EFI_SECURITY_VIOLATION The current platform policy specifies that the image should not be started.
903 @return Exit code from image
908 (EFIAPI
*EFI_IMAGE_START
)(
909 IN EFI_HANDLE ImageHandle
,
910 OUT UINTN
*ExitDataSize
,
911 OUT CHAR16
**ExitData OPTIONAL
915 Terminates a loaded EFI image and returns control to boot services.
917 @param[in] ImageHandle Handle that identifies the image. This parameter is passed to the
919 @param[in] ExitStatus The image's exit code.
920 @param[in] ExitDataSize The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS.
921 @param[in] ExitData The pointer to a data buffer that includes a Null-terminated string,
922 optionally followed by additional binary data. The string is a
923 description that the caller may use to further indicate the reason
924 for the image's exit. ExitData is only valid if ExitStatus
925 is something other than EFI_SUCCESS. The ExitData buffer
926 must be allocated by calling AllocatePool().
928 @retval EFI_SUCCESS The image specified by ImageHandle was unloaded.
929 @retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and
930 started with LoadImage() and StartImage(), but the
931 image is not the currently executing image.
937 IN EFI_HANDLE ImageHandle
,
938 IN EFI_STATUS ExitStatus
,
939 IN UINTN ExitDataSize
,
940 IN CHAR16
*ExitData OPTIONAL
946 @param[in] ImageHandle Handle that identifies the image to be unloaded.
948 @retval EFI_SUCCESS The image has been unloaded.
949 @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
954 (EFIAPI
*EFI_IMAGE_UNLOAD
)(
955 IN EFI_HANDLE ImageHandle
959 Terminates all boot services.
961 @param[in] ImageHandle Handle that identifies the exiting image.
962 @param[in] MapKey Key to the latest memory map.
964 @retval EFI_SUCCESS Boot services have been terminated.
965 @retval EFI_INVALID_PARAMETER MapKey is incorrect.
970 (EFIAPI
*EFI_EXIT_BOOT_SERVICES
)(
971 IN EFI_HANDLE ImageHandle
,
976 Induces a fine-grained stall.
978 @param[in] Microseconds The number of microseconds to stall execution.
980 @retval EFI_SUCCESS Execution was stalled at least the requested number of
987 IN UINTN Microseconds
991 Sets the system's watchdog timer.
993 @param[in] Timeout The number of seconds to set the watchdog timer to.
994 @param[in] WatchdogCode The numeric code to log on a watchdog timer timeout event.
995 @param[in] DataSize The size, in bytes, of WatchdogData.
996 @param[in] WatchdogData A data buffer that includes a Null-terminated string, optionally
997 followed by additional binary data.
999 @retval EFI_SUCCESS The timeout has been set.
1000 @retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid.
1001 @retval EFI_UNSUPPORTED The system does not have a watchdog timer.
1002 @retval EFI_DEVICE_ERROR The watchdog timer could not be programmed due to a hardware
1008 (EFIAPI
*EFI_SET_WATCHDOG_TIMER
)(
1010 IN UINT64 WatchdogCode
,
1012 IN CHAR16
*WatchdogData OPTIONAL
1016 Resets the entire platform.
1018 @param[in] ResetType The type of reset to perform.
1019 @param[in] ResetStatus The status code for the reset.
1020 @param[in] DataSize The size, in bytes, of ResetData.
1021 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
1022 EfiResetShutdown the data buffer starts with a Null-terminated
1023 string, optionally followed by additional binary data.
1024 The string is a description that the caller may use to further
1025 indicate the reason for the system reset. ResetData is only
1026 valid if ResetStatus is something other than EFI_SUCCESS
1027 unless the ResetType is EfiResetPlatformSpecific
1028 where a minimum amount of ResetData is always required.
1029 For a ResetType of EfiResetPlatformSpecific the data buffer
1030 also starts with a Null-terminated string that is followed
1031 by an EFI_GUID that describes the specific type of reset to perform.
1035 (EFIAPI
*EFI_RESET_SYSTEM
)(
1036 IN EFI_RESET_TYPE ResetType
,
1037 IN EFI_STATUS ResetStatus
,
1039 IN VOID
*ResetData OPTIONAL
1043 Returns a monotonically increasing count for the platform.
1045 @param[out] Count The pointer to returned value.
1047 @retval EFI_SUCCESS The next monotonic count was returned.
1048 @retval EFI_INVALID_PARAMETER Count is NULL.
1049 @retval EFI_DEVICE_ERROR The device is not functioning properly.
1054 (EFIAPI
*EFI_GET_NEXT_MONOTONIC_COUNT
)(
1059 Returns the next high 32 bits of the platform's monotonic counter.
1061 @param[out] HighCount The pointer to returned value.
1063 @retval EFI_SUCCESS The next high monotonic count was returned.
1064 @retval EFI_INVALID_PARAMETER HighCount is NULL.
1065 @retval EFI_DEVICE_ERROR The device is not functioning properly.
1070 (EFIAPI
*EFI_GET_NEXT_HIGH_MONO_COUNT
)(
1071 OUT UINT32
*HighCount
1075 Computes and returns a 32-bit CRC for a data buffer.
1077 @param[in] Data A pointer to the buffer on which the 32-bit CRC is to be computed.
1078 @param[in] DataSize The number of bytes in the buffer Data.
1079 @param[out] Crc32 The 32-bit CRC that was computed for the data buffer specified by Data
1082 @retval EFI_SUCCESS The 32-bit CRC was computed for the data buffer and returned in
1084 @retval EFI_INVALID_PARAMETER Data is NULL.
1085 @retval EFI_INVALID_PARAMETER Crc32 is NULL.
1086 @retval EFI_INVALID_PARAMETER DataSize is 0.
1091 (EFIAPI
*EFI_CALCULATE_CRC32
)(
1098 Copies the contents of one buffer to another buffer.
1100 @param[in] Destination The pointer to the destination buffer of the memory copy.
1101 @param[in] Source The pointer to the source buffer of the memory copy.
1102 @param[in] Length Number of bytes to copy from Source to Destination.
1107 (EFIAPI
*EFI_COPY_MEM
)(
1108 IN VOID
*Destination
,
1114 The SetMem() function fills a buffer with a specified value.
1116 @param[in] Buffer The pointer to the buffer to fill.
1117 @param[in] Size Number of bytes in Buffer to fill.
1118 @param[in] Value Value to fill Buffer with.
1123 (EFIAPI
*EFI_SET_MEM
)(
1130 /// Enumeration of EFI Interface Types
1134 /// Indicates that the supplied protocol interface is supplied in native form.
1136 EFI_NATIVE_INTERFACE
1137 } EFI_INTERFACE_TYPE
;
1140 Installs a protocol interface on a device handle. If the handle does not exist, it is created and added
1141 to the list of handles in the system. InstallMultipleProtocolInterfaces() performs
1142 more error checking than InstallProtocolInterface(), so it is recommended that
1143 InstallMultipleProtocolInterfaces() be used in place of
1144 InstallProtocolInterface()
1146 @param[in, out] Handle A pointer to the EFI_HANDLE on which the interface is to be installed.
1147 @param[in] Protocol The numeric ID of the protocol interface.
1148 @param[in] InterfaceType Indicates whether Interface is supplied in native form.
1149 @param[in] Interface A pointer to the protocol interface.
1151 @retval EFI_SUCCESS The protocol interface was installed.
1152 @retval EFI_OUT_OF_RESOURCES Space for a new handle could not be allocated.
1153 @retval EFI_INVALID_PARAMETER Handle is NULL.
1154 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1155 @retval EFI_INVALID_PARAMETER InterfaceType is not EFI_NATIVE_INTERFACE.
1156 @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.
1161 (EFIAPI
*EFI_INSTALL_PROTOCOL_INTERFACE
)(
1162 IN OUT EFI_HANDLE
*Handle
,
1163 IN EFI_GUID
*Protocol
,
1164 IN EFI_INTERFACE_TYPE InterfaceType
,
1169 Installs one or more protocol interfaces into the boot services environment.
1171 @param[in, out] Handle The pointer to a handle to install the new protocol interfaces on,
1172 or a pointer to NULL if a new handle is to be allocated.
1173 @param ... A variable argument list containing pairs of protocol GUIDs and protocol
1176 @retval EFI_SUCCESS All the protocol interface was installed.
1177 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
1178 @retval EFI_ALREADY_STARTED A Device Path Protocol instance was passed in that is already present in
1179 the handle database.
1180 @retval EFI_INVALID_PARAMETER Handle is NULL.
1181 @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.
1186 (EFIAPI
*EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES
)(
1187 IN OUT EFI_HANDLE
*Handle
,
1192 Reinstalls a protocol interface on a device handle.
1194 @param[in] Handle Handle on which the interface is to be reinstalled.
1195 @param[in] Protocol The numeric ID of the interface.
1196 @param[in] OldInterface A pointer to the old interface. NULL can be used if a structure is not
1197 associated with Protocol.
1198 @param[in] NewInterface A pointer to the new interface.
1200 @retval EFI_SUCCESS The protocol interface was reinstalled.
1201 @retval EFI_NOT_FOUND The OldInterface on the handle was not found.
1202 @retval EFI_ACCESS_DENIED The protocol interface could not be reinstalled,
1203 because OldInterface is still being used by a
1204 driver that will not release it.
1205 @retval EFI_INVALID_PARAMETER Handle is NULL.
1206 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1211 (EFIAPI
*EFI_REINSTALL_PROTOCOL_INTERFACE
)(
1212 IN EFI_HANDLE Handle
,
1213 IN EFI_GUID
*Protocol
,
1214 IN VOID
*OldInterface
,
1215 IN VOID
*NewInterface
1219 Removes a protocol interface from a device handle. It is recommended that
1220 UninstallMultipleProtocolInterfaces() be used in place of
1221 UninstallProtocolInterface().
1223 @param[in] Handle The handle on which the interface was installed.
1224 @param[in] Protocol The numeric ID of the interface.
1225 @param[in] Interface A pointer to the interface.
1227 @retval EFI_SUCCESS The interface was removed.
1228 @retval EFI_NOT_FOUND The interface was not found.
1229 @retval EFI_ACCESS_DENIED The interface was not removed because the interface
1230 is still being used by a driver.
1231 @retval EFI_INVALID_PARAMETER Handle is NULL.
1232 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1237 (EFIAPI
*EFI_UNINSTALL_PROTOCOL_INTERFACE
)(
1238 IN EFI_HANDLE Handle
,
1239 IN EFI_GUID
*Protocol
,
1244 Removes one or more protocol interfaces into the boot services environment.
1246 @param[in] Handle The handle to remove the protocol interfaces from.
1247 @param ... A variable argument list containing pairs of protocol GUIDs and
1248 protocol interfaces.
1250 @retval EFI_SUCCESS All the protocol interfaces were removed.
1251 @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.
1256 (EFIAPI
*EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES
)(
1257 IN EFI_HANDLE Handle
,
1262 Queries a handle to determine if it supports a specified protocol.
1264 @param[in] Handle The handle being queried.
1265 @param[in] Protocol The published unique identifier of the protocol.
1266 @param[out] Interface Supplies the address where a pointer to the corresponding Protocol
1267 Interface is returned.
1269 @retval EFI_SUCCESS The interface information for the specified protocol was returned.
1270 @retval EFI_UNSUPPORTED The device does not support the specified protocol.
1271 @retval EFI_INVALID_PARAMETER Handle is NULL.
1272 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1273 @retval EFI_INVALID_PARAMETER Interface is NULL.
1278 (EFIAPI
*EFI_HANDLE_PROTOCOL
)(
1279 IN EFI_HANDLE Handle
,
1280 IN EFI_GUID
*Protocol
,
1281 OUT VOID
**Interface
1284 #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
1285 #define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
1286 #define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
1287 #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
1288 #define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
1289 #define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020
1292 Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the
1293 handle, it opens the protocol on behalf of the calling agent.
1295 @param[in] Handle The handle for the protocol interface that is being opened.
1296 @param[in] Protocol The published unique identifier of the protocol.
1297 @param[out] Interface Supplies the address where a pointer to the corresponding Protocol
1298 Interface is returned.
1299 @param[in] AgentHandle The handle of the agent that is opening the protocol interface
1300 specified by Protocol and Interface.
1301 @param[in] ControllerHandle If the agent that is opening a protocol is a driver that follows the
1302 UEFI Driver Model, then this parameter is the controller handle
1303 that requires the protocol interface. If the agent does not follow
1304 the UEFI Driver Model, then this parameter is optional and may
1306 @param[in] Attributes The open mode of the protocol interface specified by Handle
1309 @retval EFI_SUCCESS An item was added to the open list for the protocol interface, and the
1310 protocol interface was returned in Interface.
1311 @retval EFI_UNSUPPORTED Handle does not support Protocol.
1312 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
1313 @retval EFI_ACCESS_DENIED Required attributes can't be supported in current environment.
1314 @retval EFI_ALREADY_STARTED Item on the open list already has requierd attributes whose agent
1315 handle is the same as AgentHandle.
1320 (EFIAPI
*EFI_OPEN_PROTOCOL
)(
1321 IN EFI_HANDLE Handle
,
1322 IN EFI_GUID
*Protocol
,
1323 OUT VOID
**Interface
, OPTIONAL
1324 IN EFI_HANDLE AgentHandle
,
1325 IN EFI_HANDLE ControllerHandle
,
1326 IN UINT32 Attributes
1331 Closes a protocol on a handle that was opened using OpenProtocol().
1333 @param[in] Handle The handle for the protocol interface that was previously opened
1334 with OpenProtocol(), and is now being closed.
1335 @param[in] Protocol The published unique identifier of the protocol.
1336 @param[in] AgentHandle The handle of the agent that is closing the protocol interface.
1337 @param[in] ControllerHandle If the agent that opened a protocol is a driver that follows the
1338 UEFI Driver Model, then this parameter is the controller handle
1339 that required the protocol interface.
1341 @retval EFI_SUCCESS The protocol instance was closed.
1342 @retval EFI_INVALID_PARAMETER 1) Handle is NULL.
1343 2) AgentHandle is NULL.
1344 3) ControllerHandle is not NULL and ControllerHandle is not a valid EFI_HANDLE.
1345 4) Protocol is NULL.
1346 @retval EFI_NOT_FOUND 1) Handle does not support the protocol specified by Protocol.
1347 2) The protocol interface specified by Handle and Protocol is not
1348 currently open by AgentHandle and ControllerHandle.
1353 (EFIAPI
*EFI_CLOSE_PROTOCOL
)(
1354 IN EFI_HANDLE Handle
,
1355 IN EFI_GUID
*Protocol
,
1356 IN EFI_HANDLE AgentHandle
,
1357 IN EFI_HANDLE ControllerHandle
1361 /// EFI Oprn Protocol Information Entry
1364 EFI_HANDLE AgentHandle
;
1365 EFI_HANDLE ControllerHandle
;
1368 } EFI_OPEN_PROTOCOL_INFORMATION_ENTRY
;
1371 Retrieves the list of agents that currently have a protocol interface opened.
1373 @param[in] Handle The handle for the protocol interface that is being queried.
1374 @param[in] Protocol The published unique identifier of the protocol.
1375 @param[out] EntryBuffer A pointer to a buffer of open protocol information in the form of
1376 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
1377 @param[out] EntryCount A pointer to the number of entries in EntryBuffer.
1379 @retval EFI_SUCCESS The open protocol information was returned in EntryBuffer, and the
1380 number of entries was returned EntryCount.
1381 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate EntryBuffer.
1382 @retval EFI_NOT_FOUND Handle does not support the protocol specified by Protocol.
1387 (EFIAPI
*EFI_OPEN_PROTOCOL_INFORMATION
)(
1388 IN EFI_HANDLE Handle
,
1389 IN EFI_GUID
*Protocol
,
1390 OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY
**EntryBuffer
,
1391 OUT UINTN
*EntryCount
1395 Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated
1398 @param[in] Handle The handle from which to retrieve the list of protocol interface
1400 @param[out] ProtocolBuffer A pointer to the list of protocol interface GUID pointers that are
1401 installed on Handle.
1402 @param[out] ProtocolBufferCount A pointer to the number of GUID pointers present in
1405 @retval EFI_SUCCESS The list of protocol interface GUIDs installed on Handle was returned in
1406 ProtocolBuffer. The number of protocol interface GUIDs was
1407 returned in ProtocolBufferCount.
1408 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.
1409 @retval EFI_INVALID_PARAMETER Handle is NULL.
1410 @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.
1411 @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.
1412 @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.
1417 (EFIAPI
*EFI_PROTOCOLS_PER_HANDLE
)(
1418 IN EFI_HANDLE Handle
,
1419 OUT EFI_GUID
***ProtocolBuffer
,
1420 OUT UINTN
*ProtocolBufferCount
1424 Creates an event that is to be signaled whenever an interface is installed for a specified protocol.
1426 @param[in] Protocol The numeric ID of the protocol for which the event is to be registered.
1427 @param[in] Event Event that is to be signaled whenever a protocol interface is registered
1429 @param[out] Registration A pointer to a memory location to receive the registration value.
1431 @retval EFI_SUCCESS The notification event has been registered.
1432 @retval EFI_OUT_OF_RESOURCES Space for the notification event could not be allocated.
1433 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1434 @retval EFI_INVALID_PARAMETER Event is NULL.
1435 @retval EFI_INVALID_PARAMETER Registration is NULL.
1440 (EFIAPI
*EFI_REGISTER_PROTOCOL_NOTIFY
)(
1441 IN EFI_GUID
*Protocol
,
1443 OUT VOID
**Registration
1447 /// Enumeration of EFI Locate Search Types
1451 /// Retrieve all the handles in the handle database.
1455 /// Retrieve the next handle fron a RegisterProtocolNotify() event.
1459 /// Retrieve the set of handles from the handle database that support a
1460 /// specified protocol.
1463 } EFI_LOCATE_SEARCH_TYPE
;
1466 Returns an array of handles that support a specified protocol.
1468 @param[in] SearchType Specifies which handle(s) are to be returned.
1469 @param[in] Protocol Specifies the protocol to search by.
1470 @param[in] SearchKey Specifies the search key.
1471 @param[in, out] BufferSize On input, the size in bytes of Buffer. On output, the size in bytes of
1472 the array returned in Buffer (if the buffer was large enough) or the
1473 size, in bytes, of the buffer needed to obtain the array (if the buffer was
1475 @param[out] Buffer The buffer in which the array is returned.
1477 @retval EFI_SUCCESS The array of handles was returned.
1478 @retval EFI_NOT_FOUND No handles match the search.
1479 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.
1480 @retval EFI_INVALID_PARAMETER SearchType is not a member of EFI_LOCATE_SEARCH_TYPE.
1481 @retval EFI_INVALID_PARAMETER SearchType is ByRegisterNotify and SearchKey is NULL.
1482 @retval EFI_INVALID_PARAMETER SearchType is ByProtocol and Protocol is NULL.
1483 @retval EFI_INVALID_PARAMETER One or more matches are found and BufferSize is NULL.
1484 @retval EFI_INVALID_PARAMETER BufferSize is large enough for the result and Buffer is NULL.
1489 (EFIAPI
*EFI_LOCATE_HANDLE
)(
1490 IN EFI_LOCATE_SEARCH_TYPE SearchType
,
1491 IN EFI_GUID
*Protocol
, OPTIONAL
1492 IN VOID
*SearchKey
, OPTIONAL
1493 IN OUT UINTN
*BufferSize
,
1494 OUT EFI_HANDLE
*Buffer
1498 Locates the handle to a device on the device path that supports the specified protocol.
1500 @param[in] Protocol Specifies the protocol to search for.
1501 @param[in, out] DevicePath On input, a pointer to a pointer to the device path. On output, the device
1502 path pointer is modified to point to the remaining part of the device
1504 @param[out] Device A pointer to the returned device handle.
1506 @retval EFI_SUCCESS The resulting handle was returned.
1507 @retval EFI_NOT_FOUND No handles match the search.
1508 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1509 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
1510 @retval EFI_INVALID_PARAMETER A handle matched the search and Device is NULL.
1515 (EFIAPI
*EFI_LOCATE_DEVICE_PATH
)(
1516 IN EFI_GUID
*Protocol
,
1517 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
,
1518 OUT EFI_HANDLE
*Device
1522 Adds, updates, or removes a configuration table entry from the EFI System Table.
1524 @param[in] Guid A pointer to the GUID for the entry to add, update, or remove.
1525 @param[in] Table A pointer to the configuration table for the entry to add, update, or
1526 remove. May be NULL.
1528 @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.
1529 @retval EFI_NOT_FOUND An attempt was made to delete a nonexistent entry.
1530 @retval EFI_INVALID_PARAMETER Guid is NULL.
1531 @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.
1536 (EFIAPI
*EFI_INSTALL_CONFIGURATION_TABLE
)(
1542 Returns an array of handles that support the requested protocol in a buffer allocated from pool.
1544 @param[in] SearchType Specifies which handle(s) are to be returned.
1545 @param[in] Protocol Provides the protocol to search by.
1546 This parameter is only valid for a SearchType of ByProtocol.
1547 @param[in] SearchKey Supplies the search key depending on the SearchType.
1548 @param[in, out] NoHandles The number of handles returned in Buffer.
1549 @param[out] Buffer A pointer to the buffer to return the requested array of handles that
1552 @retval EFI_SUCCESS The array of handles was returned in Buffer, and the number of
1553 handles in Buffer was returned in NoHandles.
1554 @retval EFI_NOT_FOUND No handles match the search.
1555 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the matching results.
1556 @retval EFI_INVALID_PARAMETER NoHandles is NULL.
1557 @retval EFI_INVALID_PARAMETER Buffer is NULL.
1562 (EFIAPI
*EFI_LOCATE_HANDLE_BUFFER
)(
1563 IN EFI_LOCATE_SEARCH_TYPE SearchType
,
1564 IN EFI_GUID
*Protocol
, OPTIONAL
1565 IN VOID
*SearchKey
, OPTIONAL
1566 IN OUT UINTN
*NoHandles
,
1567 OUT EFI_HANDLE
**Buffer
1571 Returns the first protocol instance that matches the given protocol.
1573 @param[in] Protocol Provides the protocol to search for.
1574 @param[in] Registration Optional registration key returned from
1575 RegisterProtocolNotify().
1576 @param[out] Interface On return, a pointer to the first interface that matches Protocol and
1579 @retval EFI_SUCCESS A protocol instance matching Protocol was found and returned in
1581 @retval EFI_NOT_FOUND No protocol instances were found that match Protocol and
1583 @retval EFI_INVALID_PARAMETER Interface is NULL.
1589 (EFIAPI
*EFI_LOCATE_PROTOCOL
)(
1590 IN EFI_GUID
*Protocol
,
1591 IN VOID
*Registration
, OPTIONAL
1592 OUT VOID
**Interface
1596 /// EFI Capsule Block Descriptor
1600 /// Length in bytes of the data pointed to by DataBlock/ContinuationPointer.
1605 /// Physical address of the data block. This member of the union is
1606 /// used if Length is not equal to zero.
1608 EFI_PHYSICAL_ADDRESS DataBlock
;
1610 /// Physical address of another block of
1611 /// EFI_CAPSULE_BLOCK_DESCRIPTOR structures. This
1612 /// member of the union is used if Length is equal to zero. If
1613 /// ContinuationPointer is zero this entry represents the end of the list.
1615 EFI_PHYSICAL_ADDRESS ContinuationPointer
;
1617 } EFI_CAPSULE_BLOCK_DESCRIPTOR
;
1620 /// EFI Capsule Header.
1624 /// A GUID that defines the contents of a capsule.
1626 EFI_GUID CapsuleGuid
;
1628 /// The size of the capsule header. This may be larger than the size of
1629 /// the EFI_CAPSULE_HEADER since CapsuleGuid may imply
1630 /// extended header entries
1634 /// Bit-mapped list describing the capsule attributes. The Flag values
1635 /// of 0x0000 - 0xFFFF are defined by CapsuleGuid. Flag values
1636 /// of 0x10000 - 0xFFFFFFFF are defined by this specification
1640 /// Size in bytes of the capsule.
1642 UINT32 CapsuleImageSize
;
1643 } EFI_CAPSULE_HEADER
;
1646 /// The EFI System Table entry must point to an array of capsules
1647 /// that contain the same CapsuleGuid value. The array must be
1648 /// prefixed by a UINT32 that represents the size of the array of capsules.
1652 /// the size of the array of capsules.
1654 UINT32 CapsuleArrayNumber
;
1656 /// Point to an array of capsules that contain the same CapsuleGuid value.
1658 VOID
* CapsulePtr
[1];
1659 } EFI_CAPSULE_TABLE
;
1661 #define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000
1662 #define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000
1663 #define CAPSULE_FLAGS_INITIATE_RESET 0x00040000
1666 Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
1667 consumption, the firmware may process the capsule immediately. If the payload should persist
1668 across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must
1669 be passed into ResetSystem() and will cause the capsule to be processed by the firmware as
1670 part of the reset process.
1672 @param[in] CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
1673 being passed into update capsule.
1674 @param[in] CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in
1676 @param[in] ScatterGatherList Physical pointer to a set of
1677 EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the
1678 location in physical memory of a set of capsules.
1680 @retval EFI_SUCCESS Valid capsule was passed. If
1681 CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the
1682 capsule has been successfully processed by the firmware.
1683 @retval EFI_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were
1684 set in the capsule header.
1685 @retval EFI_INVALID_PARAMETER CapsuleCount is 0.
1686 @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error.
1687 @retval EFI_UNSUPPORTED The capsule type is not supported on this platform.
1688 @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has been previously called this error indicates the capsule
1689 is compatible with this platform but is not capable of being submitted or processed
1690 in runtime. The caller may resubmit the capsule prior to ExitBootServices().
1691 @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has not been previously called then this error indicates
1692 the capsule is compatible with this platform but there are insufficient resources to process.
1697 (EFIAPI
*EFI_UPDATE_CAPSULE
)(
1698 IN EFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
1699 IN UINTN CapsuleCount
,
1700 IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
1704 Returns if the capsule can be supported via UpdateCapsule().
1706 @param[in] CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
1707 being passed into update capsule.
1708 @param[in] CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in
1710 @param[out] MaxiumCapsuleSize On output the maximum size that UpdateCapsule() can
1711 support as an argument to UpdateCapsule() via
1712 CapsuleHeaderArray and ScatterGatherList.
1713 @param[out] ResetType Returns the type of reset required for the capsule update.
1715 @retval EFI_SUCCESS Valid answer returned.
1716 @retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and
1717 MaximumCapsuleSize and ResetType are undefined.
1718 @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.
1719 @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has been previously called this error indicates the capsule
1720 is compatible with this platform but is not capable of being submitted or processed
1721 in runtime. The caller may resubmit the capsule prior to ExitBootServices().
1722 @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has not been previously called then this error indicates
1723 the capsule is compatible with this platform but there are insufficient resources to process.
1728 (EFIAPI
*EFI_QUERY_CAPSULE_CAPABILITIES
)(
1729 IN EFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
1730 IN UINTN CapsuleCount
,
1731 OUT UINT64
*MaximumCapsuleSize
,
1732 OUT EFI_RESET_TYPE
*ResetType
1736 Returns information about the EFI variables.
1738 @param[in] Attributes Attributes bitmask to specify the type of variables on
1739 which to return information.
1740 @param[out] MaximumVariableStorageSize On output the maximum size of the storage space
1741 available for the EFI variables associated with the
1742 attributes specified.
1743 @param[out] RemainingVariableStorageSize Returns the remaining size of the storage space
1744 available for the EFI variables associated with the
1745 attributes specified.
1746 @param[out] MaximumVariableSize Returns the maximum size of the individual EFI
1747 variables associated with the attributes specified.
1749 @retval EFI_SUCCESS Valid answer returned.
1750 @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied
1751 @retval EFI_UNSUPPORTED The attribute is not supported on this platform, and the
1752 MaximumVariableStorageSize,
1753 RemainingVariableStorageSize, MaximumVariableSize
1759 (EFIAPI
*EFI_QUERY_VARIABLE_INFO
)(
1760 IN UINT32 Attributes
,
1761 OUT UINT64
*MaximumVariableStorageSize
,
1762 OUT UINT64
*RemainingVariableStorageSize
,
1763 OUT UINT64
*MaximumVariableSize
1767 // Firmware should stop at a firmware user interface on next boot
1769 #define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001
1770 #define EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION 0x0000000000000002
1771 #define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004
1772 #define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED 0x0000000000000008
1773 #define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED 0x0000000000000010
1774 #define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY 0x0000000000000040
1777 // EFI Runtime Services Table
1779 #define EFI_SYSTEM_TABLE_SIGNATURE SIGNATURE_64 ('I','B','I',' ','S','Y','S','T')
1780 #define EFI_2_60_SYSTEM_TABLE_REVISION ((2 << 16) | (60))
1781 #define EFI_2_50_SYSTEM_TABLE_REVISION ((2 << 16) | (50))
1782 #define EFI_2_40_SYSTEM_TABLE_REVISION ((2 << 16) | (40))
1783 #define EFI_2_31_SYSTEM_TABLE_REVISION ((2 << 16) | (31))
1784 #define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30))
1785 #define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20))
1786 #define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | (10))
1787 #define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00))
1788 #define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10))
1789 #define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02))
1790 #define EFI_SYSTEM_TABLE_REVISION EFI_2_60_SYSTEM_TABLE_REVISION
1791 #define EFI_SPECIFICATION_VERSION EFI_SYSTEM_TABLE_REVISION
1793 #define EFI_RUNTIME_SERVICES_SIGNATURE SIGNATURE_64 ('R','U','N','T','S','E','R','V')
1794 #define EFI_RUNTIME_SERVICES_REVISION EFI_SPECIFICATION_VERSION
1797 /// EFI Runtime Services Table.
1801 /// The table header for the EFI Runtime Services Table.
1803 EFI_TABLE_HEADER Hdr
;
1808 EFI_GET_TIME GetTime
;
1809 EFI_SET_TIME SetTime
;
1810 EFI_GET_WAKEUP_TIME GetWakeupTime
;
1811 EFI_SET_WAKEUP_TIME SetWakeupTime
;
1814 // Virtual Memory Services
1816 EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap
;
1817 EFI_CONVERT_POINTER ConvertPointer
;
1820 // Variable Services
1822 EFI_GET_VARIABLE GetVariable
;
1823 EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName
;
1824 EFI_SET_VARIABLE SetVariable
;
1827 // Miscellaneous Services
1829 EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount
;
1830 EFI_RESET_SYSTEM ResetSystem
;
1833 // UEFI 2.0 Capsule Services
1835 EFI_UPDATE_CAPSULE UpdateCapsule
;
1836 EFI_QUERY_CAPSULE_CAPABILITIES QueryCapsuleCapabilities
;
1839 // Miscellaneous UEFI 2.0 Service
1841 EFI_QUERY_VARIABLE_INFO QueryVariableInfo
;
1842 } EFI_RUNTIME_SERVICES
;
1845 #define EFI_BOOT_SERVICES_SIGNATURE SIGNATURE_64 ('B','O','O','T','S','E','R','V')
1846 #define EFI_BOOT_SERVICES_REVISION EFI_SPECIFICATION_VERSION
1849 /// EFI Boot Services Table.
1853 /// The table header for the EFI Boot Services Table.
1855 EFI_TABLE_HEADER Hdr
;
1858 // Task Priority Services
1860 EFI_RAISE_TPL RaiseTPL
;
1861 EFI_RESTORE_TPL RestoreTPL
;
1866 EFI_ALLOCATE_PAGES AllocatePages
;
1867 EFI_FREE_PAGES FreePages
;
1868 EFI_GET_MEMORY_MAP GetMemoryMap
;
1869 EFI_ALLOCATE_POOL AllocatePool
;
1870 EFI_FREE_POOL FreePool
;
1873 // Event & Timer Services
1875 EFI_CREATE_EVENT CreateEvent
;
1876 EFI_SET_TIMER SetTimer
;
1877 EFI_WAIT_FOR_EVENT WaitForEvent
;
1878 EFI_SIGNAL_EVENT SignalEvent
;
1879 EFI_CLOSE_EVENT CloseEvent
;
1880 EFI_CHECK_EVENT CheckEvent
;
1883 // Protocol Handler Services
1885 EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface
;
1886 EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface
;
1887 EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface
;
1888 EFI_HANDLE_PROTOCOL HandleProtocol
;
1890 EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify
;
1891 EFI_LOCATE_HANDLE LocateHandle
;
1892 EFI_LOCATE_DEVICE_PATH LocateDevicePath
;
1893 EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable
;
1898 EFI_IMAGE_LOAD LoadImage
;
1899 EFI_IMAGE_START StartImage
;
1901 EFI_IMAGE_UNLOAD UnloadImage
;
1902 EFI_EXIT_BOOT_SERVICES ExitBootServices
;
1905 // Miscellaneous Services
1907 EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount
;
1909 EFI_SET_WATCHDOG_TIMER SetWatchdogTimer
;
1912 // DriverSupport Services
1914 EFI_CONNECT_CONTROLLER ConnectController
;
1915 EFI_DISCONNECT_CONTROLLER DisconnectController
;
1918 // Open and Close Protocol Services
1920 EFI_OPEN_PROTOCOL OpenProtocol
;
1921 EFI_CLOSE_PROTOCOL CloseProtocol
;
1922 EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
;
1927 EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
;
1928 EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
;
1929 EFI_LOCATE_PROTOCOL LocateProtocol
;
1930 EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces
;
1931 EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces
;
1934 // 32-bit CRC Services
1936 EFI_CALCULATE_CRC32 CalculateCrc32
;
1939 // Miscellaneous Services
1941 EFI_COPY_MEM CopyMem
;
1943 EFI_CREATE_EVENT_EX CreateEventEx
;
1944 } EFI_BOOT_SERVICES
;
1947 /// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the
1948 /// EFI System Table.
1952 /// The 128-bit GUID value that uniquely identifies the system configuration table.
1954 EFI_GUID VendorGuid
;
1956 /// A pointer to the table associated with VendorGuid.
1959 } EFI_CONFIGURATION_TABLE
;
1962 /// EFI System Table
1966 /// The table header for the EFI System Table.
1968 EFI_TABLE_HEADER Hdr
;
1970 /// A pointer to a null terminated string that identifies the vendor
1971 /// that produces the system firmware for the platform.
1973 CHAR16
*FirmwareVendor
;
1975 /// A firmware vendor specific value that identifies the revision
1976 /// of the system firmware for the platform.
1978 UINT32 FirmwareRevision
;
1980 /// The handle for the active console input device. This handle must support
1981 /// EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.
1983 EFI_HANDLE ConsoleInHandle
;
1985 /// A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is
1986 /// associated with ConsoleInHandle.
1988 EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*ConIn
;
1990 /// The handle for the active console output device.
1992 EFI_HANDLE ConsoleOutHandle
;
1994 /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
1995 /// that is associated with ConsoleOutHandle.
1997 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*ConOut
;
1999 /// The handle for the active standard error console device.
2000 /// This handle must support the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
2002 EFI_HANDLE StandardErrorHandle
;
2004 /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
2005 /// that is associated with StandardErrorHandle.
2007 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*StdErr
;
2009 /// A pointer to the EFI Runtime Services Table.
2011 EFI_RUNTIME_SERVICES
*RuntimeServices
;
2013 /// A pointer to the EFI Boot Services Table.
2015 EFI_BOOT_SERVICES
*BootServices
;
2017 /// The number of system configuration tables in the buffer ConfigurationTable.
2019 UINTN NumberOfTableEntries
;
2021 /// A pointer to the system configuration tables.
2022 /// The number of entries in the table is NumberOfTableEntries.
2024 EFI_CONFIGURATION_TABLE
*ConfigurationTable
;
2028 This is the declaration of an EFI image entry point. This entry point is
2029 the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
2030 both device drivers and bus drivers.
2032 @param[in] ImageHandle The firmware allocated handle for the UEFI image.
2033 @param[in] SystemTable A pointer to the EFI System Table.
2035 @retval EFI_SUCCESS The operation completed successfully.
2036 @retval Others An unexpected error occurred.
2040 (EFIAPI
*EFI_IMAGE_ENTRY_POINT
)(
2041 IN EFI_HANDLE ImageHandle
,
2042 IN EFI_SYSTEM_TABLE
*SystemTable
2046 // EFI Load Option. This data structure describes format of UEFI boot option variables.
2048 // NOTE: EFI Load Option is a byte packed buffer of variable length fields.
2049 // The first two fields have fixed length. They are declared as members of the
2050 // EFI_LOAD_OPTION structure. All the other fields are variable length fields.
2051 // They are listed in the comment block below for reference purposes.
2054 typedef struct _EFI_LOAD_OPTION
{
2056 /// The attributes for this load option entry. All unused bits must be zero
2057 /// and are reserved by the UEFI specification for future growth.
2061 /// Length in bytes of the FilePathList. OptionalData starts at offset
2062 /// sizeof(UINT32) + sizeof(UINT16) + StrSize(Description) + FilePathListLength
2063 /// of the EFI_LOAD_OPTION descriptor.
2065 UINT16 FilePathListLength
;
2067 /// The user readable description for the load option.
2068 /// This field ends with a Null character.
2070 // CHAR16 Description[];
2072 /// A packed array of UEFI device paths. The first element of the array is a
2073 /// device path that describes the device and location of the Image for this
2074 /// load option. The FilePathList[0] is specific to the device type. Other
2075 /// device paths may optionally exist in the FilePathList, but their usage is
2076 /// OSV specific. Each element in the array is variable length, and ends at
2077 /// the device path end structure. Because the size of Description is
2078 /// arbitrary, this data structure is not guaranteed to be aligned on a
2079 /// natural boundary. This data structure may have to be copied to an aligned
2080 /// natural boundary before it is used.
2082 // EFI_DEVICE_PATH_PROTOCOL FilePathList[];
2084 /// The remaining bytes in the load option descriptor are a binary data buffer
2085 /// that is passed to the loaded image. If the field is zero bytes long, a
2086 /// NULL pointer is passed to the loaded image. The number of bytes in
2087 /// OptionalData can be computed by subtracting the starting offset of
2088 /// OptionalData from total size in bytes of the EFI_LOAD_OPTION.
2090 // UINT8 OptionalData[];
2095 // EFI Load Options Attributes
2097 #define LOAD_OPTION_ACTIVE 0x00000001
2098 #define LOAD_OPTION_FORCE_RECONNECT 0x00000002
2099 #define LOAD_OPTION_HIDDEN 0x00000008
2100 #define LOAD_OPTION_CATEGORY 0x00001F00
2102 #define LOAD_OPTION_CATEGORY_BOOT 0x00000000
2103 #define LOAD_OPTION_CATEGORY_APP 0x00000100
2105 #define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001
2106 #define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002
2107 #define EFI_BOOT_OPTION_SUPPORT_SYSPREP 0x00000010
2108 #define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300
2111 /// EFI Boot Key Data
2116 /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
2118 UINT32 Revision
: 8;
2120 /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
2122 UINT32 ShiftPressed
: 1;
2124 /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
2126 UINT32 ControlPressed
: 1;
2128 /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
2130 UINT32 AltPressed
: 1;
2132 /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
2134 UINT32 LogoPressed
: 1;
2136 /// The Menu key must be pressed (1) or must not be pressed (0).
2138 UINT32 MenuPressed
: 1;
2140 /// The SysReq key must be pressed (1) or must not be pressed (0).
2142 UINT32 SysReqPressed
: 1;
2143 UINT32 Reserved
: 16;
2145 /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
2146 /// zero, then only the shift state is considered. If more than one, then the boot option will
2147 /// only be launched if all of the specified keys are pressed with the same shift state.
2149 UINT32 InputKeyCount
: 2;
2152 } EFI_BOOT_KEY_DATA
;
2160 /// Specifies options about how the key will be processed.
2162 EFI_BOOT_KEY_DATA KeyData
;
2164 /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to
2165 /// which BootOption refers. If the CRC-32s do not match this value, then this key
2166 /// option is ignored.
2168 UINT32 BootOptionCrc
;
2170 /// The Boot#### option which will be invoked if this key is pressed and the boot option
2171 /// is active (LOAD_OPTION_ACTIVE is set).
2175 /// The key codes to compare against those returned by the
2176 /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.
2177 /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.
2179 //EFI_INPUT_KEY Keys[];
2184 // EFI File location to boot from on removable media devices
2186 #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI"
2187 #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI"
2188 #define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI"
2189 #define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM L"\\EFI\\BOOT\\BOOTARM.EFI"
2190 #define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI"
2192 #if defined (MDE_CPU_IA32)
2193 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
2194 #elif defined (MDE_CPU_IPF)
2195 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA64
2196 #elif defined (MDE_CPU_X64)
2197 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64
2198 #elif defined (MDE_CPU_EBC)
2199 #elif defined (MDE_CPU_ARM)
2200 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
2201 #elif defined (MDE_CPU_AARCH64)
2202 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
2204 #error Unknown Processor Type
2207 #include <Uefi/UefiPxe.h>
2208 #include <Uefi/UefiGpt.h>
2209 #include <Uefi/UefiInternalFormRepresentation.h>