iPXE
UefiSpec.h
Go to the documentation of this file.
00001 /** @file
00002   Include file that supports UEFI.
00003 
00004   This include file must contain things defined in the UEFI 2.6 specification.
00005   If a code construct is defined in the UEFI 2.6 specification it must be included
00006   by this include file.
00007 
00008 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
00009 This program and the accompanying materials are licensed and made available under
00010 the terms and conditions of the BSD License that accompanies this distribution.
00011 The full text of the license may be found at
00012 http://opensource.org/licenses/bsd-license.php.
00013 
00014 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00015 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00016 
00017 **/
00018 
00019 #ifndef __UEFI_SPEC_H__
00020 #define __UEFI_SPEC_H__
00021 
00022 FILE_LICENCE ( BSD3 );
00023 
00024 #include <ipxe/efi/Uefi/UefiMultiPhase.h>
00025 
00026 #include <ipxe/efi/Protocol/DevicePath.h>
00027 #include <ipxe/efi/Protocol/SimpleTextIn.h>
00028 #include <ipxe/efi/Protocol/SimpleTextInEx.h>
00029 #include <ipxe/efi/Protocol/SimpleTextOut.h>
00030 
00031 ///
00032 /// Enumeration of EFI memory allocation types.
00033 ///
00034 typedef enum {
00035   ///
00036   /// Allocate any available range of pages that satisfies the request.
00037   ///
00038   AllocateAnyPages,
00039   ///
00040   /// Allocate any available range of pages whose uppermost address is less than
00041   /// or equal to a specified maximum address.
00042   ///
00043   AllocateMaxAddress,
00044   ///
00045   /// Allocate pages at a specified address.
00046   ///
00047   AllocateAddress,
00048   ///
00049   /// Maximum enumeration value that may be used for bounds checking.
00050   ///
00051   MaxAllocateType
00052 } EFI_ALLOCATE_TYPE;
00053 
00054 //
00055 // Bit definitions for EFI_TIME.Daylight
00056 //
00057 #define EFI_TIME_ADJUST_DAYLIGHT  0x01
00058 #define EFI_TIME_IN_DAYLIGHT      0x02
00059 
00060 ///
00061 /// Value definition for EFI_TIME.TimeZone.
00062 ///
00063 #define EFI_UNSPECIFIED_TIMEZONE  0x07FF
00064 
00065 //
00066 // Memory cacheability attributes
00067 //
00068 #define EFI_MEMORY_UC               0x0000000000000001ULL
00069 #define EFI_MEMORY_WC               0x0000000000000002ULL
00070 #define EFI_MEMORY_WT               0x0000000000000004ULL
00071 #define EFI_MEMORY_WB               0x0000000000000008ULL
00072 #define EFI_MEMORY_UCE              0x0000000000000010ULL
00073 //
00074 // Physical memory protection attributes
00075 //
00076 // Note: UEFI spec 2.5 and following: use EFI_MEMORY_RO as write-protected physical memory
00077 // protection attribute. Also, EFI_MEMORY_WP means cacheability attribute.
00078 //
00079 #define EFI_MEMORY_WP               0x0000000000001000ULL
00080 #define EFI_MEMORY_RP               0x0000000000002000ULL
00081 #define EFI_MEMORY_XP               0x0000000000004000ULL
00082 #define EFI_MEMORY_RO               0x0000000000020000ULL
00083 //
00084 // Physical memory persistence attribute.
00085 // The memory region supports byte-addressable non-volatility.
00086 //
00087 #define EFI_MEMORY_NV               0x0000000000008000ULL
00088 //
00089 // The memory region provides higher reliability relative to other memory in the system.
00090 // If all memory has the same reliability, then this bit is not used.
00091 //
00092 #define EFI_MEMORY_MORE_RELIABLE    0x0000000000010000ULL
00093 //
00094 // Runtime memory attribute
00095 //
00096 #define EFI_MEMORY_RUNTIME          0x8000000000000000ULL
00097 
00098 ///
00099 /// Memory descriptor version number.
00100 ///
00101 #define EFI_MEMORY_DESCRIPTOR_VERSION 1
00102 
00103 ///
00104 /// Definition of an EFI memory descriptor.
00105 ///
00106 typedef struct {
00107   ///
00108   /// Type of the memory region.  See EFI_MEMORY_TYPE.
00109   ///
00110   UINT32                Type;
00111   ///
00112   /// Physical address of the first byte of the memory region.  Must aligned
00113   /// on a 4 KB boundary.
00114   ///
00115   EFI_PHYSICAL_ADDRESS  PhysicalStart;
00116   ///
00117   /// Virtual address of the first byte of the memory region.  Must aligned
00118   /// on a 4 KB boundary.
00119   ///
00120   EFI_VIRTUAL_ADDRESS   VirtualStart;
00121   ///
00122   /// Number of 4KB pages in the memory region.
00123   ///
00124   UINT64                NumberOfPages;
00125   ///
00126   /// Attributes of the memory region that describe the bit mask of capabilities
00127   /// for that memory region, and not necessarily the current settings for that
00128   /// memory region.
00129   ///
00130   UINT64                Attribute;
00131 } EFI_MEMORY_DESCRIPTOR;
00132 
00133 /**
00134   Allocates memory pages from the system.
00135 
00136   @param[in]       Type         The type of allocation to perform.
00137   @param[in]       MemoryType   The type of memory to allocate.
00138                                 MemoryType values in the range 0x70000000..0x7FFFFFFF
00139                                 are reserved for OEM use. MemoryType values in the range
00140                                 0x80000000..0xFFFFFFFF are reserved for use by UEFI OS loaders
00141                                 that are provided by operating system vendors.
00142   @param[in]       Pages        The number of contiguous 4 KB pages to allocate.
00143   @param[in, out]  Memory       The pointer to a physical address. On input, the way in which the address is
00144                                 used depends on the value of Type.
00145 
00146   @retval EFI_SUCCESS           The requested pages were allocated.
00147   @retval EFI_INVALID_PARAMETER 1) Type is not AllocateAnyPages or
00148                                 AllocateMaxAddress or AllocateAddress.
00149                                 2) MemoryType is in the range
00150                                 EfiMaxMemoryType..0x6FFFFFFF.
00151                                 3) Memory is NULL.
00152                                 4) MemoryType is EfiPersistentMemory.
00153   @retval EFI_OUT_OF_RESOURCES  The pages could not be allocated.
00154   @retval EFI_NOT_FOUND         The requested pages could not be found.
00155 
00156 **/
00157 typedef
00158 EFI_STATUS
00159 (EFIAPI *EFI_ALLOCATE_PAGES)(
00160   IN     EFI_ALLOCATE_TYPE            Type,
00161   IN     EFI_MEMORY_TYPE              MemoryType,
00162   IN     UINTN                        Pages,
00163   IN OUT EFI_PHYSICAL_ADDRESS         *Memory
00164   );
00165 
00166 /**
00167   Frees memory pages.
00168 
00169   @param[in]  Memory      The base physical address of the pages to be freed.
00170   @param[in]  Pages       The number of contiguous 4 KB pages to free.
00171 
00172   @retval EFI_SUCCESS           The requested pages were freed.
00173   @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.
00174   @retval EFI_NOT_FOUND         The requested memory pages were not allocated with
00175                                 AllocatePages().
00176 
00177 **/
00178 typedef
00179 EFI_STATUS
00180 (EFIAPI *EFI_FREE_PAGES)(
00181   IN  EFI_PHYSICAL_ADDRESS         Memory,
00182   IN  UINTN                        Pages
00183   );
00184 
00185 /**
00186   Returns the current memory map.
00187 
00188   @param[in, out]  MemoryMapSize         A pointer to the size, in bytes, of the MemoryMap buffer.
00189                                          On input, this is the size of the buffer allocated by the caller.
00190                                          On output, it is the size of the buffer returned by the firmware if
00191                                          the buffer was large enough, or the size of the buffer needed to contain
00192                                          the map if the buffer was too small.
00193   @param[in, out]  MemoryMap             A pointer to the buffer in which firmware places the current memory
00194                                          map.
00195   @param[out]      MapKey                A pointer to the location in which firmware returns the key for the
00196                                          current memory map.
00197   @param[out]      DescriptorSize        A pointer to the location in which firmware returns the size, in bytes, of
00198                                          an individual EFI_MEMORY_DESCRIPTOR.
00199   @param[out]      DescriptorVersion     A pointer to the location in which firmware returns the version number
00200                                          associated with the EFI_MEMORY_DESCRIPTOR.
00201 
00202   @retval EFI_SUCCESS           The memory map was returned in the MemoryMap buffer.
00203   @retval EFI_BUFFER_TOO_SMALL  The MemoryMap buffer was too small. The current buffer size
00204                                 needed to hold the memory map is returned in MemoryMapSize.
00205   @retval EFI_INVALID_PARAMETER 1) MemoryMapSize is NULL.
00206                                 2) The MemoryMap buffer is not too small and MemoryMap is
00207                                    NULL.
00208 
00209 **/
00210 typedef
00211 EFI_STATUS
00212 (EFIAPI *EFI_GET_MEMORY_MAP)(
00213   IN OUT UINTN                       *MemoryMapSize,
00214   IN OUT EFI_MEMORY_DESCRIPTOR       *MemoryMap,
00215   OUT    UINTN                       *MapKey,
00216   OUT    UINTN                       *DescriptorSize,
00217   OUT    UINT32                      *DescriptorVersion
00218   );
00219 
00220 /**
00221   Allocates pool memory.
00222 
00223   @param[in]   PoolType         The type of pool to allocate.
00224                                 MemoryType values in the range 0x70000000..0x7FFFFFFF
00225                                 are reserved for OEM use. MemoryType values in the range
00226                                 0x80000000..0xFFFFFFFF are reserved for use by UEFI OS loaders
00227                                 that are provided by operating system vendors.
00228   @param[in]   Size             The number of bytes to allocate from the pool.
00229   @param[out]  Buffer           A pointer to a pointer to the allocated buffer if the call succeeds;
00230                                 undefined otherwise.
00231 
00232   @retval EFI_SUCCESS           The requested number of bytes was allocated.
00233   @retval EFI_OUT_OF_RESOURCES  The pool requested could not be allocated.
00234   @retval EFI_INVALID_PARAMETER Buffer is NULL.
00235                                 PoolType is in the range EfiMaxMemoryType..0x6FFFFFFF.
00236                                 PoolType is EfiPersistentMemory.
00237 
00238 **/
00239 typedef
00240 EFI_STATUS
00241 (EFIAPI *EFI_ALLOCATE_POOL)(
00242   IN  EFI_MEMORY_TYPE              PoolType,
00243   IN  UINTN                        Size,
00244   OUT VOID                         **Buffer
00245   );
00246 
00247 /**
00248   Returns pool memory to the system.
00249 
00250   @param[in]  Buffer            The pointer to the buffer to free.
00251 
00252   @retval EFI_SUCCESS           The memory was returned to the system.
00253   @retval EFI_INVALID_PARAMETER Buffer was invalid.
00254 
00255 **/
00256 typedef
00257 EFI_STATUS
00258 (EFIAPI *EFI_FREE_POOL)(
00259   IN  VOID                         *Buffer
00260   );
00261 
00262 /**
00263   Changes the runtime addressing mode of EFI firmware from physical to virtual.
00264 
00265   @param[in]  MemoryMapSize     The size in bytes of VirtualMap.
00266   @param[in]  DescriptorSize    The size in bytes of an entry in the VirtualMap.
00267   @param[in]  DescriptorVersion The version of the structure entries in VirtualMap.
00268   @param[in]  VirtualMap        An array of memory descriptors which contain new virtual
00269                                 address mapping information for all runtime ranges.
00270 
00271   @retval EFI_SUCCESS           The virtual address map has been applied.
00272   @retval EFI_UNSUPPORTED       EFI firmware is not at runtime, or the EFI firmware is already in
00273                                 virtual address mapped mode.
00274   @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.
00275   @retval EFI_NO_MAPPING        A virtual address was not supplied for a range in the memory
00276                                 map that requires a mapping.
00277   @retval EFI_NOT_FOUND         A virtual address was supplied for an address that is not found
00278                                 in the memory map.
00279 
00280 **/
00281 typedef
00282 EFI_STATUS
00283 (EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP)(
00284   IN  UINTN                        MemoryMapSize,
00285   IN  UINTN                        DescriptorSize,
00286   IN  UINT32                       DescriptorVersion,
00287   IN  EFI_MEMORY_DESCRIPTOR        *VirtualMap
00288   );
00289 
00290 /**
00291   Connects one or more drivers to a controller.
00292 
00293   @param[in]  ControllerHandle      The handle of the controller to which driver(s) are to be connected.
00294   @param[in]  DriverImageHandle     A pointer to an ordered list handles that support the
00295                                     EFI_DRIVER_BINDING_PROTOCOL.
00296   @param[in]  RemainingDevicePath   A pointer to the device path that specifies a child of the
00297                                     controller specified by ControllerHandle.
00298   @param[in]  Recursive             If TRUE, then ConnectController() is called recursively
00299                                     until the entire tree of controllers below the controller specified
00300                                     by ControllerHandle have been created. If FALSE, then
00301                                     the tree of controllers is only expanded one level.
00302 
00303   @retval EFI_SUCCESS           1) One or more drivers were connected to ControllerHandle.
00304                                 2) No drivers were connected to ControllerHandle, but
00305                                 RemainingDevicePath is not NULL, and it is an End Device
00306                                 Path Node.
00307   @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
00308   @retval EFI_NOT_FOUND         1) There are no EFI_DRIVER_BINDING_PROTOCOL instances
00309                                 present in the system.
00310                                 2) No drivers were connected to ControllerHandle.
00311   @retval EFI_SECURITY_VIOLATION
00312                                 The user has no permission to start UEFI device drivers on the device path
00313                                 associated with the ControllerHandle or specified by the RemainingDevicePath.
00314 **/
00315 typedef
00316 EFI_STATUS
00317 (EFIAPI *EFI_CONNECT_CONTROLLER)(
00318   IN  EFI_HANDLE                    ControllerHandle,
00319   IN  EFI_HANDLE                    *DriverImageHandle,   OPTIONAL
00320   IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath, OPTIONAL
00321   IN  BOOLEAN                       Recursive
00322   );
00323 
00324 /**
00325   Disconnects one or more drivers from a controller.
00326 
00327   @param[in]  ControllerHandle      The handle of the controller from which driver(s) are to be disconnected.
00328   @param[in]  DriverImageHandle     The driver to disconnect from ControllerHandle.
00329                                     If DriverImageHandle is NULL, then all the drivers currently managing
00330                                     ControllerHandle are disconnected from ControllerHandle.
00331   @param[in]  ChildHandle           The handle of the child to destroy.
00332                                     If ChildHandle is NULL, then all the children of ControllerHandle are
00333                                     destroyed before the drivers are disconnected from ControllerHandle.
00334 
00335   @retval EFI_SUCCESS           1) One or more drivers were disconnected from the controller.
00336                                 2) On entry, no drivers are managing ControllerHandle.
00337                                 3) DriverImageHandle is not NULL, and on entry
00338                                    DriverImageHandle is not managing ControllerHandle.
00339   @retval EFI_INVALID_PARAMETER 1) ControllerHandle is NULL.
00340                                 2) DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.
00341                                 3) ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
00342                                 4) DriverImageHandle does not support the EFI_DRIVER_BINDING_PROTOCOL.
00343   @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to disconnect any drivers from
00344                                 ControllerHandle.
00345   @retval EFI_DEVICE_ERROR      The controller could not be disconnected because of a device error.
00346 
00347 **/
00348 typedef
00349 EFI_STATUS
00350 (EFIAPI *EFI_DISCONNECT_CONTROLLER)(
00351   IN  EFI_HANDLE                     ControllerHandle,
00352   IN  EFI_HANDLE                     DriverImageHandle, OPTIONAL
00353   IN  EFI_HANDLE                     ChildHandle        OPTIONAL
00354   );
00355 
00356 
00357 
00358 //
00359 // ConvertPointer DebugDisposition type.
00360 //
00361 #define EFI_OPTIONAL_PTR     0x00000001
00362 
00363 /**
00364   Determines the new virtual address that is to be used on subsequent memory accesses.
00365 
00366   @param[in]       DebugDisposition  Supplies type information for the pointer being converted.
00367   @param[in, out]  Address           A pointer to a pointer that is to be fixed to be the value needed
00368                                      for the new virtual address mappings being applied.
00369 
00370   @retval EFI_SUCCESS           The pointer pointed to by Address was modified.
00371   @retval EFI_INVALID_PARAMETER 1) Address is NULL.
00372                                 2) *Address is NULL and DebugDisposition does
00373                                 not have the EFI_OPTIONAL_PTR bit set.
00374   @retval EFI_NOT_FOUND         The pointer pointed to by Address was not found to be part
00375                                 of the current memory map. This is normally fatal.
00376 
00377 **/
00378 typedef
00379 EFI_STATUS
00380 (EFIAPI *EFI_CONVERT_POINTER)(
00381   IN     UINTN                      DebugDisposition,
00382   IN OUT VOID                       **Address
00383   );
00384 
00385 
00386 //
00387 // These types can be ORed together as needed - for example,
00388 // EVT_TIMER might be Ored with EVT_NOTIFY_WAIT or
00389 // EVT_NOTIFY_SIGNAL.
00390 //
00391 #define EVT_TIMER                         0x80000000
00392 #define EVT_RUNTIME                       0x40000000
00393 #define EVT_NOTIFY_WAIT                   0x00000100
00394 #define EVT_NOTIFY_SIGNAL                 0x00000200
00395 
00396 #define EVT_SIGNAL_EXIT_BOOT_SERVICES     0x00000201
00397 #define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202
00398 
00399 //
00400 // The event's NotifyContext pointer points to a runtime memory
00401 // address.
00402 // The event is deprecated in UEFI2.0 and later specifications.
00403 //
00404 #define EVT_RUNTIME_CONTEXT               0x20000000
00405 
00406 
00407 /**
00408   Invoke a notification event
00409 
00410   @param[in]  Event                 Event whose notification function is being invoked.
00411   @param[in]  Context               The pointer to the notification function's context,
00412                                     which is implementation-dependent.
00413 
00414 **/
00415 typedef
00416 VOID
00417 (EFIAPI *EFI_EVENT_NOTIFY)(
00418   IN  EFI_EVENT                Event,
00419   IN  VOID                     *Context
00420   );
00421 
00422 /**
00423   Creates an event.
00424 
00425   @param[in]   Type             The type of event to create and its mode and attributes.
00426   @param[in]   NotifyTpl        The task priority level of event notifications, if needed.
00427   @param[in]   NotifyFunction   The pointer to the event's notification function, if any.
00428   @param[in]   NotifyContext    The pointer to the notification function's context; corresponds to parameter
00429                                 Context in the notification function.
00430   @param[out]  Event            The pointer to the newly created event if the call succeeds; undefined
00431                                 otherwise.
00432 
00433   @retval EFI_SUCCESS           The event structure was created.
00434   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
00435   @retval EFI_OUT_OF_RESOURCES  The event could not be allocated.
00436 
00437 **/
00438 typedef
00439 EFI_STATUS
00440 (EFIAPI *EFI_CREATE_EVENT)(
00441   IN  UINT32                       Type,
00442   IN  EFI_TPL                      NotifyTpl,
00443   IN  EFI_EVENT_NOTIFY             NotifyFunction,
00444   IN  VOID                         *NotifyContext,
00445   OUT EFI_EVENT                    *Event
00446   );
00447 
00448 /**
00449   Creates an event in a group.
00450 
00451   @param[in]   Type             The type of event to create and its mode and attributes.
00452   @param[in]   NotifyTpl        The task priority level of event notifications,if needed.
00453   @param[in]   NotifyFunction   The pointer to the event's notification function, if any.
00454   @param[in]   NotifyContext    The pointer to the notification function's context; corresponds to parameter
00455                                 Context in the notification function.
00456   @param[in]   EventGroup       The pointer to the unique identifier of the group to which this event belongs.
00457                                 If this is NULL, then the function behaves as if the parameters were passed
00458                                 to CreateEvent.
00459   @param[out]  Event            The pointer to the newly created event if the call succeeds; undefined
00460                                 otherwise.
00461 
00462   @retval EFI_SUCCESS           The event structure was created.
00463   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
00464   @retval EFI_OUT_OF_RESOURCES  The event could not be allocated.
00465 
00466 **/
00467 typedef
00468 EFI_STATUS
00469 (EFIAPI *EFI_CREATE_EVENT_EX)(
00470   IN       UINT32                 Type,
00471   IN       EFI_TPL                NotifyTpl,
00472   IN       EFI_EVENT_NOTIFY       NotifyFunction OPTIONAL,
00473   IN CONST VOID                   *NotifyContext OPTIONAL,
00474   IN CONST EFI_GUID               *EventGroup    OPTIONAL,
00475   OUT      EFI_EVENT              *Event
00476   );
00477 
00478 ///
00479 /// Timer delay types
00480 ///
00481 typedef enum {
00482   ///
00483   /// An event's timer settings is to be cancelled and not trigger time is to be set/
00484   ///
00485   TimerCancel,
00486   ///
00487   /// An event is to be signaled periodically at a specified interval from the current time.
00488   ///
00489   TimerPeriodic,
00490   ///
00491   /// An event is to be signaled once at a specified interval from the current time.
00492   ///
00493   TimerRelative
00494 } EFI_TIMER_DELAY;
00495 
00496 /**
00497   Sets the type of timer and the trigger time for a timer event.
00498 
00499   @param[in]  Event             The timer event that is to be signaled at the specified time.
00500   @param[in]  Type              The type of time that is specified in TriggerTime.
00501   @param[in]  TriggerTime       The number of 100ns units until the timer expires.
00502                                 A TriggerTime of 0 is legal.
00503                                 If Type is TimerRelative and TriggerTime is 0, then the timer
00504                                 event will be signaled on the next timer tick.
00505                                 If Type is TimerPeriodic and TriggerTime is 0, then the timer
00506                                 event will be signaled on every timer tick.
00507 
00508   @retval EFI_SUCCESS           The event has been set to be signaled at the requested time.
00509   @retval EFI_INVALID_PARAMETER Event or Type is not valid.
00510 
00511 **/
00512 typedef
00513 EFI_STATUS
00514 (EFIAPI *EFI_SET_TIMER)(
00515   IN  EFI_EVENT                Event,
00516   IN  EFI_TIMER_DELAY          Type,
00517   IN  UINT64                   TriggerTime
00518   );
00519 
00520 /**
00521   Signals an event.
00522 
00523   @param[in]  Event             The event to signal.
00524 
00525   @retval EFI_SUCCESS           The event has been signaled.
00526 
00527 **/
00528 typedef
00529 EFI_STATUS
00530 (EFIAPI *EFI_SIGNAL_EVENT)(
00531   IN  EFI_EVENT                Event
00532   );
00533 
00534 /**
00535   Stops execution until an event is signaled.
00536 
00537   @param[in]   NumberOfEvents   The number of events in the Event array.
00538   @param[in]   Event            An array of EFI_EVENT.
00539   @param[out]  Index            The pointer to the index of the event which satisfied the wait condition.
00540 
00541   @retval EFI_SUCCESS           The event indicated by Index was signaled.
00542   @retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0.
00543                                 2) The event indicated by Index is of type
00544                                    EVT_NOTIFY_SIGNAL.
00545   @retval EFI_UNSUPPORTED       The current TPL is not TPL_APPLICATION.
00546 
00547 **/
00548 typedef
00549 EFI_STATUS
00550 (EFIAPI *EFI_WAIT_FOR_EVENT)(
00551   IN  UINTN                    NumberOfEvents,
00552   IN  EFI_EVENT                *Event,
00553   OUT UINTN                    *Index
00554   );
00555 
00556 /**
00557   Closes an event.
00558 
00559   @param[in]  Event             The event to close.
00560 
00561   @retval EFI_SUCCESS           The event has been closed.
00562 
00563 **/
00564 typedef
00565 EFI_STATUS
00566 (EFIAPI *EFI_CLOSE_EVENT)(
00567   IN EFI_EVENT                Event
00568   );
00569 
00570 /**
00571   Checks whether an event is in the signaled state.
00572 
00573   @param[in]  Event             The event to check.
00574 
00575   @retval EFI_SUCCESS           The event is in the signaled state.
00576   @retval EFI_NOT_READY         The event is not in the signaled state.
00577   @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL.
00578 
00579 **/
00580 typedef
00581 EFI_STATUS
00582 (EFIAPI *EFI_CHECK_EVENT)(
00583   IN EFI_EVENT                Event
00584   );
00585 
00586 
00587 //
00588 // Task priority level
00589 //
00590 #define TPL_APPLICATION       4
00591 #define TPL_CALLBACK          8
00592 #define TPL_NOTIFY            16
00593 #define TPL_HIGH_LEVEL        31
00594 
00595 
00596 /**
00597   Raises a task's priority level and returns its previous level.
00598 
00599   @param[in]  NewTpl          The new task priority level.
00600 
00601   @return Previous task priority level
00602 
00603 **/
00604 typedef
00605 EFI_TPL
00606 (EFIAPI *EFI_RAISE_TPL)(
00607   IN EFI_TPL      NewTpl
00608   );
00609 
00610 /**
00611   Restores a task's priority level to its previous value.
00612 
00613   @param[in]  OldTpl          The previous task priority level to restore.
00614 
00615 **/
00616 typedef
00617 VOID
00618 (EFIAPI *EFI_RESTORE_TPL)(
00619   IN EFI_TPL      OldTpl
00620   );
00621 
00622 /**
00623   Returns the value of a variable.
00624 
00625   @param[in]       VariableName  A Null-terminated string that is the name of the vendor's
00626                                  variable.
00627   @param[in]       VendorGuid    A unique identifier for the vendor.
00628   @param[out]      Attributes    If not NULL, a pointer to the memory location to return the
00629                                  attributes bitmask for the variable.
00630   @param[in, out]  DataSize      On input, the size in bytes of the return Data buffer.
00631                                  On output the size of data returned in Data.
00632   @param[out]      Data          The buffer to return the contents of the variable. May be NULL
00633                                  with a zero DataSize in order to determine the size buffer needed.
00634 
00635   @retval EFI_SUCCESS            The function completed successfully.
00636   @retval EFI_NOT_FOUND          The variable was not found.
00637   @retval EFI_BUFFER_TOO_SMALL   The DataSize is too small for the result.
00638   @retval EFI_INVALID_PARAMETER  VariableName is NULL.
00639   @retval EFI_INVALID_PARAMETER  VendorGuid is NULL.
00640   @retval EFI_INVALID_PARAMETER  DataSize is NULL.
00641   @retval EFI_INVALID_PARAMETER  The DataSize is not too small and Data is NULL.
00642   @retval EFI_DEVICE_ERROR       The variable could not be retrieved due to a hardware error.
00643   @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
00644 
00645 **/
00646 typedef
00647 EFI_STATUS
00648 (EFIAPI *EFI_GET_VARIABLE)(
00649   IN     CHAR16                      *VariableName,
00650   IN     EFI_GUID                    *VendorGuid,
00651   OUT    UINT32                      *Attributes,    OPTIONAL
00652   IN OUT UINTN                       *DataSize,
00653   OUT    VOID                        *Data           OPTIONAL
00654   );
00655 
00656 /**
00657   Enumerates the current variable names.
00658 
00659   @param[in, out]  VariableNameSize The size of the VariableName buffer.
00660   @param[in, out]  VariableName     On input, supplies the last VariableName that was returned
00661                                     by GetNextVariableName(). On output, returns the Nullterminated
00662                                     string of the current variable.
00663   @param[in, out]  VendorGuid       On input, supplies the last VendorGuid that was returned by
00664                                     GetNextVariableName(). On output, returns the
00665                                     VendorGuid of the current variable.
00666 
00667   @retval EFI_SUCCESS           The function completed successfully.
00668   @retval EFI_NOT_FOUND         The next variable was not found.
00669   @retval EFI_BUFFER_TOO_SMALL  The VariableNameSize is too small for the result.
00670   @retval EFI_INVALID_PARAMETER VariableNameSize is NULL.
00671   @retval EFI_INVALID_PARAMETER VariableName is NULL.
00672   @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
00673   @retval EFI_DEVICE_ERROR      The variable could not be retrieved due to a hardware error.
00674 
00675 **/
00676 typedef
00677 EFI_STATUS
00678 (EFIAPI *EFI_GET_NEXT_VARIABLE_NAME)(
00679   IN OUT UINTN                    *VariableNameSize,
00680   IN OUT CHAR16                   *VariableName,
00681   IN OUT EFI_GUID                 *VendorGuid
00682   );
00683 
00684 /**
00685   Sets the value of a variable.
00686 
00687   @param[in]  VariableName       A Null-terminated string that is the name of the vendor's variable.
00688                                  Each VariableName is unique for each VendorGuid. VariableName must
00689                                  contain 1 or more characters. If VariableName is an empty string,
00690                                  then EFI_INVALID_PARAMETER is returned.
00691   @param[in]  VendorGuid         A unique identifier for the vendor.
00692   @param[in]  Attributes         Attributes bitmask to set for the variable.
00693   @param[in]  DataSize           The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE,
00694                                  EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, or
00695                                  EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero
00696                                  causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is
00697                                  set, then a SetVariable() call with a DataSize of zero will not cause any change to
00698                                  the variable value (the timestamp associated with the variable may be updated however
00699                                  even if no new data value is provided,see the description of the
00700                                  EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not
00701                                  be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated).
00702   @param[in]  Data               The contents for the variable.
00703 
00704   @retval EFI_SUCCESS            The firmware has successfully stored the variable and its data as
00705                                  defined by the Attributes.
00706   @retval EFI_INVALID_PARAMETER  An invalid combination of attribute bits, name, and GUID was supplied, or the
00707                                  DataSize exceeds the maximum allowed.
00708   @retval EFI_INVALID_PARAMETER  VariableName is an empty string.
00709   @retval EFI_OUT_OF_RESOURCES   Not enough storage is available to hold the variable and its data.
00710   @retval EFI_DEVICE_ERROR       The variable could not be retrieved due to a hardware error.
00711   @retval EFI_WRITE_PROTECTED    The variable in question is read-only.
00712   @retval EFI_WRITE_PROTECTED    The variable in question cannot be deleted.
00713   @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
00714                                  or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo
00715                                  does NOT pass the validation check carried out by the firmware.
00716 
00717   @retval EFI_NOT_FOUND          The variable trying to be updated or deleted was not found.
00718 
00719 **/
00720 typedef
00721 EFI_STATUS
00722 (EFIAPI *EFI_SET_VARIABLE)(
00723   IN  CHAR16                       *VariableName,
00724   IN  EFI_GUID                     *VendorGuid,
00725   IN  UINT32                       Attributes,
00726   IN  UINTN                        DataSize,
00727   IN  VOID                         *Data
00728   );
00729 
00730 
00731 ///
00732 /// This provides the capabilities of the
00733 /// real time clock device as exposed through the EFI interfaces.
00734 ///
00735 typedef struct {
00736   ///
00737   /// Provides the reporting resolution of the real-time clock device in
00738   /// counts per second. For a normal PC-AT CMOS RTC device, this
00739   /// value would be 1 Hz, or 1, to indicate that the device only reports
00740   /// the time to the resolution of 1 second.
00741   ///
00742   UINT32    Resolution;
00743   ///
00744   /// Provides the timekeeping accuracy of the real-time clock in an
00745   /// error rate of 1E-6 parts per million. For a clock with an accuracy
00746   /// of 50 parts per million, the value in this field would be
00747   /// 50,000,000.
00748   ///
00749   UINT32    Accuracy;
00750   ///
00751   /// A TRUE indicates that a time set operation clears the device's
00752   /// time below the Resolution reporting level. A FALSE
00753   /// indicates that the state below the Resolution level of the
00754   /// device is not cleared when the time is set. Normal PC-AT CMOS
00755   /// RTC devices set this value to FALSE.
00756   ///
00757   BOOLEAN   SetsToZero;
00758 } EFI_TIME_CAPABILITIES;
00759 
00760 /**
00761   Returns the current time and date information, and the time-keeping capabilities
00762   of the hardware platform.
00763 
00764   @param[out]  Time             A pointer to storage to receive a snapshot of the current time.
00765   @param[out]  Capabilities     An optional pointer to a buffer to receive the real time clock
00766                                 device's capabilities.
00767 
00768   @retval EFI_SUCCESS           The operation completed successfully.
00769   @retval EFI_INVALID_PARAMETER Time is NULL.
00770   @retval EFI_DEVICE_ERROR      The time could not be retrieved due to hardware error.
00771 
00772 **/
00773 typedef
00774 EFI_STATUS
00775 (EFIAPI *EFI_GET_TIME)(
00776   OUT  EFI_TIME                    *Time,
00777   OUT  EFI_TIME_CAPABILITIES       *Capabilities OPTIONAL
00778   );
00779 
00780 /**
00781   Sets the current local time and date information.
00782 
00783   @param[in]  Time              A pointer to the current time.
00784 
00785   @retval EFI_SUCCESS           The operation completed successfully.
00786   @retval EFI_INVALID_PARAMETER A time field is out of range.
00787   @retval EFI_DEVICE_ERROR      The time could not be set due due to hardware error.
00788 
00789 **/
00790 typedef
00791 EFI_STATUS
00792 (EFIAPI *EFI_SET_TIME)(
00793   IN  EFI_TIME                     *Time
00794   );
00795 
00796 /**
00797   Returns the current wakeup alarm clock setting.
00798 
00799   @param[out]  Enabled          Indicates if the alarm is currently enabled or disabled.
00800   @param[out]  Pending          Indicates if the alarm signal is pending and requires acknowledgement.
00801   @param[out]  Time             The current alarm setting.
00802 
00803   @retval EFI_SUCCESS           The alarm settings were returned.
00804   @retval EFI_INVALID_PARAMETER Enabled is NULL.
00805   @retval EFI_INVALID_PARAMETER Pending is NULL.
00806   @retval EFI_INVALID_PARAMETER Time is NULL.
00807   @retval EFI_DEVICE_ERROR      The wakeup time could not be retrieved due to a hardware error.
00808   @retval EFI_UNSUPPORTED       A wakeup timer is not supported on this platform.
00809 
00810 **/
00811 typedef
00812 EFI_STATUS
00813 (EFIAPI *EFI_GET_WAKEUP_TIME)(
00814   OUT BOOLEAN                     *Enabled,
00815   OUT BOOLEAN                     *Pending,
00816   OUT EFI_TIME                    *Time
00817   );
00818 
00819 /**
00820   Sets the system wakeup alarm clock time.
00821 
00822   @param[in]  Enable            Enable or disable the wakeup alarm.
00823   @param[in]  Time              If Enable is TRUE, the time to set the wakeup alarm for.
00824                                 If Enable is FALSE, then this parameter is optional, and may be NULL.
00825 
00826   @retval EFI_SUCCESS           If Enable is TRUE, then the wakeup alarm was enabled. If
00827                                 Enable is FALSE, then the wakeup alarm was disabled.
00828   @retval EFI_INVALID_PARAMETER A time field is out of range.
00829   @retval EFI_DEVICE_ERROR      The wakeup time could not be set due to a hardware error.
00830   @retval EFI_UNSUPPORTED       A wakeup timer is not supported on this platform.
00831 
00832 **/
00833 typedef
00834 EFI_STATUS
00835 (EFIAPI *EFI_SET_WAKEUP_TIME)(
00836   IN  BOOLEAN                      Enable,
00837   IN  EFI_TIME                     *Time   OPTIONAL
00838   );
00839 
00840 /**
00841   Loads an EFI image into memory.
00842 
00843   @param[in]   BootPolicy        If TRUE, indicates that the request originates from the boot
00844                                  manager, and that the boot manager is attempting to load
00845                                  FilePath as a boot selection. Ignored if SourceBuffer is
00846                                  not NULL.
00847   @param[in]   ParentImageHandle The caller's image handle.
00848   @param[in]   DevicePath        The DeviceHandle specific file path from which the image is
00849                                  loaded.
00850   @param[in]   SourceBuffer      If not NULL, a pointer to the memory location containing a copy
00851                                  of the image to be loaded.
00852   @param[in]   SourceSize        The size in bytes of SourceBuffer. Ignored if SourceBuffer is NULL.
00853   @param[out]  ImageHandle       The pointer to the returned image handle that is created when the
00854                                  image is successfully loaded.
00855 
00856   @retval EFI_SUCCESS            Image was loaded into memory correctly.
00857   @retval EFI_NOT_FOUND          Both SourceBuffer and DevicePath are NULL.
00858   @retval EFI_INVALID_PARAMETER  One or more parametes are invalid.
00859   @retval EFI_UNSUPPORTED        The image type is not supported.
00860   @retval EFI_OUT_OF_RESOURCES   Image was not loaded due to insufficient resources.
00861   @retval EFI_LOAD_ERROR         Image was not loaded because the image format was corrupt or not
00862                                  understood.
00863   @retval EFI_DEVICE_ERROR       Image was not loaded because the device returned a read error.
00864   @retval EFI_ACCESS_DENIED      Image was not loaded because the platform policy prohibits the
00865                                  image from being loaded. NULL is returned in *ImageHandle.
00866   @retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
00867                                  valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
00868                                  platform policy specifies that the image should not be started.
00869 **/
00870 typedef
00871 EFI_STATUS
00872 (EFIAPI *EFI_IMAGE_LOAD)(
00873   IN  BOOLEAN                      BootPolicy,
00874   IN  EFI_HANDLE                   ParentImageHandle,
00875   IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath,
00876   IN  VOID                         *SourceBuffer OPTIONAL,
00877   IN  UINTN                        SourceSize,
00878   OUT EFI_HANDLE                   *ImageHandle
00879   );
00880 
00881 /**
00882   Transfers control to a loaded image's entry point.
00883 
00884   @param[in]   ImageHandle       Handle of image to be started.
00885   @param[out]  ExitDataSize      The pointer to the size, in bytes, of ExitData.
00886   @param[out]  ExitData          The pointer to a pointer to a data buffer that includes a Null-terminated
00887                                  string, optionally followed by additional binary data.
00888 
00889   @retval EFI_INVALID_PARAMETER  ImageHandle is either an invalid image handle or the image
00890                                  has already been initialized with StartImage.
00891   @retval EFI_SECURITY_VIOLATION The current platform policy specifies that the image should not be started.
00892   @return Exit code from image
00893 
00894 **/
00895 typedef
00896 EFI_STATUS
00897 (EFIAPI *EFI_IMAGE_START)(
00898   IN  EFI_HANDLE                  ImageHandle,
00899   OUT UINTN                       *ExitDataSize,
00900   OUT CHAR16                      **ExitData    OPTIONAL
00901   );
00902 
00903 /**
00904   Terminates a loaded EFI image and returns control to boot services.
00905 
00906   @param[in]  ImageHandle       Handle that identifies the image. This parameter is passed to the
00907                                 image on entry.
00908   @param[in]  ExitStatus        The image's exit code.
00909   @param[in]  ExitDataSize      The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS.
00910   @param[in]  ExitData          The pointer to a data buffer that includes a Null-terminated string,
00911                                 optionally followed by additional binary data. The string is a
00912                                 description that the caller may use to further indicate the reason
00913                                 for the image's exit. ExitData is only valid if ExitStatus
00914                                 is something other than EFI_SUCCESS. The ExitData buffer
00915                                 must be allocated by calling AllocatePool().
00916 
00917   @retval EFI_SUCCESS           The image specified by ImageHandle was unloaded.
00918   @retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and
00919                                 started with LoadImage() and StartImage(), but the
00920                                 image is not the currently executing image.
00921 
00922 **/
00923 typedef
00924 EFI_STATUS
00925 (EFIAPI *EFI_EXIT)(
00926   IN  EFI_HANDLE                   ImageHandle,
00927   IN  EFI_STATUS                   ExitStatus,
00928   IN  UINTN                        ExitDataSize,
00929   IN  CHAR16                       *ExitData     OPTIONAL
00930   );
00931 
00932 /**
00933   Unloads an image.
00934 
00935   @param[in]  ImageHandle       Handle that identifies the image to be unloaded.
00936 
00937   @retval EFI_SUCCESS           The image has been unloaded.
00938   @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
00939 
00940 **/
00941 typedef
00942 EFI_STATUS
00943 (EFIAPI *EFI_IMAGE_UNLOAD)(
00944   IN  EFI_HANDLE                   ImageHandle
00945   );
00946 
00947 /**
00948   Terminates all boot services.
00949 
00950   @param[in]  ImageHandle       Handle that identifies the exiting image.
00951   @param[in]  MapKey            Key to the latest memory map.
00952 
00953   @retval EFI_SUCCESS           Boot services have been terminated.
00954   @retval EFI_INVALID_PARAMETER MapKey is incorrect.
00955 
00956 **/
00957 typedef
00958 EFI_STATUS
00959 (EFIAPI *EFI_EXIT_BOOT_SERVICES)(
00960   IN  EFI_HANDLE                   ImageHandle,
00961   IN  UINTN                        MapKey
00962   );
00963 
00964 /**
00965   Induces a fine-grained stall.
00966 
00967   @param[in]  Microseconds      The number of microseconds to stall execution.
00968 
00969   @retval EFI_SUCCESS           Execution was stalled at least the requested number of
00970                                 Microseconds.
00971 
00972 **/
00973 typedef
00974 EFI_STATUS
00975 (EFIAPI *EFI_STALL)(
00976   IN  UINTN                    Microseconds
00977   );
00978 
00979 /**
00980   Sets the system's watchdog timer.
00981 
00982   @param[in]  Timeout           The number of seconds to set the watchdog timer to.
00983   @param[in]  WatchdogCode      The numeric code to log on a watchdog timer timeout event.
00984   @param[in]  DataSize          The size, in bytes, of WatchdogData.
00985   @param[in]  WatchdogData      A data buffer that includes a Null-terminated string, optionally
00986                                 followed by additional binary data.
00987 
00988   @retval EFI_SUCCESS           The timeout has been set.
00989   @retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid.
00990   @retval EFI_UNSUPPORTED       The system does not have a watchdog timer.
00991   @retval EFI_DEVICE_ERROR      The watchdog timer could not be programmed due to a hardware
00992                                 error.
00993 
00994 **/
00995 typedef
00996 EFI_STATUS
00997 (EFIAPI *EFI_SET_WATCHDOG_TIMER)(
00998   IN UINTN                    Timeout,
00999   IN UINT64                   WatchdogCode,
01000   IN UINTN                    DataSize,
01001   IN CHAR16                   *WatchdogData OPTIONAL
01002   );
01003 
01004 /**
01005   Resets the entire platform.
01006 
01007   @param[in]  ResetType         The type of reset to perform.
01008   @param[in]  ResetStatus       The status code for the reset.
01009   @param[in]  DataSize          The size, in bytes, of ResetData.
01010   @param[in]  ResetData         For a ResetType of EfiResetCold, EfiResetWarm, or
01011                                 EfiResetShutdown the data buffer starts with a Null-terminated
01012                                 string, optionally followed by additional binary data.
01013                                 The string is a description that the caller may use to further
01014                                 indicate the reason for the system reset. ResetData is only
01015                                 valid if ResetStatus is something other than EFI_SUCCESS
01016                                 unless the ResetType is EfiResetPlatformSpecific
01017                                 where a minimum amount of ResetData is always required.
01018 **/
01019 typedef
01020 VOID
01021 (EFIAPI *EFI_RESET_SYSTEM)(
01022   IN EFI_RESET_TYPE           ResetType,
01023   IN EFI_STATUS               ResetStatus,
01024   IN UINTN                    DataSize,
01025   IN VOID                     *ResetData OPTIONAL
01026   );
01027 
01028 /**
01029   Returns a monotonically increasing count for the platform.
01030 
01031   @param[out]  Count            The pointer to returned value.
01032 
01033   @retval EFI_SUCCESS           The next monotonic count was returned.
01034   @retval EFI_INVALID_PARAMETER Count is NULL.
01035   @retval EFI_DEVICE_ERROR      The device is not functioning properly.
01036 
01037 **/
01038 typedef
01039 EFI_STATUS
01040 (EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT)(
01041   OUT UINT64                  *Count
01042   );
01043 
01044 /**
01045   Returns the next high 32 bits of the platform's monotonic counter.
01046 
01047   @param[out]  HighCount        The pointer to returned value.
01048 
01049   @retval EFI_SUCCESS           The next high monotonic count was returned.
01050   @retval EFI_INVALID_PARAMETER HighCount is NULL.
01051   @retval EFI_DEVICE_ERROR      The device is not functioning properly.
01052 
01053 **/
01054 typedef
01055 EFI_STATUS
01056 (EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT)(
01057   OUT UINT32                  *HighCount
01058   );
01059 
01060 /**
01061   Computes and returns a 32-bit CRC for a data buffer.
01062 
01063   @param[in]   Data             A pointer to the buffer on which the 32-bit CRC is to be computed.
01064   @param[in]   DataSize         The number of bytes in the buffer Data.
01065   @param[out]  Crc32            The 32-bit CRC that was computed for the data buffer specified by Data
01066                                 and DataSize.
01067 
01068   @retval EFI_SUCCESS           The 32-bit CRC was computed for the data buffer and returned in
01069                                 Crc32.
01070   @retval EFI_INVALID_PARAMETER Data is NULL.
01071   @retval EFI_INVALID_PARAMETER Crc32 is NULL.
01072   @retval EFI_INVALID_PARAMETER DataSize is 0.
01073 
01074 **/
01075 typedef
01076 EFI_STATUS
01077 (EFIAPI *EFI_CALCULATE_CRC32)(
01078   IN  VOID                              *Data,
01079   IN  UINTN                             DataSize,
01080   OUT UINT32                            *Crc32
01081   );
01082 
01083 /**
01084   Copies the contents of one buffer to another buffer.
01085 
01086   @param[in]  Destination       The pointer to the destination buffer of the memory copy.
01087   @param[in]  Source            The pointer to the source buffer of the memory copy.
01088   @param[in]  Length            Number of bytes to copy from Source to Destination.
01089 
01090 **/
01091 typedef
01092 VOID
01093 (EFIAPI *EFI_COPY_MEM)(
01094   IN VOID     *Destination,
01095   IN VOID     *Source,
01096   IN UINTN    Length
01097   );
01098 
01099 /**
01100   The SetMem() function fills a buffer with a specified value.
01101 
01102   @param[in]  Buffer            The pointer to the buffer to fill.
01103   @param[in]  Size              Number of bytes in Buffer to fill.
01104   @param[in]  Value             Value to fill Buffer with.
01105 
01106 **/
01107 typedef
01108 VOID
01109 (EFIAPI *EFI_SET_MEM)(
01110   IN VOID     *Buffer,
01111   IN UINTN    Size,
01112   IN UINT8    Value
01113   );
01114 
01115 ///
01116 /// Enumeration of EFI Interface Types
01117 ///
01118 typedef enum {
01119   ///
01120   /// Indicates that the supplied protocol interface is supplied in native form.
01121   ///
01122   EFI_NATIVE_INTERFACE
01123 } EFI_INTERFACE_TYPE;
01124 
01125 /**
01126   Installs a protocol interface on a device handle. If the handle does not exist, it is created and added
01127   to the list of handles in the system. InstallMultipleProtocolInterfaces() performs
01128   more error checking than InstallProtocolInterface(), so it is recommended that
01129   InstallMultipleProtocolInterfaces() be used in place of
01130   InstallProtocolInterface()
01131 
01132   @param[in, out]  Handle         A pointer to the EFI_HANDLE on which the interface is to be installed.
01133   @param[in]       Protocol       The numeric ID of the protocol interface.
01134   @param[in]       InterfaceType  Indicates whether Interface is supplied in native form.
01135   @param[in]       Interface      A pointer to the protocol interface.
01136 
01137   @retval EFI_SUCCESS           The protocol interface was installed.
01138   @retval EFI_OUT_OF_RESOURCES  Space for a new handle could not be allocated.
01139   @retval EFI_INVALID_PARAMETER Handle is NULL.
01140   @retval EFI_INVALID_PARAMETER Protocol is NULL.
01141   @retval EFI_INVALID_PARAMETER InterfaceType is not EFI_NATIVE_INTERFACE.
01142   @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.
01143 
01144 **/
01145 typedef
01146 EFI_STATUS
01147 (EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE)(
01148   IN OUT EFI_HANDLE               *Handle,
01149   IN     EFI_GUID                 *Protocol,
01150   IN     EFI_INTERFACE_TYPE       InterfaceType,
01151   IN     VOID                     *Interface
01152   );
01153 
01154 /**
01155   Installs one or more protocol interfaces into the boot services environment.
01156 
01157   @param[in, out]  Handle       The pointer to a handle to install the new protocol interfaces on,
01158                                 or a pointer to NULL if a new handle is to be allocated.
01159   @param  ...                   A variable argument list containing pairs of protocol GUIDs and protocol
01160                                 interfaces.
01161 
01162   @retval EFI_SUCCESS           All the protocol interface was installed.
01163   @retval EFI_OUT_OF_RESOURCES  There was not enough memory in pool to install all the protocols.
01164   @retval EFI_ALREADY_STARTED   A Device Path Protocol instance was passed in that is already present in
01165                                 the handle database.
01166   @retval EFI_INVALID_PARAMETER Handle is NULL.
01167   @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.
01168 
01169 **/
01170 typedef
01171 EFI_STATUS
01172 (EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES)(
01173   IN OUT EFI_HANDLE           *Handle,
01174   ...
01175   );
01176 
01177 /**
01178   Reinstalls a protocol interface on a device handle.
01179 
01180   @param[in]  Handle            Handle on which the interface is to be reinstalled.
01181   @param[in]  Protocol          The numeric ID of the interface.
01182   @param[in]  OldInterface      A pointer to the old interface. NULL can be used if a structure is not
01183                                 associated with Protocol.
01184   @param[in]  NewInterface      A pointer to the new interface.
01185 
01186   @retval EFI_SUCCESS           The protocol interface was reinstalled.
01187   @retval EFI_NOT_FOUND         The OldInterface on the handle was not found.
01188   @retval EFI_ACCESS_DENIED     The protocol interface could not be reinstalled,
01189                                 because OldInterface is still being used by a
01190                                 driver that will not release it.
01191   @retval EFI_INVALID_PARAMETER Handle is NULL.
01192   @retval EFI_INVALID_PARAMETER Protocol is NULL.
01193 
01194 **/
01195 typedef
01196 EFI_STATUS
01197 (EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE)(
01198   IN EFI_HANDLE               Handle,
01199   IN EFI_GUID                 *Protocol,
01200   IN VOID                     *OldInterface,
01201   IN VOID                     *NewInterface
01202   );
01203 
01204 /**
01205   Removes a protocol interface from a device handle. It is recommended that
01206   UninstallMultipleProtocolInterfaces() be used in place of
01207   UninstallProtocolInterface().
01208 
01209   @param[in]  Handle            The handle on which the interface was installed.
01210   @param[in]  Protocol          The numeric ID of the interface.
01211   @param[in]  Interface         A pointer to the interface.
01212 
01213   @retval EFI_SUCCESS           The interface was removed.
01214   @retval EFI_NOT_FOUND         The interface was not found.
01215   @retval EFI_ACCESS_DENIED     The interface was not removed because the interface
01216                                 is still being used by a driver.
01217   @retval EFI_INVALID_PARAMETER Handle is NULL.
01218   @retval EFI_INVALID_PARAMETER Protocol is NULL.
01219 
01220 **/
01221 typedef
01222 EFI_STATUS
01223 (EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE)(
01224   IN EFI_HANDLE               Handle,
01225   IN EFI_GUID                 *Protocol,
01226   IN VOID                     *Interface
01227   );
01228 
01229 /**
01230   Removes one or more protocol interfaces into the boot services environment.
01231 
01232   @param[in]  Handle            The handle to remove the protocol interfaces from.
01233   @param  ...                   A variable argument list containing pairs of protocol GUIDs and
01234                                 protocol interfaces.
01235 
01236   @retval EFI_SUCCESS           All the protocol interfaces were removed.
01237   @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.
01238 
01239 **/
01240 typedef
01241 EFI_STATUS
01242 (EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES)(
01243   IN EFI_HANDLE           Handle,
01244   ...
01245   );
01246 
01247 /**
01248   Queries a handle to determine if it supports a specified protocol.
01249 
01250   @param[in]   Handle           The handle being queried.
01251   @param[in]   Protocol         The published unique identifier of the protocol.
01252   @param[out]  Interface        Supplies the address where a pointer to the corresponding Protocol
01253                                 Interface is returned.
01254 
01255   @retval EFI_SUCCESS           The interface information for the specified protocol was returned.
01256   @retval EFI_UNSUPPORTED       The device does not support the specified protocol.
01257   @retval EFI_INVALID_PARAMETER Handle is NULL.
01258   @retval EFI_INVALID_PARAMETER Protocol is NULL.
01259   @retval EFI_INVALID_PARAMETER Interface is NULL.
01260 
01261 **/
01262 typedef
01263 EFI_STATUS
01264 (EFIAPI *EFI_HANDLE_PROTOCOL)(
01265   IN  EFI_HANDLE               Handle,
01266   IN  EFI_GUID                 *Protocol,
01267   OUT VOID                     **Interface
01268   );
01269 
01270 #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL  0x00000001
01271 #define EFI_OPEN_PROTOCOL_GET_PROTOCOL        0x00000002
01272 #define EFI_OPEN_PROTOCOL_TEST_PROTOCOL       0x00000004
01273 #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
01274 #define EFI_OPEN_PROTOCOL_BY_DRIVER           0x00000010
01275 #define EFI_OPEN_PROTOCOL_EXCLUSIVE           0x00000020
01276 
01277 /**
01278   Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the
01279   handle, it opens the protocol on behalf of the calling agent.
01280 
01281   @param[in]   Handle           The handle for the protocol interface that is being opened.
01282   @param[in]   Protocol         The published unique identifier of the protocol.
01283   @param[out]  Interface        Supplies the address where a pointer to the corresponding Protocol
01284                                 Interface is returned.
01285   @param[in]   AgentHandle      The handle of the agent that is opening the protocol interface
01286                                 specified by Protocol and Interface.
01287   @param[in]   ControllerHandle If the agent that is opening a protocol is a driver that follows the
01288                                 UEFI Driver Model, then this parameter is the controller handle
01289                                 that requires the protocol interface. If the agent does not follow
01290                                 the UEFI Driver Model, then this parameter is optional and may
01291                                 be NULL.
01292   @param[in]   Attributes       The open mode of the protocol interface specified by Handle
01293                                 and Protocol.
01294 
01295   @retval EFI_SUCCESS           An item was added to the open list for the protocol interface, and the
01296                                 protocol interface was returned in Interface.
01297   @retval EFI_UNSUPPORTED       Handle does not support Protocol.
01298   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
01299   @retval EFI_ACCESS_DENIED     Required attributes can't be supported in current environment.
01300   @retval EFI_ALREADY_STARTED   Item on the open list already has requierd attributes whose agent
01301                                 handle is the same as AgentHandle.
01302 
01303 **/
01304 typedef
01305 EFI_STATUS
01306 (EFIAPI *EFI_OPEN_PROTOCOL)(
01307   IN  EFI_HANDLE                Handle,
01308   IN  EFI_GUID                  *Protocol,
01309   OUT VOID                      **Interface, OPTIONAL
01310   IN  EFI_HANDLE                AgentHandle,
01311   IN  EFI_HANDLE                ControllerHandle,
01312   IN  UINT32                    Attributes
01313   );
01314 
01315 
01316 /**
01317   Closes a protocol on a handle that was opened using OpenProtocol().
01318 
01319   @param[in]  Handle            The handle for the protocol interface that was previously opened
01320                                 with OpenProtocol(), and is now being closed.
01321   @param[in]  Protocol          The published unique identifier of the protocol.
01322   @param[in]  AgentHandle       The handle of the agent that is closing the protocol interface.
01323   @param[in]  ControllerHandle  If the agent that opened a protocol is a driver that follows the
01324                                 UEFI Driver Model, then this parameter is the controller handle
01325                                 that required the protocol interface.
01326 
01327   @retval EFI_SUCCESS           The protocol instance was closed.
01328   @retval EFI_INVALID_PARAMETER 1) Handle is NULL.
01329                                 2) AgentHandle is NULL.
01330                                 3) ControllerHandle is not NULL and ControllerHandle is not a valid EFI_HANDLE.
01331                                 4) Protocol is NULL.
01332   @retval EFI_NOT_FOUND         1) Handle does not support the protocol specified by Protocol.
01333                                 2) The protocol interface specified by Handle and Protocol is not
01334                                    currently open by AgentHandle and ControllerHandle.
01335 
01336 **/
01337 typedef
01338 EFI_STATUS
01339 (EFIAPI *EFI_CLOSE_PROTOCOL)(
01340   IN EFI_HANDLE               Handle,
01341   IN EFI_GUID                 *Protocol,
01342   IN EFI_HANDLE               AgentHandle,
01343   IN EFI_HANDLE               ControllerHandle
01344   );
01345 
01346 ///
01347 /// EFI Oprn Protocol Information Entry
01348 ///
01349 typedef struct {
01350   EFI_HANDLE  AgentHandle;
01351   EFI_HANDLE  ControllerHandle;
01352   UINT32      Attributes;
01353   UINT32      OpenCount;
01354 } EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
01355 
01356 /**
01357   Retrieves the list of agents that currently have a protocol interface opened.
01358 
01359   @param[in]   Handle           The handle for the protocol interface that is being queried.
01360   @param[in]   Protocol         The published unique identifier of the protocol.
01361   @param[out]  EntryBuffer      A pointer to a buffer of open protocol information in the form of
01362                                 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
01363   @param[out]  EntryCount       A pointer to the number of entries in EntryBuffer.
01364 
01365   @retval EFI_SUCCESS           The open protocol information was returned in EntryBuffer, and the
01366                                 number of entries was returned EntryCount.
01367   @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to allocate EntryBuffer.
01368   @retval EFI_NOT_FOUND         Handle does not support the protocol specified by Protocol.
01369 
01370 **/
01371 typedef
01372 EFI_STATUS
01373 (EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION)(
01374   IN  EFI_HANDLE                          Handle,
01375   IN  EFI_GUID                            *Protocol,
01376   OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
01377   OUT UINTN                               *EntryCount
01378   );
01379 
01380 /**
01381   Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated
01382   from pool.
01383 
01384   @param[in]   Handle              The handle from which to retrieve the list of protocol interface
01385                                    GUIDs.
01386   @param[out]  ProtocolBuffer      A pointer to the list of protocol interface GUID pointers that are
01387                                    installed on Handle.
01388   @param[out]  ProtocolBufferCount A pointer to the number of GUID pointers present in
01389                                    ProtocolBuffer.
01390 
01391   @retval EFI_SUCCESS           The list of protocol interface GUIDs installed on Handle was returned in
01392                                 ProtocolBuffer. The number of protocol interface GUIDs was
01393                                 returned in ProtocolBufferCount.
01394   @retval EFI_OUT_OF_RESOURCES  There is not enough pool memory to store the results.
01395   @retval EFI_INVALID_PARAMETER Handle is NULL.
01396   @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.
01397   @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.
01398   @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.
01399 
01400 **/
01401 typedef
01402 EFI_STATUS
01403 (EFIAPI *EFI_PROTOCOLS_PER_HANDLE)(
01404   IN  EFI_HANDLE      Handle,
01405   OUT EFI_GUID        ***ProtocolBuffer,
01406   OUT UINTN           *ProtocolBufferCount
01407   );
01408 
01409 /**
01410   Creates an event that is to be signaled whenever an interface is installed for a specified protocol.
01411 
01412   @param[in]   Protocol         The numeric ID of the protocol for which the event is to be registered.
01413   @param[in]   Event            Event that is to be signaled whenever a protocol interface is registered
01414                                 for Protocol.
01415   @param[out]  Registration     A pointer to a memory location to receive the registration value.
01416 
01417   @retval EFI_SUCCESS           The notification event has been registered.
01418   @retval EFI_OUT_OF_RESOURCES  Space for the notification event could not be allocated.
01419   @retval EFI_INVALID_PARAMETER Protocol is NULL.
01420   @retval EFI_INVALID_PARAMETER Event is NULL.
01421   @retval EFI_INVALID_PARAMETER Registration is NULL.
01422 
01423 **/
01424 typedef
01425 EFI_STATUS
01426 (EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY)(
01427   IN  EFI_GUID                 *Protocol,
01428   IN  EFI_EVENT                Event,
01429   OUT VOID                     **Registration
01430   );
01431 
01432 ///
01433 /// Enumeration of EFI Locate Search Types
01434 ///
01435 typedef enum {
01436   ///
01437   /// Retrieve all the handles in the handle database.
01438   ///
01439   AllHandles,
01440   ///
01441   /// Retrieve the next handle fron a RegisterProtocolNotify() event.
01442   ///
01443   ByRegisterNotify,
01444   ///
01445   /// Retrieve the set of handles from the handle database that support a
01446   /// specified protocol.
01447   ///
01448   ByProtocol
01449 } EFI_LOCATE_SEARCH_TYPE;
01450 
01451 /**
01452   Returns an array of handles that support a specified protocol.
01453 
01454   @param[in]       SearchType   Specifies which handle(s) are to be returned.
01455   @param[in]       Protocol     Specifies the protocol to search by.
01456   @param[in]       SearchKey    Specifies the search key.
01457   @param[in, out]  BufferSize   On input, the size in bytes of Buffer. On output, the size in bytes of
01458                                 the array returned in Buffer (if the buffer was large enough) or the
01459                                 size, in bytes, of the buffer needed to obtain the array (if the buffer was
01460                                 not large enough).
01461   @param[out]      Buffer       The buffer in which the array is returned.
01462 
01463   @retval EFI_SUCCESS           The array of handles was returned.
01464   @retval EFI_NOT_FOUND         No handles match the search.
01465   @retval EFI_BUFFER_TOO_SMALL  The BufferSize is too small for the result.
01466   @retval EFI_INVALID_PARAMETER SearchType is not a member of EFI_LOCATE_SEARCH_TYPE.
01467   @retval EFI_INVALID_PARAMETER SearchType is ByRegisterNotify and SearchKey is NULL.
01468   @retval EFI_INVALID_PARAMETER SearchType is ByProtocol and Protocol is NULL.
01469   @retval EFI_INVALID_PARAMETER One or more matches are found and BufferSize is NULL.
01470   @retval EFI_INVALID_PARAMETER BufferSize is large enough for the result and Buffer is NULL.
01471 
01472 **/
01473 typedef
01474 EFI_STATUS
01475 (EFIAPI *EFI_LOCATE_HANDLE)(
01476   IN     EFI_LOCATE_SEARCH_TYPE   SearchType,
01477   IN     EFI_GUID                 *Protocol,    OPTIONAL
01478   IN     VOID                     *SearchKey,   OPTIONAL
01479   IN OUT UINTN                    *BufferSize,
01480   OUT    EFI_HANDLE               *Buffer
01481   );
01482 
01483 /**
01484   Locates the handle to a device on the device path that supports the specified protocol.
01485 
01486   @param[in]       Protocol     Specifies the protocol to search for.
01487   @param[in, out]  DevicePath   On input, a pointer to a pointer to the device path. On output, the device
01488                                 path pointer is modified to point to the remaining part of the device
01489                                 path.
01490   @param[out]      Device       A pointer to the returned device handle.
01491 
01492   @retval EFI_SUCCESS           The resulting handle was returned.
01493   @retval EFI_NOT_FOUND         No handles match the search.
01494   @retval EFI_INVALID_PARAMETER Protocol is NULL.
01495   @retval EFI_INVALID_PARAMETER DevicePath is NULL.
01496   @retval EFI_INVALID_PARAMETER A handle matched the search and Device is NULL.
01497 
01498 **/
01499 typedef
01500 EFI_STATUS
01501 (EFIAPI *EFI_LOCATE_DEVICE_PATH)(
01502   IN     EFI_GUID                         *Protocol,
01503   IN OUT EFI_DEVICE_PATH_PROTOCOL         **DevicePath,
01504   OUT    EFI_HANDLE                       *Device
01505   );
01506 
01507 /**
01508   Adds, updates, or removes a configuration table entry from the EFI System Table.
01509 
01510   @param[in]  Guid              A pointer to the GUID for the entry to add, update, or remove.
01511   @param[in]  Table             A pointer to the configuration table for the entry to add, update, or
01512                                 remove. May be NULL.
01513 
01514   @retval EFI_SUCCESS           The (Guid, Table) pair was added, updated, or removed.
01515   @retval EFI_NOT_FOUND         An attempt was made to delete a nonexistent entry.
01516   @retval EFI_INVALID_PARAMETER Guid is NULL.
01517   @retval EFI_OUT_OF_RESOURCES  There is not enough memory available to complete the operation.
01518 
01519 **/
01520 typedef
01521 EFI_STATUS
01522 (EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE)(
01523   IN EFI_GUID                 *Guid,
01524   IN VOID                     *Table
01525   );
01526 
01527 /**
01528   Returns an array of handles that support the requested protocol in a buffer allocated from pool.
01529 
01530   @param[in]       SearchType   Specifies which handle(s) are to be returned.
01531   @param[in]       Protocol     Provides the protocol to search by.
01532                                 This parameter is only valid for a SearchType of ByProtocol.
01533   @param[in]       SearchKey    Supplies the search key depending on the SearchType.
01534   @param[in, out]  NoHandles    The number of handles returned in Buffer.
01535   @param[out]      Buffer       A pointer to the buffer to return the requested array of handles that
01536                                 support Protocol.
01537 
01538   @retval EFI_SUCCESS           The array of handles was returned in Buffer, and the number of
01539                                 handles in Buffer was returned in NoHandles.
01540   @retval EFI_NOT_FOUND         No handles match the search.
01541   @retval EFI_OUT_OF_RESOURCES  There is not enough pool memory to store the matching results.
01542   @retval EFI_INVALID_PARAMETER NoHandles is NULL.
01543   @retval EFI_INVALID_PARAMETER Buffer is NULL.
01544 
01545 **/
01546 typedef
01547 EFI_STATUS
01548 (EFIAPI *EFI_LOCATE_HANDLE_BUFFER)(
01549   IN     EFI_LOCATE_SEARCH_TYPE       SearchType,
01550   IN     EFI_GUID                     *Protocol,      OPTIONAL
01551   IN     VOID                         *SearchKey,     OPTIONAL
01552   IN OUT UINTN                        *NoHandles,
01553   OUT    EFI_HANDLE                   **Buffer
01554   );
01555 
01556 /**
01557   Returns the first protocol instance that matches the given protocol.
01558 
01559   @param[in]  Protocol          Provides the protocol to search for.
01560   @param[in]  Registration      Optional registration key returned from
01561                                 RegisterProtocolNotify().
01562   @param[out]  Interface        On return, a pointer to the first interface that matches Protocol and
01563                                 Registration.
01564 
01565   @retval EFI_SUCCESS           A protocol instance matching Protocol was found and returned in
01566                                 Interface.
01567   @retval EFI_NOT_FOUND         No protocol instances were found that match Protocol and
01568                                 Registration.
01569   @retval EFI_INVALID_PARAMETER Interface is NULL.
01570 
01571 **/
01572 typedef
01573 EFI_STATUS
01574 (EFIAPI *EFI_LOCATE_PROTOCOL)(
01575   IN  EFI_GUID  *Protocol,
01576   IN  VOID      *Registration, OPTIONAL
01577   OUT VOID      **Interface
01578   );
01579 
01580 ///
01581 /// EFI Capsule Block Descriptor
01582 ///
01583 typedef struct {
01584   ///
01585   /// Length in bytes of the data pointed to by DataBlock/ContinuationPointer.
01586   ///
01587   UINT64                  Length;
01588   union {
01589     ///
01590     /// Physical address of the data block. This member of the union is
01591     /// used if Length is not equal to zero.
01592     ///
01593     EFI_PHYSICAL_ADDRESS  DataBlock;
01594     ///
01595     /// Physical address of another block of
01596     /// EFI_CAPSULE_BLOCK_DESCRIPTOR structures. This
01597     /// member of the union is used if Length is equal to zero. If
01598     /// ContinuationPointer is zero this entry represents the end of the list.
01599     ///
01600     EFI_PHYSICAL_ADDRESS  ContinuationPointer;
01601   } Union;
01602 } EFI_CAPSULE_BLOCK_DESCRIPTOR;
01603 
01604 ///
01605 /// EFI Capsule Header.
01606 ///
01607 typedef struct {
01608   ///
01609   /// A GUID that defines the contents of a capsule.
01610   ///
01611   EFI_GUID          CapsuleGuid;
01612   ///
01613   /// The size of the capsule header. This may be larger than the size of
01614   /// the EFI_CAPSULE_HEADER since CapsuleGuid may imply
01615   /// extended header entries
01616   ///
01617   UINT32            HeaderSize;
01618   ///
01619   /// Bit-mapped list describing the capsule attributes. The Flag values
01620   /// of 0x0000 - 0xFFFF are defined by CapsuleGuid. Flag values
01621   /// of 0x10000 - 0xFFFFFFFF are defined by this specification
01622   ///
01623   UINT32            Flags;
01624   ///
01625   /// Size in bytes of the capsule.
01626   ///
01627   UINT32            CapsuleImageSize;
01628 } EFI_CAPSULE_HEADER;
01629 
01630 ///
01631 /// The EFI System Table entry must point to an array of capsules
01632 /// that contain the same CapsuleGuid value. The array must be
01633 /// prefixed by a UINT32 that represents the size of the array of capsules.
01634 ///
01635 typedef struct {
01636   ///
01637   /// the size of the array of capsules.
01638   ///
01639   UINT32   CapsuleArrayNumber;
01640   ///
01641   /// Point to an array of capsules that contain the same CapsuleGuid value.
01642   ///
01643   VOID*    CapsulePtr[1];
01644 } EFI_CAPSULE_TABLE;
01645 
01646 #define CAPSULE_FLAGS_PERSIST_ACROSS_RESET          0x00010000
01647 #define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE         0x00020000
01648 #define CAPSULE_FLAGS_INITIATE_RESET                0x00040000
01649 
01650 /**
01651   Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
01652   consumption, the firmware may process the capsule immediately. If the payload should persist
01653   across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must
01654   be passed into ResetSystem() and will cause the capsule to be processed by the firmware as
01655   part of the reset process.
01656 
01657   @param[in]  CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
01658                                  being passed into update capsule.
01659   @param[in]  CapsuleCount       Number of pointers to EFI_CAPSULE_HEADER in
01660                                  CaspuleHeaderArray.
01661   @param[in]  ScatterGatherList  Physical pointer to a set of
01662                                  EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the
01663                                  location in physical memory of a set of capsules.
01664 
01665   @retval EFI_SUCCESS           Valid capsule was passed. If
01666                                 CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the
01667                                 capsule has been successfully processed by the firmware.
01668   @retval EFI_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were
01669                                 set in the capsule header.
01670   @retval EFI_INVALID_PARAMETER CapsuleCount is 0.
01671   @retval EFI_DEVICE_ERROR      The capsule update was started, but failed due to a device error.
01672   @retval EFI_UNSUPPORTED       The capsule type is not supported on this platform.
01673   @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has been previously called this error indicates the capsule
01674                                 is compatible with this platform but is not capable of being submitted or processed
01675                                 in runtime. The caller may resubmit the capsule prior to ExitBootServices().
01676   @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates
01677                                 the capsule is compatible with this platform but there are insufficient resources to process.
01678 
01679 **/
01680 typedef
01681 EFI_STATUS
01682 (EFIAPI *EFI_UPDATE_CAPSULE)(
01683   IN EFI_CAPSULE_HEADER     **CapsuleHeaderArray,
01684   IN UINTN                  CapsuleCount,
01685   IN EFI_PHYSICAL_ADDRESS   ScatterGatherList   OPTIONAL
01686   );
01687 
01688 /**
01689   Returns if the capsule can be supported via UpdateCapsule().
01690 
01691   @param[in]   CapsuleHeaderArray  Virtual pointer to an array of virtual pointers to the capsules
01692                                    being passed into update capsule.
01693   @param[in]   CapsuleCount        Number of pointers to EFI_CAPSULE_HEADER in
01694                                    CaspuleHeaderArray.
01695   @param[out]  MaxiumCapsuleSize   On output the maximum size that UpdateCapsule() can
01696                                    support as an argument to UpdateCapsule() via
01697                                    CapsuleHeaderArray and ScatterGatherList.
01698   @param[out]  ResetType           Returns the type of reset required for the capsule update.
01699 
01700   @retval EFI_SUCCESS           Valid answer returned.
01701   @retval EFI_UNSUPPORTED       The capsule type is not supported on this platform, and
01702                                 MaximumCapsuleSize and ResetType are undefined.
01703   @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.
01704   @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has been previously called this error indicates the capsule
01705                                 is compatible with this platform but is not capable of being submitted or processed
01706                                 in runtime. The caller may resubmit the capsule prior to ExitBootServices().
01707   @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates
01708                                 the capsule is compatible with this platform but there are insufficient resources to process.
01709 
01710 **/
01711 typedef
01712 EFI_STATUS
01713 (EFIAPI *EFI_QUERY_CAPSULE_CAPABILITIES)(
01714   IN  EFI_CAPSULE_HEADER     **CapsuleHeaderArray,
01715   IN  UINTN                  CapsuleCount,
01716   OUT UINT64                 *MaximumCapsuleSize,
01717   OUT EFI_RESET_TYPE         *ResetType
01718   );
01719 
01720 /**
01721   Returns information about the EFI variables.
01722 
01723   @param[in]   Attributes                   Attributes bitmask to specify the type of variables on
01724                                             which to return information.
01725   @param[out]  MaximumVariableStorageSize   On output the maximum size of the storage space
01726                                             available for the EFI variables associated with the
01727                                             attributes specified.
01728   @param[out]  RemainingVariableStorageSize Returns the remaining size of the storage space
01729                                             available for the EFI variables associated with the
01730                                             attributes specified.
01731   @param[out]  MaximumVariableSize          Returns the maximum size of the individual EFI
01732                                             variables associated with the attributes specified.
01733 
01734   @retval EFI_SUCCESS                  Valid answer returned.
01735   @retval EFI_INVALID_PARAMETER        An invalid combination of attribute bits was supplied
01736   @retval EFI_UNSUPPORTED              The attribute is not supported on this platform, and the
01737                                        MaximumVariableStorageSize,
01738                                        RemainingVariableStorageSize, MaximumVariableSize
01739                                        are undefined.
01740 
01741 **/
01742 typedef
01743 EFI_STATUS
01744 (EFIAPI *EFI_QUERY_VARIABLE_INFO)(
01745   IN  UINT32            Attributes,
01746   OUT UINT64            *MaximumVariableStorageSize,
01747   OUT UINT64            *RemainingVariableStorageSize,
01748   OUT UINT64            *MaximumVariableSize
01749   );
01750 
01751 //
01752 // Firmware should stop at a firmware user interface on next boot
01753 //
01754 #define EFI_OS_INDICATIONS_BOOT_TO_FW_UI                    0x0000000000000001
01755 #define EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION             0x0000000000000002
01756 #define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED  0x0000000000000004
01757 #define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED            0x0000000000000008
01758 #define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED     0x0000000000000010
01759 #define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY          0x0000000000000040
01760 
01761 //
01762 // EFI Runtime Services Table
01763 //
01764 #define EFI_SYSTEM_TABLE_SIGNATURE      SIGNATURE_64 ('I','B','I',' ','S','Y','S','T')
01765 #define EFI_2_60_SYSTEM_TABLE_REVISION  ((2 << 16) | (60))
01766 #define EFI_2_50_SYSTEM_TABLE_REVISION  ((2 << 16) | (50))
01767 #define EFI_2_40_SYSTEM_TABLE_REVISION  ((2 << 16) | (40))
01768 #define EFI_2_31_SYSTEM_TABLE_REVISION  ((2 << 16) | (31))
01769 #define EFI_2_30_SYSTEM_TABLE_REVISION  ((2 << 16) | (30))
01770 #define EFI_2_20_SYSTEM_TABLE_REVISION  ((2 << 16) | (20))
01771 #define EFI_2_10_SYSTEM_TABLE_REVISION  ((2 << 16) | (10))
01772 #define EFI_2_00_SYSTEM_TABLE_REVISION  ((2 << 16) | (00))
01773 #define EFI_1_10_SYSTEM_TABLE_REVISION  ((1 << 16) | (10))
01774 #define EFI_1_02_SYSTEM_TABLE_REVISION  ((1 << 16) | (02))
01775 #define EFI_SYSTEM_TABLE_REVISION       EFI_2_60_SYSTEM_TABLE_REVISION
01776 #define EFI_SPECIFICATION_VERSION       EFI_SYSTEM_TABLE_REVISION
01777 
01778 #define EFI_RUNTIME_SERVICES_SIGNATURE  SIGNATURE_64 ('R','U','N','T','S','E','R','V')
01779 #define EFI_RUNTIME_SERVICES_REVISION   EFI_SPECIFICATION_VERSION
01780 
01781 ///
01782 /// EFI Runtime Services Table.
01783 ///
01784 typedef struct {
01785   ///
01786   /// The table header for the EFI Runtime Services Table.
01787   ///
01788   EFI_TABLE_HEADER                Hdr;
01789 
01790   //
01791   // Time Services
01792   //
01793   EFI_GET_TIME                    GetTime;
01794   EFI_SET_TIME                    SetTime;
01795   EFI_GET_WAKEUP_TIME             GetWakeupTime;
01796   EFI_SET_WAKEUP_TIME             SetWakeupTime;
01797 
01798   //
01799   // Virtual Memory Services
01800   //
01801   EFI_SET_VIRTUAL_ADDRESS_MAP     SetVirtualAddressMap;
01802   EFI_CONVERT_POINTER             ConvertPointer;
01803 
01804   //
01805   // Variable Services
01806   //
01807   EFI_GET_VARIABLE                GetVariable;
01808   EFI_GET_NEXT_VARIABLE_NAME      GetNextVariableName;
01809   EFI_SET_VARIABLE                SetVariable;
01810 
01811   //
01812   // Miscellaneous Services
01813   //
01814   EFI_GET_NEXT_HIGH_MONO_COUNT    GetNextHighMonotonicCount;
01815   EFI_RESET_SYSTEM                ResetSystem;
01816 
01817   //
01818   // UEFI 2.0 Capsule Services
01819   //
01820   EFI_UPDATE_CAPSULE              UpdateCapsule;
01821   EFI_QUERY_CAPSULE_CAPABILITIES  QueryCapsuleCapabilities;
01822 
01823   //
01824   // Miscellaneous UEFI 2.0 Service
01825   //
01826   EFI_QUERY_VARIABLE_INFO         QueryVariableInfo;
01827 } EFI_RUNTIME_SERVICES;
01828 
01829 
01830 #define EFI_BOOT_SERVICES_SIGNATURE   SIGNATURE_64 ('B','O','O','T','S','E','R','V')
01831 #define EFI_BOOT_SERVICES_REVISION    EFI_SPECIFICATION_VERSION
01832 
01833 ///
01834 /// EFI Boot Services Table.
01835 ///
01836 typedef struct {
01837   ///
01838   /// The table header for the EFI Boot Services Table.
01839   ///
01840   EFI_TABLE_HEADER                Hdr;
01841 
01842   //
01843   // Task Priority Services
01844   //
01845   EFI_RAISE_TPL                   RaiseTPL;
01846   EFI_RESTORE_TPL                 RestoreTPL;
01847 
01848   //
01849   // Memory Services
01850   //
01851   EFI_ALLOCATE_PAGES              AllocatePages;
01852   EFI_FREE_PAGES                  FreePages;
01853   EFI_GET_MEMORY_MAP              GetMemoryMap;
01854   EFI_ALLOCATE_POOL               AllocatePool;
01855   EFI_FREE_POOL                   FreePool;
01856 
01857   //
01858   // Event & Timer Services
01859   //
01860   EFI_CREATE_EVENT                  CreateEvent;
01861   EFI_SET_TIMER                     SetTimer;
01862   EFI_WAIT_FOR_EVENT                WaitForEvent;
01863   EFI_SIGNAL_EVENT                  SignalEvent;
01864   EFI_CLOSE_EVENT                   CloseEvent;
01865   EFI_CHECK_EVENT                   CheckEvent;
01866 
01867   //
01868   // Protocol Handler Services
01869   //
01870   EFI_INSTALL_PROTOCOL_INTERFACE    InstallProtocolInterface;
01871   EFI_REINSTALL_PROTOCOL_INTERFACE  ReinstallProtocolInterface;
01872   EFI_UNINSTALL_PROTOCOL_INTERFACE  UninstallProtocolInterface;
01873   EFI_HANDLE_PROTOCOL               HandleProtocol;
01874   VOID                              *Reserved;
01875   EFI_REGISTER_PROTOCOL_NOTIFY      RegisterProtocolNotify;
01876   EFI_LOCATE_HANDLE                 LocateHandle;
01877   EFI_LOCATE_DEVICE_PATH            LocateDevicePath;
01878   EFI_INSTALL_CONFIGURATION_TABLE   InstallConfigurationTable;
01879 
01880   //
01881   // Image Services
01882   //
01883   EFI_IMAGE_LOAD                    LoadImage;
01884   EFI_IMAGE_START                   StartImage;
01885   EFI_EXIT                          Exit;
01886   EFI_IMAGE_UNLOAD                  UnloadImage;
01887   EFI_EXIT_BOOT_SERVICES            ExitBootServices;
01888 
01889   //
01890   // Miscellaneous Services
01891   //
01892   EFI_GET_NEXT_MONOTONIC_COUNT      GetNextMonotonicCount;
01893   EFI_STALL                         Stall;
01894   EFI_SET_WATCHDOG_TIMER            SetWatchdogTimer;
01895 
01896   //
01897   // DriverSupport Services
01898   //
01899   EFI_CONNECT_CONTROLLER            ConnectController;
01900   EFI_DISCONNECT_CONTROLLER         DisconnectController;
01901 
01902   //
01903   // Open and Close Protocol Services
01904   //
01905   EFI_OPEN_PROTOCOL                 OpenProtocol;
01906   EFI_CLOSE_PROTOCOL                CloseProtocol;
01907   EFI_OPEN_PROTOCOL_INFORMATION     OpenProtocolInformation;
01908 
01909   //
01910   // Library Services
01911   //
01912   EFI_PROTOCOLS_PER_HANDLE          ProtocolsPerHandle;
01913   EFI_LOCATE_HANDLE_BUFFER          LocateHandleBuffer;
01914   EFI_LOCATE_PROTOCOL               LocateProtocol;
01915   EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES    InstallMultipleProtocolInterfaces;
01916   EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES  UninstallMultipleProtocolInterfaces;
01917 
01918   //
01919   // 32-bit CRC Services
01920   //
01921   EFI_CALCULATE_CRC32               CalculateCrc32;
01922 
01923   //
01924   // Miscellaneous Services
01925   //
01926   EFI_COPY_MEM                      CopyMem;
01927   EFI_SET_MEM                       SetMem;
01928   EFI_CREATE_EVENT_EX               CreateEventEx;
01929 } EFI_BOOT_SERVICES;
01930 
01931 ///
01932 /// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the
01933 /// EFI System Table.
01934 ///
01935 typedef struct {
01936   ///
01937   /// The 128-bit GUID value that uniquely identifies the system configuration table.
01938   ///
01939   EFI_GUID                          VendorGuid;
01940   ///
01941   /// A pointer to the table associated with VendorGuid.
01942   ///
01943   VOID                              *VendorTable;
01944 } EFI_CONFIGURATION_TABLE;
01945 
01946 ///
01947 /// EFI System Table
01948 ///
01949 typedef struct {
01950   ///
01951   /// The table header for the EFI System Table.
01952   ///
01953   EFI_TABLE_HEADER                  Hdr;
01954   ///
01955   /// A pointer to a null terminated string that identifies the vendor
01956   /// that produces the system firmware for the platform.
01957   ///
01958   CHAR16                            *FirmwareVendor;
01959   ///
01960   /// A firmware vendor specific value that identifies the revision
01961   /// of the system firmware for the platform.
01962   ///
01963   UINT32                            FirmwareRevision;
01964   ///
01965   /// The handle for the active console input device. This handle must support
01966   /// EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.
01967   ///
01968   EFI_HANDLE                        ConsoleInHandle;
01969   ///
01970   /// A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is
01971   /// associated with ConsoleInHandle.
01972   ///
01973   EFI_SIMPLE_TEXT_INPUT_PROTOCOL    *ConIn;
01974   ///
01975   /// The handle for the active console output device.
01976   ///
01977   EFI_HANDLE                        ConsoleOutHandle;
01978   ///
01979   /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
01980   /// that is associated with ConsoleOutHandle.
01981   ///
01982   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *ConOut;
01983   ///
01984   /// The handle for the active standard error console device.
01985   /// This handle must support the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
01986   ///
01987   EFI_HANDLE                        StandardErrorHandle;
01988   ///
01989   /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
01990   /// that is associated with StandardErrorHandle.
01991   ///
01992   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *StdErr;
01993   ///
01994   /// A pointer to the EFI Runtime Services Table.
01995   ///
01996   EFI_RUNTIME_SERVICES              *RuntimeServices;
01997   ///
01998   /// A pointer to the EFI Boot Services Table.
01999   ///
02000   EFI_BOOT_SERVICES                 *BootServices;
02001   ///
02002   /// The number of system configuration tables in the buffer ConfigurationTable.
02003   ///
02004   UINTN                             NumberOfTableEntries;
02005   ///
02006   /// A pointer to the system configuration tables.
02007   /// The number of entries in the table is NumberOfTableEntries.
02008   ///
02009   EFI_CONFIGURATION_TABLE           *ConfigurationTable;
02010 } EFI_SYSTEM_TABLE;
02011 
02012 /**
02013   This is the declaration of an EFI image entry point. This entry point is
02014   the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
02015   both device drivers and bus drivers.
02016 
02017   @param[in]  ImageHandle       The firmware allocated handle for the UEFI image.
02018   @param[in]  SystemTable       A pointer to the EFI System Table.
02019 
02020   @retval EFI_SUCCESS           The operation completed successfully.
02021   @retval Others                An unexpected error occurred.
02022 **/
02023 typedef
02024 EFI_STATUS
02025 (EFIAPI *EFI_IMAGE_ENTRY_POINT)(
02026   IN  EFI_HANDLE                   ImageHandle,
02027   IN  EFI_SYSTEM_TABLE             *SystemTable
02028   );
02029 
02030 //
02031 // EFI Load Option. This data structure describes format of UEFI boot option variables.
02032 //
02033 // NOTE: EFI Load Option is a byte packed buffer of variable length fields.
02034 // The first two fields have fixed length. They are declared as members of the
02035 // EFI_LOAD_OPTION structure. All the other fields are variable length fields.
02036 // They are listed in the comment block below for reference purposes.
02037 //
02038 #pragma pack(1)
02039 typedef struct _EFI_LOAD_OPTION {
02040   ///
02041   /// The attributes for this load option entry. All unused bits must be zero
02042   /// and are reserved by the UEFI specification for future growth.
02043   ///
02044   UINT32                           Attributes;
02045   ///
02046   /// Length in bytes of the FilePathList. OptionalData starts at offset
02047   /// sizeof(UINT32) + sizeof(UINT16) + StrSize(Description) + FilePathListLength
02048   /// of the EFI_LOAD_OPTION descriptor.
02049   ///
02050   UINT16                           FilePathListLength;
02051   ///
02052   /// The user readable description for the load option.
02053   /// This field ends with a Null character.
02054   ///
02055   // CHAR16                        Description[];
02056   ///
02057   /// A packed array of UEFI device paths. The first element of the array is a
02058   /// device path that describes the device and location of the Image for this
02059   /// load option. The FilePathList[0] is specific to the device type. Other
02060   /// device paths may optionally exist in the FilePathList, but their usage is
02061   /// OSV specific. Each element in the array is variable length, and ends at
02062   /// the device path end structure. Because the size of Description is
02063   /// arbitrary, this data structure is not guaranteed to be aligned on a
02064   /// natural boundary. This data structure may have to be copied to an aligned
02065   /// natural boundary before it is used.
02066   ///
02067   // EFI_DEVICE_PATH_PROTOCOL      FilePathList[];
02068   ///
02069   /// The remaining bytes in the load option descriptor are a binary data buffer
02070   /// that is passed to the loaded image. If the field is zero bytes long, a
02071   /// NULL pointer is passed to the loaded image. The number of bytes in
02072   /// OptionalData can be computed by subtracting the starting offset of
02073   /// OptionalData from total size in bytes of the EFI_LOAD_OPTION.
02074   ///
02075   // UINT8                         OptionalData[];
02076 } EFI_LOAD_OPTION;
02077 #pragma pack()
02078 
02079 //
02080 // EFI Load Options Attributes
02081 //
02082 #define LOAD_OPTION_ACTIVE              0x00000001
02083 #define LOAD_OPTION_FORCE_RECONNECT     0x00000002
02084 #define LOAD_OPTION_HIDDEN              0x00000008
02085 #define LOAD_OPTION_CATEGORY            0x00001F00
02086 
02087 #define LOAD_OPTION_CATEGORY_BOOT       0x00000000
02088 #define LOAD_OPTION_CATEGORY_APP        0x00000100
02089 
02090 #define EFI_BOOT_OPTION_SUPPORT_KEY     0x00000001
02091 #define EFI_BOOT_OPTION_SUPPORT_APP     0x00000002
02092 #define EFI_BOOT_OPTION_SUPPORT_SYSPREP 0x00000010
02093 #define EFI_BOOT_OPTION_SUPPORT_COUNT   0x00000300
02094 
02095 ///
02096 /// EFI Boot Key Data
02097 ///
02098 typedef union {
02099   struct {
02100     ///
02101     /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
02102     ///
02103     UINT32  Revision        : 8;
02104     ///
02105     /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
02106     ///
02107     UINT32  ShiftPressed    : 1;
02108     ///
02109     /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
02110     ///
02111     UINT32  ControlPressed  : 1;
02112     ///
02113     /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
02114     ///
02115     UINT32  AltPressed      : 1;
02116     ///
02117     /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
02118     ///
02119     UINT32  LogoPressed     : 1;
02120     ///
02121     /// The Menu key must be pressed (1) or must not be pressed (0).
02122     ///
02123     UINT32  MenuPressed     : 1;
02124     ///
02125     /// The SysReq key must be pressed (1) or must not be pressed (0).
02126     ///
02127     UINT32  SysReqPressed    : 1;
02128     UINT32  Reserved        : 16;
02129     ///
02130     /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
02131     /// zero, then only the shift state is considered. If more than one, then the boot option will
02132     /// only be launched if all of the specified keys are pressed with the same shift state.
02133     ///
02134     UINT32  InputKeyCount   : 2;
02135   } Options;
02136   UINT32  PackedValue;
02137 } EFI_BOOT_KEY_DATA;
02138 
02139 ///
02140 /// EFI Key Option.
02141 ///
02142 #pragma pack(1)
02143 typedef struct {
02144   ///
02145   /// Specifies options about how the key will be processed.
02146   ///
02147   EFI_BOOT_KEY_DATA  KeyData;
02148   ///
02149   /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to
02150   /// which BootOption refers. If the CRC-32s do not match this value, then this key
02151   /// option is ignored.
02152   ///
02153   UINT32             BootOptionCrc;
02154   ///
02155   /// The Boot#### option which will be invoked if this key is pressed and the boot option
02156   /// is active (LOAD_OPTION_ACTIVE is set).
02157   ///
02158   UINT16             BootOption;
02159   ///
02160   /// The key codes to compare against those returned by the
02161   /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.
02162   /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.
02163   ///
02164   //EFI_INPUT_KEY      Keys[];
02165 } EFI_KEY_OPTION;
02166 #pragma pack()
02167 
02168 //
02169 // EFI File location to boot from on removable media devices
02170 //
02171 #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32    L"\\EFI\\BOOT\\BOOTIA32.EFI"
02172 #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64    L"\\EFI\\BOOT\\BOOTIA64.EFI"
02173 #define EFI_REMOVABLE_MEDIA_FILE_NAME_X64     L"\\EFI\\BOOT\\BOOTX64.EFI"
02174 #define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM     L"\\EFI\\BOOT\\BOOTARM.EFI"
02175 #define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI"
02176 
02177 #if   defined (MDE_CPU_IA32)
02178   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
02179 #elif defined (MDE_CPU_IPF)
02180   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_IA64
02181 #elif defined (MDE_CPU_X64)
02182   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_X64
02183 #elif defined (MDE_CPU_EBC)
02184 #elif defined (MDE_CPU_ARM)
02185   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
02186 #elif defined (MDE_CPU_AARCH64)
02187   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
02188 #else
02189   #error Unknown Processor Type
02190 #endif
02191 
02192 #include <ipxe/efi/Uefi/UefiPxe.h>
02193 #include <ipxe/efi/Uefi/UefiGpt.h>
02194 #include <ipxe/efi/Uefi/UefiInternalFormRepresentation.h>
02195 
02196 #endif