2 Include file that supports UEFI.
4 This include file must contain things defined in the UEFI 2.4 specification.
5 If a code construct is defined in the UEFI 2.4 specification it must be included
8 Copyright (c) 2006 - 2015, 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. See EFI_MEMORY_TYPE.
110 /// Physical address of the first byte of the memory region. Must aligned
111 /// on a 4 KB boundary.
113 EFI_PHYSICAL_ADDRESS PhysicalStart
;
115 /// Virtual address of the first byte of the memory region. Must aligned
116 /// on a 4 KB boundary.
118 EFI_VIRTUAL_ADDRESS VirtualStart
;
120 /// Number of 4KB pages in the memory region.
122 UINT64 NumberOfPages
;
124 /// Attributes of the memory region that describe the bit mask of capabilities
125 /// for that memory region, and not necessarily the current settings for that
129 } EFI_MEMORY_DESCRIPTOR
;
132 Allocates memory pages from the system.
134 @param[in] Type The type of allocation to perform.
135 @param[in] MemoryType The type of memory to allocate.
136 @param[in] Pages The number of contiguous 4 KB pages to allocate.
137 @param[in, out] Memory The pointer to a physical address. On input, the way in which the address is
138 used depends on the value of Type.
140 @retval EFI_SUCCESS The requested pages were allocated.
141 @retval EFI_INVALID_PARAMETER 1) Type is not AllocateAnyPages or
142 AllocateMaxAddress or AllocateAddress.
143 2) MemoryType is in the range
145 4) MemoryType was EfiPersistentMemory.
146 EfiMaxMemoryType..0x7FFFFFFF.
147 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
148 @retval EFI_NOT_FOUND The requested pages could not be found.
153 (EFIAPI
*EFI_ALLOCATE_PAGES
)(
154 IN EFI_ALLOCATE_TYPE Type
,
155 IN EFI_MEMORY_TYPE MemoryType
,
157 IN OUT EFI_PHYSICAL_ADDRESS
*Memory
163 @param[in] Memory The base physical address of the pages to be freed.
164 @param[in] Pages The number of contiguous 4 KB pages to free.
166 @retval EFI_SUCCESS The requested pages were freed.
167 @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.
168 @retval EFI_NOT_FOUND The requested memory pages were not allocated with
174 (EFIAPI
*EFI_FREE_PAGES
)(
175 IN EFI_PHYSICAL_ADDRESS Memory
,
180 Returns the current memory map.
182 @param[in, out] MemoryMapSize A pointer to the size, in bytes, of the MemoryMap buffer.
183 On input, this is the size of the buffer allocated by the caller.
184 On output, it is the size of the buffer returned by the firmware if
185 the buffer was large enough, or the size of the buffer needed to contain
186 the map if the buffer was too small.
187 @param[in, out] MemoryMap A pointer to the buffer in which firmware places the current memory
189 @param[out] MapKey A pointer to the location in which firmware returns the key for the
191 @param[out] DescriptorSize A pointer to the location in which firmware returns the size, in bytes, of
192 an individual EFI_MEMORY_DESCRIPTOR.
193 @param[out] DescriptorVersion A pointer to the location in which firmware returns the version number
194 associated with the EFI_MEMORY_DESCRIPTOR.
196 @retval EFI_SUCCESS The memory map was returned in the MemoryMap buffer.
197 @retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current buffer size
198 needed to hold the memory map is returned in MemoryMapSize.
199 @retval EFI_INVALID_PARAMETER 1) MemoryMapSize is NULL.
200 2) The MemoryMap buffer is not too small and MemoryMap is
206 (EFIAPI
*EFI_GET_MEMORY_MAP
)(
207 IN OUT UINTN
*MemoryMapSize
,
208 IN OUT EFI_MEMORY_DESCRIPTOR
*MemoryMap
,
210 OUT UINTN
*DescriptorSize
,
211 OUT UINT32
*DescriptorVersion
215 Allocates pool memory.
217 @param[in] PoolType The type of pool to allocate.
218 @param[in] Size The number of bytes to allocate from the pool.
219 @param[out] Buffer A pointer to a pointer to the allocated buffer if the call succeeds;
222 @retval EFI_SUCCESS The requested number of bytes was allocated.
223 @retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated.
224 @retval EFI_INVALID_PARAMETER PoolType was invalid or Buffer is NULL.
225 PoolType was EfiPersistentMemory.
230 (EFIAPI
*EFI_ALLOCATE_POOL
)(
231 IN EFI_MEMORY_TYPE PoolType
,
237 Returns pool memory to the system.
239 @param[in] Buffer The pointer to the buffer to free.
241 @retval EFI_SUCCESS The memory was returned to the system.
242 @retval EFI_INVALID_PARAMETER Buffer was invalid.
247 (EFIAPI
*EFI_FREE_POOL
)(
252 Changes the runtime addressing mode of EFI firmware from physical to virtual.
254 @param[in] MemoryMapSize The size in bytes of VirtualMap.
255 @param[in] DescriptorSize The size in bytes of an entry in the VirtualMap.
256 @param[in] DescriptorVersion The version of the structure entries in VirtualMap.
257 @param[in] VirtualMap An array of memory descriptors which contain new virtual
258 address mapping information for all runtime ranges.
260 @retval EFI_SUCCESS The virtual address map has been applied.
261 @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
262 virtual address mapped mode.
263 @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.
264 @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
265 map that requires a mapping.
266 @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
272 (EFIAPI
*EFI_SET_VIRTUAL_ADDRESS_MAP
)(
273 IN UINTN MemoryMapSize
,
274 IN UINTN DescriptorSize
,
275 IN UINT32 DescriptorVersion
,
276 IN EFI_MEMORY_DESCRIPTOR
*VirtualMap
280 Connects one or more drivers to a controller.
282 @param[in] ControllerHandle The handle of the controller to which driver(s) are to be connected.
283 @param[in] DriverImageHandle A pointer to an ordered list handles that support the
284 EFI_DRIVER_BINDING_PROTOCOL.
285 @param[in] RemainingDevicePath A pointer to the device path that specifies a child of the
286 controller specified by ControllerHandle.
287 @param[in] Recursive If TRUE, then ConnectController() is called recursively
288 until the entire tree of controllers below the controller specified
289 by ControllerHandle have been created. If FALSE, then
290 the tree of controllers is only expanded one level.
292 @retval EFI_SUCCESS 1) One or more drivers were connected to ControllerHandle.
293 2) No drivers were connected to ControllerHandle, but
294 RemainingDevicePath is not NULL, and it is an End Device
296 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
297 @retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances
298 present in the system.
299 2) No drivers were connected to ControllerHandle.
300 @retval EFI_SECURITY_VIOLATION
301 The user has no permission to start UEFI device drivers on the device path
302 associated with the ControllerHandle or specified by the RemainingDevicePath.
306 (EFIAPI
*EFI_CONNECT_CONTROLLER
)(
307 IN EFI_HANDLE ControllerHandle
,
308 IN EFI_HANDLE
*DriverImageHandle
, OPTIONAL
309 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
, OPTIONAL
314 Disconnects one or more drivers from a controller.
316 @param[in] ControllerHandle The handle of the controller from which driver(s) are to be disconnected.
317 @param[in] DriverImageHandle The driver to disconnect from ControllerHandle.
318 If DriverImageHandle is NULL, then all the drivers currently managing
319 ControllerHandle are disconnected from ControllerHandle.
320 @param[in] ChildHandle The handle of the child to destroy.
321 If ChildHandle is NULL, then all the children of ControllerHandle are
322 destroyed before the drivers are disconnected from ControllerHandle.
324 @retval EFI_SUCCESS 1) One or more drivers were disconnected from the controller.
325 2) On entry, no drivers are managing ControllerHandle.
326 3) DriverImageHandle is not NULL, and on entry
327 DriverImageHandle is not managing ControllerHandle.
328 @retval EFI_INVALID_PARAMETER 1) ControllerHandle is NULL.
329 2) DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.
330 3) ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
331 4) DriverImageHandle does not support the EFI_DRIVER_BINDING_PROTOCOL.
332 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to disconnect any drivers from
334 @retval EFI_DEVICE_ERROR The controller could not be disconnected because of a device error.
339 (EFIAPI
*EFI_DISCONNECT_CONTROLLER
)(
340 IN EFI_HANDLE ControllerHandle
,
341 IN EFI_HANDLE DriverImageHandle
, OPTIONAL
342 IN EFI_HANDLE ChildHandle OPTIONAL
348 // ConvertPointer DebugDisposition type.
350 #define EFI_OPTIONAL_PTR 0x00000001
353 Determines the new virtual address that is to be used on subsequent memory accesses.
355 @param[in] DebugDisposition Supplies type information for the pointer being converted.
356 @param[in, out] Address A pointer to a pointer that is to be fixed to be the value needed
357 for the new virtual address mappings being applied.
359 @retval EFI_SUCCESS The pointer pointed to by Address was modified.
360 @retval EFI_INVALID_PARAMETER 1) Address is NULL.
361 2) *Address is NULL and DebugDisposition does
362 not have the EFI_OPTIONAL_PTR bit set.
363 @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part
364 of the current memory map. This is normally fatal.
369 (EFIAPI
*EFI_CONVERT_POINTER
)(
370 IN UINTN DebugDisposition
,
371 IN OUT VOID
**Address
376 // These types can be ORed together as needed - for example,
377 // EVT_TIMER might be Ored with EVT_NOTIFY_WAIT or
378 // EVT_NOTIFY_SIGNAL.
380 #define EVT_TIMER 0x80000000
381 #define EVT_RUNTIME 0x40000000
382 #define EVT_NOTIFY_WAIT 0x00000100
383 #define EVT_NOTIFY_SIGNAL 0x00000200
385 #define EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201
386 #define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202
389 // The event's NotifyContext pointer points to a runtime memory
391 // The event is deprecated in UEFI2.0 and later specifications.
393 #define EVT_RUNTIME_CONTEXT 0x20000000
397 Invoke a notification event
399 @param[in] Event Event whose notification function is being invoked.
400 @param[in] Context The pointer to the notification function's context,
401 which is implementation-dependent.
406 (EFIAPI
*EFI_EVENT_NOTIFY
)(
414 @param[in] Type The type of event to create and its mode and attributes.
415 @param[in] NotifyTpl The task priority level of event notifications, if needed.
416 @param[in] NotifyFunction The pointer to the event's notification function, if any.
417 @param[in] NotifyContext The pointer to the notification function's context; corresponds to parameter
418 Context in the notification function.
419 @param[out] Event The pointer to the newly created event if the call succeeds; undefined
422 @retval EFI_SUCCESS The event structure was created.
423 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
424 @retval EFI_OUT_OF_RESOURCES The event could not be allocated.
429 (EFIAPI
*EFI_CREATE_EVENT
)(
431 IN EFI_TPL NotifyTpl
,
432 IN EFI_EVENT_NOTIFY NotifyFunction
,
433 IN VOID
*NotifyContext
,
438 Creates an event in a group.
440 @param[in] Type The type of event to create and its mode and attributes.
441 @param[in] NotifyTpl The task priority level of event notifications,if needed.
442 @param[in] NotifyFunction The pointer to the event's notification function, if any.
443 @param[in] NotifyContext The pointer to the notification function's context; corresponds to parameter
444 Context in the notification function.
445 @param[in] EventGroup The pointer to the unique identifier of the group to which this event belongs.
446 If this is NULL, then the function behaves as if the parameters were passed
448 @param[out] Event The pointer to the newly created event if the call succeeds; undefined
451 @retval EFI_SUCCESS The event structure was created.
452 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
453 @retval EFI_OUT_OF_RESOURCES The event could not be allocated.
458 (EFIAPI
*EFI_CREATE_EVENT_EX
)(
460 IN EFI_TPL NotifyTpl
,
461 IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL
,
462 IN CONST VOID
*NotifyContext OPTIONAL
,
463 IN CONST EFI_GUID
*EventGroup OPTIONAL
,
468 /// Timer delay types
472 /// An event's timer settings is to be cancelled and not trigger time is to be set/
476 /// An event is to be signaled periodically at a specified interval from the current time.
480 /// An event is to be signaled once at a specified interval from the current time.
486 Sets the type of timer and the trigger time for a timer event.
488 @param[in] Event The timer event that is to be signaled at the specified time.
489 @param[in] Type The type of time that is specified in TriggerTime.
490 @param[in] TriggerTime The number of 100ns units until the timer expires.
491 A TriggerTime of 0 is legal.
492 If Type is TimerRelative and TriggerTime is 0, then the timer
493 event will be signaled on the next timer tick.
494 If Type is TimerPeriodic and TriggerTime is 0, then the timer
495 event will be signaled on every timer tick.
497 @retval EFI_SUCCESS The event has been set to be signaled at the requested time.
498 @retval EFI_INVALID_PARAMETER Event or Type is not valid.
503 (EFIAPI
*EFI_SET_TIMER
)(
505 IN EFI_TIMER_DELAY Type
,
506 IN UINT64 TriggerTime
512 @param[in] Event The event to signal.
514 @retval EFI_SUCCESS The event has been signaled.
519 (EFIAPI
*EFI_SIGNAL_EVENT
)(
524 Stops execution until an event is signaled.
526 @param[in] NumberOfEvents The number of events in the Event array.
527 @param[in] Event An array of EFI_EVENT.
528 @param[out] Index The pointer to the index of the event which satisfied the wait condition.
530 @retval EFI_SUCCESS The event indicated by Index was signaled.
531 @retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0.
532 2) The event indicated by Index is of type
534 @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION.
539 (EFIAPI
*EFI_WAIT_FOR_EVENT
)(
540 IN UINTN NumberOfEvents
,
548 @param[in] Event The event to close.
550 @retval EFI_SUCCESS The event has been closed.
555 (EFIAPI
*EFI_CLOSE_EVENT
)(
560 Checks whether an event is in the signaled state.
562 @param[in] Event The event to check.
564 @retval EFI_SUCCESS The event is in the signaled state.
565 @retval EFI_NOT_READY The event is not in the signaled state.
566 @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL.
571 (EFIAPI
*EFI_CHECK_EVENT
)(
577 // Task priority level
579 #define TPL_APPLICATION 4
580 #define TPL_CALLBACK 8
581 #define TPL_NOTIFY 16
582 #define TPL_HIGH_LEVEL 31
586 Raises a task's priority level and returns its previous level.
588 @param[in] NewTpl The new task priority level.
590 @return Previous task priority level
595 (EFIAPI
*EFI_RAISE_TPL
)(
600 Restores a task's priority level to its previous value.
602 @param[in] OldTpl The previous task priority level to restore.
607 (EFIAPI
*EFI_RESTORE_TPL
)(
612 Returns the value of a variable.
614 @param[in] VariableName A Null-terminated string that is the name of the vendor's
616 @param[in] VendorGuid A unique identifier for the vendor.
617 @param[out] Attributes If not NULL, a pointer to the memory location to return the
618 attributes bitmask for the variable.
619 @param[in, out] DataSize On input, the size in bytes of the return Data buffer.
620 On output the size of data returned in Data.
621 @param[out] Data The buffer to return the contents of the variable.
623 @retval EFI_SUCCESS The function completed successfully.
624 @retval EFI_NOT_FOUND The variable was not found.
625 @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result.
626 @retval EFI_INVALID_PARAMETER VariableName is NULL.
627 @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
628 @retval EFI_INVALID_PARAMETER DataSize is NULL.
629 @retval EFI_INVALID_PARAMETER The DataSize is not too small and Data is NULL.
630 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
631 @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
636 (EFIAPI
*EFI_GET_VARIABLE
)(
637 IN CHAR16
*VariableName
,
638 IN EFI_GUID
*VendorGuid
,
639 OUT UINT32
*Attributes
, OPTIONAL
640 IN OUT UINTN
*DataSize
,
645 Enumerates the current variable names.
647 @param[in, out] VariableNameSize The size of the VariableName buffer.
648 @param[in, out] VariableName On input, supplies the last VariableName that was returned
649 by GetNextVariableName(). On output, returns the Nullterminated
650 string of the current variable.
651 @param[in, out] VendorGuid On input, supplies the last VendorGuid that was returned by
652 GetNextVariableName(). On output, returns the
653 VendorGuid of the current variable.
655 @retval EFI_SUCCESS The function completed successfully.
656 @retval EFI_NOT_FOUND The next variable was not found.
657 @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.
658 @retval EFI_INVALID_PARAMETER VariableNameSize is NULL.
659 @retval EFI_INVALID_PARAMETER VariableName is NULL.
660 @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
661 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
666 (EFIAPI
*EFI_GET_NEXT_VARIABLE_NAME
)(
667 IN OUT UINTN
*VariableNameSize
,
668 IN OUT CHAR16
*VariableName
,
669 IN OUT EFI_GUID
*VendorGuid
673 Sets the value of a variable.
675 @param[in] VariableName A Null-terminated string that is the name of the vendor's variable.
676 Each VariableName is unique for each VendorGuid. VariableName must
677 contain 1 or more characters. If VariableName is an empty string,
678 then EFI_INVALID_PARAMETER is returned.
679 @param[in] VendorGuid A unique identifier for the vendor.
680 @param[in] Attributes Attributes bitmask to set for the variable.
681 @param[in] DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE,
682 EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, or
683 EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero
684 causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is
685 set, then a SetVariable() call with a DataSize of zero will not cause any change to
686 the variable value (the timestamp associated with the variable may be updated however
687 even if no new data value is provided,see the description of the
688 EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not
689 be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated).
690 @param[in] Data The contents for the variable.
692 @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
693 defined by the Attributes.
694 @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the
695 DataSize exceeds the maximum allowed.
696 @retval EFI_INVALID_PARAMETER VariableName is an empty string.
697 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
698 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
699 @retval EFI_WRITE_PROTECTED The variable in question is read-only.
700 @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
701 @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
702 or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo
703 does NOT pass the validation check carried out by the firmware.
705 @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
710 (EFIAPI
*EFI_SET_VARIABLE
)(
711 IN CHAR16
*VariableName
,
712 IN EFI_GUID
*VendorGuid
,
713 IN UINT32 Attributes
,
720 /// This provides the capabilities of the
721 /// real time clock device as exposed through the EFI interfaces.
725 /// Provides the reporting resolution of the real-time clock device in
726 /// counts per second. For a normal PC-AT CMOS RTC device, this
727 /// value would be 1 Hz, or 1, to indicate that the device only reports
728 /// the time to the resolution of 1 second.
732 /// Provides the timekeeping accuracy of the real-time clock in an
733 /// error rate of 1E-6 parts per million. For a clock with an accuracy
734 /// of 50 parts per million, the value in this field would be
739 /// A TRUE indicates that a time set operation clears the device's
740 /// time below the Resolution reporting level. A FALSE
741 /// indicates that the state below the Resolution level of the
742 /// device is not cleared when the time is set. Normal PC-AT CMOS
743 /// RTC devices set this value to FALSE.
746 } EFI_TIME_CAPABILITIES
;
749 Returns the current time and date information, and the time-keeping capabilities
750 of the hardware platform.
752 @param[out] Time A pointer to storage to receive a snapshot of the current time.
753 @param[out] Capabilities An optional pointer to a buffer to receive the real time clock
754 device's capabilities.
756 @retval EFI_SUCCESS The operation completed successfully.
757 @retval EFI_INVALID_PARAMETER Time is NULL.
758 @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.
763 (EFIAPI
*EFI_GET_TIME
)(
765 OUT EFI_TIME_CAPABILITIES
*Capabilities OPTIONAL
769 Sets the current local time and date information.
771 @param[in] Time A pointer to the current time.
773 @retval EFI_SUCCESS The operation completed successfully.
774 @retval EFI_INVALID_PARAMETER A time field is out of range.
775 @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error.
780 (EFIAPI
*EFI_SET_TIME
)(
785 Returns the current wakeup alarm clock setting.
787 @param[out] Enabled Indicates if the alarm is currently enabled or disabled.
788 @param[out] Pending Indicates if the alarm signal is pending and requires acknowledgement.
789 @param[out] Time The current alarm setting.
791 @retval EFI_SUCCESS The alarm settings were returned.
792 @retval EFI_INVALID_PARAMETER Enabled is NULL.
793 @retval EFI_INVALID_PARAMETER Pending is NULL.
794 @retval EFI_INVALID_PARAMETER Time is NULL.
795 @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.
796 @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.
801 (EFIAPI
*EFI_GET_WAKEUP_TIME
)(
802 OUT BOOLEAN
*Enabled
,
803 OUT BOOLEAN
*Pending
,
808 Sets the system wakeup alarm clock time.
810 @param[in] Enable Enable or disable the wakeup alarm.
811 @param[in] Time If Enable is TRUE, the time to set the wakeup alarm for.
812 If Enable is FALSE, then this parameter is optional, and may be NULL.
814 @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If
815 Enable is FALSE, then the wakeup alarm was disabled.
816 @retval EFI_INVALID_PARAMETER A time field is out of range.
817 @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.
818 @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.
823 (EFIAPI
*EFI_SET_WAKEUP_TIME
)(
825 IN EFI_TIME
*Time OPTIONAL
829 Loads an EFI image into memory.
831 @param[in] BootPolicy If TRUE, indicates that the request originates from the boot
832 manager, and that the boot manager is attempting to load
833 FilePath as a boot selection. Ignored if SourceBuffer is
835 @param[in] ParentImageHandle The caller's image handle.
836 @param[in] DevicePath The DeviceHandle specific file path from which the image is
838 @param[in] SourceBuffer If not NULL, a pointer to the memory location containing a copy
839 of the image to be loaded.
840 @param[in] SourceSize The size in bytes of SourceBuffer. Ignored if SourceBuffer is NULL.
841 @param[out] ImageHandle The pointer to the returned image handle that is created when the
842 image is successfully loaded.
844 @retval EFI_SUCCESS Image was loaded into memory correctly.
845 @retval EFI_NOT_FOUND Both SourceBuffer and DevicePath are NULL.
846 @retval EFI_INVALID_PARAMETER One or more parametes are invalid.
847 @retval EFI_UNSUPPORTED The image type is not supported.
848 @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient resources.
849 @retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not
851 @retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.
852 @retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
853 image from being loaded. NULL is returned in *ImageHandle.
854 @retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
855 valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
856 platform policy specifies that the image should not be started.
860 (EFIAPI
*EFI_IMAGE_LOAD
)(
861 IN BOOLEAN BootPolicy
,
862 IN EFI_HANDLE ParentImageHandle
,
863 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
864 IN VOID
*SourceBuffer OPTIONAL
,
866 OUT EFI_HANDLE
*ImageHandle
870 Transfers control to a loaded image's entry point.
872 @param[in] ImageHandle Handle of image to be started.
873 @param[out] ExitDataSize The pointer to the size, in bytes, of ExitData.
874 @param[out] ExitData The pointer to a pointer to a data buffer that includes a Null-terminated
875 string, optionally followed by additional binary data.
877 @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image
878 has already been initialized with StartImage.
879 @retval EFI_SECURITY_VIOLATION The current platform policy specifies that the image should not be started.
880 @return Exit code from image
885 (EFIAPI
*EFI_IMAGE_START
)(
886 IN EFI_HANDLE ImageHandle
,
887 OUT UINTN
*ExitDataSize
,
888 OUT CHAR16
**ExitData OPTIONAL
892 Terminates a loaded EFI image and returns control to boot services.
894 @param[in] ImageHandle Handle that identifies the image. This parameter is passed to the
896 @param[in] ExitStatus The image's exit code.
897 @param[in] ExitDataSize The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS.
898 @param[in] ExitData The pointer to a data buffer that includes a Null-terminated string,
899 optionally followed by additional binary data. The string is a
900 description that the caller may use to further indicate the reason
901 for the image's exit. ExitData is only valid if ExitStatus
902 is something other than EFI_SUCCESS. The ExitData buffer
903 must be allocated by calling AllocatePool().
905 @retval EFI_SUCCESS The image specified by ImageHandle was unloaded.
906 @retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and
907 started with LoadImage() and StartImage(), but the
908 image is not the currently executing image.
914 IN EFI_HANDLE ImageHandle
,
915 IN EFI_STATUS ExitStatus
,
916 IN UINTN ExitDataSize
,
917 IN CHAR16
*ExitData OPTIONAL
923 @param[in] ImageHandle Handle that identifies the image to be unloaded.
925 @retval EFI_SUCCESS The image has been unloaded.
926 @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
931 (EFIAPI
*EFI_IMAGE_UNLOAD
)(
932 IN EFI_HANDLE ImageHandle
936 Terminates all boot services.
938 @param[in] ImageHandle Handle that identifies the exiting image.
939 @param[in] MapKey Key to the latest memory map.
941 @retval EFI_SUCCESS Boot services have been terminated.
942 @retval EFI_INVALID_PARAMETER MapKey is incorrect.
947 (EFIAPI
*EFI_EXIT_BOOT_SERVICES
)(
948 IN EFI_HANDLE ImageHandle
,
953 Induces a fine-grained stall.
955 @param[in] Microseconds The number of microseconds to stall execution.
957 @retval EFI_SUCCESS Execution was stalled at least the requested number of
964 IN UINTN Microseconds
968 Sets the system's watchdog timer.
970 @param[in] Timeout The number of seconds to set the watchdog timer to.
971 @param[in] WatchdogCode The numeric code to log on a watchdog timer timeout event.
972 @param[in] DataSize The size, in bytes, of WatchdogData.
973 @param[in] WatchdogData A data buffer that includes a Null-terminated string, optionally
974 followed by additional binary data.
976 @retval EFI_SUCCESS The timeout has been set.
977 @retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid.
978 @retval EFI_UNSUPPORTED The system does not have a watchdog timer.
979 @retval EFI_DEVICE_ERROR The watchdog timer could not be programmed due to a hardware
985 (EFIAPI
*EFI_SET_WATCHDOG_TIMER
)(
987 IN UINT64 WatchdogCode
,
989 IN CHAR16
*WatchdogData OPTIONAL
993 Resets the entire platform.
995 @param[in] ResetType The type of reset to perform.
996 @param[in] ResetStatus The status code for the reset.
997 @param[in] DataSize The size, in bytes, of WatchdogData.
998 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
999 EfiResetShutdown the data buffer starts with a Null-terminated
1000 string, optionally followed by additional binary data.
1005 (EFIAPI
*EFI_RESET_SYSTEM
)(
1006 IN EFI_RESET_TYPE ResetType
,
1007 IN EFI_STATUS ResetStatus
,
1009 IN VOID
*ResetData OPTIONAL
1013 Returns a monotonically increasing count for the platform.
1015 @param[out] Count The pointer to returned value.
1017 @retval EFI_SUCCESS The next monotonic count was returned.
1018 @retval EFI_INVALID_PARAMETER Count is NULL.
1019 @retval EFI_DEVICE_ERROR The device is not functioning properly.
1024 (EFIAPI
*EFI_GET_NEXT_MONOTONIC_COUNT
)(
1029 Returns the next high 32 bits of the platform's monotonic counter.
1031 @param[out] HighCount The pointer to returned value.
1033 @retval EFI_SUCCESS The next high monotonic count was returned.
1034 @retval EFI_INVALID_PARAMETER HighCount is NULL.
1035 @retval EFI_DEVICE_ERROR The device is not functioning properly.
1040 (EFIAPI
*EFI_GET_NEXT_HIGH_MONO_COUNT
)(
1041 OUT UINT32
*HighCount
1045 Computes and returns a 32-bit CRC for a data buffer.
1047 @param[in] Data A pointer to the buffer on which the 32-bit CRC is to be computed.
1048 @param[in] DataSize The number of bytes in the buffer Data.
1049 @param[out] Crc32 The 32-bit CRC that was computed for the data buffer specified by Data
1052 @retval EFI_SUCCESS The 32-bit CRC was computed for the data buffer and returned in
1054 @retval EFI_INVALID_PARAMETER Data is NULL.
1055 @retval EFI_INVALID_PARAMETER Crc32 is NULL.
1056 @retval EFI_INVALID_PARAMETER DataSize is 0.
1061 (EFIAPI
*EFI_CALCULATE_CRC32
)(
1068 Copies the contents of one buffer to another buffer.
1070 @param[in] Destination The pointer to the destination buffer of the memory copy.
1071 @param[in] Source The pointer to the source buffer of the memory copy.
1072 @param[in] Length Number of bytes to copy from Source to Destination.
1077 (EFIAPI
*EFI_COPY_MEM
)(
1078 IN VOID
*Destination
,
1084 The SetMem() function fills a buffer with a specified value.
1086 @param[in] Buffer The pointer to the buffer to fill.
1087 @param[in] Size Number of bytes in Buffer to fill.
1088 @param[in] Value Value to fill Buffer with.
1093 (EFIAPI
*EFI_SET_MEM
)(
1100 /// Enumeration of EFI Interface Types
1104 /// Indicates that the supplied protocol interface is supplied in native form.
1106 EFI_NATIVE_INTERFACE
1107 } EFI_INTERFACE_TYPE
;
1110 Installs a protocol interface on a device handle. If the handle does not exist, it is created and added
1111 to the list of handles in the system. InstallMultipleProtocolInterfaces() performs
1112 more error checking than InstallProtocolInterface(), so it is recommended that
1113 InstallMultipleProtocolInterfaces() be used in place of
1114 InstallProtocolInterface()
1116 @param[in, out] Handle A pointer to the EFI_HANDLE on which the interface is to be installed.
1117 @param[in] Protocol The numeric ID of the protocol interface.
1118 @param[in] InterfaceType Indicates whether Interface is supplied in native form.
1119 @param[in] Interface A pointer to the protocol interface.
1121 @retval EFI_SUCCESS The protocol interface was installed.
1122 @retval EFI_OUT_OF_RESOURCES Space for a new handle could not be allocated.
1123 @retval EFI_INVALID_PARAMETER Handle is NULL.
1124 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1125 @retval EFI_INVALID_PARAMETER InterfaceType is not EFI_NATIVE_INTERFACE.
1126 @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.
1131 (EFIAPI
*EFI_INSTALL_PROTOCOL_INTERFACE
)(
1132 IN OUT EFI_HANDLE
*Handle
,
1133 IN EFI_GUID
*Protocol
,
1134 IN EFI_INTERFACE_TYPE InterfaceType
,
1139 Installs one or more protocol interfaces into the boot services environment.
1141 @param[in, out] Handle The pointer to a handle to install the new protocol interfaces on,
1142 or a pointer to NULL if a new handle is to be allocated.
1143 @param ... A variable argument list containing pairs of protocol GUIDs and protocol
1146 @retval EFI_SUCCESS All the protocol interface was installed.
1147 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
1148 @retval EFI_ALREADY_STARTED A Device Path Protocol instance was passed in that is already present in
1149 the handle database.
1150 @retval EFI_INVALID_PARAMETER Handle is NULL.
1151 @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.
1156 (EFIAPI
*EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES
)(
1157 IN OUT EFI_HANDLE
*Handle
,
1162 Reinstalls a protocol interface on a device handle.
1164 @param[in] Handle Handle on which the interface is to be reinstalled.
1165 @param[in] Protocol The numeric ID of the interface.
1166 @param[in] OldInterface A pointer to the old interface. NULL can be used if a structure is not
1167 associated with Protocol.
1168 @param[in] NewInterface A pointer to the new interface.
1170 @retval EFI_SUCCESS The protocol interface was reinstalled.
1171 @retval EFI_NOT_FOUND The OldInterface on the handle was not found.
1172 @retval EFI_ACCESS_DENIED The protocol interface could not be reinstalled,
1173 because OldInterface is still being used by a
1174 driver that will not release it.
1175 @retval EFI_INVALID_PARAMETER Handle is NULL.
1176 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1181 (EFIAPI
*EFI_REINSTALL_PROTOCOL_INTERFACE
)(
1182 IN EFI_HANDLE Handle
,
1183 IN EFI_GUID
*Protocol
,
1184 IN VOID
*OldInterface
,
1185 IN VOID
*NewInterface
1189 Removes a protocol interface from a device handle. It is recommended that
1190 UninstallMultipleProtocolInterfaces() be used in place of
1191 UninstallProtocolInterface().
1193 @param[in] Handle The handle on which the interface was installed.
1194 @param[in] Protocol The numeric ID of the interface.
1195 @param[in] Interface A pointer to the interface.
1197 @retval EFI_SUCCESS The interface was removed.
1198 @retval EFI_NOT_FOUND The interface was not found.
1199 @retval EFI_ACCESS_DENIED The interface was not removed because the interface
1200 is still being used by a driver.
1201 @retval EFI_INVALID_PARAMETER Handle is NULL.
1202 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1207 (EFIAPI
*EFI_UNINSTALL_PROTOCOL_INTERFACE
)(
1208 IN EFI_HANDLE Handle
,
1209 IN EFI_GUID
*Protocol
,
1214 Removes one or more protocol interfaces into the boot services environment.
1216 @param[in] Handle The handle to remove the protocol interfaces from.
1217 @param ... A variable argument list containing pairs of protocol GUIDs and
1218 protocol interfaces.
1220 @retval EFI_SUCCESS All the protocol interfaces were removed.
1221 @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.
1226 (EFIAPI
*EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES
)(
1227 IN EFI_HANDLE Handle
,
1232 Queries a handle to determine if it supports a specified protocol.
1234 @param[in] Handle The handle being queried.
1235 @param[in] Protocol The published unique identifier of the protocol.
1236 @param[out] Interface Supplies the address where a pointer to the corresponding Protocol
1237 Interface is returned.
1239 @retval EFI_SUCCESS The interface information for the specified protocol was returned.
1240 @retval EFI_UNSUPPORTED The device does not support the specified protocol.
1241 @retval EFI_INVALID_PARAMETER Handle is NULL.
1242 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1243 @retval EFI_INVALID_PARAMETER Interface is NULL.
1248 (EFIAPI
*EFI_HANDLE_PROTOCOL
)(
1249 IN EFI_HANDLE Handle
,
1250 IN EFI_GUID
*Protocol
,
1251 OUT VOID
**Interface
1254 #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
1255 #define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
1256 #define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
1257 #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
1258 #define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
1259 #define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020
1262 Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the
1263 handle, it opens the protocol on behalf of the calling agent.
1265 @param[in] Handle The handle for the protocol interface that is being opened.
1266 @param[in] Protocol The published unique identifier of the protocol.
1267 @param[out] Interface Supplies the address where a pointer to the corresponding Protocol
1268 Interface is returned.
1269 @param[in] AgentHandle The handle of the agent that is opening the protocol interface
1270 specified by Protocol and Interface.
1271 @param[in] ControllerHandle If the agent that is opening a protocol is a driver that follows the
1272 UEFI Driver Model, then this parameter is the controller handle
1273 that requires the protocol interface. If the agent does not follow
1274 the UEFI Driver Model, then this parameter is optional and may
1276 @param[in] Attributes The open mode of the protocol interface specified by Handle
1279 @retval EFI_SUCCESS An item was added to the open list for the protocol interface, and the
1280 protocol interface was returned in Interface.
1281 @retval EFI_UNSUPPORTED Handle does not support Protocol.
1282 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
1283 @retval EFI_ACCESS_DENIED Required attributes can't be supported in current environment.
1284 @retval EFI_ALREADY_STARTED Item on the open list already has requierd attributes whose agent
1285 handle is the same as AgentHandle.
1290 (EFIAPI
*EFI_OPEN_PROTOCOL
)(
1291 IN EFI_HANDLE Handle
,
1292 IN EFI_GUID
*Protocol
,
1293 OUT VOID
**Interface
, OPTIONAL
1294 IN EFI_HANDLE AgentHandle
,
1295 IN EFI_HANDLE ControllerHandle
,
1296 IN UINT32 Attributes
1301 Closes a protocol on a handle that was opened using OpenProtocol().
1303 @param[in] Handle The handle for the protocol interface that was previously opened
1304 with OpenProtocol(), and is now being closed.
1305 @param[in] Protocol The published unique identifier of the protocol.
1306 @param[in] AgentHandle The handle of the agent that is closing the protocol interface.
1307 @param[in] ControllerHandle If the agent that opened a protocol is a driver that follows the
1308 UEFI Driver Model, then this parameter is the controller handle
1309 that required the protocol interface.
1311 @retval EFI_SUCCESS The protocol instance was closed.
1312 @retval EFI_INVALID_PARAMETER 1) Handle is NULL.
1313 2) AgentHandle is NULL.
1314 3) ControllerHandle is not NULL and ControllerHandle is not a valid EFI_HANDLE.
1315 4) Protocol is NULL.
1316 @retval EFI_NOT_FOUND 1) Handle does not support the protocol specified by Protocol.
1317 2) The protocol interface specified by Handle and Protocol is not
1318 currently open by AgentHandle and ControllerHandle.
1323 (EFIAPI
*EFI_CLOSE_PROTOCOL
)(
1324 IN EFI_HANDLE Handle
,
1325 IN EFI_GUID
*Protocol
,
1326 IN EFI_HANDLE AgentHandle
,
1327 IN EFI_HANDLE ControllerHandle
1331 /// EFI Oprn Protocol Information Entry
1334 EFI_HANDLE AgentHandle
;
1335 EFI_HANDLE ControllerHandle
;
1338 } EFI_OPEN_PROTOCOL_INFORMATION_ENTRY
;
1341 Retrieves the list of agents that currently have a protocol interface opened.
1343 @param[in] Handle The handle for the protocol interface that is being queried.
1344 @param[in] Protocol The published unique identifier of the protocol.
1345 @param[out] EntryBuffer A pointer to a buffer of open protocol information in the form of
1346 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
1347 @param[out] EntryCount A pointer to the number of entries in EntryBuffer.
1349 @retval EFI_SUCCESS The open protocol information was returned in EntryBuffer, and the
1350 number of entries was returned EntryCount.
1351 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate EntryBuffer.
1352 @retval EFI_NOT_FOUND Handle does not support the protocol specified by Protocol.
1357 (EFIAPI
*EFI_OPEN_PROTOCOL_INFORMATION
)(
1358 IN EFI_HANDLE Handle
,
1359 IN EFI_GUID
*Protocol
,
1360 OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY
**EntryBuffer
,
1361 OUT UINTN
*EntryCount
1365 Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated
1368 @param[in] Handle The handle from which to retrieve the list of protocol interface
1370 @param[out] ProtocolBuffer A pointer to the list of protocol interface GUID pointers that are
1371 installed on Handle.
1372 @param[out] ProtocolBufferCount A pointer to the number of GUID pointers present in
1375 @retval EFI_SUCCESS The list of protocol interface GUIDs installed on Handle was returned in
1376 ProtocolBuffer. The number of protocol interface GUIDs was
1377 returned in ProtocolBufferCount.
1378 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.
1379 @retval EFI_INVALID_PARAMETER Handle is NULL.
1380 @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.
1381 @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.
1382 @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.
1387 (EFIAPI
*EFI_PROTOCOLS_PER_HANDLE
)(
1388 IN EFI_HANDLE Handle
,
1389 OUT EFI_GUID
***ProtocolBuffer
,
1390 OUT UINTN
*ProtocolBufferCount
1394 Creates an event that is to be signaled whenever an interface is installed for a specified protocol.
1396 @param[in] Protocol The numeric ID of the protocol for which the event is to be registered.
1397 @param[in] Event Event that is to be signaled whenever a protocol interface is registered
1399 @param[out] Registration A pointer to a memory location to receive the registration value.
1401 @retval EFI_SUCCESS The notification event has been registered.
1402 @retval EFI_OUT_OF_RESOURCES Space for the notification event could not be allocated.
1403 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1404 @retval EFI_INVALID_PARAMETER Event is NULL.
1405 @retval EFI_INVALID_PARAMETER Registration is NULL.
1410 (EFIAPI
*EFI_REGISTER_PROTOCOL_NOTIFY
)(
1411 IN EFI_GUID
*Protocol
,
1413 OUT VOID
**Registration
1417 /// Enumeration of EFI Locate Search Types
1421 /// Retrieve all the handles in the handle database.
1425 /// Retrieve the next handle fron a RegisterProtocolNotify() event.
1429 /// Retrieve the set of handles from the handle database that support a
1430 /// specified protocol.
1433 } EFI_LOCATE_SEARCH_TYPE
;
1436 Returns an array of handles that support a specified protocol.
1438 @param[in] SearchType Specifies which handle(s) are to be returned.
1439 @param[in] Protocol Specifies the protocol to search by.
1440 @param[in] SearchKey Specifies the search key.
1441 @param[in, out] BufferSize On input, the size in bytes of Buffer. On output, the size in bytes of
1442 the array returned in Buffer (if the buffer was large enough) or the
1443 size, in bytes, of the buffer needed to obtain the array (if the buffer was
1445 @param[out] Buffer The buffer in which the array is returned.
1447 @retval EFI_SUCCESS The array of handles was returned.
1448 @retval EFI_NOT_FOUND No handles match the search.
1449 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.
1450 @retval EFI_INVALID_PARAMETER SearchType is not a member of EFI_LOCATE_SEARCH_TYPE.
1451 @retval EFI_INVALID_PARAMETER SearchType is ByRegisterNotify and SearchKey is NULL.
1452 @retval EFI_INVALID_PARAMETER SearchType is ByProtocol and Protocol is NULL.
1453 @retval EFI_INVALID_PARAMETER One or more matches are found and BufferSize is NULL.
1454 @retval EFI_INVALID_PARAMETER BufferSize is large enough for the result and Buffer is NULL.
1459 (EFIAPI
*EFI_LOCATE_HANDLE
)(
1460 IN EFI_LOCATE_SEARCH_TYPE SearchType
,
1461 IN EFI_GUID
*Protocol
, OPTIONAL
1462 IN VOID
*SearchKey
, OPTIONAL
1463 IN OUT UINTN
*BufferSize
,
1464 OUT EFI_HANDLE
*Buffer
1468 Locates the handle to a device on the device path that supports the specified protocol.
1470 @param[in] Protocol Specifies the protocol to search for.
1471 @param[in, out] DevicePath On input, a pointer to a pointer to the device path. On output, the device
1472 path pointer is modified to point to the remaining part of the device
1474 @param[out] Device A pointer to the returned device handle.
1476 @retval EFI_SUCCESS The resulting handle was returned.
1477 @retval EFI_NOT_FOUND No handles match the search.
1478 @retval EFI_INVALID_PARAMETER Protocol is NULL.
1479 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
1480 @retval EFI_INVALID_PARAMETER A handle matched the search and Device is NULL.
1485 (EFIAPI
*EFI_LOCATE_DEVICE_PATH
)(
1486 IN EFI_GUID
*Protocol
,
1487 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
,
1488 OUT EFI_HANDLE
*Device
1492 Adds, updates, or removes a configuration table entry from the EFI System Table.
1494 @param[in] Guid A pointer to the GUID for the entry to add, update, or remove.
1495 @param[in] Table A pointer to the configuration table for the entry to add, update, or
1496 remove. May be NULL.
1498 @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.
1499 @retval EFI_NOT_FOUND An attempt was made to delete a nonexistent entry.
1500 @retval EFI_INVALID_PARAMETER Guid is NULL.
1501 @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.
1506 (EFIAPI
*EFI_INSTALL_CONFIGURATION_TABLE
)(
1512 Returns an array of handles that support the requested protocol in a buffer allocated from pool.
1514 @param[in] SearchType Specifies which handle(s) are to be returned.
1515 @param[in] Protocol Provides the protocol to search by.
1516 This parameter is only valid for a SearchType of ByProtocol.
1517 @param[in] SearchKey Supplies the search key depending on the SearchType.
1518 @param[in, out] NoHandles The number of handles returned in Buffer.
1519 @param[out] Buffer A pointer to the buffer to return the requested array of handles that
1522 @retval EFI_SUCCESS The array of handles was returned in Buffer, and the number of
1523 handles in Buffer was returned in NoHandles.
1524 @retval EFI_NOT_FOUND No handles match the search.
1525 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the matching results.
1526 @retval EFI_INVALID_PARAMETER NoHandles is NULL.
1527 @retval EFI_INVALID_PARAMETER Buffer is NULL.
1532 (EFIAPI
*EFI_LOCATE_HANDLE_BUFFER
)(
1533 IN EFI_LOCATE_SEARCH_TYPE SearchType
,
1534 IN EFI_GUID
*Protocol
, OPTIONAL
1535 IN VOID
*SearchKey
, OPTIONAL
1536 IN OUT UINTN
*NoHandles
,
1537 OUT EFI_HANDLE
**Buffer
1541 Returns the first protocol instance that matches the given protocol.
1543 @param[in] Protocol Provides the protocol to search for.
1544 @param[in] Registration Optional registration key returned from
1545 RegisterProtocolNotify().
1546 @param[out] Interface On return, a pointer to the first interface that matches Protocol and
1549 @retval EFI_SUCCESS A protocol instance matching Protocol was found and returned in
1551 @retval EFI_NOT_FOUND No protocol instances were found that match Protocol and
1553 @retval EFI_INVALID_PARAMETER Interface is NULL.
1558 (EFIAPI
*EFI_LOCATE_PROTOCOL
)(
1559 IN EFI_GUID
*Protocol
,
1560 IN VOID
*Registration
, OPTIONAL
1561 OUT VOID
**Interface
1565 /// EFI Capsule Block Descriptor
1569 /// Length in bytes of the data pointed to by DataBlock/ContinuationPointer.
1574 /// Physical address of the data block. This member of the union is
1575 /// used if Length is not equal to zero.
1577 EFI_PHYSICAL_ADDRESS DataBlock
;
1579 /// Physical address of another block of
1580 /// EFI_CAPSULE_BLOCK_DESCRIPTOR structures. This
1581 /// member of the union is used if Length is equal to zero. If
1582 /// ContinuationPointer is zero this entry represents the end of the list.
1584 EFI_PHYSICAL_ADDRESS ContinuationPointer
;
1586 } EFI_CAPSULE_BLOCK_DESCRIPTOR
;
1589 /// EFI Capsule Header.
1593 /// A GUID that defines the contents of a capsule.
1595 EFI_GUID CapsuleGuid
;
1597 /// The size of the capsule header. This may be larger than the size of
1598 /// the EFI_CAPSULE_HEADER since CapsuleGuid may imply
1599 /// extended header entries
1603 /// Bit-mapped list describing the capsule attributes. The Flag values
1604 /// of 0x0000 - 0xFFFF are defined by CapsuleGuid. Flag values
1605 /// of 0x10000 - 0xFFFFFFFF are defined by this specification
1609 /// Size in bytes of the capsule.
1611 UINT32 CapsuleImageSize
;
1612 } EFI_CAPSULE_HEADER
;
1615 /// The EFI System Table entry must point to an array of capsules
1616 /// that contain the same CapsuleGuid value. The array must be
1617 /// prefixed by a UINT32 that represents the size of the array of capsules.
1621 /// the size of the array of capsules.
1623 UINT32 CapsuleArrayNumber
;
1625 /// Point to an array of capsules that contain the same CapsuleGuid value.
1627 VOID
* CapsulePtr
[1];
1628 } EFI_CAPSULE_TABLE
;
1630 #define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000
1631 #define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000
1632 #define CAPSULE_FLAGS_INITIATE_RESET 0x00040000
1635 Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
1636 consumption, the firmware may process the capsule immediately. If the payload should persist
1637 across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must
1638 be passed into ResetSystem() and will cause the capsule to be processed by the firmware as
1639 part of the reset process.
1641 @param[in] CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
1642 being passed into update capsule.
1643 @param[in] CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in
1645 @param[in] ScatterGatherList Physical pointer to a set of
1646 EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the
1647 location in physical memory of a set of capsules.
1649 @retval EFI_SUCCESS Valid capsule was passed. If
1650 CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the
1651 capsule has been successfully processed by the firmware.
1652 @retval EFI_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were
1653 set in the capsule header.
1654 @retval EFI_INVALID_PARAMETER CapsuleCount is 0.
1655 @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error.
1656 @retval EFI_UNSUPPORTED The capsule type is not supported on this platform.
1657 @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has been previously called this error indicates the capsule
1658 is compatible with this platform but is not capable of being submitted or processed
1659 in runtime. The caller may resubmit the capsule prior to ExitBootServices().
1660 @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has not been previously called then this error indicates
1661 the capsule is compatible with this platform but there are insufficient resources to process.
1666 (EFIAPI
*EFI_UPDATE_CAPSULE
)(
1667 IN EFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
1668 IN UINTN CapsuleCount
,
1669 IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
1673 Returns if the capsule can be supported via UpdateCapsule().
1675 @param[in] CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
1676 being passed into update capsule.
1677 @param[in] CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in
1679 @param[out] MaxiumCapsuleSize On output the maximum size that UpdateCapsule() can
1680 support as an argument to UpdateCapsule() via
1681 CapsuleHeaderArray and ScatterGatherList.
1682 @param[out] ResetType Returns the type of reset required for the capsule update.
1684 @retval EFI_SUCCESS Valid answer returned.
1685 @retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and
1686 MaximumCapsuleSize and ResetType are undefined.
1687 @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.
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_QUERY_CAPSULE_CAPABILITIES
)(
1698 IN EFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
1699 IN UINTN CapsuleCount
,
1700 OUT UINT64
*MaximumCapsuleSize
,
1701 OUT EFI_RESET_TYPE
*ResetType
1705 Returns information about the EFI variables.
1707 @param[in] Attributes Attributes bitmask to specify the type of variables on
1708 which to return information.
1709 @param[out] MaximumVariableStorageSize On output the maximum size of the storage space
1710 available for the EFI variables associated with the
1711 attributes specified.
1712 @param[out] RemainingVariableStorageSize Returns the remaining size of the storage space
1713 available for the EFI variables associated with the
1714 attributes specified.
1715 @param[out] MaximumVariableSize Returns the maximum size of the individual EFI
1716 variables associated with the attributes specified.
1718 @retval EFI_SUCCESS Valid answer returned.
1719 @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied
1720 @retval EFI_UNSUPPORTED The attribute is not supported on this platform, and the
1721 MaximumVariableStorageSize,
1722 RemainingVariableStorageSize, MaximumVariableSize
1728 (EFIAPI
*EFI_QUERY_VARIABLE_INFO
)(
1729 IN UINT32 Attributes
,
1730 OUT UINT64
*MaximumVariableStorageSize
,
1731 OUT UINT64
*RemainingVariableStorageSize
,
1732 OUT UINT64
*MaximumVariableSize
1736 // Firmware should stop at a firmware user interface on next boot
1738 #define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001
1739 #define EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION 0x0000000000000002
1740 #define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004
1741 #define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED 0x0000000000000008
1742 #define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED 0x0000000000000010
1745 // EFI Runtime Services Table
1747 #define EFI_SYSTEM_TABLE_SIGNATURE SIGNATURE_64 ('I','B','I',' ','S','Y','S','T')
1748 #define EFI_2_50_SYSTEM_TABLE_REVISION ((2 << 16) | (50))
1749 #define EFI_2_40_SYSTEM_TABLE_REVISION ((2 << 16) | (40))
1750 #define EFI_2_31_SYSTEM_TABLE_REVISION ((2 << 16) | (31))
1751 #define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30))
1752 #define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20))
1753 #define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | (10))
1754 #define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00))
1755 #define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10))
1756 #define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02))
1757 #define EFI_SYSTEM_TABLE_REVISION EFI_2_50_SYSTEM_TABLE_REVISION
1758 #define EFI_SPECIFICATION_VERSION EFI_SYSTEM_TABLE_REVISION
1760 #define EFI_RUNTIME_SERVICES_SIGNATURE SIGNATURE_64 ('R','U','N','T','S','E','R','V')
1761 #define EFI_RUNTIME_SERVICES_REVISION EFI_SPECIFICATION_VERSION
1764 /// EFI Runtime Services Table.
1768 /// The table header for the EFI Runtime Services Table.
1770 EFI_TABLE_HEADER Hdr
;
1775 EFI_GET_TIME GetTime
;
1776 EFI_SET_TIME SetTime
;
1777 EFI_GET_WAKEUP_TIME GetWakeupTime
;
1778 EFI_SET_WAKEUP_TIME SetWakeupTime
;
1781 // Virtual Memory Services
1783 EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap
;
1784 EFI_CONVERT_POINTER ConvertPointer
;
1787 // Variable Services
1789 EFI_GET_VARIABLE GetVariable
;
1790 EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName
;
1791 EFI_SET_VARIABLE SetVariable
;
1794 // Miscellaneous Services
1796 EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount
;
1797 EFI_RESET_SYSTEM ResetSystem
;
1800 // UEFI 2.0 Capsule Services
1802 EFI_UPDATE_CAPSULE UpdateCapsule
;
1803 EFI_QUERY_CAPSULE_CAPABILITIES QueryCapsuleCapabilities
;
1806 // Miscellaneous UEFI 2.0 Service
1808 EFI_QUERY_VARIABLE_INFO QueryVariableInfo
;
1809 } EFI_RUNTIME_SERVICES
;
1812 #define EFI_BOOT_SERVICES_SIGNATURE SIGNATURE_64 ('B','O','O','T','S','E','R','V')
1813 #define EFI_BOOT_SERVICES_REVISION EFI_SPECIFICATION_VERSION
1816 /// EFI Boot Services Table.
1820 /// The table header for the EFI Boot Services Table.
1822 EFI_TABLE_HEADER Hdr
;
1825 // Task Priority Services
1827 EFI_RAISE_TPL RaiseTPL
;
1828 EFI_RESTORE_TPL RestoreTPL
;
1833 EFI_ALLOCATE_PAGES AllocatePages
;
1834 EFI_FREE_PAGES FreePages
;
1835 EFI_GET_MEMORY_MAP GetMemoryMap
;
1836 EFI_ALLOCATE_POOL AllocatePool
;
1837 EFI_FREE_POOL FreePool
;
1840 // Event & Timer Services
1842 EFI_CREATE_EVENT CreateEvent
;
1843 EFI_SET_TIMER SetTimer
;
1844 EFI_WAIT_FOR_EVENT WaitForEvent
;
1845 EFI_SIGNAL_EVENT SignalEvent
;
1846 EFI_CLOSE_EVENT CloseEvent
;
1847 EFI_CHECK_EVENT CheckEvent
;
1850 // Protocol Handler Services
1852 EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface
;
1853 EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface
;
1854 EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface
;
1855 EFI_HANDLE_PROTOCOL HandleProtocol
;
1857 EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify
;
1858 EFI_LOCATE_HANDLE LocateHandle
;
1859 EFI_LOCATE_DEVICE_PATH LocateDevicePath
;
1860 EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable
;
1865 EFI_IMAGE_LOAD LoadImage
;
1866 EFI_IMAGE_START StartImage
;
1868 EFI_IMAGE_UNLOAD UnloadImage
;
1869 EFI_EXIT_BOOT_SERVICES ExitBootServices
;
1872 // Miscellaneous Services
1874 EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount
;
1876 EFI_SET_WATCHDOG_TIMER SetWatchdogTimer
;
1879 // DriverSupport Services
1881 EFI_CONNECT_CONTROLLER ConnectController
;
1882 EFI_DISCONNECT_CONTROLLER DisconnectController
;
1885 // Open and Close Protocol Services
1887 EFI_OPEN_PROTOCOL OpenProtocol
;
1888 EFI_CLOSE_PROTOCOL CloseProtocol
;
1889 EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
;
1894 EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
;
1895 EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
;
1896 EFI_LOCATE_PROTOCOL LocateProtocol
;
1897 EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces
;
1898 EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces
;
1901 // 32-bit CRC Services
1903 EFI_CALCULATE_CRC32 CalculateCrc32
;
1906 // Miscellaneous Services
1908 EFI_COPY_MEM CopyMem
;
1910 EFI_CREATE_EVENT_EX CreateEventEx
;
1911 } EFI_BOOT_SERVICES
;
1914 /// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the
1915 /// EFI System Table.
1919 /// The 128-bit GUID value that uniquely identifies the system configuration table.
1921 EFI_GUID VendorGuid
;
1923 /// A pointer to the table associated with VendorGuid.
1926 } EFI_CONFIGURATION_TABLE
;
1929 /// EFI System Table
1933 /// The table header for the EFI System Table.
1935 EFI_TABLE_HEADER Hdr
;
1937 /// A pointer to a null terminated string that identifies the vendor
1938 /// that produces the system firmware for the platform.
1940 CHAR16
*FirmwareVendor
;
1942 /// A firmware vendor specific value that identifies the revision
1943 /// of the system firmware for the platform.
1945 UINT32 FirmwareRevision
;
1947 /// The handle for the active console input device. This handle must support
1948 /// EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.
1950 EFI_HANDLE ConsoleInHandle
;
1952 /// A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is
1953 /// associated with ConsoleInHandle.
1955 EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*ConIn
;
1957 /// The handle for the active console output device.
1959 EFI_HANDLE ConsoleOutHandle
;
1961 /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
1962 /// that is associated with ConsoleOutHandle.
1964 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*ConOut
;
1966 /// The handle for the active standard error console device.
1967 /// This handle must support the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
1969 EFI_HANDLE StandardErrorHandle
;
1971 /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
1972 /// that is associated with StandardErrorHandle.
1974 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*StdErr
;
1976 /// A pointer to the EFI Runtime Services Table.
1978 EFI_RUNTIME_SERVICES
*RuntimeServices
;
1980 /// A pointer to the EFI Boot Services Table.
1982 EFI_BOOT_SERVICES
*BootServices
;
1984 /// The number of system configuration tables in the buffer ConfigurationTable.
1986 UINTN NumberOfTableEntries
;
1988 /// A pointer to the system configuration tables.
1989 /// The number of entries in the table is NumberOfTableEntries.
1991 EFI_CONFIGURATION_TABLE
*ConfigurationTable
;
1995 This is the declaration of an EFI image entry point. This entry point is
1996 the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
1997 both device drivers and bus drivers.
1999 @param[in] ImageHandle The firmware allocated handle for the UEFI image.
2000 @param[in] SystemTable A pointer to the EFI System Table.
2002 @retval EFI_SUCCESS The operation completed successfully.
2003 @retval Others An unexpected error occurred.
2007 (EFIAPI
*EFI_IMAGE_ENTRY_POINT
)(
2008 IN EFI_HANDLE ImageHandle
,
2009 IN EFI_SYSTEM_TABLE
*SystemTable
2013 // EFI Load Option. This data structure describes format of UEFI boot option variables.
2015 // NOTE: EFI Load Option is a byte packed buffer of variable length fields.
2016 // The first two fields have fixed length. They are declared as members of the
2017 // EFI_LOAD_OPTION structure. All the other fields are variable length fields.
2018 // They are listed in the comment block below for reference purposes.
2021 typedef struct _EFI_LOAD_OPTION
{
2023 /// The attributes for this load option entry. All unused bits must be zero
2024 /// and are reserved by the UEFI specification for future growth.
2028 /// Length in bytes of the FilePathList. OptionalData starts at offset
2029 /// sizeof(UINT32) + sizeof(UINT16) + StrSize(Description) + FilePathListLength
2030 /// of the EFI_LOAD_OPTION descriptor.
2032 UINT16 FilePathListLength
;
2034 /// The user readable description for the load option.
2035 /// This field ends with a Null character.
2037 // CHAR16 Description[];
2039 /// A packed array of UEFI device paths. The first element of the array is a
2040 /// device path that describes the device and location of the Image for this
2041 /// load option. The FilePathList[0] is specific to the device type. Other
2042 /// device paths may optionally exist in the FilePathList, but their usage is
2043 /// OSV specific. Each element in the array is variable length, and ends at
2044 /// the device path end structure. Because the size of Description is
2045 /// arbitrary, this data structure is not guaranteed to be aligned on a
2046 /// natural boundary. This data structure may have to be copied to an aligned
2047 /// natural boundary before it is used.
2049 // EFI_DEVICE_PATH_PROTOCOL FilePathList[];
2051 /// The remaining bytes in the load option descriptor are a binary data buffer
2052 /// that is passed to the loaded image. If the field is zero bytes long, a
2053 /// NULL pointer is passed to the loaded image. The number of bytes in
2054 /// OptionalData can be computed by subtracting the starting offset of
2055 /// OptionalData from total size in bytes of the EFI_LOAD_OPTION.
2057 // UINT8 OptionalData[];
2062 // EFI Load Options Attributes
2064 #define LOAD_OPTION_ACTIVE 0x00000001
2065 #define LOAD_OPTION_FORCE_RECONNECT 0x00000002
2066 #define LOAD_OPTION_HIDDEN 0x00000008
2067 #define LOAD_OPTION_CATEGORY 0x00001F00
2069 #define LOAD_OPTION_CATEGORY_BOOT 0x00000000
2070 #define LOAD_OPTION_CATEGORY_APP 0x00000100
2072 #define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001
2073 #define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002
2074 #define EFI_BOOT_OPTION_SUPPORT_SYSPREP 0x00000010
2075 #define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300
2078 /// EFI Boot Key Data
2083 /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
2085 UINT32 Revision
: 8;
2087 /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
2089 UINT32 ShiftPressed
: 1;
2091 /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
2093 UINT32 ControlPressed
: 1;
2095 /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
2097 UINT32 AltPressed
: 1;
2099 /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
2101 UINT32 LogoPressed
: 1;
2103 /// The Menu key must be pressed (1) or must not be pressed (0).
2105 UINT32 MenuPressed
: 1;
2107 /// The SysReq key must be pressed (1) or must not be pressed (0).
2109 UINT32 SysReqPressed
: 1;
2110 UINT32 Reserved
: 16;
2112 /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
2113 /// zero, then only the shift state is considered. If more than one, then the boot option will
2114 /// only be launched if all of the specified keys are pressed with the same shift state.
2116 UINT32 InputKeyCount
: 2;
2119 } EFI_BOOT_KEY_DATA
;
2127 /// Specifies options about how the key will be processed.
2129 EFI_BOOT_KEY_DATA KeyData
;
2131 /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to
2132 /// which BootOption refers. If the CRC-32s do not match this value, then this key
2133 /// option is ignored.
2135 UINT32 BootOptionCrc
;
2137 /// The Boot#### option which will be invoked if this key is pressed and the boot option
2138 /// is active (LOAD_OPTION_ACTIVE is set).
2142 /// The key codes to compare against those returned by the
2143 /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.
2144 /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.
2146 //EFI_INPUT_KEY Keys[];
2151 // EFI File location to boot from on removable media devices
2153 #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI"
2154 #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI"
2155 #define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI"
2156 #define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM L"\\EFI\\BOOT\\BOOTARM.EFI"
2157 #define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI"
2159 #if defined (MDE_CPU_IA32)
2160 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
2161 #elif defined (MDE_CPU_IPF)
2162 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA64
2163 #elif defined (MDE_CPU_X64)
2164 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64
2165 #elif defined (MDE_CPU_EBC)
2166 #elif defined (MDE_CPU_ARM)
2167 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
2168 #elif defined (MDE_CPU_AARCH64)
2169 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
2171 #error Unknown Processor Type
2174 #include <Uefi/UefiPxe.h>
2175 #include <Uefi/UefiGpt.h>
2176 #include <Uefi/UefiInternalFormRepresentation.h>