+/** @file\r
+ Include file that supportes UEFI.\r
+\r
+ This include file must only contain things defined in the UEFI 2.0 specification.\r
+ If a code construct is defined in the UEFI 2.0 specification it must be included\r
+ by this include file.\r
+\r
+ Copyright (c) 2006 - 2007, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ Module Name: UefiSpec.h\r
+\r
+**/\r
+\r
+#ifndef __UEFI_SPEC_H__\r
+#define __UEFI_SPEC_H__\r
+\r
+#include <Uefi/UefiMultiPhase.h>\r
+\r
+#include <Protocol/DevicePath.h>\r
+#include <Protocol/SimpleTextIn.h>\r
+#include <Protocol/SimpleTextOut.h>\r
+\r
+//\r
+// Networking Definitions\r
+//\r
+typedef struct {\r
+ UINT8 Addr[4];\r
+} EFI_IPv4_ADDRESS;\r
+\r
+typedef struct {\r
+ UINT8 Addr[16];\r
+} EFI_IPv6_ADDRESS;\r
+\r
+typedef struct {\r
+ UINT8 Addr[32];\r
+} EFI_MAC_ADDRESS;\r
+\r
+typedef union {\r
+ UINT32 Addr[4];\r
+ EFI_IPv4_ADDRESS v4;\r
+ EFI_IPv6_ADDRESS v6;\r
+} EFI_IP_ADDRESS;\r
+\r
+\r
+//\r
+// Enumeration of memory allocation.\r
+// \r
+typedef enum {\r
+ AllocateAnyPages,\r
+ AllocateMaxAddress,\r
+ AllocateAddress,\r
+ MaxAllocateType\r
+} EFI_ALLOCATE_TYPE;\r
+\r
+\r
+//\r
+// possible caching types for the memory range\r
+//\r
+#define EFI_MEMORY_UC 0x0000000000000001ULL\r
+#define EFI_MEMORY_WC 0x0000000000000002ULL\r
+#define EFI_MEMORY_WT 0x0000000000000004ULL\r
+#define EFI_MEMORY_WB 0x0000000000000008ULL\r
+#define EFI_MEMORY_UCE 0x0000000000000010ULL\r
+\r
+//\r
+// physical memory protection on range\r
+//\r
+#define EFI_MEMORY_WP 0x0000000000001000ULL\r
+#define EFI_MEMORY_RP 0x0000000000002000ULL\r
+#define EFI_MEMORY_XP 0x0000000000004000ULL\r
+\r
+//\r
+// range requires a runtime mapping\r
+//\r
+#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL\r
+\r
+#define EFI_MEMORY_DESCRIPTOR_VERSION 1\r
+typedef struct {\r
+ UINT32 Type;\r
+ EFI_PHYSICAL_ADDRESS PhysicalStart;\r
+ EFI_VIRTUAL_ADDRESS VirtualStart;\r
+ UINT64 NumberOfPages;\r
+ UINT64 Attribute;\r
+} EFI_MEMORY_DESCRIPTOR;\r
+\r
+//\r
+// Build macros to find next EFI_MEMORY_DESCRIPTOR.\r
+// \r
+#define NextMemoryDescriptor(_Ptr, _Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size)))\r
+#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size) NextMemoryDescriptor (_Ptr, _Size)\r
+\r
+//\r
+// Declare forward referenced data structures\r
+//\r
+typedef struct _EFI_SYSTEM_TABLE EFI_SYSTEM_TABLE;\r
+\r
+/**\r
+ Allocates memory pages from the system.\r
+\r
+ @param Type The type of allocation to perform.\r
+ @param MemoryType The type of memory to allocate.\r
+ @param Pages The number of contiguous 4 KB pages to allocate.\r
+ @param Memory Pointer to a physical address. On input, the way in which the address is\r
+ used depends on the value of Type.\r
+\r
+ @retval EFI_SUCCESS The requested pages were allocated.\r
+ @retval EFI_INVALID_PARAMETER 1) Type is not AllocateAnyPages or\r
+ AllocateMaxAddress or AllocateAddress.\r
+ 2) MemoryType is in the range\r
+ EfiMaxMemoryType..0x7FFFFFFF.\r
+ @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.\r
+ @retval EFI_NOT_FOUND The requested pages could not be found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ALLOCATE_PAGES) (\r
+ IN EFI_ALLOCATE_TYPE Type,\r
+ IN EFI_MEMORY_TYPE MemoryType,\r
+ IN UINTN Pages,\r
+ IN OUT EFI_PHYSICAL_ADDRESS *Memory\r
+ );\r
+\r
+/**\r
+ Frees memory pages.\r
+\r
+ @param Memory The base physical address of the pages to be freed.\r
+ @param Pages The number of contiguous 4 KB pages to free.\r
+\r
+ @retval EFI_SUCCESS The requested pages were freed.\r
+ @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.\r
+ @retval EFI_NOT_FOUND The requested memory pages were not allocated with\r
+ AllocatePages().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FREE_PAGES) (\r
+ IN EFI_PHYSICAL_ADDRESS Memory,\r
+ IN UINTN Pages\r
+ );\r
+\r
+/**\r
+ Returns the current memory map.\r
+\r
+ @param MemoryMapSize A pointer to the size, in bytes, of the MemoryMap buffer.\r
+ @param MemoryMap A pointer to the buffer in which firmware places the current memory\r
+ map.\r
+ @param MapKey A pointer to the location in which firmware returns the key for the\r
+ current memory map.\r
+ @param DescriptorSize A pointer to the location in which firmware returns the size, in bytes, of\r
+ an individual EFI_MEMORY_DESCRIPTOR.\r
+ @param DescriptorVersion A pointer to the location in which firmware returns the version number\r
+ associated with the EFI_MEMORY_DESCRIPTOR.\r
+\r
+ @retval EFI_SUCCESS The memory map was returned in the MemoryMap buffer.\r
+ @retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current buffer size\r
+ needed to hold the memory map is returned in MemoryMapSize.\r
+ @retval EFI_INVALID_PARAMETER 1) MemoryMapSize is NULL.\r
+ 2) The MemoryMap buffer is not too small and MemoryMap is\r
+ NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_MEMORY_MAP) (\r
+ IN OUT UINTN *MemoryMapSize,\r
+ IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,\r
+ OUT UINTN *MapKey,\r
+ OUT UINTN *DescriptorSize,\r
+ OUT UINT32 *DescriptorVersion\r
+ );\r
+\r
+/**\r
+ Allocates pool memory.\r
+\r
+ @param PoolType The type of pool to allocate.\r
+ @param Size The number of bytes to allocate from the pool.\r
+ @param Buffer A pointer to a pointer to the allocated buffer if the call succeeds;\r
+ undefined otherwise.\r
+\r
+ @retval EFI_SUCCESS The requested number of bytes was allocated.\r
+ @retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated.\r
+ @retval EFI_INVALID_PARAMETER PoolType was invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ALLOCATE_POOL) (\r
+ IN EFI_MEMORY_TYPE PoolType,\r
+ IN UINTN Size,\r
+ OUT VOID **Buffer\r
+ );\r
+\r
+/**\r
+ Returns pool memory to the system.\r
+\r
+ @param Buffer Pointer to the buffer to free.\r
+\r
+ @retval EFI_SUCCESS The memory was returned to the system.\r
+ @retval EFI_INVALID_PARAMETER Buffer was invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FREE_POOL) (\r
+ IN VOID *Buffer\r
+ );\r
+\r
+/**\r
+ Changes the runtime addressing mode of EFI firmware from physical to virtual.\r
+\r
+ @param MemoryMapSize The size in bytes of VirtualMap.\r
+ @param DescriptorSize The size in bytes of an entry in the VirtualMap.\r
+ @param DescriptorVersion The version of the structure entries in VirtualMap.\r
+ @param VirtualMap An array of memory descriptors which contain new virtual\r
+ address mapping information for all runtime ranges.\r
+\r
+ @retval EFI_SUCCESS The virtual address map has been applied.\r
+ @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in\r
+ virtual address mapped mode.\r
+ @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.\r
+ @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory\r
+ map that requires a mapping.\r
+ @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found\r
+ in the memory map.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) (\r
+ IN UINTN MemoryMapSize,\r
+ IN UINTN DescriptorSize,\r
+ IN UINT32 DescriptorVersion,\r
+ IN EFI_MEMORY_DESCRIPTOR *VirtualMap\r
+ );\r
+\r
+/**\r
+ Connects one or more drivers to a controller.\r
+\r
+ @param ControllerHandle The handle of the controller to which driver(s) are to be connected.\r
+ @param DriverImageHandle A pointer to an ordered list handles that support the\r
+ EFI_DRIVER_BINDING_PROTOCOL.\r
+ @param RemainingDevicePath A pointer to the device path that specifies a child of the\r
+ controller specified by ControllerHandle.\r
+ @param Recursive If TRUE, then ConnectController() is called recursively\r
+ until the entire tree of controllers below the controller specified\r
+ by ControllerHandle have been created. If FALSE, then\r
+ the tree of controllers is only expanded one level.\r
+\r
+ @retval EFI_SUCCESS 1) One or more drivers were connected to ControllerHandle.\r
+ 2) No drivers were connected to ControllerHandle, but\r
+ RemainingDevicePath is not NULL, and it is an End Device\r
+ Path Node.\r
+ @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+ @retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances\r
+ present in the system.\r
+ 2) No drivers were connected to ControllerHandle.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CONNECT_CONTROLLER) (\r
+ IN EFI_HANDLE ControllerHandle,\r
+ IN EFI_HANDLE *DriverImageHandle, OPTIONAL\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath, OPTIONAL\r
+ IN BOOLEAN Recursive\r
+ );\r
+\r
+/**\r
+ Disconnects one or more drivers from a controller.\r
+\r
+ @param ControllerHandle The handle of the controller from which driver(s) are to be disconnected.\r
+ @param DriverImageHandle The driver to disconnect from ControllerHandle.\r
+ @param ChildHandle The handle of the child to destroy.\r
+\r
+ @retval EFI_SUCCESS 1) One or more drivers were disconnected from the controller.\r
+ 2) On entry, no drivers are managing ControllerHandle.\r
+ 3) DriverImageHandle is not NULL, and on entry\r
+ DriverImageHandle is not managing ControllerHandle.\r
+\r
+ @retval EFI_INVALID_PARAMETER One ore more parameters are invalid.\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to disconnect any drivers from\r
+ ControllerHandle.\r
+ @retval EFI_DEVICE_ERROR The controller could not be disconnected because of a device error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DISCONNECT_CONTROLLER) (\r
+ IN EFI_HANDLE ControllerHandle,\r
+ IN EFI_HANDLE DriverImageHandle, OPTIONAL\r
+ IN EFI_HANDLE ChildHandle OPTIONAL\r
+ );\r
+\r
+\r
+\r
+//\r
+// ConvertPointer DebugDisposition type.\r
+//\r
+#define EFI_OPTIONAL_PTR 0x00000001\r
+#define EFI_OPTIONAL_POINTER EFI_OPTIONAL_PTR\r
+\r
+/**\r
+ Determines the new virtual address that is to be used on subsequent memory accesses.\r
+\r
+ @param DebugDisposition Supplies type information for the pointer being converted.\r
+ @param Address A pointer to a pointer that is to be fixed to be the value needed\r
+ for the new virtual address mappings being applied.\r
+\r
+ @retval EFI_SUCCESS The pointer pointed to by Address was modified.\r
+ @retval EFI_INVALID_PARAMETER 1) Address is NULL.\r
+ 2) *Address is NULL and DebugDisposition does\r
+ not have the EFI_OPTIONAL_PTR bit set.\r
+ @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part\r
+ of the current memory map. This is normally fatal.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CONVERT_POINTER) (\r
+ IN UINTN DebugDisposition,\r
+ IN OUT VOID **Address\r
+ );\r
+\r
+\r
+//\r
+// These types can be ¡°ORed¡± together as needed ¨C for example,\r
+// EVT_TIMER might be ¡°Ored¡± with EVT_NOTIFY_WAIT or\r
+// EVT_NOTIFY_SIGNAL.\r
+//\r
+#define EVT_TIMER 0x80000000\r
+#define EVT_RUNTIME 0x40000000\r
+\r
+#define EVT_NOTIFY_WAIT 0x00000100\r
+#define EVT_NOTIFY_SIGNAL 0x00000200\r
+#define EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201\r
+#define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202\r
+\r
+\r
+//\r
+// The event¡¯s NotifyContext pointer points to a runtime memory\r
+// address. \r
+// The event is deprecated in UEFI2.0 and later specifications.\r
+// \r
+#define EVT_RUNTIME_CONTEXT 0x20000000\r
+\r
+\r
+/**\r
+ Invoke a notification event\r
+\r
+ @param Event Event whose notification function is being invoked.\r
+ @param Context Pointer to the notification function's context,\r
+ which is implementation-dependent.\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_EVENT_NOTIFY) (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ );\r
+\r
+/**\r
+ Creates an event.\r
+\r
+ @param Type The type of event to create and its mode and attributes.\r
+ @param NotifyTpl Pointer to the notification function's context.\r
+ @param NotifyFunction Pointer to the event's notification function, if any.\r
+ @param NotifyContext Pointer to the notification function's context; corresponds to parameter\r
+ Context in the notification function.\r
+ @param Event Pointer to the newly created event if the call succeeds; undefined\r
+ otherwise.\r
+\r
+ @retval EFI_SUCCESS The event structure was created.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+ @retval EFI_OUT_OF_RESOURCES The event could not be allocated.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CREATE_EVENT) (\r
+ IN UINT32 Type,\r
+ IN EFI_TPL NotifyTpl,\r
+ IN EFI_EVENT_NOTIFY NotifyFunction,\r
+ IN VOID *NotifyContext,\r
+ OUT EFI_EVENT *Event\r
+ );\r
+\r
+/**\r
+ Creates an event in a group.\r
+\r
+ @param Type The type of event to create and its mode and attributes.\r
+ @param NotifyTpl Pointer to the notification function's context.\r
+ @param NotifyFunction Pointer to the event's notification function, if any.\r
+ @param NotifyContext Pointer to the notification function's context; corresponds to parameter\r
+ Context in the notification function.\r
+ @param EventGroup Pointer to the unique identifier of the group to which this event belongs.\r
+ @param Event Pointer to the newly created event if the call succeeds; undefined\r
+ otherwise.\r
+\r
+ @retval EFI_SUCCESS The event structure was created.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+ @retval EFI_OUT_OF_RESOURCES The event could not be allocated.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CREATE_EVENT_EX) (\r
+ IN UINT32 Type,\r
+ IN EFI_TPL NotifyTpl OPTIONAL,\r
+ IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,\r
+ IN CONST VOID *NotifyContext OPTIONAL,\r
+ IN CONST EFI_GUID *EventGroup OPTIONAL,\r
+ OUT EFI_EVENT *Event\r
+ );\r
+\r
+typedef enum {\r
+ TimerCancel,\r
+ TimerPeriodic,\r
+ TimerRelative\r
+} EFI_TIMER_DELAY;\r
+\r
+/**\r
+ Sets the type of timer and the trigger time for a timer event.\r
+\r
+ @param Event The timer event that is to be signaled at the specified time.\r
+ @param Type The type of time that is specified in TriggerTime.\r
+ @param TriggerTime The number of 100ns units until the timer expires.\r
+\r
+ @retval EFI_SUCCESS The event has been set to be signaled at the requested time.\r
+ @retval EFI_INVALID_PARAMETER Event or Type is not valid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_TIMER) (\r
+ IN EFI_EVENT Event,\r
+ IN EFI_TIMER_DELAY Type,\r
+ IN UINT64 TriggerTime\r
+ );\r
+\r
+/**\r
+ Signals an event.\r
+\r
+ @param Event The event to signal.\r
+\r
+ @retval EFI_SUCCESS The event has been signaled.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIGNAL_EVENT) (\r
+ IN EFI_EVENT Event\r
+ );\r
+\r
+/**\r
+ Stops execution until an event is signaled.\r
+\r
+ @param NumberOfEvents The number of events in the Event array.\r
+ @param Event An array of EFI_EVENT.\r
+ @param Index Pointer to the index of the event which satisfied the wait condition.\r
+\r
+ @retval EFI_SUCCESS The event indicated by Index was signaled.\r
+ @retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0.\r
+ 2) The event indicated by Index is of type\r
+ EVT_NOTIFY_SIGNAL.\r
+ @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_WAIT_FOR_EVENT) (\r
+ IN UINTN NumberOfEvents,\r
+ IN EFI_EVENT *Event,\r
+ OUT UINTN *Index\r
+ );\r
+\r
+/**\r
+ Closes an event.\r
+\r
+ @param Event The event to close.\r
+\r
+ @retval EFI_SUCCESS The event has been closed.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CLOSE_EVENT) (\r
+ IN EFI_EVENT Event\r
+ );\r
+\r
+/**\r
+ Checks whether an event is in the signaled state.\r
+\r
+ @param Event The event to check.\r
+\r
+ @retval EFI_SUCCESS The event is in the signaled state.\r
+ @retval EFI_NOT_READY The event is not in the signaled state.\r
+ @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CHECK_EVENT) (\r
+ IN EFI_EVENT Event\r
+ );\r
+\r
+\r
+//\r
+// Task priority level (name defined in spec).\r
+//\r
+#define TPL_APPLICATION 4\r
+#define TPL_CALLBACK 8\r
+#define TPL_NOTIFY 16\r
+#define TPL_HIGH_LEVEL 31\r
+\r
+\r
+/**\r
+ Raises a task's priority level and returns its previous level.\r
+\r
+ @param NewTpl The new task priority level.\r
+\r
+ @retval Previous task priority level\r
+\r
+**/\r
+typedef\r
+EFI_TPL\r
+(EFIAPI *EFI_RAISE_TPL) (\r
+ IN EFI_TPL NewTpl\r
+ );\r
+\r
+/**\r
+ Restores a task's priority level to its previous value.\r
+\r
+ @param OldTpl The previous task priority level to restore\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_RESTORE_TPL) (\r
+ IN EFI_TPL OldTpl\r
+ );\r
+\r
+/**\r
+ Returns the value of a variable.\r
+\r
+ @param VariableName A Null-terminated Unicode string that is the name of the\r
+ vendor's variable.\r
+ @param VendorGuid A unique identifier for the vendor.\r
+ @param Attributes If not NULL, a pointer to the memory location to return the\r
+ attributes bitmask for the variable.\r
+ @param DataSize On input, the size in bytes of the return Data buffer.\r
+ On output the size of data returned in Data.\r
+ @param Data The buffer to return the contents of the variable.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+ @retval EFI_NOT_FOUND The variable was not found.\r
+ @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+ @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_VARIABLE) (\r
+ IN CHAR16 *VariableName,\r
+ IN EFI_GUID *VendorGuid,\r
+ OUT UINT32 *Attributes, OPTIONAL\r
+ IN OUT UINTN *DataSize,\r
+ OUT VOID *Data\r
+ );\r
+\r
+/**\r
+ Enumerates the current variable names.\r
+\r
+ @param VariableNameSize The size of the VariableName buffer.\r
+ @param VariableName On input, supplies the last VariableName that was returned\r
+ by GetNextVariableName(). On output, returns the Nullterminated\r
+ Unicode string of the current variable.\r
+ @param VendorGuid On input, supplies the last VendorGuid that was returned by\r
+ GetNextVariableName(). On output, returns the\r
+ VendorGuid of the current variable.\r
+\r
+ @retval EFI_SUCCESS The function completed successfully.\r
+ @retval EFI_NOT_FOUND The next variable was not found.\r
+ @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+ @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_NEXT_VARIABLE_NAME) (\r
+ IN OUT UINTN *VariableNameSize,\r
+ IN OUT CHAR16 *VariableName,\r
+ IN OUT EFI_GUID *VendorGuid\r
+ );\r
+\r
+/**\r
+ Sets the value of a variable.\r
+\r
+ @param VariableName A Null-terminated Unicode string that is the name of the\r
+ vendor's variable.\r
+ @param VendorGuid A unique identifier for the vendor.\r
+ @param Attributes Attributes bitmask to set for the variable.\r
+ @param DataSize The size in bytes of the Data buffer.\r
+ @param Data The contents for the variable.\r
+\r
+ @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as\r
+ defined by the Attributes.\r
+ @retval EFI_WRITE_PROTECTED The variable in question is read-only.\r
+ @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+ @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_VARIABLE) (\r
+ IN CHAR16 *VariableName,\r
+ IN EFI_GUID *VendorGuid,\r
+ IN UINT32 Attributes,\r
+ IN UINTN DataSize,\r
+ IN VOID *Data\r
+ );\r
+\r
+\r
+// \r
+// This provides the capabilities of the\r
+// real time clock device as exposed through the EFI interfaces.\r
+// \r
+typedef struct {\r
+ UINT32 Resolution;\r
+ UINT32 Accuracy;\r
+ BOOLEAN SetsToZero;\r
+} EFI_TIME_CAPABILITIES;\r
+\r
+/**\r
+ Returns the current time and date information, and the time-keeping capabilities\r
+ of the hardware platform.\r
+\r
+ @param Time A pointer to storage to receive a snapshot of the current time.\r
+ @param Capabilities An optional pointer to a buffer to receive the real time clock\r
+ device's capabilities.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_INVALID_PARAMETER Time is NULL.\r
+ @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_TIME) (\r
+ OUT EFI_TIME *Time,\r
+ OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL\r
+ );\r
+\r
+/**\r
+ Sets the current local time and date information.\r
+\r
+ @param Time A pointer to the current time.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_INVALID_PARAMETER A time field is out of range.\r
+ @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_TIME) (\r
+ IN EFI_TIME *Time\r
+ );\r
+\r
+/**\r
+ Returns the current wakeup alarm clock setting.\r
+\r
+ @param Enabled Indicates if the alarm is currently enabled or disabled.\r
+ @param Pending Indicates if the alarm signal is pending and requires acknowledgement.\r
+ @param Time The current alarm setting.\r
+\r
+ @retval EFI_SUCCESS The alarm settings were returned.\r
+ @retval EFI_INVALID_PARAMETER Any parameter is NULL.\r
+ @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_WAKEUP_TIME) (\r
+ OUT BOOLEAN *Enabled,\r
+ OUT BOOLEAN *Pending,\r
+ OUT EFI_TIME *Time\r
+ );\r
+\r
+/**\r
+ Sets the system wakeup alarm clock time.\r
+\r
+ @param Enabled Enable or disable the wakeup alarm.\r
+ @param Time If Enable is TRUE, the time to set the wakeup alarm for.\r
+\r
+ @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If\r
+ Enable is FALSE, then the wakeup alarm was disabled.\r
+ @retval EFI_INVALID_PARAMETER A time field is out of range.\r
+ @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.\r
+ @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_WAKEUP_TIME) (\r
+ IN BOOLEAN Enable,\r
+ IN EFI_TIME *Time OPTIONAL\r
+ );\r
+\r
+/**\r
+ This is the declaration of an EFI image entry point. This can be the entry point to an application\r
+ written to this specification, an EFI boot service driver, or an EFI runtime driver.\r
+\r
+ @param ImageHandle Handle that identifies the loaded image.\r
+ @param SystemTable System Table for this image.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IMAGE_ENTRY_POINT) (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ );\r
+\r
+/**\r
+ Loads an EFI image into memory.\r
+\r
+ @param BootPolicy If TRUE, indicates that the request originates from the boot\r
+ manager, and that the boot manager is attempting to load\r
+ FilePath as a boot selection. Ignored if SourceBuffer is\r
+ not NULL.\r
+ @param ParentImageHandle The caller's image handle.\r
+ @param FilePath The DeviceHandle specific file path from which the image is\r
+ loaded.\r
+ @param SourceBuffer If not NULL, a pointer to the memory location containing a copy\r
+ of the image to be loaded.\r
+ @param SourceSize The size in bytes of SourceBuffer.\r
+ @param ImageHandle Pointer to the returned image handle that is created when the\r
+ image is successfully loaded.\r
+\r
+ @retval EFI_SUCCESS Image was loaded into memory correctly.\r
+ @retval EFI_NOT_FOUND Both SourceBuffer and FilePath are NULL.\r
+ @retval EFI_INVALID_PARAMETER One or more parametes are invalid.\r
+ @retval EFI_UNSUPPORTED The image type is not supported.\r
+ @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient resources.\r
+ @retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not\r
+ understood.\r
+ @retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IMAGE_LOAD) (\r
+ IN BOOLEAN BootPolicy,\r
+ IN EFI_HANDLE ParentImageHandle,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
+ IN VOID *SourceBuffer OPTIONAL,\r
+ IN UINTN SourceSize,\r
+ OUT EFI_HANDLE *ImageHandle\r
+ );\r
+\r
+/**\r
+ Transfers control to a loaded image's entry point.\r
+\r
+ @param ImageHandle Handle of image to be started.\r
+ @param ExitDataSize Pointer to the size, in bytes, of ExitData.\r
+ @param ExitData Pointer to a pointer to a data buffer that includes a Null-terminated\r
+ Unicode string, optionally followed by additional binary data.\r
+\r
+ @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image\r
+ has already been initialized with StartImage\r
+ @retval Exit code from image Exit code from image\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IMAGE_START) (\r
+ IN EFI_HANDLE ImageHandle,\r
+ OUT UINTN *ExitDataSize,\r
+ OUT CHAR16 **ExitData OPTIONAL\r
+ );\r
+\r
+/**\r
+ Terminates a loaded EFI image and returns control to boot services.\r
+\r
+ @param ImageHandle Handle that identifies the image.\r
+ @param ExitStatus The image's exit code.\r
+ @param ExitDataSize The size, in bytes, of ExitData.\r
+ @param ExitData Pointer to a data buffer that includes a Null-terminated Unicode string,\r
+ optionally followed by additional binary data.\r
+\r
+ @retval EFI_SUCCESS The image specified by ImageHandle was unloaded.\r
+ @retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and\r
+ started with LoadImage() and StartImage(), but the\r
+ image is not the currently executing image.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXIT) (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_STATUS ExitStatus,\r
+ IN UINTN ExitDataSize,\r
+ IN CHAR16 *ExitData OPTIONAL\r
+ );\r
+\r
+/**\r
+ Unloads an image.\r
+\r
+ @param ImageHandle Handle that identifies the image to be unloaded.\r
+\r
+ @retval EFI_SUCCESS The image has been unloaded.\r
+ @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.\r
+ @retval EFI_UNSUPPORTED The image has been started, and does not support unload.\r
+ @retval Exit code from the image's unload handler\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IMAGE_UNLOAD) (\r
+ IN EFI_HANDLE ImageHandle\r
+ );\r
+\r
+/**\r
+ Terminates all boot services.\r
+\r
+ @param ImageHandle Handle that identifies the exiting image.\r
+ @param MapKey Key to the latest memory map.\r
+\r
+ @retval EFI_SUCCESS Boot services have been terminated.\r
+ @retval EFI_INVALID_PARAMETER MapKey is incorrect.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXIT_BOOT_SERVICES) (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN UINTN MapKey\r
+ );\r
+\r
+/**\r
+ Induces a fine-grained stall.\r
+\r
+ @param Microseconds The number of microseconds to stall execution.\r
+\r
+ @retval EFI_SUCCESS Execution was stalled at least the requested number of\r
+ Microseconds.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_STALL) (\r
+ IN UINTN Microseconds\r
+ );\r
+\r
+/**\r
+ Sets the system's watchdog timer.\r
+\r
+ @param Timeout The number of seconds to set the watchdog timer to.\r
+ @param WatchdogCode The numeric code to log on a watchdog timer timeout event.\r
+ @param DataSize The size, in bytes, of WatchdogData.\r
+ @param WatchdogData A data buffer that includes a Null-terminated Unicode string, optionally\r
+ followed by additional binary data.\r
+\r
+ @retval EFI_SUCCESS The timeout has been set.\r
+ @retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid.\r
+ @retval EFI_UNSUPPORTED The system does not have a watchdog timer.\r
+ @retval EFI_DEVICE_ERROR The watch dog timer could not be programmed due to a hardware\r
+ error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_WATCHDOG_TIMER) (\r
+ IN UINTN Timeout,\r
+ IN UINT64 WatchdogCode,\r
+ IN UINTN DataSize,\r
+ IN CHAR16 *WatchdogData OPTIONAL\r
+ );\r
+\r
+//\r
+// Enumeration of reset types.\r
+// \r
+typedef enum {\r
+ EfiResetCold,\r
+ EfiResetWarm,\r
+ EfiResetShutdown,\r
+} EFI_RESET_TYPE;\r
+\r
+/**\r
+ Resets the entire platform.\r
+\r
+ @param ResetType The type of reset to perform.\r
+ @param ResetStatus The status code for the reset.\r
+ @param DataSize The size, in bytes, of WatchdogData.\r
+ @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or\r
+ EfiResetShutdown the data buffer starts with a Null-terminated\r
+ Unicode string, optionally followed by additional binary data.\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_RESET_SYSTEM) (\r
+ IN EFI_RESET_TYPE ResetType,\r
+ IN EFI_STATUS ResetStatus,\r
+ IN UINTN DataSize,\r
+ IN CHAR16 *ResetData OPTIONAL\r
+ );\r
+\r
+/**\r
+ Returns a monotonically increasing count for the platform.\r
+\r
+ @param Count Pointer to returned value.\r
+\r
+ @retval EFI_SUCCESS The next monotonic count was returned.\r
+ @retval EFI_INVALID_PARAMETER Count is NULL.\r
+ @retval EFI_DEVICE_ERROR The device is not functioning properly.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT) (\r
+ OUT UINT64 *Count\r
+ );\r
+\r
+/**\r
+ Returns the next high 32 bits of the platform's monotonic counter.\r
+\r
+ @param HighCount Pointer to returned value.\r
+\r
+ @retval EFI_SUCCESS The next high monotonic count was returned.\r
+ @retval EFI_INVALID_PARAMETER HighCount is NULL.\r
+ @retval EFI_DEVICE_ERROR The device is not functioning properly.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) (\r
+ OUT UINT32 *HighCount\r
+ );\r
+\r
+/**\r
+ Computes and returns a 32-bit CRC for a data buffer.\r
+\r
+ @param Data A pointer to the buffer on which the 32-bit CRC is to be computed.\r
+ @param DataSize The number of bytes in the buffer Data.\r
+ @param Crc32 The 32-bit CRC that was computed for the data buffer specified by Data\r
+ and DataSize.\r
+\r
+ @retval EFI_SUCCESS The 32-bit CRC was computed for the data buffer and returned in\r
+ Crc32.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CALCULATE_CRC32) (\r
+ IN VOID *Data,\r
+ IN UINTN DataSize,\r
+ OUT UINT32 *Crc32\r
+ );\r
+\r
+/**\r
+ Copies the contents of one buffer to another buffer.\r
+\r
+ @param Destination Pointer to the destination buffer of the memory copy.\r
+ @param Source Pointer to the source buffer of the memory copy.\r
+ @param Length Number of bytes to copy from Source to Destination.\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_COPY_MEM) (\r
+ IN VOID *Destination,\r
+ IN VOID *Source,\r
+ IN UINTN Length\r
+ );\r
+\r
+/**\r
+ The SetMem() function fills a buffer with a specified value.\r
+\r
+ @param Buffer Pointer to the buffer to fill.\r
+ @param Size Number of bytes in Buffer to fill.\r
+ @param Value Value to fill Buffer with.\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SET_MEM) (\r
+ IN VOID *Buffer,\r
+ IN UINTN Size,\r
+ IN UINT8 Value\r
+ );\r
+\r
+\r
+//\r
+// Protocol handler functions\r
+//\r
+typedef enum {\r
+ EFI_NATIVE_INTERFACE\r
+} EFI_INTERFACE_TYPE;\r
+\r
+/**\r
+ Installs a protocol interface on a device handle. If the handle does not exist, it is created and added\r
+ to the list of handles in the system. InstallMultipleProtocolInterfaces() performs\r
+ more error checking than InstallProtocolInterface(), so it is recommended that\r
+ InstallMultipleProtocolInterfaces() be used in place of\r
+ InstallProtocolInterface()\r
+\r
+ @param Handle A pointer to the EFI_HANDLE on which the interface is to be installed.\r
+ @param Protocol The numeric ID of the protocol interface.\r
+ @param InterfaceType Indicates whether Interface is supplied in native form.\r
+ @param Interface A pointer to the protocol interface.\r
+\r
+ @retval EFI_SUCCESS The protocol interface was installed.\r
+ @retval EFI_OUT_OF_RESOURCES Space for a new handle could not be allocated.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) (\r
+ IN OUT EFI_HANDLE *Handle,\r
+ IN EFI_GUID *Protocol,\r
+ IN EFI_INTERFACE_TYPE InterfaceType,\r
+ IN VOID *Interface\r
+ );\r
+\r
+/**\r
+ Installs one or more protocol interfaces into the boot services environment.\r
+\r
+ @param Handle The handle to install the new protocol interfaces on, or NULL if a new\r
+ handle is to be allocated.\r
+ @param ... A variable argument list containing pairs of protocol GUIDs and protocol\r
+ interfaces.\r
+\r
+ @retval EFI_SUCCESS All the protocol interface was installed.\r
+ @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.\r
+ @retval EFI_ALREADY_STARTED A Device Path Protocol instance was passed in that is already present in\r
+ the handle database.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (\r
+ IN OUT EFI_HANDLE *Handle,\r
+ ...\r
+ );\r
+\r
+/**\r
+ Reinstalls a protocol interface on a device handle.\r
+\r
+ @param Handle Handle on which the interface is to be reinstalled.\r
+ @param Protocol The numeric ID of the interface.\r
+ @param OldInterface A pointer to the old interface. NULL can be used if a structure is not\r
+ associated with Protocol.\r
+ @param NewInterface A pointer to the new interface.\r
+\r
+ @retval EFI_SUCCESS The protocol interface was reinstalled.\r
+ @retval EFI_NOT_FOUND The OldInterface on the handle was not found.\r
+ @retval EFI_ACCESS_DENIED The protocol interface could not be reinstalled,\r
+ because OldInterface is still being used by a\r
+ driver that will not release it.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE) (\r
+ IN EFI_HANDLE Handle,\r
+ IN EFI_GUID *Protocol,\r
+ IN VOID *OldInterface,\r
+ IN VOID *NewInterface\r
+ );\r
+\r
+/**\r
+ Removes a protocol interface from a device handle. It is recommended that\r
+ UninstallMultipleProtocolInterfaces() be used in place of\r
+ UninstallProtocolInterface().\r
+\r
+ @param Handle The handle on which the interface was installed.\r
+ @param Protocol The numeric ID of the interface.\r
+ @param Interface A pointer to the interface.\r
+\r
+ @retval EFI_SUCCESS The interface was removed.\r
+ @retval EFI_NOT_FOUND The interface was not found.\r
+ @retval EFI_ACCESS_DENIED The interface was not removed because the interface\r
+ is still being used by a driver.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE) (\r
+ IN EFI_HANDLE Handle,\r
+ IN EFI_GUID *Protocol,\r
+ IN VOID *Interface\r
+ );\r
+\r
+/**\r
+ Removes one or more protocol interfaces into the boot services environment.\r
+\r
+ @param Handle The handle to remove the protocol interfaces from.\r
+ @param ... A variable argument list containing pairs of protocol GUIDs and\r
+ protocol interfaces.\r
+\r
+ @retval EFI_SUCCESS All the protocol interfaces were removed.\r
+ @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (\r
+ IN EFI_HANDLE Handle,\r
+ ...\r
+ );\r
+\r
+/**\r
+ Queries a handle to determine if it supports a specified protocol.\r
+\r
+ @param Handle The handle being queried.\r
+ @param Protocol The published unique identifier of the protocol.\r
+ @param Interface Supplies the address where a pointer to the corresponding Protocol\r
+ Interface is returned.\r
+ @retval EFI_SUCCESS The interface information for the specified protocol was returned.\r
+ @retval EFI_UNSUPPORTED The device does not support the specified protocol.\r
+ @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HANDLE_PROTOCOL) (\r
+ IN EFI_HANDLE Handle,\r
+ IN EFI_GUID *Protocol,\r
+ OUT VOID **Interface\r
+ );\r
+\r
+#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001\r
+#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002\r
+#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004\r
+#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008\r
+#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010\r
+#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020\r
+\r
+/**\r
+ Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the\r
+ handle, it opens the protocol on behalf of the calling agent.\r
+\r
+ @param Handle The handle for the protocol interface that is being opened.\r
+ @param Protocol The published unique identifier of the protocol.\r
+ @param Interface Supplies the address where a pointer to the corresponding Protocol\r
+ Interface is returned.\r
+ @param AgentHandle The handle of the agent that is opening the protocol interface\r
+ specified by Protocol and Interface.\r
+ @param ControllerHandle If the agent that is opening a protocol is a driver that follows the\r
+ UEFI Driver Model, then this parameter is the controller handle\r
+ that requires the protocol interface. If the agent does not follow\r
+ the UEFI Driver Model, then this parameter is optional and may\r
+ be NULL.\r
+ @param Attributes The open mode of the protocol interface specified by Handle\r
+ and Protocol.\r
+\r
+ @retval EFI_SUCCESS An item was added to the open list for the protocol interface, and the\r
+ protocol interface was returned in Interface.\r
+ @retval EFI_UNSUPPORTED Handle does not support Protocol.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+ @retval EFI_ACCESS_DENIED Required attributes can't be supported in current environment.\r
+ @retval EFI_ALREADY_STARTED Item on the open list already has requierd attributes whose agent\r
+ handle is the same as AgentHandle.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_OPEN_PROTOCOL) (\r
+ IN EFI_HANDLE Handle,\r
+ IN EFI_GUID *Protocol,\r
+ OUT VOID **Interface,\r
+ IN EFI_HANDLE AgentHandle,\r
+ IN EFI_HANDLE ControllerHandle, OPTIONAL\r
+ IN UINT32 Attributes\r
+ );\r
+\r
+\r
+/**\r
+ Closes a protocol on a handle that was opened using OpenProtocol().\r
+\r
+ @param Handle The handle for the protocol interface that was previously opened\r
+ with OpenProtocol(), and is now being closed.\r
+ @param Protocol The published unique identifier of the protocol.\r
+ @param Interface Supplies the address where a pointer to the corresponding Protocol\r
+ Interface is returned.\r
+ @param AgentHandle The handle of the agent that is closing the protocol interface.\r
+ @param ControllerHandle If the agent that opened a protocol is a driver that follows the\r
+ UEFI Driver Model, then this parameter is the controller handle\r
+ that required the protocol interface.\r
+\r
+ @retval EFI_SUCCESS The protocol instance was closed.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+ @retval EFI_NOT_FOUND 1) Handle does not support the protocol specified by Protocol.\r
+ 2) The protocol interface specified by Handle and Protocol is not\r
+ currently open by AgentHandle and ControllerHandle.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CLOSE_PROTOCOL) (\r
+ IN EFI_HANDLE Handle,\r
+ IN EFI_GUID *Protocol,\r
+ IN EFI_HANDLE AgentHandle,\r
+ IN EFI_HANDLE ControllerHandle\r
+ );\r
+\r
+\r
+typedef struct {\r
+ EFI_HANDLE AgentHandle;\r
+ EFI_HANDLE ControllerHandle;\r
+ UINT32 Attributes;\r
+ UINT32 OpenCount;\r
+} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;\r
+\r
+/**\r
+ Retrieves the list of agents that currently have a protocol interface opened.\r
+\r
+ @param Handle The handle for the protocol interface that is being queried.\r
+ @param Protocol The published unique identifier of the protocol.\r
+ @param EntryBuffer A pointer to a buffer of open protocol information in the form of\r
+ EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.\r
+ @param EntryCount A pointer to the number of entries in EntryBuffer.\r
+\r
+ @retval EFI_SUCCESS The open protocol information was returned in EntryBuffer, and the\r
+ number of entries was returned EntryCount.\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate EntryBuffer.\r
+ @retval EFI_NOT_FOUND Handle does not support the protocol specified by Protocol.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (\r
+ IN EFI_HANDLE Handle,\r
+ IN EFI_GUID *Protocol,\r
+ IN EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,\r
+ OUT UINTN *EntryCount\r
+ );\r
+\r
+/**\r
+ Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r
+ from pool.\r
+\r
+ @param Handle The handle from which to retrieve the list of protocol interface\r
+ GUIDs.\r
+ @param ProtocolBuffer A pointer to the list of protocol interface GUID pointers that are\r
+ installed on Handle.\r
+ @param ProtocolBufferCount A pointer to the number of GUID pointers present in\r
+ ProtocolBuffer.\r
+\r
+ @retval EFI_SUCCESS The list of protocol interface GUIDs installed on Handle was returned in\r
+ ProtocolBuffer. The number of protocol interface GUIDs was\r
+ returned in ProtocolBufferCount.\r
+ @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (\r
+ IN EFI_HANDLE Handle,\r
+ OUT EFI_GUID ***ProtocolBuffer,\r
+ OUT UINTN *ProtocolBufferCount\r
+ );\r
+\r
+/**\r
+ Creates an event that is to be signaled whenever an interface is installed for a specified protocol.\r
+\r
+ @param Protocol The numeric ID of the protocol for which the event is to be registered.\r
+ @param Event Event that is to be signaled whenever a protocol interface is registered\r
+ for Protocol.\r
+ @param Registration A pointer to a memory location to receive the registration value.\r
+\r
+ @retval EFI_SUCCESS The notification event has been registered.\r
+ @retval EFI_OUT_OF_RESOURCES Space for the notification event could not be allocated.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) (\r
+ IN EFI_GUID *Protocol,\r
+ IN EFI_EVENT Event,\r
+ OUT VOID **Registration\r
+ );\r
+\r
+\r
+typedef enum {\r
+ AllHandles,\r
+ ByRegisterNotify,\r
+ ByProtocol\r
+} EFI_LOCATE_SEARCH_TYPE;\r
+\r
+/**\r
+ Returns an array of handles that support a specified protocol.\r
+\r
+ @param SearchType Specifies which handle(s) are to be returned.\r
+ @param Protocol Specifies the protocol to search by.\r
+ @param SearchKey Specifies the search key.\r
+ @param BufferSize On input, the size in bytes of Buffer. On output, the size in bytes of\r
+ the array returned in Buffer (if the buffer was large enough) or the\r
+ size, in bytes, of the buffer needed to obtain the array (if the buffer was\r
+ not large enough).\r
+ @param Buffer The buffer in which the array is returned.\r
+\r
+ @retval EFI_SUCCESS The array of handles was returned.\r
+ @retval EFI_NOT_FOUND No handles match the search.\r
+ @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LOCATE_HANDLE) (\r
+ IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
+ IN EFI_GUID *Protocol, OPTIONAL\r
+ IN VOID *SearchKey, OPTIONAL\r
+ IN OUT UINTN *BufferSize,\r
+ OUT EFI_HANDLE *Buffer\r
+ );\r
+\r
+/**\r
+ Locates the handle to a device on the device path that supports the specified protocol.\r
+\r
+ @param Protocol Specifies the protocol to search for.\r
+ @param DevicePath On input, a pointer to a pointer to the device path. On output, the device\r
+ path pointer is modified to point to the remaining part of the device\r
+ path.\r
+ @param Device A pointer to the returned device handle.\r
+\r
+ @retval EFI_SUCCESS The resulting handle was returned.\r
+ @retval EFI_NOT_FOUND No handles match the search.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LOCATE_DEVICE_PATH) (\r
+ IN EFI_GUID *Protocol,\r
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,\r
+ OUT EFI_HANDLE *Device\r
+ );\r
+\r
+/**\r
+ Adds, updates, or removes a configuration table entry from the EFI System Table.\r
+\r
+ @param Guid A pointer to the GUID for the entry to add, update, or remove.\r
+ @param Table A pointer to the configuration table for the entry to add, update, or\r
+ remove. May be NULL.\r
+\r
+ @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.\r
+ @retval EFI_NOT_FOUND An attempt was made to delete a nonexistent entry.\r
+ @retval EFI_INVALID_PARAMETER Guid is not valid.\r
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) (\r
+ IN EFI_GUID *Guid,\r
+ IN VOID *Table\r
+ );\r
+\r
+\r
+/**\r
+ Returns an array of handles that support the requested protocol in a buffer allocated from pool.\r
+\r
+ @param SearchType Specifies which handle(s) are to be returned.\r
+ @param Protocol Specifies the protocol to search by.\r
+ @param SearchKey Supplies the search key depending on the SearchType.\r
+ @param NoHandles The number of handles returned in Buffer.\r
+ @param Buffer A pointer to the buffer to return the requested array of handles that\r
+ support Protocol.\r
+\r
+ @retval EFI_SUCCESS The array of handles was returned in Buffer, and the number of\r
+ handles in Buffer was returned in NoHandles.\r
+ @retval EFI_NOT_FOUND No handles match the search.\r
+ @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the matching results.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (\r
+ IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
+ IN EFI_GUID *Protocol, OPTIONAL\r
+ IN VOID *SearchKey, OPTIONAL\r
+ IN OUT UINTN *NoHandles,\r
+ OUT EFI_HANDLE **Buffer\r
+ );\r
+\r
+/**\r
+ Returns the first protocol instance that matches the given protocol.\r
+\r
+ @param Protocol Provides the protocol to search for.\r
+ @param Registration Optional registration key returned from\r
+ RegisterProtocolNotify().\r
+ @param Interface On return, a pointer to the first interface that matches Protocol and\r
+ Registration.\r
+\r
+ @retval EFI_SUCCESS A protocol instance matching Protocol was found and returned in\r
+ Interface.\r
+ @retval EFI_NOT_FOUND No protocol instances were found that match Protocol and\r
+ Registration.\r
+ @retval EFI_INVALID_PARAMETER Interface is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LOCATE_PROTOCOL) (\r
+ IN EFI_GUID *Protocol,\r
+ IN VOID *Registration, OPTIONAL\r
+ OUT VOID **Interface\r
+ );\r
+\r
+typedef struct {\r
+ UINT64 Length;\r
+ union {\r
+ EFI_PHYSICAL_ADDRESS DataBlock;\r
+ EFI_PHYSICAL_ADDRESS ContinuationPointer;\r
+ } Union;\r
+} UEFI_CAPSULE_BLOCK_DESCRIPTOR;\r
+\r
+typedef struct {\r
+ EFI_GUID CapsuleGuid;\r
+ UINT32 HeaderSize;\r
+ UINT32 Flags;\r
+ UINT32 CapsuleImageSize;\r
+} UEFI_CAPSULE_HEADER;\r
+\r
+#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000\r
+#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000\r
+\r
+/**\r
+ Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended\r
+ consumption, the firmware may process the capsule immediately. If the payload should persist\r
+ across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must\r
+ be passed into ResetSystem() and will cause the capsule to be processed by the firmware as\r
+ part of the reset process.\r
+\r
+ @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules\r
+ being passed into update capsule.\r
+ @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r
+ CaspuleHeaderArray.\r
+ @param ScatterGatherList Physical pointer to a set of\r
+ EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the\r
+ location in physical memory of a set of capsules.\r
+\r
+ @retval EFI_SUCCESS Valid capsule was passed. If\r
+ CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the\r
+ capsule has been successfully processed by the firmware.\r
+ @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error.\r
+ @retval EFI_INVALID_PARAMETER CapsuleSize is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UPDATE_CAPSULE) (\r
+ IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,\r
+ IN UINTN CapsuleCount,\r
+ IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL\r
+ );\r
+\r
+/**\r
+ Returns if the capsule can be supported via UpdateCapsule().\r
+\r
+ @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules\r
+ being passed into update capsule.\r
+ @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r
+ CaspuleHeaderArray.\r
+ @param MaxiumCapsuleSize On output the maximum size that UpdateCapsule() can\r
+ support as an argument to UpdateCapsule() via\r
+ CapsuleHeaderArray and ScatterGatherList.\r
+ @param ResetType Returns the type of reset required for the capsule update.\r
+\r
+ @retval EFI_SUCCESS Valid answer returned.\r
+ @retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and\r
+ MaximumCapsuleSize and ResetType are undefined.\r
+ @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_QUERY_CAPSULE_CAPABILITIES) (\r
+ IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,\r
+ IN UINTN CapsuleCount,\r
+ OUT UINT64 *MaximumCapsuleSize,\r
+ OUT EFI_RESET_TYPE *ResetType\r
+ );\r
+\r
+/**\r
+ Returns information about the EFI variables.\r
+\r
+ @param Attributes Attributes bitmask to specify the type of variables on\r
+ which to return information.\r
+ @param MaximumVariableStorageSize On output the maximum size of the storage space\r
+ available for the EFI variables associated with the\r
+ attributes specified.\r
+ @param RemainingVariableStorageSize Returns the remaining size of the storage space\r
+ available for the EFI variables associated with the\r
+ attributes specified.\r
+ @param MaximumVariableSize Returns the maximum size of the individual EFI\r
+ variables associated with the attributes specified.\r
+\r
+ @retval EFI_SUCCESS Valid answer returned.\r
+ @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied\r
+ @retval EFI_UNSUPPORTED The attribute is not supported on this platform, and the\r
+ MaximumVariableStorageSize,\r
+ RemainingVariableStorageSize, MaximumVariableSize\r
+ are undefined.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_QUERY_VARIABLE_INFO) (\r
+ IN UINT32 Attributes,\r
+ OUT UINT64 *MaximumVariableStorageSize,\r
+ OUT UINT64 *RemainingVariableStorageSize,\r
+ OUT UINT64 *MaximumVariableSize\r
+ );\r
+\r
+\r
+//\r
+// EFI Runtime Services Table\r
+//\r
+#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249\r
+#define EFI_SYSTEM_TABLE_REVISION ((2<<16) | (10))\r
+#define EFI_2_10_SYSTEM_TABLE_REVISION ((2<<16) | (10))\r
+#define EFI_2_00_SYSTEM_TABLE_REVISION ((2<<16) | (00))\r
+#define EFI_1_10_SYSTEM_TABLE_REVISION ((1<<16) | (10))\r
+#define EFI_1_02_SYSTEM_TABLE_REVISION ((1<<16) | (02))\r
+\r
+#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552\r
+#define EFI_RUNTIME_SERVICES_REVISION EFI_2_00_SYSTEM_TABLE_REVISION\r
+\r
+typedef struct {\r
+ EFI_TABLE_HEADER Hdr;\r
+\r
+ //\r
+ // Time Services\r
+ //\r
+ EFI_GET_TIME GetTime;\r
+ EFI_SET_TIME SetTime;\r
+ EFI_GET_WAKEUP_TIME GetWakeupTime;\r
+ EFI_SET_WAKEUP_TIME SetWakeupTime;\r
+\r
+ //\r
+ // Virtual Memory Services\r
+ //\r
+ EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap;\r
+ EFI_CONVERT_POINTER ConvertPointer;\r
+\r
+ //\r
+ // Variable Services\r
+ //\r
+ EFI_GET_VARIABLE GetVariable;\r
+ EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName;\r
+ EFI_SET_VARIABLE SetVariable;\r
+\r
+ //\r
+ // Miscellaneous Services\r
+ //\r
+ EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount;\r
+ EFI_RESET_SYSTEM ResetSystem;\r
+\r
+ //\r
+ // UEFI 2.0 Capsule Services\r
+ //\r
+ EFI_UPDATE_CAPSULE UpdateCapsule;\r
+ EFI_QUERY_CAPSULE_CAPABILITIES QueryCapsuleCapabilities;\r
+\r
+ //\r
+ // Miscellaneous UEFI 2.0 Service\r
+ //\r
+ EFI_QUERY_VARIABLE_INFO QueryVariableInfo;\r
+} EFI_RUNTIME_SERVICES;\r
+\r
+\r
+#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42\r
+#define EFI_BOOT_SERVICES_REVISION ((2<<16) | (00))\r
+\r
+typedef struct {\r
+ EFI_TABLE_HEADER Hdr;\r
+ \r
+ //\r
+ // Task Priority Services\r
+ //\r
+ EFI_RAISE_TPL RaiseTPL;\r
+ EFI_RESTORE_TPL RestoreTPL;\r
+\r
+ //\r
+ // Memory Services\r
+ //\r
+ EFI_ALLOCATE_PAGES AllocatePages;\r
+ EFI_FREE_PAGES FreePages;\r
+ EFI_GET_MEMORY_MAP GetMemoryMap;\r
+ EFI_ALLOCATE_POOL AllocatePool;\r
+ EFI_FREE_POOL FreePool;\r
+\r
+ //\r
+ // Event & Timer Services\r
+ //\r
+ EFI_CREATE_EVENT CreateEvent;\r
+ EFI_SET_TIMER SetTimer;\r
+ EFI_WAIT_FOR_EVENT WaitForEvent;\r
+ EFI_SIGNAL_EVENT SignalEvent;\r
+ EFI_CLOSE_EVENT CloseEvent;\r
+ EFI_CHECK_EVENT CheckEvent;\r
+\r
+ //\r
+ // Protocol Handler Services\r
+ //\r
+ EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;\r
+ EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;\r
+ EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;\r
+ EFI_HANDLE_PROTOCOL HandleProtocol;\r
+ VOID *Reserved;\r
+ EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;\r
+ EFI_LOCATE_HANDLE LocateHandle;\r
+ EFI_LOCATE_DEVICE_PATH LocateDevicePath;\r
+ EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;\r
+\r
+ //\r
+ // Image Services\r
+ //\r
+ EFI_IMAGE_LOAD LoadImage;\r
+ EFI_IMAGE_START StartImage;\r
+ EFI_EXIT Exit;\r
+ EFI_IMAGE_UNLOAD UnloadImage;\r
+ EFI_EXIT_BOOT_SERVICES ExitBootServices;\r
+\r
+ //\r
+ // Miscellaneous Services\r
+ //\r
+ EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;\r
+ EFI_STALL Stall;\r
+ EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;\r
+\r
+ //\r
+ // DriverSupport Services\r
+ //\r
+ EFI_CONNECT_CONTROLLER ConnectController;\r
+ EFI_DISCONNECT_CONTROLLER DisconnectController;\r
+\r
+ //\r
+ // Open and Close Protocol Services\r
+ //\r
+ EFI_OPEN_PROTOCOL OpenProtocol;\r
+ EFI_CLOSE_PROTOCOL CloseProtocol;\r
+ EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation;\r
+\r
+ //\r
+ // Library Services\r
+ //\r
+ EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle;\r
+ EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer;\r
+ EFI_LOCATE_PROTOCOL LocateProtocol;\r
+ EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;\r
+ EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;\r
+\r
+ //\r
+ // 32-bit CRC Services\r
+ //\r
+ EFI_CALCULATE_CRC32 CalculateCrc32;\r
+\r
+ //\r
+ // Miscellaneous Services\r
+ //\r
+ EFI_COPY_MEM CopyMem;\r
+ EFI_SET_MEM SetMem;\r
+\r
+ EFI_CREATE_EVENT_EX CreateEventEx;\r
+} EFI_BOOT_SERVICES;\r
+\r
+//\r
+// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the \r
+// EFI System Table.\r
+// \r
+typedef struct{\r
+ EFI_GUID VendorGuid;\r
+ VOID *VendorTable;\r
+} EFI_CONFIGURATION_TABLE;\r
+\r
+struct _EFI_SYSTEM_TABLE {\r
+ EFI_TABLE_HEADER Hdr;\r
+ CHAR16 *FirmwareVendor;\r
+ UINT32 FirmwareRevision;\r
+ EFI_HANDLE ConsoleInHandle;\r
+ EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ConIn;\r
+ EFI_HANDLE ConsoleOutHandle;\r
+ EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;\r
+ EFI_HANDLE StandardErrorHandle;\r
+ EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *StdErr;\r
+ EFI_RUNTIME_SERVICES *RuntimeServices;\r
+ EFI_BOOT_SERVICES *BootServices;\r
+ UINTN NumberOfTableEntries;\r
+ EFI_CONFIGURATION_TABLE *ConfigurationTable;\r
+};\r
+\r
+//\r
+// EFI File location to boot from on removable media devices\r
+//\r
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI"\r
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI"\r
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI"\r
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_EBC L"\\EFI\\BOOT\\BOOTEBC.EFI"\r
+\r
+#if defined (MDE_CPU_IA32)\r
+ #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA32\r
+#elif defined (MDE_CPU_IPF)\r
+ #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA64\r
+#elif defined (MDE_CPU_X64)\r
+ #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64\r
+#elif defined (MDE_CPU_EBC)\r
+ #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_EBC\r
+#else\r
+ #error Unknown Processor Type\r
+#endif\r
+\r
+#include <Uefi/UefiDevicePath.h>\r
+#include <Uefi/UefiPxe.h>\r
+#include <Uefi/UefiGpt.h>\r
+#include <Uefi/UefiInternalFormRepresentation.h>\r
+\r
+#endif\r