xref: /freebsd/sys/contrib/edk2/Include/Uefi/UefiSpec.h (revision 580fcf642ea2d5a1e60f24947d1c2e97007e44e9)
10d1ba665SWarner Losh /** @file
20d1ba665SWarner Losh   Include file that supports UEFI.
30d1ba665SWarner Losh 
43245fa21SMitchell Horne   This include file must contain things defined in the UEFI 2.7 specification.
53245fa21SMitchell Horne   If a code construct is defined in the UEFI 2.7 specification it must be included
60d1ba665SWarner Losh   by this include file.
70d1ba665SWarner Losh 
8*580fcf64SWarner Losh Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
93245fa21SMitchell Horne Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
10*580fcf64SWarner Losh Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
110d1ba665SWarner Losh 
123245fa21SMitchell Horne SPDX-License-Identifier: BSD-2-Clause-Patent
130d1ba665SWarner Losh 
140d1ba665SWarner Losh **/
150d1ba665SWarner Losh 
160d1ba665SWarner Losh #ifndef __UEFI_SPEC_H__
170d1ba665SWarner Losh #define __UEFI_SPEC_H__
180d1ba665SWarner Losh 
190d1ba665SWarner Losh #include <Uefi/UefiMultiPhase.h>
200d1ba665SWarner Losh 
210d1ba665SWarner Losh #include <Protocol/DevicePath.h>
220d1ba665SWarner Losh #include <Protocol/SimpleTextIn.h>
230d1ba665SWarner Losh #include <Protocol/SimpleTextInEx.h>
240d1ba665SWarner Losh #include <Protocol/SimpleTextOut.h>
250d1ba665SWarner Losh 
260d1ba665SWarner Losh ///
270d1ba665SWarner Losh /// Enumeration of EFI memory allocation types.
280d1ba665SWarner Losh ///
290d1ba665SWarner Losh typedef enum {
300d1ba665SWarner Losh   ///
310d1ba665SWarner Losh   /// Allocate any available range of pages that satisfies the request.
320d1ba665SWarner Losh   ///
330d1ba665SWarner Losh   AllocateAnyPages,
340d1ba665SWarner Losh   ///
350d1ba665SWarner Losh   /// Allocate any available range of pages whose uppermost address is less than
360d1ba665SWarner Losh   /// or equal to a specified maximum address.
370d1ba665SWarner Losh   ///
380d1ba665SWarner Losh   AllocateMaxAddress,
390d1ba665SWarner Losh   ///
400d1ba665SWarner Losh   /// Allocate pages at a specified address.
410d1ba665SWarner Losh   ///
420d1ba665SWarner Losh   AllocateAddress,
430d1ba665SWarner Losh   ///
440d1ba665SWarner Losh   /// Maximum enumeration value that may be used for bounds checking.
450d1ba665SWarner Losh   ///
460d1ba665SWarner Losh   MaxAllocateType
470d1ba665SWarner Losh } EFI_ALLOCATE_TYPE;
480d1ba665SWarner Losh 
490d1ba665SWarner Losh //
500d1ba665SWarner Losh // Bit definitions for EFI_TIME.Daylight
510d1ba665SWarner Losh //
520d1ba665SWarner Losh #define EFI_TIME_ADJUST_DAYLIGHT  0x01
530d1ba665SWarner Losh #define EFI_TIME_IN_DAYLIGHT      0x02
540d1ba665SWarner Losh 
550d1ba665SWarner Losh ///
560d1ba665SWarner Losh /// Value definition for EFI_TIME.TimeZone.
570d1ba665SWarner Losh ///
580d1ba665SWarner Losh #define EFI_UNSPECIFIED_TIMEZONE  0x07FF
590d1ba665SWarner Losh 
600d1ba665SWarner Losh //
610d1ba665SWarner Losh // Memory cacheability attributes
620d1ba665SWarner Losh //
630d1ba665SWarner Losh #define EFI_MEMORY_UC   0x0000000000000001ULL
640d1ba665SWarner Losh #define EFI_MEMORY_WC   0x0000000000000002ULL
650d1ba665SWarner Losh #define EFI_MEMORY_WT   0x0000000000000004ULL
660d1ba665SWarner Losh #define EFI_MEMORY_WB   0x0000000000000008ULL
670d1ba665SWarner Losh #define EFI_MEMORY_UCE  0x0000000000000010ULL
680d1ba665SWarner Losh //
690d1ba665SWarner Losh // Physical memory protection attributes
700d1ba665SWarner Losh //
710d1ba665SWarner Losh // Note: UEFI spec 2.5 and following: use EFI_MEMORY_RO as write-protected physical memory
720d1ba665SWarner Losh // protection attribute. Also, EFI_MEMORY_WP means cacheability attribute.
730d1ba665SWarner Losh //
740d1ba665SWarner Losh #define EFI_MEMORY_WP  0x0000000000001000ULL
750d1ba665SWarner Losh #define EFI_MEMORY_RP  0x0000000000002000ULL
760d1ba665SWarner Losh #define EFI_MEMORY_XP  0x0000000000004000ULL
770d1ba665SWarner Losh #define EFI_MEMORY_RO  0x0000000000020000ULL
780d1ba665SWarner Losh //
790d1ba665SWarner Losh // Physical memory persistence attribute.
800d1ba665SWarner Losh // The memory region supports byte-addressable non-volatility.
810d1ba665SWarner Losh //
820d1ba665SWarner Losh #define EFI_MEMORY_NV  0x0000000000008000ULL
830d1ba665SWarner Losh //
840d1ba665SWarner Losh // The memory region provides higher reliability relative to other memory in the system.
850d1ba665SWarner Losh // If all memory has the same reliability, then this bit is not used.
860d1ba665SWarner Losh //
870d1ba665SWarner Losh #define EFI_MEMORY_MORE_RELIABLE  0x0000000000010000ULL
883245fa21SMitchell Horne 
893245fa21SMitchell Horne //
903245fa21SMitchell Horne // Note: UEFI spec 2.8 and following:
913245fa21SMitchell Horne //
923245fa21SMitchell Horne // Specific-purpose memory (SPM). The memory is earmarked for
933245fa21SMitchell Horne // specific purposes such as for specific device drivers or applications.
943245fa21SMitchell Horne // The SPM attribute serves as a hint to the OS to avoid allocating this
953245fa21SMitchell Horne // memory for core OS data or code that can not be relocated.
963245fa21SMitchell Horne //
973245fa21SMitchell Horne #define EFI_MEMORY_SP  0x0000000000040000ULL
983245fa21SMitchell Horne //
993245fa21SMitchell Horne // If this flag is set, the memory region is capable of being
100*580fcf64SWarner Losh // protected with the CPU's memory cryptographic
1013245fa21SMitchell Horne // capabilities. If this flag is clear, the memory region is not
102*580fcf64SWarner Losh // capable of being protected with the CPU's memory
1033245fa21SMitchell Horne // cryptographic capabilities or the CPU does not support CPU
1043245fa21SMitchell Horne // memory cryptographic capabilities.
1053245fa21SMitchell Horne //
1063245fa21SMitchell Horne #define EFI_MEMORY_CPU_CRYPTO  0x0000000000080000ULL
1073245fa21SMitchell Horne 
1080d1ba665SWarner Losh //
109*580fcf64SWarner Losh // If this flag is set, the memory region is present and capable of having
110*580fcf64SWarner Losh // memory dynamically removed from the platform. This attribute serves as
111*580fcf64SWarner Losh // a hint to the OS prior to its ACPI subsystem initialization to avoid
112*580fcf64SWarner Losh // allocating this memory for core OS data or code that cannot be dynamically
113*580fcf64SWarner Losh // relocated at runtime. If this flag is clear, the memory region is not
114*580fcf64SWarner Losh // capable of being dynamically removed from the platform at runtime.
115*580fcf64SWarner Losh //
116*580fcf64SWarner Losh #define EFI_MEMORY_HOT_PLUGGABLE  0x0000000000100000
117*580fcf64SWarner Losh 
118*580fcf64SWarner Losh //
1190d1ba665SWarner Losh // Runtime memory attribute
1200d1ba665SWarner Losh //
1210d1ba665SWarner Losh #define EFI_MEMORY_RUNTIME  0x8000000000000000ULL
1220d1ba665SWarner Losh 
123*580fcf64SWarner Losh //
124*580fcf64SWarner Losh // If this flag is set, the memory region is
125*580fcf64SWarner Losh // described with additional ISA-specific memory attributes
126*580fcf64SWarner Losh // as specified in EFI_MEMORY_ISA_MASK.
127*580fcf64SWarner Losh //
128*580fcf64SWarner Losh #define EFI_MEMORY_ISA_VALID  0x4000000000000000ULL
129*580fcf64SWarner Losh 
130*580fcf64SWarner Losh //
131*580fcf64SWarner Losh // Defines the bits reserved for describing optional ISA-specific cacheability
132*580fcf64SWarner Losh // attributes that are not covered by the standard UEFI Memory Attributes cacheability
133*580fcf64SWarner Losh // bits (EFI_MEMORY_UC, EFI_MEMORY_WC, EFI_MEMORY_WT, EFI_MEMORY_WB and EFI_MEMORY_UCE).
134*580fcf64SWarner Losh // See Calling Conventions for further ISA-specific enumeration of these bits.
135*580fcf64SWarner Losh //
136*580fcf64SWarner Losh #define EFI_MEMORY_ISA_MASK  0x0FFFF00000000000ULL
137*580fcf64SWarner Losh 
138*580fcf64SWarner Losh //
139*580fcf64SWarner Losh // Attributes bitmasks, grouped by type
140*580fcf64SWarner Losh //
141*580fcf64SWarner Losh #define EFI_CACHE_ATTRIBUTE_MASK   (EFI_MEMORY_UC | EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_MEMORY_WB | EFI_MEMORY_UCE | EFI_MEMORY_WP)
142*580fcf64SWarner Losh #define EFI_MEMORY_ACCESS_MASK     (EFI_MEMORY_RP | EFI_MEMORY_XP | EFI_MEMORY_RO)
143*580fcf64SWarner Losh #define EFI_MEMORY_ATTRIBUTE_MASK  (EFI_MEMORY_ACCESS_MASK | EFI_MEMORY_SP | EFI_MEMORY_CPU_CRYPTO)
144*580fcf64SWarner Losh 
1450d1ba665SWarner Losh ///
1460d1ba665SWarner Losh /// Memory descriptor version number.
1470d1ba665SWarner Losh ///
1480d1ba665SWarner Losh #define EFI_MEMORY_DESCRIPTOR_VERSION  1
1490d1ba665SWarner Losh 
1500d1ba665SWarner Losh ///
1510d1ba665SWarner Losh /// Definition of an EFI memory descriptor.
1520d1ba665SWarner Losh ///
1530d1ba665SWarner Losh typedef struct {
1540d1ba665SWarner Losh   ///
1553245fa21SMitchell Horne   /// Type of the memory region.
1563245fa21SMitchell Horne   /// Type EFI_MEMORY_TYPE is defined in the
1573245fa21SMitchell Horne   /// AllocatePages() function description.
1580d1ba665SWarner Losh   ///
1590d1ba665SWarner Losh   UINT32                  Type;
1600d1ba665SWarner Losh   ///
1613245fa21SMitchell Horne   /// Physical address of the first byte in the memory region. PhysicalStart must be
1623245fa21SMitchell Horne   /// aligned on a 4 KiB boundary, and must not be above 0xfffffffffffff000. Type
1633245fa21SMitchell Horne   /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function description
1640d1ba665SWarner Losh   ///
1650d1ba665SWarner Losh   EFI_PHYSICAL_ADDRESS    PhysicalStart;
1660d1ba665SWarner Losh   ///
1673245fa21SMitchell Horne   /// Virtual address of the first byte in the memory region.
1683245fa21SMitchell Horne   /// VirtualStart must be aligned on a 4 KiB boundary,
1693245fa21SMitchell Horne   /// and must not be above 0xfffffffffffff000.
1700d1ba665SWarner Losh   ///
1710d1ba665SWarner Losh   EFI_VIRTUAL_ADDRESS     VirtualStart;
1720d1ba665SWarner Losh   ///
1733245fa21SMitchell Horne   /// NumberOfPagesNumber of 4 KiB pages in the memory region.
1743245fa21SMitchell Horne   /// NumberOfPages must not be 0, and must not be any value
1753245fa21SMitchell Horne   /// that would represent a memory page with a start address,
1763245fa21SMitchell Horne   /// either physical or virtual, above 0xfffffffffffff000.
1770d1ba665SWarner Losh   ///
1780d1ba665SWarner Losh   UINT64                  NumberOfPages;
1790d1ba665SWarner Losh   ///
1800d1ba665SWarner Losh   /// Attributes of the memory region that describe the bit mask of capabilities
1810d1ba665SWarner Losh   /// for that memory region, and not necessarily the current settings for that
1820d1ba665SWarner Losh   /// memory region.
1830d1ba665SWarner Losh   ///
1840d1ba665SWarner Losh   UINT64                  Attribute;
1850d1ba665SWarner Losh } EFI_MEMORY_DESCRIPTOR;
1860d1ba665SWarner Losh 
1870d1ba665SWarner Losh /**
1880d1ba665SWarner Losh   Allocates memory pages from the system.
1890d1ba665SWarner Losh 
1900d1ba665SWarner Losh   @param[in]       Type         The type of allocation to perform.
1910d1ba665SWarner Losh   @param[in]       MemoryType   The type of memory to allocate.
1920d1ba665SWarner Losh                                 MemoryType values in the range 0x70000000..0x7FFFFFFF
1930d1ba665SWarner Losh                                 are reserved for OEM use. MemoryType values in the range
1940d1ba665SWarner Losh                                 0x80000000..0xFFFFFFFF are reserved for use by UEFI OS loaders
1950d1ba665SWarner Losh                                 that are provided by operating system vendors.
1960d1ba665SWarner Losh   @param[in]       Pages        The number of contiguous 4 KB pages to allocate.
1970d1ba665SWarner Losh   @param[in, out]  Memory       The pointer to a physical address. On input, the way in which the address is
1980d1ba665SWarner Losh                                 used depends on the value of Type.
1990d1ba665SWarner Losh 
2000d1ba665SWarner Losh   @retval EFI_SUCCESS           The requested pages were allocated.
2010d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER 1) Type is not AllocateAnyPages or
2020d1ba665SWarner Losh                                 AllocateMaxAddress or AllocateAddress.
2030d1ba665SWarner Losh                                 2) MemoryType is in the range
2040d1ba665SWarner Losh                                 EfiMaxMemoryType..0x6FFFFFFF.
2050d1ba665SWarner Losh                                 3) Memory is NULL.
2060d1ba665SWarner Losh                                 4) MemoryType is EfiPersistentMemory.
2070d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  The pages could not be allocated.
2080d1ba665SWarner Losh   @retval EFI_NOT_FOUND         The requested pages could not be found.
2090d1ba665SWarner Losh 
2100d1ba665SWarner Losh **/
2110d1ba665SWarner Losh typedef
2120d1ba665SWarner Losh EFI_STATUS
2130d1ba665SWarner Losh (EFIAPI *EFI_ALLOCATE_PAGES)(
2140d1ba665SWarner Losh   IN     EFI_ALLOCATE_TYPE            Type,
2150d1ba665SWarner Losh   IN     EFI_MEMORY_TYPE              MemoryType,
2160d1ba665SWarner Losh   IN     UINTN                        Pages,
2170d1ba665SWarner Losh   IN OUT EFI_PHYSICAL_ADDRESS         *Memory
2180d1ba665SWarner Losh   );
2190d1ba665SWarner Losh 
2200d1ba665SWarner Losh /**
2210d1ba665SWarner Losh   Frees memory pages.
2220d1ba665SWarner Losh 
2230d1ba665SWarner Losh   @param[in]  Memory      The base physical address of the pages to be freed.
2240d1ba665SWarner Losh   @param[in]  Pages       The number of contiguous 4 KB pages to free.
2250d1ba665SWarner Losh 
2260d1ba665SWarner Losh   @retval EFI_SUCCESS           The requested pages were freed.
2270d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.
2280d1ba665SWarner Losh   @retval EFI_NOT_FOUND         The requested memory pages were not allocated with
2290d1ba665SWarner Losh                                 AllocatePages().
2300d1ba665SWarner Losh 
2310d1ba665SWarner Losh **/
2320d1ba665SWarner Losh typedef
2330d1ba665SWarner Losh EFI_STATUS
2340d1ba665SWarner Losh (EFIAPI *EFI_FREE_PAGES)(
2350d1ba665SWarner Losh   IN  EFI_PHYSICAL_ADDRESS         Memory,
2360d1ba665SWarner Losh   IN  UINTN                        Pages
2370d1ba665SWarner Losh   );
2380d1ba665SWarner Losh 
2390d1ba665SWarner Losh /**
2400d1ba665SWarner Losh   Returns the current memory map.
2410d1ba665SWarner Losh 
2420d1ba665SWarner Losh   @param[in, out]  MemoryMapSize         A pointer to the size, in bytes, of the MemoryMap buffer.
2430d1ba665SWarner Losh                                          On input, this is the size of the buffer allocated by the caller.
2440d1ba665SWarner Losh                                          On output, it is the size of the buffer returned by the firmware if
2450d1ba665SWarner Losh                                          the buffer was large enough, or the size of the buffer needed to contain
2460d1ba665SWarner Losh                                          the map if the buffer was too small.
2473245fa21SMitchell Horne   @param[out]      MemoryMap             A pointer to the buffer in which firmware places the current memory
2480d1ba665SWarner Losh                                          map.
2490d1ba665SWarner Losh   @param[out]      MapKey                A pointer to the location in which firmware returns the key for the
2500d1ba665SWarner Losh                                          current memory map.
2510d1ba665SWarner Losh   @param[out]      DescriptorSize        A pointer to the location in which firmware returns the size, in bytes, of
2520d1ba665SWarner Losh                                          an individual EFI_MEMORY_DESCRIPTOR.
2530d1ba665SWarner Losh   @param[out]      DescriptorVersion     A pointer to the location in which firmware returns the version number
2540d1ba665SWarner Losh                                          associated with the EFI_MEMORY_DESCRIPTOR.
2550d1ba665SWarner Losh 
2560d1ba665SWarner Losh   @retval EFI_SUCCESS           The memory map was returned in the MemoryMap buffer.
2570d1ba665SWarner Losh   @retval EFI_BUFFER_TOO_SMALL  The MemoryMap buffer was too small. The current buffer size
2580d1ba665SWarner Losh                                 needed to hold the memory map is returned in MemoryMapSize.
2590d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER 1) MemoryMapSize is NULL.
2600d1ba665SWarner Losh                                 2) The MemoryMap buffer is not too small and MemoryMap is
2610d1ba665SWarner Losh                                    NULL.
2620d1ba665SWarner Losh 
2630d1ba665SWarner Losh **/
2640d1ba665SWarner Losh typedef
2650d1ba665SWarner Losh EFI_STATUS
2660d1ba665SWarner Losh (EFIAPI *EFI_GET_MEMORY_MAP)(
2670d1ba665SWarner Losh   IN OUT UINTN                       *MemoryMapSize,
2683245fa21SMitchell Horne   OUT    EFI_MEMORY_DESCRIPTOR       *MemoryMap,
2690d1ba665SWarner Losh   OUT    UINTN                       *MapKey,
2700d1ba665SWarner Losh   OUT    UINTN                       *DescriptorSize,
2710d1ba665SWarner Losh   OUT    UINT32                      *DescriptorVersion
2720d1ba665SWarner Losh   );
2730d1ba665SWarner Losh 
2740d1ba665SWarner Losh /**
2750d1ba665SWarner Losh   Allocates pool memory.
2760d1ba665SWarner Losh 
2770d1ba665SWarner Losh   @param[in]   PoolType         The type of pool to allocate.
2780d1ba665SWarner Losh                                 MemoryType values in the range 0x70000000..0x7FFFFFFF
2790d1ba665SWarner Losh                                 are reserved for OEM use. MemoryType values in the range
2800d1ba665SWarner Losh                                 0x80000000..0xFFFFFFFF are reserved for use by UEFI OS loaders
2810d1ba665SWarner Losh                                 that are provided by operating system vendors.
2820d1ba665SWarner Losh   @param[in]   Size             The number of bytes to allocate from the pool.
2830d1ba665SWarner Losh   @param[out]  Buffer           A pointer to a pointer to the allocated buffer if the call succeeds;
2840d1ba665SWarner Losh                                 undefined otherwise.
2850d1ba665SWarner Losh 
2860d1ba665SWarner Losh   @retval EFI_SUCCESS           The requested number of bytes was allocated.
2870d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  The pool requested could not be allocated.
2880d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Buffer is NULL.
2890d1ba665SWarner Losh                                 PoolType is in the range EfiMaxMemoryType..0x6FFFFFFF.
2900d1ba665SWarner Losh                                 PoolType is EfiPersistentMemory.
2910d1ba665SWarner Losh 
2920d1ba665SWarner Losh **/
2930d1ba665SWarner Losh typedef
2940d1ba665SWarner Losh EFI_STATUS
2950d1ba665SWarner Losh (EFIAPI *EFI_ALLOCATE_POOL)(
2960d1ba665SWarner Losh   IN  EFI_MEMORY_TYPE              PoolType,
2970d1ba665SWarner Losh   IN  UINTN                        Size,
2980d1ba665SWarner Losh   OUT VOID                         **Buffer
2990d1ba665SWarner Losh   );
3000d1ba665SWarner Losh 
3010d1ba665SWarner Losh /**
3020d1ba665SWarner Losh   Returns pool memory to the system.
3030d1ba665SWarner Losh 
3040d1ba665SWarner Losh   @param[in]  Buffer            The pointer to the buffer to free.
3050d1ba665SWarner Losh 
3060d1ba665SWarner Losh   @retval EFI_SUCCESS           The memory was returned to the system.
3070d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Buffer was invalid.
3080d1ba665SWarner Losh 
3090d1ba665SWarner Losh **/
3100d1ba665SWarner Losh typedef
3110d1ba665SWarner Losh EFI_STATUS
3120d1ba665SWarner Losh (EFIAPI *EFI_FREE_POOL)(
3130d1ba665SWarner Losh   IN  VOID                         *Buffer
3140d1ba665SWarner Losh   );
3150d1ba665SWarner Losh 
3160d1ba665SWarner Losh /**
3170d1ba665SWarner Losh   Changes the runtime addressing mode of EFI firmware from physical to virtual.
3180d1ba665SWarner Losh 
3190d1ba665SWarner Losh   @param[in]  MemoryMapSize     The size in bytes of VirtualMap.
3200d1ba665SWarner Losh   @param[in]  DescriptorSize    The size in bytes of an entry in the VirtualMap.
3210d1ba665SWarner Losh   @param[in]  DescriptorVersion The version of the structure entries in VirtualMap.
3220d1ba665SWarner Losh   @param[in]  VirtualMap        An array of memory descriptors which contain new virtual
3230d1ba665SWarner Losh                                 address mapping information for all runtime ranges.
3240d1ba665SWarner Losh 
3250d1ba665SWarner Losh   @retval EFI_SUCCESS           The virtual address map has been applied.
3260d1ba665SWarner Losh   @retval EFI_UNSUPPORTED       EFI firmware is not at runtime, or the EFI firmware is already in
3270d1ba665SWarner Losh                                 virtual address mapped mode.
3280d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.
3290d1ba665SWarner Losh   @retval EFI_NO_MAPPING        A virtual address was not supplied for a range in the memory
3300d1ba665SWarner Losh                                 map that requires a mapping.
3310d1ba665SWarner Losh   @retval EFI_NOT_FOUND         A virtual address was supplied for an address that is not found
3320d1ba665SWarner Losh                                 in the memory map.
333*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
334*580fcf64SWarner Losh                                 The platform should describe this runtime service as unsupported at runtime
335*580fcf64SWarner Losh                                 via an EFI_RT_PROPERTIES_TABLE configuration table.
3360d1ba665SWarner Losh 
3370d1ba665SWarner Losh **/
3380d1ba665SWarner Losh typedef
3390d1ba665SWarner Losh EFI_STATUS
3400d1ba665SWarner Losh (EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP)(
3410d1ba665SWarner Losh   IN  UINTN                        MemoryMapSize,
3420d1ba665SWarner Losh   IN  UINTN                        DescriptorSize,
3430d1ba665SWarner Losh   IN  UINT32                       DescriptorVersion,
3440d1ba665SWarner Losh   IN  EFI_MEMORY_DESCRIPTOR        *VirtualMap
3450d1ba665SWarner Losh   );
3460d1ba665SWarner Losh 
3470d1ba665SWarner Losh /**
3480d1ba665SWarner Losh   Connects one or more drivers to a controller.
3490d1ba665SWarner Losh 
3500d1ba665SWarner Losh   @param[in]  ControllerHandle      The handle of the controller to which driver(s) are to be connected.
3510d1ba665SWarner Losh   @param[in]  DriverImageHandle     A pointer to an ordered list handles that support the
3520d1ba665SWarner Losh                                     EFI_DRIVER_BINDING_PROTOCOL.
3530d1ba665SWarner Losh   @param[in]  RemainingDevicePath   A pointer to the device path that specifies a child of the
3540d1ba665SWarner Losh                                     controller specified by ControllerHandle.
3550d1ba665SWarner Losh   @param[in]  Recursive             If TRUE, then ConnectController() is called recursively
3560d1ba665SWarner Losh                                     until the entire tree of controllers below the controller specified
3570d1ba665SWarner Losh                                     by ControllerHandle have been created. If FALSE, then
3580d1ba665SWarner Losh                                     the tree of controllers is only expanded one level.
3590d1ba665SWarner Losh 
3600d1ba665SWarner Losh   @retval EFI_SUCCESS           1) One or more drivers were connected to ControllerHandle.
3610d1ba665SWarner Losh                                 2) No drivers were connected to ControllerHandle, but
3620d1ba665SWarner Losh                                 RemainingDevicePath is not NULL, and it is an End Device
3630d1ba665SWarner Losh                                 Path Node.
3640d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
3650d1ba665SWarner Losh   @retval EFI_NOT_FOUND         1) There are no EFI_DRIVER_BINDING_PROTOCOL instances
3660d1ba665SWarner Losh                                 present in the system.
3670d1ba665SWarner Losh                                 2) No drivers were connected to ControllerHandle.
3680d1ba665SWarner Losh   @retval EFI_SECURITY_VIOLATION
3690d1ba665SWarner Losh                                 The user has no permission to start UEFI device drivers on the device path
3700d1ba665SWarner Losh                                 associated with the ControllerHandle or specified by the RemainingDevicePath.
3710d1ba665SWarner Losh **/
3720d1ba665SWarner Losh typedef
3730d1ba665SWarner Losh EFI_STATUS
3740d1ba665SWarner Losh (EFIAPI *EFI_CONNECT_CONTROLLER)(
3750d1ba665SWarner Losh   IN  EFI_HANDLE                    ControllerHandle,
376*580fcf64SWarner Losh   IN  EFI_HANDLE                    *DriverImageHandle    OPTIONAL,
377*580fcf64SWarner Losh   IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath  OPTIONAL,
3780d1ba665SWarner Losh   IN  BOOLEAN                       Recursive
3790d1ba665SWarner Losh   );
3800d1ba665SWarner Losh 
3810d1ba665SWarner Losh /**
3820d1ba665SWarner Losh   Disconnects one or more drivers from a controller.
3830d1ba665SWarner Losh 
3840d1ba665SWarner Losh   @param[in]  ControllerHandle      The handle of the controller from which driver(s) are to be disconnected.
3850d1ba665SWarner Losh   @param[in]  DriverImageHandle     The driver to disconnect from ControllerHandle.
3860d1ba665SWarner Losh                                     If DriverImageHandle is NULL, then all the drivers currently managing
3870d1ba665SWarner Losh                                     ControllerHandle are disconnected from ControllerHandle.
3880d1ba665SWarner Losh   @param[in]  ChildHandle           The handle of the child to destroy.
3890d1ba665SWarner Losh                                     If ChildHandle is NULL, then all the children of ControllerHandle are
3900d1ba665SWarner Losh                                     destroyed before the drivers are disconnected from ControllerHandle.
3910d1ba665SWarner Losh 
3920d1ba665SWarner Losh   @retval EFI_SUCCESS           1) One or more drivers were disconnected from the controller.
3930d1ba665SWarner Losh                                 2) On entry, no drivers are managing ControllerHandle.
3940d1ba665SWarner Losh                                 3) DriverImageHandle is not NULL, and on entry
3950d1ba665SWarner Losh                                    DriverImageHandle is not managing ControllerHandle.
3960d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER 1) ControllerHandle is NULL.
3970d1ba665SWarner Losh                                 2) DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.
3980d1ba665SWarner Losh                                 3) ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
3990d1ba665SWarner Losh                                 4) DriverImageHandle does not support the EFI_DRIVER_BINDING_PROTOCOL.
4000d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to disconnect any drivers from
4010d1ba665SWarner Losh                                 ControllerHandle.
4020d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR      The controller could not be disconnected because of a device error.
4030d1ba665SWarner Losh 
4040d1ba665SWarner Losh **/
4050d1ba665SWarner Losh typedef
4060d1ba665SWarner Losh EFI_STATUS
4070d1ba665SWarner Losh (EFIAPI *EFI_DISCONNECT_CONTROLLER)(
4080d1ba665SWarner Losh   IN  EFI_HANDLE                     ControllerHandle,
409*580fcf64SWarner Losh   IN  EFI_HANDLE                     DriverImageHandle  OPTIONAL,
4100d1ba665SWarner Losh   IN  EFI_HANDLE                     ChildHandle        OPTIONAL
4110d1ba665SWarner Losh   );
4120d1ba665SWarner Losh 
4130d1ba665SWarner Losh //
4140d1ba665SWarner Losh // ConvertPointer DebugDisposition type.
4150d1ba665SWarner Losh //
4160d1ba665SWarner Losh #define EFI_OPTIONAL_PTR  0x00000001
4170d1ba665SWarner Losh 
4180d1ba665SWarner Losh /**
4190d1ba665SWarner Losh   Determines the new virtual address that is to be used on subsequent memory accesses.
4200d1ba665SWarner Losh 
4210d1ba665SWarner Losh   @param[in]       DebugDisposition  Supplies type information for the pointer being converted.
4220d1ba665SWarner Losh   @param[in, out]  Address           A pointer to a pointer that is to be fixed to be the value needed
4230d1ba665SWarner Losh                                      for the new virtual address mappings being applied.
4240d1ba665SWarner Losh 
4250d1ba665SWarner Losh   @retval EFI_SUCCESS           The pointer pointed to by Address was modified.
4260d1ba665SWarner Losh   @retval EFI_NOT_FOUND         The pointer pointed to by Address was not found to be part
4270d1ba665SWarner Losh                                 of the current memory map. This is normally fatal.
428*580fcf64SWarner Losh   @retval EFI_INVALID_PARAMETER Address is NULL.
429*580fcf64SWarner Losh   @retval EFI_INVALID_PARAMETER *Address is NULL and DebugDisposition does
430*580fcf64SWarner Losh                                 not have the EFI_OPTIONAL_PTR bit set.
431*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
432*580fcf64SWarner Losh                                 The platform should describe this runtime service as unsupported at runtime
433*580fcf64SWarner Losh                                 via an EFI_RT_PROPERTIES_TABLE configuration table.
4340d1ba665SWarner Losh 
4350d1ba665SWarner Losh **/
4360d1ba665SWarner Losh typedef
4370d1ba665SWarner Losh EFI_STATUS
4380d1ba665SWarner Losh (EFIAPI *EFI_CONVERT_POINTER)(
4390d1ba665SWarner Losh   IN     UINTN                      DebugDisposition,
4400d1ba665SWarner Losh   IN OUT VOID                       **Address
4410d1ba665SWarner Losh   );
4420d1ba665SWarner Losh 
4430d1ba665SWarner Losh //
4440d1ba665SWarner Losh // These types can be ORed together as needed - for example,
4450d1ba665SWarner Losh // EVT_TIMER might be Ored with EVT_NOTIFY_WAIT or
4460d1ba665SWarner Losh // EVT_NOTIFY_SIGNAL.
4470d1ba665SWarner Losh //
4480d1ba665SWarner Losh #define EVT_TIMER          0x80000000
4490d1ba665SWarner Losh #define EVT_RUNTIME        0x40000000
4500d1ba665SWarner Losh #define EVT_NOTIFY_WAIT    0x00000100
4510d1ba665SWarner Losh #define EVT_NOTIFY_SIGNAL  0x00000200
4520d1ba665SWarner Losh 
4530d1ba665SWarner Losh #define EVT_SIGNAL_EXIT_BOOT_SERVICES      0x00000201
4540d1ba665SWarner Losh #define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE  0x60000202
4550d1ba665SWarner Losh 
4560d1ba665SWarner Losh //
4570d1ba665SWarner Losh // The event's NotifyContext pointer points to a runtime memory
4580d1ba665SWarner Losh // address.
4590d1ba665SWarner Losh // The event is deprecated in UEFI2.0 and later specifications.
4600d1ba665SWarner Losh //
4610d1ba665SWarner Losh #define EVT_RUNTIME_CONTEXT  0x20000000
4620d1ba665SWarner Losh 
4630d1ba665SWarner Losh /**
4640d1ba665SWarner Losh   Invoke a notification event
4650d1ba665SWarner Losh 
4660d1ba665SWarner Losh   @param[in]  Event                 Event whose notification function is being invoked.
4670d1ba665SWarner Losh   @param[in]  Context               The pointer to the notification function's context,
4680d1ba665SWarner Losh                                     which is implementation-dependent.
4690d1ba665SWarner Losh 
4700d1ba665SWarner Losh **/
4710d1ba665SWarner Losh typedef
4720d1ba665SWarner Losh VOID
4730d1ba665SWarner Losh (EFIAPI *EFI_EVENT_NOTIFY)(
4740d1ba665SWarner Losh   IN  EFI_EVENT                Event,
4750d1ba665SWarner Losh   IN  VOID                     *Context
4760d1ba665SWarner Losh   );
4770d1ba665SWarner Losh 
4780d1ba665SWarner Losh /**
4790d1ba665SWarner Losh   Creates an event.
4800d1ba665SWarner Losh 
4810d1ba665SWarner Losh   @param[in]   Type             The type of event to create and its mode and attributes.
4820d1ba665SWarner Losh   @param[in]   NotifyTpl        The task priority level of event notifications, if needed.
4830d1ba665SWarner Losh   @param[in]   NotifyFunction   The pointer to the event's notification function, if any.
4840d1ba665SWarner Losh   @param[in]   NotifyContext    The pointer to the notification function's context; corresponds to parameter
4850d1ba665SWarner Losh                                 Context in the notification function.
4860d1ba665SWarner Losh   @param[out]  Event            The pointer to the newly created event if the call succeeds; undefined
4870d1ba665SWarner Losh                                 otherwise.
4880d1ba665SWarner Losh 
4890d1ba665SWarner Losh   @retval EFI_SUCCESS           The event structure was created.
4900d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
4910d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  The event could not be allocated.
4920d1ba665SWarner Losh 
4930d1ba665SWarner Losh **/
4940d1ba665SWarner Losh typedef
4950d1ba665SWarner Losh EFI_STATUS
4960d1ba665SWarner Losh (EFIAPI *EFI_CREATE_EVENT)(
4970d1ba665SWarner Losh   IN  UINT32                       Type,
4980d1ba665SWarner Losh   IN  EFI_TPL                      NotifyTpl,
499*580fcf64SWarner Losh   IN  EFI_EVENT_NOTIFY             NotifyFunction OPTIONAL,
500*580fcf64SWarner Losh   IN  VOID                         *NotifyContext OPTIONAL,
5010d1ba665SWarner Losh   OUT EFI_EVENT                    *Event
5020d1ba665SWarner Losh   );
5030d1ba665SWarner Losh 
5040d1ba665SWarner Losh /**
5050d1ba665SWarner Losh   Creates an event in a group.
5060d1ba665SWarner Losh 
5070d1ba665SWarner Losh   @param[in]   Type             The type of event to create and its mode and attributes.
5080d1ba665SWarner Losh   @param[in]   NotifyTpl        The task priority level of event notifications,if needed.
5090d1ba665SWarner Losh   @param[in]   NotifyFunction   The pointer to the event's notification function, if any.
5100d1ba665SWarner Losh   @param[in]   NotifyContext    The pointer to the notification function's context; corresponds to parameter
5110d1ba665SWarner Losh                                 Context in the notification function.
5120d1ba665SWarner Losh   @param[in]   EventGroup       The pointer to the unique identifier of the group to which this event belongs.
5130d1ba665SWarner Losh                                 If this is NULL, then the function behaves as if the parameters were passed
5140d1ba665SWarner Losh                                 to CreateEvent.
5150d1ba665SWarner Losh   @param[out]  Event            The pointer to the newly created event if the call succeeds; undefined
5160d1ba665SWarner Losh                                 otherwise.
5170d1ba665SWarner Losh 
5180d1ba665SWarner Losh   @retval EFI_SUCCESS           The event structure was created.
5190d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
5200d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  The event could not be allocated.
5210d1ba665SWarner Losh 
5220d1ba665SWarner Losh **/
5230d1ba665SWarner Losh typedef
5240d1ba665SWarner Losh EFI_STATUS
5250d1ba665SWarner Losh (EFIAPI *EFI_CREATE_EVENT_EX)(
5260d1ba665SWarner Losh   IN       UINT32                 Type,
5270d1ba665SWarner Losh   IN       EFI_TPL                NotifyTpl,
5280d1ba665SWarner Losh   IN       EFI_EVENT_NOTIFY       NotifyFunction OPTIONAL,
5290d1ba665SWarner Losh   IN CONST VOID                   *NotifyContext OPTIONAL,
5300d1ba665SWarner Losh   IN CONST EFI_GUID               *EventGroup    OPTIONAL,
5310d1ba665SWarner Losh   OUT      EFI_EVENT              *Event
5320d1ba665SWarner Losh   );
5330d1ba665SWarner Losh 
5340d1ba665SWarner Losh ///
5350d1ba665SWarner Losh /// Timer delay types
5360d1ba665SWarner Losh ///
5370d1ba665SWarner Losh typedef enum {
5380d1ba665SWarner Losh   ///
5390d1ba665SWarner Losh   /// An event's timer settings is to be cancelled and not trigger time is to be set/
5400d1ba665SWarner Losh   ///
5410d1ba665SWarner Losh   TimerCancel,
5420d1ba665SWarner Losh   ///
5430d1ba665SWarner Losh   /// An event is to be signaled periodically at a specified interval from the current time.
5440d1ba665SWarner Losh   ///
5450d1ba665SWarner Losh   TimerPeriodic,
5460d1ba665SWarner Losh   ///
5470d1ba665SWarner Losh   /// An event is to be signaled once at a specified interval from the current time.
5480d1ba665SWarner Losh   ///
5490d1ba665SWarner Losh   TimerRelative
5500d1ba665SWarner Losh } EFI_TIMER_DELAY;
5510d1ba665SWarner Losh 
5520d1ba665SWarner Losh /**
5530d1ba665SWarner Losh   Sets the type of timer and the trigger time for a timer event.
5540d1ba665SWarner Losh 
5550d1ba665SWarner Losh   @param[in]  Event             The timer event that is to be signaled at the specified time.
5560d1ba665SWarner Losh   @param[in]  Type              The type of time that is specified in TriggerTime.
5570d1ba665SWarner Losh   @param[in]  TriggerTime       The number of 100ns units until the timer expires.
5580d1ba665SWarner Losh                                 A TriggerTime of 0 is legal.
5590d1ba665SWarner Losh                                 If Type is TimerRelative and TriggerTime is 0, then the timer
5600d1ba665SWarner Losh                                 event will be signaled on the next timer tick.
5610d1ba665SWarner Losh                                 If Type is TimerPeriodic and TriggerTime is 0, then the timer
5620d1ba665SWarner Losh                                 event will be signaled on every timer tick.
5630d1ba665SWarner Losh 
5640d1ba665SWarner Losh   @retval EFI_SUCCESS           The event has been set to be signaled at the requested time.
5650d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Event or Type is not valid.
5660d1ba665SWarner Losh 
5670d1ba665SWarner Losh **/
5680d1ba665SWarner Losh typedef
5690d1ba665SWarner Losh EFI_STATUS
5700d1ba665SWarner Losh (EFIAPI *EFI_SET_TIMER)(
5710d1ba665SWarner Losh   IN  EFI_EVENT                Event,
5720d1ba665SWarner Losh   IN  EFI_TIMER_DELAY          Type,
5730d1ba665SWarner Losh   IN  UINT64                   TriggerTime
5740d1ba665SWarner Losh   );
5750d1ba665SWarner Losh 
5760d1ba665SWarner Losh /**
5770d1ba665SWarner Losh   Signals an event.
5780d1ba665SWarner Losh 
5790d1ba665SWarner Losh   @param[in]  Event             The event to signal.
5800d1ba665SWarner Losh 
5810d1ba665SWarner Losh   @retval EFI_SUCCESS           The event has been signaled.
5820d1ba665SWarner Losh 
5830d1ba665SWarner Losh **/
5840d1ba665SWarner Losh typedef
5850d1ba665SWarner Losh EFI_STATUS
5860d1ba665SWarner Losh (EFIAPI *EFI_SIGNAL_EVENT)(
5870d1ba665SWarner Losh   IN  EFI_EVENT                Event
5880d1ba665SWarner Losh   );
5890d1ba665SWarner Losh 
5900d1ba665SWarner Losh /**
5910d1ba665SWarner Losh   Stops execution until an event is signaled.
5920d1ba665SWarner Losh 
5930d1ba665SWarner Losh   @param[in]   NumberOfEvents   The number of events in the Event array.
5940d1ba665SWarner Losh   @param[in]   Event            An array of EFI_EVENT.
5950d1ba665SWarner Losh   @param[out]  Index            The pointer to the index of the event which satisfied the wait condition.
5960d1ba665SWarner Losh 
5970d1ba665SWarner Losh   @retval EFI_SUCCESS           The event indicated by Index was signaled.
5980d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0.
5990d1ba665SWarner Losh                                 2) The event indicated by Index is of type
6000d1ba665SWarner Losh                                    EVT_NOTIFY_SIGNAL.
6010d1ba665SWarner Losh   @retval EFI_UNSUPPORTED       The current TPL is not TPL_APPLICATION.
6020d1ba665SWarner Losh 
6030d1ba665SWarner Losh **/
6040d1ba665SWarner Losh typedef
6050d1ba665SWarner Losh EFI_STATUS
6060d1ba665SWarner Losh (EFIAPI *EFI_WAIT_FOR_EVENT)(
6070d1ba665SWarner Losh   IN  UINTN                    NumberOfEvents,
6080d1ba665SWarner Losh   IN  EFI_EVENT                *Event,
6090d1ba665SWarner Losh   OUT UINTN                    *Index
6100d1ba665SWarner Losh   );
6110d1ba665SWarner Losh 
6120d1ba665SWarner Losh /**
6130d1ba665SWarner Losh   Closes an event.
6140d1ba665SWarner Losh 
6150d1ba665SWarner Losh   @param[in]  Event             The event to close.
6160d1ba665SWarner Losh 
6170d1ba665SWarner Losh   @retval EFI_SUCCESS           The event has been closed.
6180d1ba665SWarner Losh 
6190d1ba665SWarner Losh **/
6200d1ba665SWarner Losh typedef
6210d1ba665SWarner Losh EFI_STATUS
6220d1ba665SWarner Losh (EFIAPI *EFI_CLOSE_EVENT)(
6230d1ba665SWarner Losh   IN EFI_EVENT                Event
6240d1ba665SWarner Losh   );
6250d1ba665SWarner Losh 
6260d1ba665SWarner Losh /**
6270d1ba665SWarner Losh   Checks whether an event is in the signaled state.
6280d1ba665SWarner Losh 
6290d1ba665SWarner Losh   @param[in]  Event             The event to check.
6300d1ba665SWarner Losh 
6310d1ba665SWarner Losh   @retval EFI_SUCCESS           The event is in the signaled state.
6320d1ba665SWarner Losh   @retval EFI_NOT_READY         The event is not in the signaled state.
6330d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL.
6340d1ba665SWarner Losh 
6350d1ba665SWarner Losh **/
6360d1ba665SWarner Losh typedef
6370d1ba665SWarner Losh EFI_STATUS
6380d1ba665SWarner Losh (EFIAPI *EFI_CHECK_EVENT)(
6390d1ba665SWarner Losh   IN EFI_EVENT                Event
6400d1ba665SWarner Losh   );
6410d1ba665SWarner Losh 
6420d1ba665SWarner Losh //
6430d1ba665SWarner Losh // Task priority level
6440d1ba665SWarner Losh //
6450d1ba665SWarner Losh #define TPL_APPLICATION  4
6460d1ba665SWarner Losh #define TPL_CALLBACK     8
6470d1ba665SWarner Losh #define TPL_NOTIFY       16
6480d1ba665SWarner Losh #define TPL_HIGH_LEVEL   31
6490d1ba665SWarner Losh 
6500d1ba665SWarner Losh /**
6510d1ba665SWarner Losh   Raises a task's priority level and returns its previous level.
6520d1ba665SWarner Losh 
6530d1ba665SWarner Losh   @param[in]  NewTpl          The new task priority level.
6540d1ba665SWarner Losh 
6550d1ba665SWarner Losh   @return Previous task priority level
6560d1ba665SWarner Losh 
6570d1ba665SWarner Losh **/
6580d1ba665SWarner Losh typedef
6590d1ba665SWarner Losh EFI_TPL
6600d1ba665SWarner Losh (EFIAPI *EFI_RAISE_TPL)(
6610d1ba665SWarner Losh   IN EFI_TPL      NewTpl
6620d1ba665SWarner Losh   );
6630d1ba665SWarner Losh 
6640d1ba665SWarner Losh /**
6650d1ba665SWarner Losh   Restores a task's priority level to its previous value.
6660d1ba665SWarner Losh 
6670d1ba665SWarner Losh   @param[in]  OldTpl          The previous task priority level to restore.
6680d1ba665SWarner Losh 
6690d1ba665SWarner Losh **/
6700d1ba665SWarner Losh typedef
6710d1ba665SWarner Losh VOID
6720d1ba665SWarner Losh (EFIAPI *EFI_RESTORE_TPL)(
6730d1ba665SWarner Losh   IN EFI_TPL      OldTpl
6740d1ba665SWarner Losh   );
6750d1ba665SWarner Losh 
6760d1ba665SWarner Losh /**
6770d1ba665SWarner Losh   Returns the value of a variable.
6780d1ba665SWarner Losh 
6790d1ba665SWarner Losh   @param[in]       VariableName  A Null-terminated string that is the name of the vendor's
6800d1ba665SWarner Losh                                  variable.
6810d1ba665SWarner Losh   @param[in]       VendorGuid    A unique identifier for the vendor.
6820d1ba665SWarner Losh   @param[out]      Attributes    If not NULL, a pointer to the memory location to return the
6830d1ba665SWarner Losh                                  attributes bitmask for the variable.
6840d1ba665SWarner Losh   @param[in, out]  DataSize      On input, the size in bytes of the return Data buffer.
6850d1ba665SWarner Losh                                  On output the size of data returned in Data.
6860d1ba665SWarner Losh   @param[out]      Data          The buffer to return the contents of the variable. May be NULL
6870d1ba665SWarner Losh                                  with a zero DataSize in order to determine the size buffer needed.
6880d1ba665SWarner Losh 
6890d1ba665SWarner Losh   @retval EFI_SUCCESS            The function completed successfully.
6900d1ba665SWarner Losh   @retval EFI_NOT_FOUND          The variable was not found.
6910d1ba665SWarner Losh   @retval EFI_BUFFER_TOO_SMALL   The DataSize is too small for the result.
6920d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER  VariableName is NULL.
6930d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER  VendorGuid is NULL.
6940d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER  DataSize is NULL.
6950d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER  The DataSize is not too small and Data is NULL.
6960d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR       The variable could not be retrieved due to a hardware error.
6970d1ba665SWarner Losh   @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
698*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED        After ExitBootServices() has been called, this return code may be returned
699*580fcf64SWarner Losh                                  if no variable storage is supported. The platform should describe this
700*580fcf64SWarner Losh                                  runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE
701*580fcf64SWarner Losh                                  configuration table.
7020d1ba665SWarner Losh 
7030d1ba665SWarner Losh **/
7040d1ba665SWarner Losh typedef
7050d1ba665SWarner Losh EFI_STATUS
7060d1ba665SWarner Losh (EFIAPI *EFI_GET_VARIABLE)(
7070d1ba665SWarner Losh   IN     CHAR16                      *VariableName,
7080d1ba665SWarner Losh   IN     EFI_GUID                    *VendorGuid,
709*580fcf64SWarner Losh   OUT    UINT32                      *Attributes     OPTIONAL,
7100d1ba665SWarner Losh   IN OUT UINTN                       *DataSize,
7110d1ba665SWarner Losh   OUT    VOID                        *Data           OPTIONAL
7120d1ba665SWarner Losh   );
7130d1ba665SWarner Losh 
7140d1ba665SWarner Losh /**
7150d1ba665SWarner Losh   Enumerates the current variable names.
7160d1ba665SWarner Losh 
7173245fa21SMitchell Horne   @param[in, out]  VariableNameSize The size of the VariableName buffer. The size must be large
7183245fa21SMitchell Horne                                     enough to fit input string supplied in VariableName buffer.
7190d1ba665SWarner Losh   @param[in, out]  VariableName     On input, supplies the last VariableName that was returned
7200d1ba665SWarner Losh                                     by GetNextVariableName(). On output, returns the Nullterminated
7210d1ba665SWarner Losh                                     string of the current variable.
7220d1ba665SWarner Losh   @param[in, out]  VendorGuid       On input, supplies the last VendorGuid that was returned by
7230d1ba665SWarner Losh                                     GetNextVariableName(). On output, returns the
7240d1ba665SWarner Losh                                     VendorGuid of the current variable.
7250d1ba665SWarner Losh 
7260d1ba665SWarner Losh   @retval EFI_SUCCESS           The function completed successfully.
7270d1ba665SWarner Losh   @retval EFI_NOT_FOUND         The next variable was not found.
7280d1ba665SWarner Losh   @retval EFI_BUFFER_TOO_SMALL  The VariableNameSize is too small for the result.
7293245fa21SMitchell Horne                                 VariableNameSize has been updated with the size needed to complete the request.
7300d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER VariableNameSize is NULL.
7310d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER VariableName is NULL.
7320d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
7333245fa21SMitchell Horne   @retval EFI_INVALID_PARAMETER The input values of VariableName and VendorGuid are not a name and
7343245fa21SMitchell Horne                                 GUID of an existing variable.
7353245fa21SMitchell Horne   @retval EFI_INVALID_PARAMETER Null-terminator is not found in the first VariableNameSize bytes of
7363245fa21SMitchell Horne                                 the input VariableName buffer.
7370d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR      The variable could not be retrieved due to a hardware error.
738*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED       After ExitBootServices() has been called, this return code may be returned
739*580fcf64SWarner Losh                                 if no variable storage is supported. The platform should describe this
740*580fcf64SWarner Losh                                 runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE
741*580fcf64SWarner Losh                                 configuration table.
7420d1ba665SWarner Losh 
7430d1ba665SWarner Losh **/
7440d1ba665SWarner Losh typedef
7450d1ba665SWarner Losh EFI_STATUS
7460d1ba665SWarner Losh (EFIAPI *EFI_GET_NEXT_VARIABLE_NAME)(
7470d1ba665SWarner Losh   IN OUT UINTN                    *VariableNameSize,
7480d1ba665SWarner Losh   IN OUT CHAR16                   *VariableName,
7490d1ba665SWarner Losh   IN OUT EFI_GUID                 *VendorGuid
7500d1ba665SWarner Losh   );
7510d1ba665SWarner Losh 
7520d1ba665SWarner Losh /**
7530d1ba665SWarner Losh   Sets the value of a variable.
7540d1ba665SWarner Losh 
7550d1ba665SWarner Losh   @param[in]  VariableName       A Null-terminated string that is the name of the vendor's variable.
7560d1ba665SWarner Losh                                  Each VariableName is unique for each VendorGuid. VariableName must
7570d1ba665SWarner Losh                                  contain 1 or more characters. If VariableName is an empty string,
7580d1ba665SWarner Losh                                  then EFI_INVALID_PARAMETER is returned.
7590d1ba665SWarner Losh   @param[in]  VendorGuid         A unique identifier for the vendor.
7600d1ba665SWarner Losh   @param[in]  Attributes         Attributes bitmask to set for the variable.
7613245fa21SMitchell Horne   @param[in]  DataSize           The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE or
7620d1ba665SWarner Losh                                  EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero
7630d1ba665SWarner Losh                                  causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is
7640d1ba665SWarner Losh                                  set, then a SetVariable() call with a DataSize of zero will not cause any change to
7650d1ba665SWarner Losh                                  the variable value (the timestamp associated with the variable may be updated however
7660d1ba665SWarner Losh                                  even if no new data value is provided,see the description of the
7670d1ba665SWarner Losh                                  EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not
7680d1ba665SWarner Losh                                  be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated).
7690d1ba665SWarner Losh   @param[in]  Data               The contents for the variable.
7700d1ba665SWarner Losh 
7710d1ba665SWarner Losh   @retval EFI_SUCCESS            The firmware has successfully stored the variable and its data as
7720d1ba665SWarner Losh                                  defined by the Attributes.
7730d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER  An invalid combination of attribute bits, name, and GUID was supplied, or the
7740d1ba665SWarner Losh                                  DataSize exceeds the maximum allowed.
7750d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER  VariableName is an empty string.
7760d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES   Not enough storage is available to hold the variable and its data.
7770d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR       The variable could not be retrieved due to a hardware error.
7780d1ba665SWarner Losh   @retval EFI_WRITE_PROTECTED    The variable in question is read-only.
7790d1ba665SWarner Losh   @retval EFI_WRITE_PROTECTED    The variable in question cannot be deleted.
7803245fa21SMitchell Horne   @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set,
7813245fa21SMitchell Horne                                  but the AuthInfo does NOT pass the validation check carried out by the firmware.
7820d1ba665SWarner Losh 
7830d1ba665SWarner Losh   @retval EFI_NOT_FOUND          The variable trying to be updated or deleted was not found.
784*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED        This call is not supported by this platform at the time the call is made.
785*580fcf64SWarner Losh                                  The platform should describe this runtime service as unsupported at runtime
786*580fcf64SWarner Losh                                  via an EFI_RT_PROPERTIES_TABLE configuration table.
7870d1ba665SWarner Losh 
7880d1ba665SWarner Losh **/
7890d1ba665SWarner Losh typedef
7900d1ba665SWarner Losh EFI_STATUS
7910d1ba665SWarner Losh (EFIAPI *EFI_SET_VARIABLE)(
7920d1ba665SWarner Losh   IN  CHAR16                       *VariableName,
7930d1ba665SWarner Losh   IN  EFI_GUID                     *VendorGuid,
7940d1ba665SWarner Losh   IN  UINT32                       Attributes,
7950d1ba665SWarner Losh   IN  UINTN                        DataSize,
7960d1ba665SWarner Losh   IN  VOID                         *Data
7970d1ba665SWarner Losh   );
7980d1ba665SWarner Losh 
7990d1ba665SWarner Losh ///
8000d1ba665SWarner Losh /// This provides the capabilities of the
8010d1ba665SWarner Losh /// real time clock device as exposed through the EFI interfaces.
8020d1ba665SWarner Losh ///
8030d1ba665SWarner Losh typedef struct {
8040d1ba665SWarner Losh   ///
8050d1ba665SWarner Losh   /// Provides the reporting resolution of the real-time clock device in
8060d1ba665SWarner Losh   /// counts per second. For a normal PC-AT CMOS RTC device, this
8070d1ba665SWarner Losh   /// value would be 1 Hz, or 1, to indicate that the device only reports
8080d1ba665SWarner Losh   /// the time to the resolution of 1 second.
8090d1ba665SWarner Losh   ///
8100d1ba665SWarner Losh   UINT32     Resolution;
8110d1ba665SWarner Losh   ///
8120d1ba665SWarner Losh   /// Provides the timekeeping accuracy of the real-time clock in an
8130d1ba665SWarner Losh   /// error rate of 1E-6 parts per million. For a clock with an accuracy
8140d1ba665SWarner Losh   /// of 50 parts per million, the value in this field would be
8150d1ba665SWarner Losh   /// 50,000,000.
8160d1ba665SWarner Losh   ///
8170d1ba665SWarner Losh   UINT32     Accuracy;
8180d1ba665SWarner Losh   ///
8190d1ba665SWarner Losh   /// A TRUE indicates that a time set operation clears the device's
8200d1ba665SWarner Losh   /// time below the Resolution reporting level. A FALSE
8210d1ba665SWarner Losh   /// indicates that the state below the Resolution level of the
8220d1ba665SWarner Losh   /// device is not cleared when the time is set. Normal PC-AT CMOS
8230d1ba665SWarner Losh   /// RTC devices set this value to FALSE.
8240d1ba665SWarner Losh   ///
8250d1ba665SWarner Losh   BOOLEAN    SetsToZero;
8260d1ba665SWarner Losh } EFI_TIME_CAPABILITIES;
8270d1ba665SWarner Losh 
8280d1ba665SWarner Losh /**
8290d1ba665SWarner Losh   Returns the current time and date information, and the time-keeping capabilities
8300d1ba665SWarner Losh   of the hardware platform.
8310d1ba665SWarner Losh 
8320d1ba665SWarner Losh   @param[out]  Time             A pointer to storage to receive a snapshot of the current time.
8330d1ba665SWarner Losh   @param[out]  Capabilities     An optional pointer to a buffer to receive the real time clock
8340d1ba665SWarner Losh                                 device's capabilities.
8350d1ba665SWarner Losh 
8360d1ba665SWarner Losh   @retval EFI_SUCCESS           The operation completed successfully.
8370d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Time is NULL.
8380d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR      The time could not be retrieved due to hardware error.
839*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
840*580fcf64SWarner Losh                                 The platform should describe this runtime service as unsupported at runtime
841*580fcf64SWarner Losh                                 via an EFI_RT_PROPERTIES_TABLE configuration table.
8420d1ba665SWarner Losh 
8430d1ba665SWarner Losh **/
8440d1ba665SWarner Losh typedef
8450d1ba665SWarner Losh EFI_STATUS
8460d1ba665SWarner Losh (EFIAPI *EFI_GET_TIME)(
8470d1ba665SWarner Losh   OUT  EFI_TIME                    *Time,
8480d1ba665SWarner Losh   OUT  EFI_TIME_CAPABILITIES       *Capabilities OPTIONAL
8490d1ba665SWarner Losh   );
8500d1ba665SWarner Losh 
8510d1ba665SWarner Losh /**
8520d1ba665SWarner Losh   Sets the current local time and date information.
8530d1ba665SWarner Losh 
8540d1ba665SWarner Losh   @param[in]  Time              A pointer to the current time.
8550d1ba665SWarner Losh 
8560d1ba665SWarner Losh   @retval EFI_SUCCESS           The operation completed successfully.
8570d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER A time field is out of range.
8580d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR      The time could not be set due due to hardware error.
859*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
860*580fcf64SWarner Losh                                 The platform should describe this runtime service as unsupported at runtime
861*580fcf64SWarner Losh                                 via an EFI_RT_PROPERTIES_TABLE configuration table.
8620d1ba665SWarner Losh 
8630d1ba665SWarner Losh **/
8640d1ba665SWarner Losh typedef
8650d1ba665SWarner Losh EFI_STATUS
8660d1ba665SWarner Losh (EFIAPI *EFI_SET_TIME)(
8670d1ba665SWarner Losh   IN  EFI_TIME                     *Time
8680d1ba665SWarner Losh   );
8690d1ba665SWarner Losh 
8700d1ba665SWarner Losh /**
8710d1ba665SWarner Losh   Returns the current wakeup alarm clock setting.
8720d1ba665SWarner Losh 
8730d1ba665SWarner Losh   @param[out]  Enabled          Indicates if the alarm is currently enabled or disabled.
8740d1ba665SWarner Losh   @param[out]  Pending          Indicates if the alarm signal is pending and requires acknowledgement.
8750d1ba665SWarner Losh   @param[out]  Time             The current alarm setting.
8760d1ba665SWarner Losh 
8770d1ba665SWarner Losh   @retval EFI_SUCCESS           The alarm settings were returned.
8780d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Enabled is NULL.
8790d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Pending is NULL.
8800d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Time is NULL.
8810d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR      The wakeup time could not be retrieved due to a hardware error.
882*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
883*580fcf64SWarner Losh                                 The platform should describe this runtime service as unsupported at runtime
884*580fcf64SWarner Losh                                 via an EFI_RT_PROPERTIES_TABLE configuration table.
8850d1ba665SWarner Losh 
8860d1ba665SWarner Losh **/
8870d1ba665SWarner Losh typedef
8880d1ba665SWarner Losh EFI_STATUS
8890d1ba665SWarner Losh (EFIAPI *EFI_GET_WAKEUP_TIME)(
8900d1ba665SWarner Losh   OUT BOOLEAN                     *Enabled,
8910d1ba665SWarner Losh   OUT BOOLEAN                     *Pending,
8920d1ba665SWarner Losh   OUT EFI_TIME                    *Time
8930d1ba665SWarner Losh   );
8940d1ba665SWarner Losh 
8950d1ba665SWarner Losh /**
8960d1ba665SWarner Losh   Sets the system wakeup alarm clock time.
8970d1ba665SWarner Losh 
8980d1ba665SWarner Losh   @param[in]  Enable            Enable or disable the wakeup alarm.
8990d1ba665SWarner Losh   @param[in]  Time              If Enable is TRUE, the time to set the wakeup alarm for.
9000d1ba665SWarner Losh                                 If Enable is FALSE, then this parameter is optional, and may be NULL.
9010d1ba665SWarner Losh 
9020d1ba665SWarner Losh   @retval EFI_SUCCESS           If Enable is TRUE, then the wakeup alarm was enabled. If
9030d1ba665SWarner Losh                                 Enable is FALSE, then the wakeup alarm was disabled.
9040d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER A time field is out of range.
9050d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR      The wakeup time could not be set due to a hardware error.
906*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
907*580fcf64SWarner Losh                                 The platform should describe this runtime service as unsupported at runtime
908*580fcf64SWarner Losh                                 via an EFI_RT_PROPERTIES_TABLE configuration table.
9090d1ba665SWarner Losh 
9100d1ba665SWarner Losh **/
9110d1ba665SWarner Losh typedef
9120d1ba665SWarner Losh EFI_STATUS
9130d1ba665SWarner Losh (EFIAPI *EFI_SET_WAKEUP_TIME)(
9140d1ba665SWarner Losh   IN  BOOLEAN                      Enable,
9150d1ba665SWarner Losh   IN  EFI_TIME                     *Time   OPTIONAL
9160d1ba665SWarner Losh   );
9170d1ba665SWarner Losh 
9180d1ba665SWarner Losh /**
9190d1ba665SWarner Losh   Loads an EFI image into memory.
9200d1ba665SWarner Losh 
9210d1ba665SWarner Losh   @param[in]   BootPolicy        If TRUE, indicates that the request originates from the boot
9220d1ba665SWarner Losh                                  manager, and that the boot manager is attempting to load
9230d1ba665SWarner Losh                                  FilePath as a boot selection. Ignored if SourceBuffer is
9240d1ba665SWarner Losh                                  not NULL.
9250d1ba665SWarner Losh   @param[in]   ParentImageHandle The caller's image handle.
9260d1ba665SWarner Losh   @param[in]   DevicePath        The DeviceHandle specific file path from which the image is
9270d1ba665SWarner Losh                                  loaded.
9280d1ba665SWarner Losh   @param[in]   SourceBuffer      If not NULL, a pointer to the memory location containing a copy
9290d1ba665SWarner Losh                                  of the image to be loaded.
9300d1ba665SWarner Losh   @param[in]   SourceSize        The size in bytes of SourceBuffer. Ignored if SourceBuffer is NULL.
9310d1ba665SWarner Losh   @param[out]  ImageHandle       The pointer to the returned image handle that is created when the
9320d1ba665SWarner Losh                                  image is successfully loaded.
9330d1ba665SWarner Losh 
9340d1ba665SWarner Losh   @retval EFI_SUCCESS            Image was loaded into memory correctly.
9350d1ba665SWarner Losh   @retval EFI_NOT_FOUND          Both SourceBuffer and DevicePath are NULL.
9360d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER  One or more parametes are invalid.
9370d1ba665SWarner Losh   @retval EFI_UNSUPPORTED        The image type is not supported.
9380d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES   Image was not loaded due to insufficient resources.
9390d1ba665SWarner Losh   @retval EFI_LOAD_ERROR         Image was not loaded because the image format was corrupt or not
9400d1ba665SWarner Losh                                  understood.
9410d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR       Image was not loaded because the device returned a read error.
9420d1ba665SWarner Losh   @retval EFI_ACCESS_DENIED      Image was not loaded because the platform policy prohibits the
9430d1ba665SWarner Losh                                  image from being loaded. NULL is returned in *ImageHandle.
9440d1ba665SWarner Losh   @retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
9450d1ba665SWarner Losh                                  valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
9460d1ba665SWarner Losh                                  platform policy specifies that the image should not be started.
9470d1ba665SWarner Losh **/
9480d1ba665SWarner Losh typedef
9490d1ba665SWarner Losh EFI_STATUS
9500d1ba665SWarner Losh (EFIAPI *EFI_IMAGE_LOAD)(
9510d1ba665SWarner Losh   IN  BOOLEAN                      BootPolicy,
9520d1ba665SWarner Losh   IN  EFI_HANDLE                   ParentImageHandle,
953*580fcf64SWarner Losh   IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath   OPTIONAL,
9540d1ba665SWarner Losh   IN  VOID                         *SourceBuffer OPTIONAL,
9550d1ba665SWarner Losh   IN  UINTN                        SourceSize,
9560d1ba665SWarner Losh   OUT EFI_HANDLE                   *ImageHandle
9570d1ba665SWarner Losh   );
9580d1ba665SWarner Losh 
9590d1ba665SWarner Losh /**
9600d1ba665SWarner Losh   Transfers control to a loaded image's entry point.
9610d1ba665SWarner Losh 
9620d1ba665SWarner Losh   @param[in]   ImageHandle       Handle of image to be started.
9630d1ba665SWarner Losh   @param[out]  ExitDataSize      The pointer to the size, in bytes, of ExitData.
9640d1ba665SWarner Losh   @param[out]  ExitData          The pointer to a pointer to a data buffer that includes a Null-terminated
9650d1ba665SWarner Losh                                  string, optionally followed by additional binary data.
9660d1ba665SWarner Losh 
9670d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER  ImageHandle is either an invalid image handle or the image
9680d1ba665SWarner Losh                                  has already been initialized with StartImage.
9690d1ba665SWarner Losh   @retval EFI_SECURITY_VIOLATION The current platform policy specifies that the image should not be started.
9700d1ba665SWarner Losh   @return Exit code from image
9710d1ba665SWarner Losh 
9720d1ba665SWarner Losh **/
9730d1ba665SWarner Losh typedef
9740d1ba665SWarner Losh EFI_STATUS
9750d1ba665SWarner Losh (EFIAPI *EFI_IMAGE_START)(
9760d1ba665SWarner Losh   IN  EFI_HANDLE                  ImageHandle,
9770d1ba665SWarner Losh   OUT UINTN                       *ExitDataSize,
9780d1ba665SWarner Losh   OUT CHAR16                      **ExitData    OPTIONAL
9790d1ba665SWarner Losh   );
9800d1ba665SWarner Losh 
9810d1ba665SWarner Losh /**
9820d1ba665SWarner Losh   Terminates a loaded EFI image and returns control to boot services.
9830d1ba665SWarner Losh 
9840d1ba665SWarner Losh   @param[in]  ImageHandle       Handle that identifies the image. This parameter is passed to the
9850d1ba665SWarner Losh                                 image on entry.
9860d1ba665SWarner Losh   @param[in]  ExitStatus        The image's exit code.
9870d1ba665SWarner Losh   @param[in]  ExitDataSize      The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS.
9880d1ba665SWarner Losh   @param[in]  ExitData          The pointer to a data buffer that includes a Null-terminated string,
9890d1ba665SWarner Losh                                 optionally followed by additional binary data. The string is a
9900d1ba665SWarner Losh                                 description that the caller may use to further indicate the reason
9910d1ba665SWarner Losh                                 for the image's exit. ExitData is only valid if ExitStatus
9920d1ba665SWarner Losh                                 is something other than EFI_SUCCESS. The ExitData buffer
9930d1ba665SWarner Losh                                 must be allocated by calling AllocatePool().
9940d1ba665SWarner Losh 
9950d1ba665SWarner Losh   @retval EFI_SUCCESS           The image specified by ImageHandle was unloaded.
9960d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and
9970d1ba665SWarner Losh                                 started with LoadImage() and StartImage(), but the
9980d1ba665SWarner Losh                                 image is not the currently executing image.
9990d1ba665SWarner Losh 
10000d1ba665SWarner Losh **/
10010d1ba665SWarner Losh typedef
10020d1ba665SWarner Losh EFI_STATUS
10030d1ba665SWarner Losh (EFIAPI *EFI_EXIT)(
10040d1ba665SWarner Losh   IN  EFI_HANDLE                   ImageHandle,
10050d1ba665SWarner Losh   IN  EFI_STATUS                   ExitStatus,
10060d1ba665SWarner Losh   IN  UINTN                        ExitDataSize,
10070d1ba665SWarner Losh   IN  CHAR16                       *ExitData     OPTIONAL
10080d1ba665SWarner Losh   );
10090d1ba665SWarner Losh 
10100d1ba665SWarner Losh /**
10110d1ba665SWarner Losh   Unloads an image.
10120d1ba665SWarner Losh 
10130d1ba665SWarner Losh   @param[in]  ImageHandle       Handle that identifies the image to be unloaded.
10140d1ba665SWarner Losh 
10150d1ba665SWarner Losh   @retval EFI_SUCCESS           The image has been unloaded.
10160d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
10170d1ba665SWarner Losh 
10180d1ba665SWarner Losh **/
10190d1ba665SWarner Losh typedef
10200d1ba665SWarner Losh EFI_STATUS
10210d1ba665SWarner Losh (EFIAPI *EFI_IMAGE_UNLOAD)(
10220d1ba665SWarner Losh   IN  EFI_HANDLE                   ImageHandle
10230d1ba665SWarner Losh   );
10240d1ba665SWarner Losh 
10250d1ba665SWarner Losh /**
10260d1ba665SWarner Losh   Terminates all boot services.
10270d1ba665SWarner Losh 
10280d1ba665SWarner Losh   @param[in]  ImageHandle       Handle that identifies the exiting image.
10290d1ba665SWarner Losh   @param[in]  MapKey            Key to the latest memory map.
10300d1ba665SWarner Losh 
10310d1ba665SWarner Losh   @retval EFI_SUCCESS           Boot services have been terminated.
10320d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER MapKey is incorrect.
10330d1ba665SWarner Losh 
10340d1ba665SWarner Losh **/
10350d1ba665SWarner Losh typedef
10360d1ba665SWarner Losh EFI_STATUS
10370d1ba665SWarner Losh (EFIAPI *EFI_EXIT_BOOT_SERVICES)(
10380d1ba665SWarner Losh   IN  EFI_HANDLE                   ImageHandle,
10390d1ba665SWarner Losh   IN  UINTN                        MapKey
10400d1ba665SWarner Losh   );
10410d1ba665SWarner Losh 
10420d1ba665SWarner Losh /**
10430d1ba665SWarner Losh   Induces a fine-grained stall.
10440d1ba665SWarner Losh 
10450d1ba665SWarner Losh   @param[in]  Microseconds      The number of microseconds to stall execution.
10460d1ba665SWarner Losh 
10470d1ba665SWarner Losh   @retval EFI_SUCCESS           Execution was stalled at least the requested number of
10480d1ba665SWarner Losh                                 Microseconds.
10490d1ba665SWarner Losh 
10500d1ba665SWarner Losh **/
10510d1ba665SWarner Losh typedef
10520d1ba665SWarner Losh EFI_STATUS
10530d1ba665SWarner Losh (EFIAPI *EFI_STALL)(
10540d1ba665SWarner Losh   IN  UINTN                    Microseconds
10550d1ba665SWarner Losh   );
10560d1ba665SWarner Losh 
10570d1ba665SWarner Losh /**
10580d1ba665SWarner Losh   Sets the system's watchdog timer.
10590d1ba665SWarner Losh 
10600d1ba665SWarner Losh   @param[in]  Timeout           The number of seconds to set the watchdog timer to.
10610d1ba665SWarner Losh   @param[in]  WatchdogCode      The numeric code to log on a watchdog timer timeout event.
10620d1ba665SWarner Losh   @param[in]  DataSize          The size, in bytes, of WatchdogData.
10630d1ba665SWarner Losh   @param[in]  WatchdogData      A data buffer that includes a Null-terminated string, optionally
10640d1ba665SWarner Losh                                 followed by additional binary data.
10650d1ba665SWarner Losh 
10660d1ba665SWarner Losh   @retval EFI_SUCCESS           The timeout has been set.
10670d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid.
10680d1ba665SWarner Losh   @retval EFI_UNSUPPORTED       The system does not have a watchdog timer.
10690d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR      The watchdog timer could not be programmed due to a hardware
10700d1ba665SWarner Losh                                 error.
10710d1ba665SWarner Losh 
10720d1ba665SWarner Losh **/
10730d1ba665SWarner Losh typedef
10740d1ba665SWarner Losh EFI_STATUS
10750d1ba665SWarner Losh (EFIAPI *EFI_SET_WATCHDOG_TIMER)(
10760d1ba665SWarner Losh   IN UINTN                    Timeout,
10770d1ba665SWarner Losh   IN UINT64                   WatchdogCode,
10780d1ba665SWarner Losh   IN UINTN                    DataSize,
10790d1ba665SWarner Losh   IN CHAR16                   *WatchdogData OPTIONAL
10800d1ba665SWarner Losh   );
10810d1ba665SWarner Losh 
10820d1ba665SWarner Losh /**
10830d1ba665SWarner Losh   Resets the entire platform.
10840d1ba665SWarner Losh 
10850d1ba665SWarner Losh   @param[in]  ResetType         The type of reset to perform.
10860d1ba665SWarner Losh   @param[in]  ResetStatus       The status code for the reset.
10870d1ba665SWarner Losh   @param[in]  DataSize          The size, in bytes, of ResetData.
10880d1ba665SWarner Losh   @param[in]  ResetData         For a ResetType of EfiResetCold, EfiResetWarm, or
10890d1ba665SWarner Losh                                 EfiResetShutdown the data buffer starts with a Null-terminated
10900d1ba665SWarner Losh                                 string, optionally followed by additional binary data.
10910d1ba665SWarner Losh                                 The string is a description that the caller may use to further
10923245fa21SMitchell Horne                                 indicate the reason for the system reset.
10933245fa21SMitchell Horne                                 For a ResetType of EfiResetPlatformSpecific the data buffer
10943245fa21SMitchell Horne                                 also starts with a Null-terminated string that is followed
10953245fa21SMitchell Horne                                 by an EFI_GUID that describes the specific type of reset to perform.
10960d1ba665SWarner Losh **/
10970d1ba665SWarner Losh typedef
10980d1ba665SWarner Losh VOID
10990d1ba665SWarner Losh (EFIAPI *EFI_RESET_SYSTEM)(
11000d1ba665SWarner Losh   IN EFI_RESET_TYPE           ResetType,
11010d1ba665SWarner Losh   IN EFI_STATUS               ResetStatus,
11020d1ba665SWarner Losh   IN UINTN                    DataSize,
11030d1ba665SWarner Losh   IN VOID                     *ResetData OPTIONAL
11040d1ba665SWarner Losh   );
11050d1ba665SWarner Losh 
11060d1ba665SWarner Losh /**
11070d1ba665SWarner Losh   Returns a monotonically increasing count for the platform.
11080d1ba665SWarner Losh 
11090d1ba665SWarner Losh   @param[out]  Count            The pointer to returned value.
11100d1ba665SWarner Losh 
11110d1ba665SWarner Losh   @retval EFI_SUCCESS           The next monotonic count was returned.
11120d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Count is NULL.
11130d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR      The device is not functioning properly.
11140d1ba665SWarner Losh 
11150d1ba665SWarner Losh **/
11160d1ba665SWarner Losh typedef
11170d1ba665SWarner Losh EFI_STATUS
11180d1ba665SWarner Losh (EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT)(
11190d1ba665SWarner Losh   OUT UINT64                  *Count
11200d1ba665SWarner Losh   );
11210d1ba665SWarner Losh 
11220d1ba665SWarner Losh /**
11230d1ba665SWarner Losh   Returns the next high 32 bits of the platform's monotonic counter.
11240d1ba665SWarner Losh 
11250d1ba665SWarner Losh   @param[out]  HighCount        The pointer to returned value.
11260d1ba665SWarner Losh 
11270d1ba665SWarner Losh   @retval EFI_SUCCESS           The next high monotonic count was returned.
11280d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER HighCount is NULL.
11290d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR      The device is not functioning properly.
1130*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
1131*580fcf64SWarner Losh                                 The platform should describe this runtime service as unsupported at runtime
1132*580fcf64SWarner Losh                                 via an EFI_RT_PROPERTIES_TABLE configuration table.
11330d1ba665SWarner Losh 
11340d1ba665SWarner Losh **/
11350d1ba665SWarner Losh typedef
11360d1ba665SWarner Losh EFI_STATUS
11370d1ba665SWarner Losh (EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT)(
11380d1ba665SWarner Losh   OUT UINT32                  *HighCount
11390d1ba665SWarner Losh   );
11400d1ba665SWarner Losh 
11410d1ba665SWarner Losh /**
11420d1ba665SWarner Losh   Computes and returns a 32-bit CRC for a data buffer.
11430d1ba665SWarner Losh 
11440d1ba665SWarner Losh   @param[in]   Data             A pointer to the buffer on which the 32-bit CRC is to be computed.
11450d1ba665SWarner Losh   @param[in]   DataSize         The number of bytes in the buffer Data.
11460d1ba665SWarner Losh   @param[out]  Crc32            The 32-bit CRC that was computed for the data buffer specified by Data
11470d1ba665SWarner Losh                                 and DataSize.
11480d1ba665SWarner Losh 
11490d1ba665SWarner Losh   @retval EFI_SUCCESS           The 32-bit CRC was computed for the data buffer and returned in
11500d1ba665SWarner Losh                                 Crc32.
11510d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Data is NULL.
11520d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Crc32 is NULL.
11530d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER DataSize is 0.
11540d1ba665SWarner Losh 
11550d1ba665SWarner Losh **/
11560d1ba665SWarner Losh typedef
11570d1ba665SWarner Losh EFI_STATUS
11580d1ba665SWarner Losh (EFIAPI *EFI_CALCULATE_CRC32)(
11590d1ba665SWarner Losh   IN  VOID                              *Data,
11600d1ba665SWarner Losh   IN  UINTN                             DataSize,
11610d1ba665SWarner Losh   OUT UINT32                            *Crc32
11620d1ba665SWarner Losh   );
11630d1ba665SWarner Losh 
11640d1ba665SWarner Losh /**
11650d1ba665SWarner Losh   Copies the contents of one buffer to another buffer.
11660d1ba665SWarner Losh 
11670d1ba665SWarner Losh   @param[in]  Destination       The pointer to the destination buffer of the memory copy.
11680d1ba665SWarner Losh   @param[in]  Source            The pointer to the source buffer of the memory copy.
11690d1ba665SWarner Losh   @param[in]  Length            Number of bytes to copy from Source to Destination.
11700d1ba665SWarner Losh 
11710d1ba665SWarner Losh **/
11720d1ba665SWarner Losh typedef
11730d1ba665SWarner Losh VOID
11740d1ba665SWarner Losh (EFIAPI *EFI_COPY_MEM)(
11750d1ba665SWarner Losh   IN VOID     *Destination,
11760d1ba665SWarner Losh   IN VOID     *Source,
11770d1ba665SWarner Losh   IN UINTN    Length
11780d1ba665SWarner Losh   );
11790d1ba665SWarner Losh 
11800d1ba665SWarner Losh /**
11810d1ba665SWarner Losh   The SetMem() function fills a buffer with a specified value.
11820d1ba665SWarner Losh 
11830d1ba665SWarner Losh   @param[in]  Buffer            The pointer to the buffer to fill.
11840d1ba665SWarner Losh   @param[in]  Size              Number of bytes in Buffer to fill.
11850d1ba665SWarner Losh   @param[in]  Value             Value to fill Buffer with.
11860d1ba665SWarner Losh 
11870d1ba665SWarner Losh **/
11880d1ba665SWarner Losh typedef
11890d1ba665SWarner Losh VOID
11900d1ba665SWarner Losh (EFIAPI *EFI_SET_MEM)(
11910d1ba665SWarner Losh   IN VOID     *Buffer,
11920d1ba665SWarner Losh   IN UINTN    Size,
11930d1ba665SWarner Losh   IN UINT8    Value
11940d1ba665SWarner Losh   );
11950d1ba665SWarner Losh 
11960d1ba665SWarner Losh ///
11970d1ba665SWarner Losh /// Enumeration of EFI Interface Types
11980d1ba665SWarner Losh ///
11990d1ba665SWarner Losh typedef enum {
12000d1ba665SWarner Losh   ///
12010d1ba665SWarner Losh   /// Indicates that the supplied protocol interface is supplied in native form.
12020d1ba665SWarner Losh   ///
12030d1ba665SWarner Losh   EFI_NATIVE_INTERFACE
12040d1ba665SWarner Losh } EFI_INTERFACE_TYPE;
12050d1ba665SWarner Losh 
12060d1ba665SWarner Losh /**
12070d1ba665SWarner Losh   Installs a protocol interface on a device handle. If the handle does not exist, it is created and added
12080d1ba665SWarner Losh   to the list of handles in the system. InstallMultipleProtocolInterfaces() performs
12090d1ba665SWarner Losh   more error checking than InstallProtocolInterface(), so it is recommended that
12100d1ba665SWarner Losh   InstallMultipleProtocolInterfaces() be used in place of
12110d1ba665SWarner Losh   InstallProtocolInterface()
12120d1ba665SWarner Losh 
12130d1ba665SWarner Losh   @param[in, out]  Handle         A pointer to the EFI_HANDLE on which the interface is to be installed.
12140d1ba665SWarner Losh   @param[in]       Protocol       The numeric ID of the protocol interface.
12150d1ba665SWarner Losh   @param[in]       InterfaceType  Indicates whether Interface is supplied in native form.
12160d1ba665SWarner Losh   @param[in]       Interface      A pointer to the protocol interface.
12170d1ba665SWarner Losh 
12180d1ba665SWarner Losh   @retval EFI_SUCCESS           The protocol interface was installed.
12190d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  Space for a new handle could not be allocated.
12200d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Handle is NULL.
12210d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Protocol is NULL.
12220d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER InterfaceType is not EFI_NATIVE_INTERFACE.
12230d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.
12240d1ba665SWarner Losh 
12250d1ba665SWarner Losh **/
12260d1ba665SWarner Losh typedef
12270d1ba665SWarner Losh EFI_STATUS
12280d1ba665SWarner Losh (EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE)(
12290d1ba665SWarner Losh   IN OUT EFI_HANDLE               *Handle,
12300d1ba665SWarner Losh   IN     EFI_GUID                 *Protocol,
12310d1ba665SWarner Losh   IN     EFI_INTERFACE_TYPE       InterfaceType,
12320d1ba665SWarner Losh   IN     VOID                     *Interface
12330d1ba665SWarner Losh   );
12340d1ba665SWarner Losh 
12350d1ba665SWarner Losh /**
12360d1ba665SWarner Losh   Installs one or more protocol interfaces into the boot services environment.
12370d1ba665SWarner Losh 
12380d1ba665SWarner Losh   @param[in, out]  Handle       The pointer to a handle to install the new protocol interfaces on,
12390d1ba665SWarner Losh                                 or a pointer to NULL if a new handle is to be allocated.
12400d1ba665SWarner Losh   @param  ...                   A variable argument list containing pairs of protocol GUIDs and protocol
12410d1ba665SWarner Losh                                 interfaces.
12420d1ba665SWarner Losh 
12430d1ba665SWarner Losh   @retval EFI_SUCCESS           All the protocol interface was installed.
12440d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  There was not enough memory in pool to install all the protocols.
12450d1ba665SWarner Losh   @retval EFI_ALREADY_STARTED   A Device Path Protocol instance was passed in that is already present in
12460d1ba665SWarner Losh                                 the handle database.
12470d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Handle is NULL.
12480d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.
12490d1ba665SWarner Losh 
12500d1ba665SWarner Losh **/
12510d1ba665SWarner Losh typedef
12520d1ba665SWarner Losh EFI_STATUS
12530d1ba665SWarner Losh (EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES)(
12540d1ba665SWarner Losh   IN OUT EFI_HANDLE           *Handle,
12550d1ba665SWarner Losh   ...
12560d1ba665SWarner Losh   );
12570d1ba665SWarner Losh 
12580d1ba665SWarner Losh /**
12590d1ba665SWarner Losh   Reinstalls a protocol interface on a device handle.
12600d1ba665SWarner Losh 
12610d1ba665SWarner Losh   @param[in]  Handle            Handle on which the interface is to be reinstalled.
12620d1ba665SWarner Losh   @param[in]  Protocol          The numeric ID of the interface.
12630d1ba665SWarner Losh   @param[in]  OldInterface      A pointer to the old interface. NULL can be used if a structure is not
12640d1ba665SWarner Losh                                 associated with Protocol.
12650d1ba665SWarner Losh   @param[in]  NewInterface      A pointer to the new interface.
12660d1ba665SWarner Losh 
12670d1ba665SWarner Losh   @retval EFI_SUCCESS           The protocol interface was reinstalled.
12680d1ba665SWarner Losh   @retval EFI_NOT_FOUND         The OldInterface on the handle was not found.
12690d1ba665SWarner Losh   @retval EFI_ACCESS_DENIED     The protocol interface could not be reinstalled,
12700d1ba665SWarner Losh                                 because OldInterface is still being used by a
12710d1ba665SWarner Losh                                 driver that will not release it.
12720d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Handle is NULL.
12730d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Protocol is NULL.
12740d1ba665SWarner Losh 
12750d1ba665SWarner Losh **/
12760d1ba665SWarner Losh typedef
12770d1ba665SWarner Losh EFI_STATUS
12780d1ba665SWarner Losh (EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE)(
12790d1ba665SWarner Losh   IN EFI_HANDLE               Handle,
12800d1ba665SWarner Losh   IN EFI_GUID                 *Protocol,
12810d1ba665SWarner Losh   IN VOID                     *OldInterface,
12820d1ba665SWarner Losh   IN VOID                     *NewInterface
12830d1ba665SWarner Losh   );
12840d1ba665SWarner Losh 
12850d1ba665SWarner Losh /**
12860d1ba665SWarner Losh   Removes a protocol interface from a device handle. It is recommended that
12870d1ba665SWarner Losh   UninstallMultipleProtocolInterfaces() be used in place of
12880d1ba665SWarner Losh   UninstallProtocolInterface().
12890d1ba665SWarner Losh 
12900d1ba665SWarner Losh   @param[in]  Handle            The handle on which the interface was installed.
12910d1ba665SWarner Losh   @param[in]  Protocol          The numeric ID of the interface.
12920d1ba665SWarner Losh   @param[in]  Interface         A pointer to the interface.
12930d1ba665SWarner Losh 
12940d1ba665SWarner Losh   @retval EFI_SUCCESS           The interface was removed.
12950d1ba665SWarner Losh   @retval EFI_NOT_FOUND         The interface was not found.
12960d1ba665SWarner Losh   @retval EFI_ACCESS_DENIED     The interface was not removed because the interface
12970d1ba665SWarner Losh                                 is still being used by a driver.
12980d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Handle is NULL.
12990d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Protocol is NULL.
13000d1ba665SWarner Losh 
13010d1ba665SWarner Losh **/
13020d1ba665SWarner Losh typedef
13030d1ba665SWarner Losh EFI_STATUS
13040d1ba665SWarner Losh (EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE)(
13050d1ba665SWarner Losh   IN EFI_HANDLE               Handle,
13060d1ba665SWarner Losh   IN EFI_GUID                 *Protocol,
13070d1ba665SWarner Losh   IN VOID                     *Interface
13080d1ba665SWarner Losh   );
13090d1ba665SWarner Losh 
13100d1ba665SWarner Losh /**
13110d1ba665SWarner Losh   Removes one or more protocol interfaces into the boot services environment.
13120d1ba665SWarner Losh 
13130d1ba665SWarner Losh   @param[in]  Handle            The handle to remove the protocol interfaces from.
13140d1ba665SWarner Losh   @param  ...                   A variable argument list containing pairs of protocol GUIDs and
13150d1ba665SWarner Losh                                 protocol interfaces.
13160d1ba665SWarner Losh 
13170d1ba665SWarner Losh   @retval EFI_SUCCESS           All the protocol interfaces were removed.
13180d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.
13190d1ba665SWarner Losh 
13200d1ba665SWarner Losh **/
13210d1ba665SWarner Losh typedef
13220d1ba665SWarner Losh EFI_STATUS
13230d1ba665SWarner Losh (EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES)(
13240d1ba665SWarner Losh   IN EFI_HANDLE           Handle,
13250d1ba665SWarner Losh   ...
13260d1ba665SWarner Losh   );
13270d1ba665SWarner Losh 
13280d1ba665SWarner Losh /**
13290d1ba665SWarner Losh   Queries a handle to determine if it supports a specified protocol.
13300d1ba665SWarner Losh 
13310d1ba665SWarner Losh   @param[in]   Handle           The handle being queried.
13320d1ba665SWarner Losh   @param[in]   Protocol         The published unique identifier of the protocol.
13330d1ba665SWarner Losh   @param[out]  Interface        Supplies the address where a pointer to the corresponding Protocol
13340d1ba665SWarner Losh                                 Interface is returned.
13350d1ba665SWarner Losh 
13360d1ba665SWarner Losh   @retval EFI_SUCCESS           The interface information for the specified protocol was returned.
13370d1ba665SWarner Losh   @retval EFI_UNSUPPORTED       The device does not support the specified protocol.
13380d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Handle is NULL.
13390d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Protocol is NULL.
13400d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Interface is NULL.
13410d1ba665SWarner Losh 
13420d1ba665SWarner Losh **/
13430d1ba665SWarner Losh typedef
13440d1ba665SWarner Losh EFI_STATUS
13450d1ba665SWarner Losh (EFIAPI *EFI_HANDLE_PROTOCOL)(
13460d1ba665SWarner Losh   IN  EFI_HANDLE               Handle,
13470d1ba665SWarner Losh   IN  EFI_GUID                 *Protocol,
13480d1ba665SWarner Losh   OUT VOID                     **Interface
13490d1ba665SWarner Losh   );
13500d1ba665SWarner Losh 
13510d1ba665SWarner Losh #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL   0x00000001
13520d1ba665SWarner Losh #define EFI_OPEN_PROTOCOL_GET_PROTOCOL         0x00000002
13530d1ba665SWarner Losh #define EFI_OPEN_PROTOCOL_TEST_PROTOCOL        0x00000004
13540d1ba665SWarner Losh #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER  0x00000008
13550d1ba665SWarner Losh #define EFI_OPEN_PROTOCOL_BY_DRIVER            0x00000010
13560d1ba665SWarner Losh #define EFI_OPEN_PROTOCOL_EXCLUSIVE            0x00000020
13570d1ba665SWarner Losh 
13580d1ba665SWarner Losh /**
13590d1ba665SWarner Losh   Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the
13600d1ba665SWarner Losh   handle, it opens the protocol on behalf of the calling agent.
13610d1ba665SWarner Losh 
13620d1ba665SWarner Losh   @param[in]   Handle           The handle for the protocol interface that is being opened.
13630d1ba665SWarner Losh   @param[in]   Protocol         The published unique identifier of the protocol.
13640d1ba665SWarner Losh   @param[out]  Interface        Supplies the address where a pointer to the corresponding Protocol
13650d1ba665SWarner Losh                                 Interface is returned.
13660d1ba665SWarner Losh   @param[in]   AgentHandle      The handle of the agent that is opening the protocol interface
13670d1ba665SWarner Losh                                 specified by Protocol and Interface.
13680d1ba665SWarner Losh   @param[in]   ControllerHandle If the agent that is opening a protocol is a driver that follows the
13690d1ba665SWarner Losh                                 UEFI Driver Model, then this parameter is the controller handle
13700d1ba665SWarner Losh                                 that requires the protocol interface. If the agent does not follow
13710d1ba665SWarner Losh                                 the UEFI Driver Model, then this parameter is optional and may
13720d1ba665SWarner Losh                                 be NULL.
13730d1ba665SWarner Losh   @param[in]   Attributes       The open mode of the protocol interface specified by Handle
13740d1ba665SWarner Losh                                 and Protocol.
13750d1ba665SWarner Losh 
13760d1ba665SWarner Losh   @retval EFI_SUCCESS           An item was added to the open list for the protocol interface, and the
13770d1ba665SWarner Losh                                 protocol interface was returned in Interface.
13780d1ba665SWarner Losh   @retval EFI_UNSUPPORTED       Handle does not support Protocol.
13790d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
13800d1ba665SWarner Losh   @retval EFI_ACCESS_DENIED     Required attributes can't be supported in current environment.
13810d1ba665SWarner Losh   @retval EFI_ALREADY_STARTED   Item on the open list already has requierd attributes whose agent
13820d1ba665SWarner Losh                                 handle is the same as AgentHandle.
13830d1ba665SWarner Losh 
13840d1ba665SWarner Losh **/
13850d1ba665SWarner Losh typedef
13860d1ba665SWarner Losh EFI_STATUS
13870d1ba665SWarner Losh (EFIAPI *EFI_OPEN_PROTOCOL)(
13880d1ba665SWarner Losh   IN  EFI_HANDLE                Handle,
13890d1ba665SWarner Losh   IN  EFI_GUID                  *Protocol,
1390*580fcf64SWarner Losh   OUT VOID                      **Interface  OPTIONAL,
13910d1ba665SWarner Losh   IN  EFI_HANDLE                AgentHandle,
13920d1ba665SWarner Losh   IN  EFI_HANDLE                ControllerHandle,
13930d1ba665SWarner Losh   IN  UINT32                    Attributes
13940d1ba665SWarner Losh   );
13950d1ba665SWarner Losh 
13960d1ba665SWarner Losh /**
13970d1ba665SWarner Losh   Closes a protocol on a handle that was opened using OpenProtocol().
13980d1ba665SWarner Losh 
13990d1ba665SWarner Losh   @param[in]  Handle            The handle for the protocol interface that was previously opened
14000d1ba665SWarner Losh                                 with OpenProtocol(), and is now being closed.
14010d1ba665SWarner Losh   @param[in]  Protocol          The published unique identifier of the protocol.
14020d1ba665SWarner Losh   @param[in]  AgentHandle       The handle of the agent that is closing the protocol interface.
14030d1ba665SWarner Losh   @param[in]  ControllerHandle  If the agent that opened a protocol is a driver that follows the
14040d1ba665SWarner Losh                                 UEFI Driver Model, then this parameter is the controller handle
14050d1ba665SWarner Losh                                 that required the protocol interface.
14060d1ba665SWarner Losh 
14070d1ba665SWarner Losh   @retval EFI_SUCCESS           The protocol instance was closed.
14080d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER 1) Handle is NULL.
14090d1ba665SWarner Losh                                 2) AgentHandle is NULL.
14100d1ba665SWarner Losh                                 3) ControllerHandle is not NULL and ControllerHandle is not a valid EFI_HANDLE.
14110d1ba665SWarner Losh                                 4) Protocol is NULL.
14120d1ba665SWarner Losh   @retval EFI_NOT_FOUND         1) Handle does not support the protocol specified by Protocol.
14130d1ba665SWarner Losh                                 2) The protocol interface specified by Handle and Protocol is not
14140d1ba665SWarner Losh                                    currently open by AgentHandle and ControllerHandle.
14150d1ba665SWarner Losh 
14160d1ba665SWarner Losh **/
14170d1ba665SWarner Losh typedef
14180d1ba665SWarner Losh EFI_STATUS
14190d1ba665SWarner Losh (EFIAPI *EFI_CLOSE_PROTOCOL)(
14200d1ba665SWarner Losh   IN EFI_HANDLE               Handle,
14210d1ba665SWarner Losh   IN EFI_GUID                 *Protocol,
14220d1ba665SWarner Losh   IN EFI_HANDLE               AgentHandle,
14230d1ba665SWarner Losh   IN EFI_HANDLE               ControllerHandle
14240d1ba665SWarner Losh   );
14250d1ba665SWarner Losh 
14260d1ba665SWarner Losh ///
14270d1ba665SWarner Losh /// EFI Oprn Protocol Information Entry
14280d1ba665SWarner Losh ///
14290d1ba665SWarner Losh typedef struct {
14300d1ba665SWarner Losh   EFI_HANDLE    AgentHandle;
14310d1ba665SWarner Losh   EFI_HANDLE    ControllerHandle;
14320d1ba665SWarner Losh   UINT32        Attributes;
14330d1ba665SWarner Losh   UINT32        OpenCount;
14340d1ba665SWarner Losh } EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
14350d1ba665SWarner Losh 
14360d1ba665SWarner Losh /**
14370d1ba665SWarner Losh   Retrieves the list of agents that currently have a protocol interface opened.
14380d1ba665SWarner Losh 
14390d1ba665SWarner Losh   @param[in]   Handle           The handle for the protocol interface that is being queried.
14400d1ba665SWarner Losh   @param[in]   Protocol         The published unique identifier of the protocol.
14410d1ba665SWarner Losh   @param[out]  EntryBuffer      A pointer to a buffer of open protocol information in the form of
14420d1ba665SWarner Losh                                 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
14430d1ba665SWarner Losh   @param[out]  EntryCount       A pointer to the number of entries in EntryBuffer.
14440d1ba665SWarner Losh 
14450d1ba665SWarner Losh   @retval EFI_SUCCESS           The open protocol information was returned in EntryBuffer, and the
14460d1ba665SWarner Losh                                 number of entries was returned EntryCount.
14470d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to allocate EntryBuffer.
14480d1ba665SWarner Losh   @retval EFI_NOT_FOUND         Handle does not support the protocol specified by Protocol.
14490d1ba665SWarner Losh 
14500d1ba665SWarner Losh **/
14510d1ba665SWarner Losh typedef
14520d1ba665SWarner Losh EFI_STATUS
14530d1ba665SWarner Losh (EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION)(
14540d1ba665SWarner Losh   IN  EFI_HANDLE                          Handle,
14550d1ba665SWarner Losh   IN  EFI_GUID                            *Protocol,
14560d1ba665SWarner Losh   OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
14570d1ba665SWarner Losh   OUT UINTN                               *EntryCount
14580d1ba665SWarner Losh   );
14590d1ba665SWarner Losh 
14600d1ba665SWarner Losh /**
14610d1ba665SWarner Losh   Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated
14620d1ba665SWarner Losh   from pool.
14630d1ba665SWarner Losh 
14640d1ba665SWarner Losh   @param[in]   Handle              The handle from which to retrieve the list of protocol interface
14650d1ba665SWarner Losh                                    GUIDs.
14660d1ba665SWarner Losh   @param[out]  ProtocolBuffer      A pointer to the list of protocol interface GUID pointers that are
14670d1ba665SWarner Losh                                    installed on Handle.
14680d1ba665SWarner Losh   @param[out]  ProtocolBufferCount A pointer to the number of GUID pointers present in
14690d1ba665SWarner Losh                                    ProtocolBuffer.
14700d1ba665SWarner Losh 
14710d1ba665SWarner Losh   @retval EFI_SUCCESS           The list of protocol interface GUIDs installed on Handle was returned in
14720d1ba665SWarner Losh                                 ProtocolBuffer. The number of protocol interface GUIDs was
14730d1ba665SWarner Losh                                 returned in ProtocolBufferCount.
14740d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  There is not enough pool memory to store the results.
14750d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Handle is NULL.
14760d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.
14770d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.
14780d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.
14790d1ba665SWarner Losh 
14800d1ba665SWarner Losh **/
14810d1ba665SWarner Losh typedef
14820d1ba665SWarner Losh EFI_STATUS
14830d1ba665SWarner Losh (EFIAPI *EFI_PROTOCOLS_PER_HANDLE)(
14840d1ba665SWarner Losh   IN  EFI_HANDLE      Handle,
14850d1ba665SWarner Losh   OUT EFI_GUID        ***ProtocolBuffer,
14860d1ba665SWarner Losh   OUT UINTN           *ProtocolBufferCount
14870d1ba665SWarner Losh   );
14880d1ba665SWarner Losh 
14890d1ba665SWarner Losh /**
14900d1ba665SWarner Losh   Creates an event that is to be signaled whenever an interface is installed for a specified protocol.
14910d1ba665SWarner Losh 
14920d1ba665SWarner Losh   @param[in]   Protocol         The numeric ID of the protocol for which the event is to be registered.
14930d1ba665SWarner Losh   @param[in]   Event            Event that is to be signaled whenever a protocol interface is registered
14940d1ba665SWarner Losh                                 for Protocol.
14950d1ba665SWarner Losh   @param[out]  Registration     A pointer to a memory location to receive the registration value.
14960d1ba665SWarner Losh 
14970d1ba665SWarner Losh   @retval EFI_SUCCESS           The notification event has been registered.
14980d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  Space for the notification event could not be allocated.
14990d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Protocol is NULL.
15000d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Event is NULL.
15010d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Registration is NULL.
15020d1ba665SWarner Losh 
15030d1ba665SWarner Losh **/
15040d1ba665SWarner Losh typedef
15050d1ba665SWarner Losh EFI_STATUS
15060d1ba665SWarner Losh (EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY)(
15070d1ba665SWarner Losh   IN  EFI_GUID                 *Protocol,
15080d1ba665SWarner Losh   IN  EFI_EVENT                Event,
15090d1ba665SWarner Losh   OUT VOID                     **Registration
15100d1ba665SWarner Losh   );
15110d1ba665SWarner Losh 
15120d1ba665SWarner Losh ///
15130d1ba665SWarner Losh /// Enumeration of EFI Locate Search Types
15140d1ba665SWarner Losh ///
15150d1ba665SWarner Losh typedef enum {
15160d1ba665SWarner Losh   ///
15170d1ba665SWarner Losh   /// Retrieve all the handles in the handle database.
15180d1ba665SWarner Losh   ///
15190d1ba665SWarner Losh   AllHandles,
15200d1ba665SWarner Losh   ///
15210d1ba665SWarner Losh   /// Retrieve the next handle fron a RegisterProtocolNotify() event.
15220d1ba665SWarner Losh   ///
15230d1ba665SWarner Losh   ByRegisterNotify,
15240d1ba665SWarner Losh   ///
15250d1ba665SWarner Losh   /// Retrieve the set of handles from the handle database that support a
15260d1ba665SWarner Losh   /// specified protocol.
15270d1ba665SWarner Losh   ///
15280d1ba665SWarner Losh   ByProtocol
15290d1ba665SWarner Losh } EFI_LOCATE_SEARCH_TYPE;
15300d1ba665SWarner Losh 
15310d1ba665SWarner Losh /**
15320d1ba665SWarner Losh   Returns an array of handles that support a specified protocol.
15330d1ba665SWarner Losh 
15340d1ba665SWarner Losh   @param[in]       SearchType   Specifies which handle(s) are to be returned.
15350d1ba665SWarner Losh   @param[in]       Protocol     Specifies the protocol to search by.
15360d1ba665SWarner Losh   @param[in]       SearchKey    Specifies the search key.
15370d1ba665SWarner Losh   @param[in, out]  BufferSize   On input, the size in bytes of Buffer. On output, the size in bytes of
15380d1ba665SWarner Losh                                 the array returned in Buffer (if the buffer was large enough) or the
15390d1ba665SWarner Losh                                 size, in bytes, of the buffer needed to obtain the array (if the buffer was
15400d1ba665SWarner Losh                                 not large enough).
15410d1ba665SWarner Losh   @param[out]      Buffer       The buffer in which the array is returned.
15420d1ba665SWarner Losh 
15430d1ba665SWarner Losh   @retval EFI_SUCCESS           The array of handles was returned.
15440d1ba665SWarner Losh   @retval EFI_NOT_FOUND         No handles match the search.
15450d1ba665SWarner Losh   @retval EFI_BUFFER_TOO_SMALL  The BufferSize is too small for the result.
15460d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER SearchType is not a member of EFI_LOCATE_SEARCH_TYPE.
15470d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER SearchType is ByRegisterNotify and SearchKey is NULL.
15480d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER SearchType is ByProtocol and Protocol is NULL.
15490d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER One or more matches are found and BufferSize is NULL.
15500d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER BufferSize is large enough for the result and Buffer is NULL.
15510d1ba665SWarner Losh 
15520d1ba665SWarner Losh **/
15530d1ba665SWarner Losh typedef
15540d1ba665SWarner Losh EFI_STATUS
15550d1ba665SWarner Losh (EFIAPI *EFI_LOCATE_HANDLE)(
15560d1ba665SWarner Losh   IN     EFI_LOCATE_SEARCH_TYPE   SearchType,
1557*580fcf64SWarner Losh   IN     EFI_GUID                 *Protocol     OPTIONAL,
1558*580fcf64SWarner Losh   IN     VOID                     *SearchKey    OPTIONAL,
15590d1ba665SWarner Losh   IN OUT UINTN                    *BufferSize,
15600d1ba665SWarner Losh   OUT    EFI_HANDLE               *Buffer
15610d1ba665SWarner Losh   );
15620d1ba665SWarner Losh 
15630d1ba665SWarner Losh /**
15640d1ba665SWarner Losh   Locates the handle to a device on the device path that supports the specified protocol.
15650d1ba665SWarner Losh 
15660d1ba665SWarner Losh   @param[in]       Protocol     Specifies the protocol to search for.
15670d1ba665SWarner Losh   @param[in, out]  DevicePath   On input, a pointer to a pointer to the device path. On output, the device
15680d1ba665SWarner Losh                                 path pointer is modified to point to the remaining part of the device
15690d1ba665SWarner Losh                                 path.
15700d1ba665SWarner Losh   @param[out]      Device       A pointer to the returned device handle.
15710d1ba665SWarner Losh 
15720d1ba665SWarner Losh   @retval EFI_SUCCESS           The resulting handle was returned.
15730d1ba665SWarner Losh   @retval EFI_NOT_FOUND         No handles match the search.
15740d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Protocol is NULL.
15750d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER DevicePath is NULL.
15760d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER A handle matched the search and Device is NULL.
15770d1ba665SWarner Losh 
15780d1ba665SWarner Losh **/
15790d1ba665SWarner Losh typedef
15800d1ba665SWarner Losh EFI_STATUS
15810d1ba665SWarner Losh (EFIAPI *EFI_LOCATE_DEVICE_PATH)(
15820d1ba665SWarner Losh   IN     EFI_GUID                         *Protocol,
15830d1ba665SWarner Losh   IN OUT EFI_DEVICE_PATH_PROTOCOL         **DevicePath,
15840d1ba665SWarner Losh   OUT    EFI_HANDLE                       *Device
15850d1ba665SWarner Losh   );
15860d1ba665SWarner Losh 
15870d1ba665SWarner Losh /**
15880d1ba665SWarner Losh   Adds, updates, or removes a configuration table entry from the EFI System Table.
15890d1ba665SWarner Losh 
15900d1ba665SWarner Losh   @param[in]  Guid              A pointer to the GUID for the entry to add, update, or remove.
15910d1ba665SWarner Losh   @param[in]  Table             A pointer to the configuration table for the entry to add, update, or
15920d1ba665SWarner Losh                                 remove. May be NULL.
15930d1ba665SWarner Losh 
15940d1ba665SWarner Losh   @retval EFI_SUCCESS           The (Guid, Table) pair was added, updated, or removed.
15950d1ba665SWarner Losh   @retval EFI_NOT_FOUND         An attempt was made to delete a nonexistent entry.
15960d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Guid is NULL.
15970d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  There is not enough memory available to complete the operation.
15980d1ba665SWarner Losh 
15990d1ba665SWarner Losh **/
16000d1ba665SWarner Losh typedef
16010d1ba665SWarner Losh EFI_STATUS
16020d1ba665SWarner Losh (EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE)(
16030d1ba665SWarner Losh   IN EFI_GUID                 *Guid,
16040d1ba665SWarner Losh   IN VOID                     *Table
16050d1ba665SWarner Losh   );
16060d1ba665SWarner Losh 
16070d1ba665SWarner Losh /**
16080d1ba665SWarner Losh   Returns an array of handles that support the requested protocol in a buffer allocated from pool.
16090d1ba665SWarner Losh 
16100d1ba665SWarner Losh   @param[in]       SearchType   Specifies which handle(s) are to be returned.
16110d1ba665SWarner Losh   @param[in]       Protocol     Provides the protocol to search by.
16120d1ba665SWarner Losh                                 This parameter is only valid for a SearchType of ByProtocol.
16130d1ba665SWarner Losh   @param[in]       SearchKey    Supplies the search key depending on the SearchType.
16143245fa21SMitchell Horne   @param[out]      NoHandles    The number of handles returned in Buffer.
16150d1ba665SWarner Losh   @param[out]      Buffer       A pointer to the buffer to return the requested array of handles that
16160d1ba665SWarner Losh                                 support Protocol.
16170d1ba665SWarner Losh 
16180d1ba665SWarner Losh   @retval EFI_SUCCESS           The array of handles was returned in Buffer, and the number of
16190d1ba665SWarner Losh                                 handles in Buffer was returned in NoHandles.
16200d1ba665SWarner Losh   @retval EFI_NOT_FOUND         No handles match the search.
16210d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  There is not enough pool memory to store the matching results.
16220d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER NoHandles is NULL.
16230d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Buffer is NULL.
16240d1ba665SWarner Losh 
16250d1ba665SWarner Losh **/
16260d1ba665SWarner Losh typedef
16270d1ba665SWarner Losh EFI_STATUS
16280d1ba665SWarner Losh (EFIAPI *EFI_LOCATE_HANDLE_BUFFER)(
16290d1ba665SWarner Losh   IN     EFI_LOCATE_SEARCH_TYPE       SearchType,
1630*580fcf64SWarner Losh   IN     EFI_GUID                     *Protocol       OPTIONAL,
1631*580fcf64SWarner Losh   IN     VOID                         *SearchKey      OPTIONAL,
16323245fa21SMitchell Horne   OUT    UINTN                        *NoHandles,
16330d1ba665SWarner Losh   OUT    EFI_HANDLE                   **Buffer
16340d1ba665SWarner Losh   );
16350d1ba665SWarner Losh 
16360d1ba665SWarner Losh /**
16370d1ba665SWarner Losh   Returns the first protocol instance that matches the given protocol.
16380d1ba665SWarner Losh 
16390d1ba665SWarner Losh   @param[in]  Protocol          Provides the protocol to search for.
16400d1ba665SWarner Losh   @param[in]  Registration      Optional registration key returned from
16410d1ba665SWarner Losh                                 RegisterProtocolNotify().
16420d1ba665SWarner Losh   @param[out]  Interface        On return, a pointer to the first interface that matches Protocol and
16430d1ba665SWarner Losh                                 Registration.
16440d1ba665SWarner Losh 
16450d1ba665SWarner Losh   @retval EFI_SUCCESS           A protocol instance matching Protocol was found and returned in
16460d1ba665SWarner Losh                                 Interface.
16470d1ba665SWarner Losh   @retval EFI_NOT_FOUND         No protocol instances were found that match Protocol and
16480d1ba665SWarner Losh                                 Registration.
16490d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER Interface is NULL.
16503245fa21SMitchell Horne                                 Protocol is NULL.
16510d1ba665SWarner Losh 
16520d1ba665SWarner Losh **/
16530d1ba665SWarner Losh typedef
16540d1ba665SWarner Losh EFI_STATUS
16550d1ba665SWarner Losh (EFIAPI *EFI_LOCATE_PROTOCOL)(
16560d1ba665SWarner Losh   IN  EFI_GUID  *Protocol,
1657*580fcf64SWarner Losh   IN  VOID      *Registration  OPTIONAL,
16580d1ba665SWarner Losh   OUT VOID      **Interface
16590d1ba665SWarner Losh   );
16600d1ba665SWarner Losh 
16610d1ba665SWarner Losh ///
16620d1ba665SWarner Losh /// EFI Capsule Block Descriptor
16630d1ba665SWarner Losh ///
16640d1ba665SWarner Losh typedef struct {
16650d1ba665SWarner Losh   ///
16660d1ba665SWarner Losh   /// Length in bytes of the data pointed to by DataBlock/ContinuationPointer.
16670d1ba665SWarner Losh   ///
16680d1ba665SWarner Losh   UINT64    Length;
16690d1ba665SWarner Losh   union {
16700d1ba665SWarner Losh     ///
16710d1ba665SWarner Losh     /// Physical address of the data block. This member of the union is
16720d1ba665SWarner Losh     /// used if Length is not equal to zero.
16730d1ba665SWarner Losh     ///
16740d1ba665SWarner Losh     EFI_PHYSICAL_ADDRESS    DataBlock;
16750d1ba665SWarner Losh     ///
16760d1ba665SWarner Losh     /// Physical address of another block of
16770d1ba665SWarner Losh     /// EFI_CAPSULE_BLOCK_DESCRIPTOR structures. This
16780d1ba665SWarner Losh     /// member of the union is used if Length is equal to zero. If
16790d1ba665SWarner Losh     /// ContinuationPointer is zero this entry represents the end of the list.
16800d1ba665SWarner Losh     ///
16810d1ba665SWarner Losh     EFI_PHYSICAL_ADDRESS    ContinuationPointer;
16820d1ba665SWarner Losh   } Union;
16830d1ba665SWarner Losh } EFI_CAPSULE_BLOCK_DESCRIPTOR;
16840d1ba665SWarner Losh 
16850d1ba665SWarner Losh ///
16860d1ba665SWarner Losh /// EFI Capsule Header.
16870d1ba665SWarner Losh ///
16880d1ba665SWarner Losh typedef struct {
16890d1ba665SWarner Losh   ///
16900d1ba665SWarner Losh   /// A GUID that defines the contents of a capsule.
16910d1ba665SWarner Losh   ///
16920d1ba665SWarner Losh   EFI_GUID    CapsuleGuid;
16930d1ba665SWarner Losh   ///
16940d1ba665SWarner Losh   /// The size of the capsule header. This may be larger than the size of
16950d1ba665SWarner Losh   /// the EFI_CAPSULE_HEADER since CapsuleGuid may imply
16960d1ba665SWarner Losh   /// extended header entries
16970d1ba665SWarner Losh   ///
16980d1ba665SWarner Losh   UINT32      HeaderSize;
16990d1ba665SWarner Losh   ///
17000d1ba665SWarner Losh   /// Bit-mapped list describing the capsule attributes. The Flag values
17010d1ba665SWarner Losh   /// of 0x0000 - 0xFFFF are defined by CapsuleGuid. Flag values
17020d1ba665SWarner Losh   /// of 0x10000 - 0xFFFFFFFF are defined by this specification
17030d1ba665SWarner Losh   ///
17040d1ba665SWarner Losh   UINT32      Flags;
17050d1ba665SWarner Losh   ///
1706*580fcf64SWarner Losh   /// Size in bytes of the capsule (including capsule header).
17070d1ba665SWarner Losh   ///
17080d1ba665SWarner Losh   UINT32      CapsuleImageSize;
17090d1ba665SWarner Losh } EFI_CAPSULE_HEADER;
17100d1ba665SWarner Losh 
17110d1ba665SWarner Losh ///
17120d1ba665SWarner Losh /// The EFI System Table entry must point to an array of capsules
17130d1ba665SWarner Losh /// that contain the same CapsuleGuid value. The array must be
17140d1ba665SWarner Losh /// prefixed by a UINT32 that represents the size of the array of capsules.
17150d1ba665SWarner Losh ///
17160d1ba665SWarner Losh typedef struct {
17170d1ba665SWarner Losh   ///
17180d1ba665SWarner Losh   /// the size of the array of capsules.
17190d1ba665SWarner Losh   ///
17200d1ba665SWarner Losh   UINT32    CapsuleArrayNumber;
17210d1ba665SWarner Losh   ///
17220d1ba665SWarner Losh   /// Point to an array of capsules that contain the same CapsuleGuid value.
17230d1ba665SWarner Losh   ///
17240d1ba665SWarner Losh   VOID      *CapsulePtr[1];
17250d1ba665SWarner Losh } EFI_CAPSULE_TABLE;
17260d1ba665SWarner Losh 
17270d1ba665SWarner Losh #define CAPSULE_FLAGS_PERSIST_ACROSS_RESET   0x00010000
17280d1ba665SWarner Losh #define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE  0x00020000
17290d1ba665SWarner Losh #define CAPSULE_FLAGS_INITIATE_RESET         0x00040000
17300d1ba665SWarner Losh 
17310d1ba665SWarner Losh /**
17320d1ba665SWarner Losh   Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
17330d1ba665SWarner Losh   consumption, the firmware may process the capsule immediately. If the payload should persist
17340d1ba665SWarner Losh   across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must
17350d1ba665SWarner Losh   be passed into ResetSystem() and will cause the capsule to be processed by the firmware as
17360d1ba665SWarner Losh   part of the reset process.
17370d1ba665SWarner Losh 
17380d1ba665SWarner Losh   @param[in]  CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
17390d1ba665SWarner Losh                                  being passed into update capsule.
17400d1ba665SWarner Losh   @param[in]  CapsuleCount       Number of pointers to EFI_CAPSULE_HEADER in
17410d1ba665SWarner Losh                                  CaspuleHeaderArray.
17420d1ba665SWarner Losh   @param[in]  ScatterGatherList  Physical pointer to a set of
17430d1ba665SWarner Losh                                  EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the
17440d1ba665SWarner Losh                                  location in physical memory of a set of capsules.
17450d1ba665SWarner Losh 
17460d1ba665SWarner Losh   @retval EFI_SUCCESS           Valid capsule was passed. If
17470d1ba665SWarner Losh                                 CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the
17480d1ba665SWarner Losh                                 capsule has been successfully processed by the firmware.
17490d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were
17500d1ba665SWarner Losh                                 set in the capsule header.
17510d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER CapsuleCount is 0.
17520d1ba665SWarner Losh   @retval EFI_DEVICE_ERROR      The capsule update was started, but failed due to a device error.
17530d1ba665SWarner Losh   @retval EFI_UNSUPPORTED       The capsule type is not supported on this platform.
17540d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has been previously called this error indicates the capsule
17550d1ba665SWarner Losh                                 is compatible with this platform but is not capable of being submitted or processed
17560d1ba665SWarner Losh                                 in runtime. The caller may resubmit the capsule prior to ExitBootServices().
17570d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates
17580d1ba665SWarner Losh                                 the capsule is compatible with this platform but there are insufficient resources to process.
1759*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
1760*580fcf64SWarner Losh                                 The platform should describe this runtime service as unsupported at runtime
1761*580fcf64SWarner Losh                                 via an EFI_RT_PROPERTIES_TABLE configuration table.
17620d1ba665SWarner Losh 
17630d1ba665SWarner Losh **/
17640d1ba665SWarner Losh typedef
17650d1ba665SWarner Losh EFI_STATUS
17660d1ba665SWarner Losh (EFIAPI *EFI_UPDATE_CAPSULE)(
17670d1ba665SWarner Losh   IN EFI_CAPSULE_HEADER     **CapsuleHeaderArray,
17680d1ba665SWarner Losh   IN UINTN                  CapsuleCount,
17690d1ba665SWarner Losh   IN EFI_PHYSICAL_ADDRESS   ScatterGatherList   OPTIONAL
17700d1ba665SWarner Losh   );
17710d1ba665SWarner Losh 
17720d1ba665SWarner Losh /**
17730d1ba665SWarner Losh   Returns if the capsule can be supported via UpdateCapsule().
17740d1ba665SWarner Losh 
17750d1ba665SWarner Losh   @param[in]   CapsuleHeaderArray  Virtual pointer to an array of virtual pointers to the capsules
17760d1ba665SWarner Losh                                    being passed into update capsule.
17770d1ba665SWarner Losh   @param[in]   CapsuleCount        Number of pointers to EFI_CAPSULE_HEADER in
17780d1ba665SWarner Losh                                    CaspuleHeaderArray.
17790d1ba665SWarner Losh   @param[out]  MaxiumCapsuleSize   On output the maximum size that UpdateCapsule() can
17800d1ba665SWarner Losh                                    support as an argument to UpdateCapsule() via
17810d1ba665SWarner Losh                                    CapsuleHeaderArray and ScatterGatherList.
17820d1ba665SWarner Losh   @param[out]  ResetType           Returns the type of reset required for the capsule update.
17830d1ba665SWarner Losh 
17840d1ba665SWarner Losh   @retval EFI_SUCCESS           Valid answer returned.
17850d1ba665SWarner Losh   @retval EFI_UNSUPPORTED       The capsule type is not supported on this platform, and
17860d1ba665SWarner Losh                                 MaximumCapsuleSize and ResetType are undefined.
17870d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.
17880d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has been previously called this error indicates the capsule
17890d1ba665SWarner Losh                                 is compatible with this platform but is not capable of being submitted or processed
17900d1ba665SWarner Losh                                 in runtime. The caller may resubmit the capsule prior to ExitBootServices().
17910d1ba665SWarner Losh   @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates
17920d1ba665SWarner Losh                                 the capsule is compatible with this platform but there are insufficient resources to process.
1793*580fcf64SWarner Losh   @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
1794*580fcf64SWarner Losh                                 The platform should describe this runtime service as unsupported at runtime
1795*580fcf64SWarner Losh                                 via an EFI_RT_PROPERTIES_TABLE configuration table.
17960d1ba665SWarner Losh 
17970d1ba665SWarner Losh **/
17980d1ba665SWarner Losh typedef
17990d1ba665SWarner Losh EFI_STATUS
18000d1ba665SWarner Losh (EFIAPI *EFI_QUERY_CAPSULE_CAPABILITIES)(
18010d1ba665SWarner Losh   IN  EFI_CAPSULE_HEADER     **CapsuleHeaderArray,
18020d1ba665SWarner Losh   IN  UINTN                  CapsuleCount,
18030d1ba665SWarner Losh   OUT UINT64                 *MaximumCapsuleSize,
18040d1ba665SWarner Losh   OUT EFI_RESET_TYPE         *ResetType
18050d1ba665SWarner Losh   );
18060d1ba665SWarner Losh 
18070d1ba665SWarner Losh /**
18080d1ba665SWarner Losh   Returns information about the EFI variables.
18090d1ba665SWarner Losh 
18100d1ba665SWarner Losh   @param[in]   Attributes                   Attributes bitmask to specify the type of variables on
18110d1ba665SWarner Losh                                             which to return information.
18120d1ba665SWarner Losh   @param[out]  MaximumVariableStorageSize   On output the maximum size of the storage space
18130d1ba665SWarner Losh                                             available for the EFI variables associated with the
18140d1ba665SWarner Losh                                             attributes specified.
18150d1ba665SWarner Losh   @param[out]  RemainingVariableStorageSize Returns the remaining size of the storage space
18160d1ba665SWarner Losh                                             available for the EFI variables associated with the
18170d1ba665SWarner Losh                                             attributes specified.
18180d1ba665SWarner Losh   @param[out]  MaximumVariableSize          Returns the maximum size of the individual EFI
18190d1ba665SWarner Losh                                             variables associated with the attributes specified.
18200d1ba665SWarner Losh 
18210d1ba665SWarner Losh   @retval EFI_SUCCESS                  Valid answer returned.
18220d1ba665SWarner Losh   @retval EFI_INVALID_PARAMETER        An invalid combination of attribute bits was supplied
18230d1ba665SWarner Losh   @retval EFI_UNSUPPORTED              The attribute is not supported on this platform, and the
18240d1ba665SWarner Losh                                        MaximumVariableStorageSize,
18250d1ba665SWarner Losh                                        RemainingVariableStorageSize, MaximumVariableSize
18260d1ba665SWarner Losh                                        are undefined.
18270d1ba665SWarner Losh 
18280d1ba665SWarner Losh **/
18290d1ba665SWarner Losh typedef
18300d1ba665SWarner Losh EFI_STATUS
18310d1ba665SWarner Losh (EFIAPI *EFI_QUERY_VARIABLE_INFO)(
18320d1ba665SWarner Losh   IN  UINT32            Attributes,
18330d1ba665SWarner Losh   OUT UINT64            *MaximumVariableStorageSize,
18340d1ba665SWarner Losh   OUT UINT64            *RemainingVariableStorageSize,
18350d1ba665SWarner Losh   OUT UINT64            *MaximumVariableSize
18360d1ba665SWarner Losh   );
18370d1ba665SWarner Losh 
18380d1ba665SWarner Losh //
18390d1ba665SWarner Losh // Firmware should stop at a firmware user interface on next boot
18400d1ba665SWarner Losh //
18410d1ba665SWarner Losh #define EFI_OS_INDICATIONS_BOOT_TO_FW_UI                    0x0000000000000001
18420d1ba665SWarner Losh #define EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION             0x0000000000000002
18430d1ba665SWarner Losh #define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED  0x0000000000000004
18440d1ba665SWarner Losh #define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED            0x0000000000000008
18450d1ba665SWarner Losh #define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED     0x0000000000000010
18460d1ba665SWarner Losh #define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY          0x0000000000000040
18473245fa21SMitchell Horne #define EFI_OS_INDICATIONS_JSON_CONFIG_DATA_REFRESH         0x0000000000000080
18480d1ba665SWarner Losh 
18490d1ba665SWarner Losh //
18500d1ba665SWarner Losh // EFI Runtime Services Table
18510d1ba665SWarner Losh //
18520d1ba665SWarner Losh #define EFI_SYSTEM_TABLE_SIGNATURE       SIGNATURE_64 ('I','B','I',' ','S','Y','S','T')
1853*580fcf64SWarner Losh #define EFI_2_110_SYSTEM_TABLE_REVISION  ((2 << 16) | (110))
1854*580fcf64SWarner Losh #define EFI_2_100_SYSTEM_TABLE_REVISION  ((2 << 16) | (100))
1855*580fcf64SWarner Losh #define EFI_2_90_SYSTEM_TABLE_REVISION   ((2 << 16) | (90))
18563245fa21SMitchell Horne #define EFI_2_80_SYSTEM_TABLE_REVISION   ((2 << 16) | (80))
18573245fa21SMitchell Horne #define EFI_2_70_SYSTEM_TABLE_REVISION   ((2 << 16) | (70))
18580d1ba665SWarner Losh #define EFI_2_60_SYSTEM_TABLE_REVISION   ((2 << 16) | (60))
18590d1ba665SWarner Losh #define EFI_2_50_SYSTEM_TABLE_REVISION   ((2 << 16) | (50))
18600d1ba665SWarner Losh #define EFI_2_40_SYSTEM_TABLE_REVISION   ((2 << 16) | (40))
18610d1ba665SWarner Losh #define EFI_2_31_SYSTEM_TABLE_REVISION   ((2 << 16) | (31))
18620d1ba665SWarner Losh #define EFI_2_30_SYSTEM_TABLE_REVISION   ((2 << 16) | (30))
18630d1ba665SWarner Losh #define EFI_2_20_SYSTEM_TABLE_REVISION   ((2 << 16) | (20))
18640d1ba665SWarner Losh #define EFI_2_10_SYSTEM_TABLE_REVISION   ((2 << 16) | (10))
18650d1ba665SWarner Losh #define EFI_2_00_SYSTEM_TABLE_REVISION   ((2 << 16) | (00))
18660d1ba665SWarner Losh #define EFI_1_10_SYSTEM_TABLE_REVISION   ((1 << 16) | (10))
18670d1ba665SWarner Losh #define EFI_1_02_SYSTEM_TABLE_REVISION   ((1 << 16) | (02))
18683245fa21SMitchell Horne #define EFI_SYSTEM_TABLE_REVISION        EFI_2_70_SYSTEM_TABLE_REVISION
18690d1ba665SWarner Losh #define EFI_SPECIFICATION_VERSION        EFI_SYSTEM_TABLE_REVISION
18700d1ba665SWarner Losh 
18710d1ba665SWarner Losh #define EFI_RUNTIME_SERVICES_SIGNATURE  SIGNATURE_64 ('R','U','N','T','S','E','R','V')
18720d1ba665SWarner Losh #define EFI_RUNTIME_SERVICES_REVISION   EFI_SPECIFICATION_VERSION
18730d1ba665SWarner Losh 
18740d1ba665SWarner Losh ///
18750d1ba665SWarner Losh /// EFI Runtime Services Table.
18760d1ba665SWarner Losh ///
18770d1ba665SWarner Losh typedef struct {
18780d1ba665SWarner Losh   ///
18790d1ba665SWarner Losh   /// The table header for the EFI Runtime Services Table.
18800d1ba665SWarner Losh   ///
18810d1ba665SWarner Losh   EFI_TABLE_HEADER                  Hdr;
18820d1ba665SWarner Losh 
18830d1ba665SWarner Losh   //
18840d1ba665SWarner Losh   // Time Services
18850d1ba665SWarner Losh   //
18860d1ba665SWarner Losh   EFI_GET_TIME                      GetTime;
18870d1ba665SWarner Losh   EFI_SET_TIME                      SetTime;
18880d1ba665SWarner Losh   EFI_GET_WAKEUP_TIME               GetWakeupTime;
18890d1ba665SWarner Losh   EFI_SET_WAKEUP_TIME               SetWakeupTime;
18900d1ba665SWarner Losh 
18910d1ba665SWarner Losh   //
18920d1ba665SWarner Losh   // Virtual Memory Services
18930d1ba665SWarner Losh   //
18940d1ba665SWarner Losh   EFI_SET_VIRTUAL_ADDRESS_MAP       SetVirtualAddressMap;
18950d1ba665SWarner Losh   EFI_CONVERT_POINTER               ConvertPointer;
18960d1ba665SWarner Losh 
18970d1ba665SWarner Losh   //
18980d1ba665SWarner Losh   // Variable Services
18990d1ba665SWarner Losh   //
19000d1ba665SWarner Losh   EFI_GET_VARIABLE                  GetVariable;
19010d1ba665SWarner Losh   EFI_GET_NEXT_VARIABLE_NAME        GetNextVariableName;
19020d1ba665SWarner Losh   EFI_SET_VARIABLE                  SetVariable;
19030d1ba665SWarner Losh 
19040d1ba665SWarner Losh   //
19050d1ba665SWarner Losh   // Miscellaneous Services
19060d1ba665SWarner Losh   //
19070d1ba665SWarner Losh   EFI_GET_NEXT_HIGH_MONO_COUNT      GetNextHighMonotonicCount;
19080d1ba665SWarner Losh   EFI_RESET_SYSTEM                  ResetSystem;
19090d1ba665SWarner Losh 
19100d1ba665SWarner Losh   //
19110d1ba665SWarner Losh   // UEFI 2.0 Capsule Services
19120d1ba665SWarner Losh   //
19130d1ba665SWarner Losh   EFI_UPDATE_CAPSULE                UpdateCapsule;
19140d1ba665SWarner Losh   EFI_QUERY_CAPSULE_CAPABILITIES    QueryCapsuleCapabilities;
19150d1ba665SWarner Losh 
19160d1ba665SWarner Losh   //
19170d1ba665SWarner Losh   // Miscellaneous UEFI 2.0 Service
19180d1ba665SWarner Losh   //
19190d1ba665SWarner Losh   EFI_QUERY_VARIABLE_INFO           QueryVariableInfo;
19200d1ba665SWarner Losh } EFI_RUNTIME_SERVICES;
19210d1ba665SWarner Losh 
19220d1ba665SWarner Losh #define EFI_BOOT_SERVICES_SIGNATURE  SIGNATURE_64 ('B','O','O','T','S','E','R','V')
19230d1ba665SWarner Losh #define EFI_BOOT_SERVICES_REVISION   EFI_SPECIFICATION_VERSION
19240d1ba665SWarner Losh 
19250d1ba665SWarner Losh ///
19260d1ba665SWarner Losh /// EFI Boot Services Table.
19270d1ba665SWarner Losh ///
19280d1ba665SWarner Losh typedef struct {
19290d1ba665SWarner Losh   ///
19300d1ba665SWarner Losh   /// The table header for the EFI Boot Services Table.
19310d1ba665SWarner Losh   ///
19320d1ba665SWarner Losh   EFI_TABLE_HEADER                              Hdr;
19330d1ba665SWarner Losh 
19340d1ba665SWarner Losh   //
19350d1ba665SWarner Losh   // Task Priority Services
19360d1ba665SWarner Losh   //
19370d1ba665SWarner Losh   EFI_RAISE_TPL                                 RaiseTPL;
19380d1ba665SWarner Losh   EFI_RESTORE_TPL                               RestoreTPL;
19390d1ba665SWarner Losh 
19400d1ba665SWarner Losh   //
19410d1ba665SWarner Losh   // Memory Services
19420d1ba665SWarner Losh   //
19430d1ba665SWarner Losh   EFI_ALLOCATE_PAGES                            AllocatePages;
19440d1ba665SWarner Losh   EFI_FREE_PAGES                                FreePages;
19450d1ba665SWarner Losh   EFI_GET_MEMORY_MAP                            GetMemoryMap;
19460d1ba665SWarner Losh   EFI_ALLOCATE_POOL                             AllocatePool;
19470d1ba665SWarner Losh   EFI_FREE_POOL                                 FreePool;
19480d1ba665SWarner Losh 
19490d1ba665SWarner Losh   //
19500d1ba665SWarner Losh   // Event & Timer Services
19510d1ba665SWarner Losh   //
19520d1ba665SWarner Losh   EFI_CREATE_EVENT                              CreateEvent;
19530d1ba665SWarner Losh   EFI_SET_TIMER                                 SetTimer;
19540d1ba665SWarner Losh   EFI_WAIT_FOR_EVENT                            WaitForEvent;
19550d1ba665SWarner Losh   EFI_SIGNAL_EVENT                              SignalEvent;
19560d1ba665SWarner Losh   EFI_CLOSE_EVENT                               CloseEvent;
19570d1ba665SWarner Losh   EFI_CHECK_EVENT                               CheckEvent;
19580d1ba665SWarner Losh 
19590d1ba665SWarner Losh   //
19600d1ba665SWarner Losh   // Protocol Handler Services
19610d1ba665SWarner Losh   //
19620d1ba665SWarner Losh   EFI_INSTALL_PROTOCOL_INTERFACE                InstallProtocolInterface;
19630d1ba665SWarner Losh   EFI_REINSTALL_PROTOCOL_INTERFACE              ReinstallProtocolInterface;
19640d1ba665SWarner Losh   EFI_UNINSTALL_PROTOCOL_INTERFACE              UninstallProtocolInterface;
19650d1ba665SWarner Losh   EFI_HANDLE_PROTOCOL                           HandleProtocol;
19660d1ba665SWarner Losh   VOID                                          *Reserved;
19670d1ba665SWarner Losh   EFI_REGISTER_PROTOCOL_NOTIFY                  RegisterProtocolNotify;
19680d1ba665SWarner Losh   EFI_LOCATE_HANDLE                             LocateHandle;
19690d1ba665SWarner Losh   EFI_LOCATE_DEVICE_PATH                        LocateDevicePath;
19700d1ba665SWarner Losh   EFI_INSTALL_CONFIGURATION_TABLE               InstallConfigurationTable;
19710d1ba665SWarner Losh 
19720d1ba665SWarner Losh   //
19730d1ba665SWarner Losh   // Image Services
19740d1ba665SWarner Losh   //
19750d1ba665SWarner Losh   EFI_IMAGE_LOAD                                LoadImage;
19760d1ba665SWarner Losh   EFI_IMAGE_START                               StartImage;
19770d1ba665SWarner Losh   EFI_EXIT                                      Exit;
19780d1ba665SWarner Losh   EFI_IMAGE_UNLOAD                              UnloadImage;
19790d1ba665SWarner Losh   EFI_EXIT_BOOT_SERVICES                        ExitBootServices;
19800d1ba665SWarner Losh 
19810d1ba665SWarner Losh   //
19820d1ba665SWarner Losh   // Miscellaneous Services
19830d1ba665SWarner Losh   //
19840d1ba665SWarner Losh   EFI_GET_NEXT_MONOTONIC_COUNT                  GetNextMonotonicCount;
19850d1ba665SWarner Losh   EFI_STALL                                     Stall;
19860d1ba665SWarner Losh   EFI_SET_WATCHDOG_TIMER                        SetWatchdogTimer;
19870d1ba665SWarner Losh 
19880d1ba665SWarner Losh   //
19890d1ba665SWarner Losh   // DriverSupport Services
19900d1ba665SWarner Losh   //
19910d1ba665SWarner Losh   EFI_CONNECT_CONTROLLER                        ConnectController;
19920d1ba665SWarner Losh   EFI_DISCONNECT_CONTROLLER                     DisconnectController;
19930d1ba665SWarner Losh 
19940d1ba665SWarner Losh   //
19950d1ba665SWarner Losh   // Open and Close Protocol Services
19960d1ba665SWarner Losh   //
19970d1ba665SWarner Losh   EFI_OPEN_PROTOCOL                             OpenProtocol;
19980d1ba665SWarner Losh   EFI_CLOSE_PROTOCOL                            CloseProtocol;
19990d1ba665SWarner Losh   EFI_OPEN_PROTOCOL_INFORMATION                 OpenProtocolInformation;
20000d1ba665SWarner Losh 
20010d1ba665SWarner Losh   //
20020d1ba665SWarner Losh   // Library Services
20030d1ba665SWarner Losh   //
20040d1ba665SWarner Losh   EFI_PROTOCOLS_PER_HANDLE                      ProtocolsPerHandle;
20050d1ba665SWarner Losh   EFI_LOCATE_HANDLE_BUFFER                      LocateHandleBuffer;
20060d1ba665SWarner Losh   EFI_LOCATE_PROTOCOL                           LocateProtocol;
20070d1ba665SWarner Losh   EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES      InstallMultipleProtocolInterfaces;
20080d1ba665SWarner Losh   EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES    UninstallMultipleProtocolInterfaces;
20090d1ba665SWarner Losh 
20100d1ba665SWarner Losh   //
20110d1ba665SWarner Losh   // 32-bit CRC Services
20120d1ba665SWarner Losh   //
20130d1ba665SWarner Losh   EFI_CALCULATE_CRC32                           CalculateCrc32;
20140d1ba665SWarner Losh 
20150d1ba665SWarner Losh   //
20160d1ba665SWarner Losh   // Miscellaneous Services
20170d1ba665SWarner Losh   //
20180d1ba665SWarner Losh   EFI_COPY_MEM                                  CopyMem;
20190d1ba665SWarner Losh   EFI_SET_MEM                                   SetMem;
20200d1ba665SWarner Losh   EFI_CREATE_EVENT_EX                           CreateEventEx;
20210d1ba665SWarner Losh } EFI_BOOT_SERVICES;
20220d1ba665SWarner Losh 
20230d1ba665SWarner Losh ///
20240d1ba665SWarner Losh /// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the
20250d1ba665SWarner Losh /// EFI System Table.
20260d1ba665SWarner Losh ///
20270d1ba665SWarner Losh typedef struct {
20280d1ba665SWarner Losh   ///
20290d1ba665SWarner Losh   /// The 128-bit GUID value that uniquely identifies the system configuration table.
20300d1ba665SWarner Losh   ///
20310d1ba665SWarner Losh   EFI_GUID    VendorGuid;
20320d1ba665SWarner Losh   ///
20330d1ba665SWarner Losh   /// A pointer to the table associated with VendorGuid.
20340d1ba665SWarner Losh   ///
20350d1ba665SWarner Losh   VOID        *VendorTable;
20360d1ba665SWarner Losh } EFI_CONFIGURATION_TABLE;
20370d1ba665SWarner Losh 
20380d1ba665SWarner Losh ///
20390d1ba665SWarner Losh /// EFI System Table
20400d1ba665SWarner Losh ///
20410d1ba665SWarner Losh typedef struct {
20420d1ba665SWarner Losh   ///
20430d1ba665SWarner Losh   /// The table header for the EFI System Table.
20440d1ba665SWarner Losh   ///
20450d1ba665SWarner Losh   EFI_TABLE_HEADER                   Hdr;
20460d1ba665SWarner Losh   ///
20470d1ba665SWarner Losh   /// A pointer to a null terminated string that identifies the vendor
20480d1ba665SWarner Losh   /// that produces the system firmware for the platform.
20490d1ba665SWarner Losh   ///
20500d1ba665SWarner Losh   CHAR16                             *FirmwareVendor;
20510d1ba665SWarner Losh   ///
20520d1ba665SWarner Losh   /// A firmware vendor specific value that identifies the revision
20530d1ba665SWarner Losh   /// of the system firmware for the platform.
20540d1ba665SWarner Losh   ///
20550d1ba665SWarner Losh   UINT32                             FirmwareRevision;
20560d1ba665SWarner Losh   ///
20570d1ba665SWarner Losh   /// The handle for the active console input device. This handle must support
2058*580fcf64SWarner Losh   /// EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL. If
2059*580fcf64SWarner Losh   /// there is no active console, these protocols must still be present.
20600d1ba665SWarner Losh   ///
20610d1ba665SWarner Losh   EFI_HANDLE                         ConsoleInHandle;
20620d1ba665SWarner Losh   ///
20630d1ba665SWarner Losh   /// A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is
20640d1ba665SWarner Losh   /// associated with ConsoleInHandle.
20650d1ba665SWarner Losh   ///
20660d1ba665SWarner Losh   EFI_SIMPLE_TEXT_INPUT_PROTOCOL     *ConIn;
20670d1ba665SWarner Losh   ///
2068*580fcf64SWarner Losh   /// The handle for the active console output device. This handle must support the
2069*580fcf64SWarner Losh   /// EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. If there is no active console, these protocols
2070*580fcf64SWarner Losh   /// must still be present.
20710d1ba665SWarner Losh   ///
20720d1ba665SWarner Losh   EFI_HANDLE                         ConsoleOutHandle;
20730d1ba665SWarner Losh   ///
20740d1ba665SWarner Losh   /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
20750d1ba665SWarner Losh   /// that is associated with ConsoleOutHandle.
20760d1ba665SWarner Losh   ///
20770d1ba665SWarner Losh   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *ConOut;
20780d1ba665SWarner Losh   ///
20790d1ba665SWarner Losh   /// The handle for the active standard error console device.
2080*580fcf64SWarner Losh   /// This handle must support the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. If there
2081*580fcf64SWarner Losh   /// is no active console, this protocol must still be present.
20820d1ba665SWarner Losh   ///
20830d1ba665SWarner Losh   EFI_HANDLE                         StandardErrorHandle;
20840d1ba665SWarner Losh   ///
20850d1ba665SWarner Losh   /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
20860d1ba665SWarner Losh   /// that is associated with StandardErrorHandle.
20870d1ba665SWarner Losh   ///
20880d1ba665SWarner Losh   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *StdErr;
20890d1ba665SWarner Losh   ///
20900d1ba665SWarner Losh   /// A pointer to the EFI Runtime Services Table.
20910d1ba665SWarner Losh   ///
20920d1ba665SWarner Losh   EFI_RUNTIME_SERVICES               *RuntimeServices;
20930d1ba665SWarner Losh   ///
20940d1ba665SWarner Losh   /// A pointer to the EFI Boot Services Table.
20950d1ba665SWarner Losh   ///
20960d1ba665SWarner Losh   EFI_BOOT_SERVICES                  *BootServices;
20970d1ba665SWarner Losh   ///
20980d1ba665SWarner Losh   /// The number of system configuration tables in the buffer ConfigurationTable.
20990d1ba665SWarner Losh   ///
21000d1ba665SWarner Losh   UINTN                              NumberOfTableEntries;
21010d1ba665SWarner Losh   ///
21020d1ba665SWarner Losh   /// A pointer to the system configuration tables.
21030d1ba665SWarner Losh   /// The number of entries in the table is NumberOfTableEntries.
21040d1ba665SWarner Losh   ///
21050d1ba665SWarner Losh   EFI_CONFIGURATION_TABLE            *ConfigurationTable;
21060d1ba665SWarner Losh } EFI_SYSTEM_TABLE;
21070d1ba665SWarner Losh 
21080d1ba665SWarner Losh /**
21090d1ba665SWarner Losh   This is the declaration of an EFI image entry point. This entry point is
21100d1ba665SWarner Losh   the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
21110d1ba665SWarner Losh   both device drivers and bus drivers.
21120d1ba665SWarner Losh 
21130d1ba665SWarner Losh   @param[in]  ImageHandle       The firmware allocated handle for the UEFI image.
21140d1ba665SWarner Losh   @param[in]  SystemTable       A pointer to the EFI System Table.
21150d1ba665SWarner Losh 
21160d1ba665SWarner Losh   @retval EFI_SUCCESS           The operation completed successfully.
21170d1ba665SWarner Losh   @retval Others                An unexpected error occurred.
21180d1ba665SWarner Losh **/
21190d1ba665SWarner Losh typedef
21200d1ba665SWarner Losh EFI_STATUS
21210d1ba665SWarner Losh (EFIAPI *EFI_IMAGE_ENTRY_POINT)(
21220d1ba665SWarner Losh   IN  EFI_HANDLE                   ImageHandle,
21230d1ba665SWarner Losh   IN  EFI_SYSTEM_TABLE             *SystemTable
21240d1ba665SWarner Losh   );
21250d1ba665SWarner Losh 
21260d1ba665SWarner Losh //
21270d1ba665SWarner Losh // EFI Load Option. This data structure describes format of UEFI boot option variables.
21280d1ba665SWarner Losh //
21290d1ba665SWarner Losh // NOTE: EFI Load Option is a byte packed buffer of variable length fields.
21300d1ba665SWarner Losh // The first two fields have fixed length. They are declared as members of the
21310d1ba665SWarner Losh // EFI_LOAD_OPTION structure. All the other fields are variable length fields.
21320d1ba665SWarner Losh // They are listed in the comment block below for reference purposes.
21330d1ba665SWarner Losh //
21340d1ba665SWarner Losh #pragma pack(1)
21350d1ba665SWarner Losh typedef struct _EFI_LOAD_OPTION {
21360d1ba665SWarner Losh   ///
21370d1ba665SWarner Losh   /// The attributes for this load option entry. All unused bits must be zero
21380d1ba665SWarner Losh   /// and are reserved by the UEFI specification for future growth.
21390d1ba665SWarner Losh   ///
21400d1ba665SWarner Losh   UINT32    Attributes;
21410d1ba665SWarner Losh   ///
21420d1ba665SWarner Losh   /// Length in bytes of the FilePathList. OptionalData starts at offset
21430d1ba665SWarner Losh   /// sizeof(UINT32) + sizeof(UINT16) + StrSize(Description) + FilePathListLength
21440d1ba665SWarner Losh   /// of the EFI_LOAD_OPTION descriptor.
21450d1ba665SWarner Losh   ///
21460d1ba665SWarner Losh   UINT16    FilePathListLength;
21470d1ba665SWarner Losh   ///
21480d1ba665SWarner Losh   /// The user readable description for the load option.
21490d1ba665SWarner Losh   /// This field ends with a Null character.
21500d1ba665SWarner Losh   ///
21510d1ba665SWarner Losh   // CHAR16                        Description[];
21520d1ba665SWarner Losh   ///
21530d1ba665SWarner Losh   /// A packed array of UEFI device paths. The first element of the array is a
21540d1ba665SWarner Losh   /// device path that describes the device and location of the Image for this
21550d1ba665SWarner Losh   /// load option. The FilePathList[0] is specific to the device type. Other
21560d1ba665SWarner Losh   /// device paths may optionally exist in the FilePathList, but their usage is
21570d1ba665SWarner Losh   /// OSV specific. Each element in the array is variable length, and ends at
21580d1ba665SWarner Losh   /// the device path end structure. Because the size of Description is
21590d1ba665SWarner Losh   /// arbitrary, this data structure is not guaranteed to be aligned on a
21600d1ba665SWarner Losh   /// natural boundary. This data structure may have to be copied to an aligned
21610d1ba665SWarner Losh   /// natural boundary before it is used.
21620d1ba665SWarner Losh   ///
21630d1ba665SWarner Losh   // EFI_DEVICE_PATH_PROTOCOL      FilePathList[];
21640d1ba665SWarner Losh   ///
21650d1ba665SWarner Losh   /// The remaining bytes in the load option descriptor are a binary data buffer
21660d1ba665SWarner Losh   /// that is passed to the loaded image. If the field is zero bytes long, a
21670d1ba665SWarner Losh   /// NULL pointer is passed to the loaded image. The number of bytes in
21680d1ba665SWarner Losh   /// OptionalData can be computed by subtracting the starting offset of
21690d1ba665SWarner Losh   /// OptionalData from total size in bytes of the EFI_LOAD_OPTION.
21700d1ba665SWarner Losh   ///
21710d1ba665SWarner Losh   // UINT8                         OptionalData[];
21720d1ba665SWarner Losh } EFI_LOAD_OPTION;
21730d1ba665SWarner Losh #pragma pack()
21740d1ba665SWarner Losh 
21750d1ba665SWarner Losh //
21760d1ba665SWarner Losh // EFI Load Options Attributes
21770d1ba665SWarner Losh //
21780d1ba665SWarner Losh #define LOAD_OPTION_ACTIVE           0x00000001
21790d1ba665SWarner Losh #define LOAD_OPTION_FORCE_RECONNECT  0x00000002
21800d1ba665SWarner Losh #define LOAD_OPTION_HIDDEN           0x00000008
21810d1ba665SWarner Losh #define LOAD_OPTION_CATEGORY         0x00001F00
21820d1ba665SWarner Losh 
21830d1ba665SWarner Losh #define LOAD_OPTION_CATEGORY_BOOT  0x00000000
21840d1ba665SWarner Losh #define LOAD_OPTION_CATEGORY_APP   0x00000100
21850d1ba665SWarner Losh 
21860d1ba665SWarner Losh #define EFI_BOOT_OPTION_SUPPORT_KEY      0x00000001
21870d1ba665SWarner Losh #define EFI_BOOT_OPTION_SUPPORT_APP      0x00000002
21880d1ba665SWarner Losh #define EFI_BOOT_OPTION_SUPPORT_SYSPREP  0x00000010
21890d1ba665SWarner Losh #define EFI_BOOT_OPTION_SUPPORT_COUNT    0x00000300
21900d1ba665SWarner Losh 
21910d1ba665SWarner Losh ///
21920d1ba665SWarner Losh /// EFI Boot Key Data
21930d1ba665SWarner Losh ///
21940d1ba665SWarner Losh typedef union {
21950d1ba665SWarner Losh   struct {
21960d1ba665SWarner Losh     ///
21970d1ba665SWarner Losh     /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
21980d1ba665SWarner Losh     ///
21990d1ba665SWarner Losh     UINT32    Revision       : 8;
22000d1ba665SWarner Losh     ///
22010d1ba665SWarner Losh     /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
22020d1ba665SWarner Losh     ///
22030d1ba665SWarner Losh     UINT32    ShiftPressed   : 1;
22040d1ba665SWarner Losh     ///
22050d1ba665SWarner Losh     /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
22060d1ba665SWarner Losh     ///
22070d1ba665SWarner Losh     UINT32    ControlPressed : 1;
22080d1ba665SWarner Losh     ///
22090d1ba665SWarner Losh     /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
22100d1ba665SWarner Losh     ///
22110d1ba665SWarner Losh     UINT32    AltPressed     : 1;
22120d1ba665SWarner Losh     ///
22130d1ba665SWarner Losh     /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
22140d1ba665SWarner Losh     ///
22150d1ba665SWarner Losh     UINT32    LogoPressed    : 1;
22160d1ba665SWarner Losh     ///
22170d1ba665SWarner Losh     /// The Menu key must be pressed (1) or must not be pressed (0).
22180d1ba665SWarner Losh     ///
22190d1ba665SWarner Losh     UINT32    MenuPressed    : 1;
22200d1ba665SWarner Losh     ///
22210d1ba665SWarner Losh     /// The SysReq key must be pressed (1) or must not be pressed (0).
22220d1ba665SWarner Losh     ///
22230d1ba665SWarner Losh     UINT32    SysReqPressed  : 1;
22240d1ba665SWarner Losh     UINT32    Reserved       : 16;
22250d1ba665SWarner Losh     ///
22260d1ba665SWarner Losh     /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
22270d1ba665SWarner Losh     /// zero, then only the shift state is considered. If more than one, then the boot option will
22280d1ba665SWarner Losh     /// only be launched if all of the specified keys are pressed with the same shift state.
22290d1ba665SWarner Losh     ///
22300d1ba665SWarner Losh     UINT32    InputKeyCount  : 2;
22310d1ba665SWarner Losh   } Options;
22320d1ba665SWarner Losh   UINT32    PackedValue;
22330d1ba665SWarner Losh } EFI_BOOT_KEY_DATA;
22340d1ba665SWarner Losh 
22350d1ba665SWarner Losh ///
22360d1ba665SWarner Losh /// EFI Key Option.
22370d1ba665SWarner Losh ///
22380d1ba665SWarner Losh #pragma pack(1)
22390d1ba665SWarner Losh typedef struct {
22400d1ba665SWarner Losh   ///
22410d1ba665SWarner Losh   /// Specifies options about how the key will be processed.
22420d1ba665SWarner Losh   ///
22430d1ba665SWarner Losh   EFI_BOOT_KEY_DATA    KeyData;
22440d1ba665SWarner Losh   ///
22450d1ba665SWarner Losh   /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to
22460d1ba665SWarner Losh   /// which BootOption refers. If the CRC-32s do not match this value, then this key
22470d1ba665SWarner Losh   /// option is ignored.
22480d1ba665SWarner Losh   ///
22490d1ba665SWarner Losh   UINT32               BootOptionCrc;
22500d1ba665SWarner Losh   ///
22510d1ba665SWarner Losh   /// The Boot#### option which will be invoked if this key is pressed and the boot option
22520d1ba665SWarner Losh   /// is active (LOAD_OPTION_ACTIVE is set).
22530d1ba665SWarner Losh   ///
22540d1ba665SWarner Losh   UINT16               BootOption;
22550d1ba665SWarner Losh   ///
22560d1ba665SWarner Losh   /// The key codes to compare against those returned by the
22570d1ba665SWarner Losh   /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.
22580d1ba665SWarner Losh   /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.
22590d1ba665SWarner Losh   ///
22600d1ba665SWarner Losh   // EFI_INPUT_KEY      Keys[];
22610d1ba665SWarner Losh } EFI_KEY_OPTION;
22620d1ba665SWarner Losh #pragma pack()
22630d1ba665SWarner Losh 
22640d1ba665SWarner Losh //
22650d1ba665SWarner Losh // EFI File location to boot from on removable media devices
22660d1ba665SWarner Losh //
22670d1ba665SWarner Losh #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32         L"\\EFI\\BOOT\\BOOTIA32.EFI"
22680d1ba665SWarner Losh #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64         L"\\EFI\\BOOT\\BOOTIA64.EFI"
22690d1ba665SWarner Losh #define EFI_REMOVABLE_MEDIA_FILE_NAME_X64          L"\\EFI\\BOOT\\BOOTX64.EFI"
22700d1ba665SWarner Losh #define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM          L"\\EFI\\BOOT\\BOOTARM.EFI"
22710d1ba665SWarner Losh #define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64      L"\\EFI\\BOOT\\BOOTAA64.EFI"
22723245fa21SMitchell Horne #define EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64      L"\\EFI\\BOOT\\BOOTRISCV64.EFI"
227395f4e7f5Syu shan wei #define EFI_REMOVABLE_MEDIA_FILE_NAME_LOONGARCH64  L"\\EFI\\BOOT\\BOOTLOONGARCH64.EFI"
22740d1ba665SWarner Losh 
2275*580fcf64SWarner Losh #if !defined (EFI_REMOVABLE_MEDIA_FILE_NAME)
22760d1ba665SWarner Losh   #if   defined (MDE_CPU_IA32)
22770d1ba665SWarner Losh #define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
22780d1ba665SWarner Losh   #elif defined (MDE_CPU_X64)
22790d1ba665SWarner Losh #define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_X64
22800d1ba665SWarner Losh   #elif defined (MDE_CPU_EBC)
22810d1ba665SWarner Losh   #elif defined (MDE_CPU_ARM)
22820d1ba665SWarner Losh #define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
22830d1ba665SWarner Losh   #elif defined (MDE_CPU_AARCH64)
22840d1ba665SWarner Losh #define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
22853245fa21SMitchell Horne   #elif defined (MDE_CPU_RISCV64)
22863245fa21SMitchell Horne #define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64
228795f4e7f5Syu shan wei   #elif defined (MDE_CPU_LOONGARCH64)
228895f4e7f5Syu shan wei #define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_LOONGARCH64
22890d1ba665SWarner Losh   #else
22900d1ba665SWarner Losh     #error Unknown Processor Type
22910d1ba665SWarner Losh   #endif
2292*580fcf64SWarner Losh #endif
22930d1ba665SWarner Losh 
22943245fa21SMitchell Horne //
22953245fa21SMitchell Horne // The directory within the active EFI System Partition defined for delivery of capsule to firmware
22963245fa21SMitchell Horne //
22973245fa21SMitchell Horne #define EFI_CAPSULE_FILE_DIRECTORY  L"\\EFI\\UpdateCapsule\\"
22983245fa21SMitchell Horne 
22990d1ba665SWarner Losh #include <Uefi/UefiPxe.h>
23000d1ba665SWarner Losh #include <Uefi/UefiGpt.h>
23010d1ba665SWarner Losh #include <Uefi/UefiInternalFormRepresentation.h>
23020d1ba665SWarner Losh 
23030d1ba665SWarner Losh #endif
2304