]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Uefi/UefiSpec.h
Add the new reset type (EfiResetPlatformSpecific) to UefiSpec.h to follow UEFI Spec...
[mirror_edk2.git] / MdePkg / Include / Uefi / UefiSpec.h
index 2492a461da1b85b35766ed9723730f1d4cc70e4f..a39b4b8960845140f969901362923dc4b4d9aa38 100644 (file)
@@ -1,19 +1,18 @@
 /** @file\r
   Include file that supports UEFI.\r
 \r
-  This include file must only contain things defined in the UEFI 2.1 specification.\r
-  If a code construct is defined in the UEFI 2.1 specification it must be included\r
+  This include file must contain things defined in the UEFI 2.4 specification.\r
+  If a code construct is defined in the UEFI 2.4 specification it must be included\r
   by this include file.\r
 \r
-  Copyright (c) 2006 - 2009, Intel Corporation<BR>\r
-  Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>\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
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+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
 **/\r
 \r
@@ -24,6 +23,7 @@
 \r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/SimpleTextIn.h>\r
+#include <Protocol/SimpleTextInEx.h>\r
 #include <Protocol/SimpleTextOut.h>\r
 \r
 ///\r
 ///\r
 typedef enum {\r
   ///\r
-  /// Allocate any available range of pages that satisfies the request\r
+  /// Allocate any available range of pages that satisfies the request.\r
   ///\r
   AllocateAnyPages,\r
   ///\r
   /// Allocate any available range of pages whose uppermost address is less than \r
-  /// or equal to a specified maximum address\r
+  /// or equal to a specified maximum address.\r
   ///\r
   AllocateMaxAddress,\r
   ///\r
-  /// Allocate pages at a specified address\r
+  /// Allocate pages at a specified address.\r
   ///\r
   AllocateAddress,\r
   ///\r
-  /// Maximum enumeration value that may be used for bounds checking\r
+  /// Maximum enumeration value that may be used for bounds checking.\r
   ///\r
   MaxAllocateType\r
 } EFI_ALLOCATE_TYPE;\r
@@ -56,7 +56,7 @@ typedef enum {
 #define EFI_TIME_IN_DAYLIGHT      0x02\r
 \r
 ///\r
-/// Value definition for EFI_TIME.TimeZone\r
+/// Value definition for EFI_TIME.TimeZone.\r
 ///\r
 #define EFI_UNSPECIFIED_TIMEZONE  0x07FF\r
 \r
@@ -80,16 +80,16 @@ typedef enum {
 #define EFI_MEMORY_RUNTIME  0x8000000000000000ULL\r
 \r
 ///\r
-/// Memory descriptor version number\r
+/// Memory descriptor version number.\r
 ///\r
 #define EFI_MEMORY_DESCRIPTOR_VERSION 1\r
 \r
 ///\r
-/// Definition of an EFI memory descriptor\r
+/// Definition of an EFI memory descriptor.\r
 ///\r
 typedef struct {\r
   ///\r
-  /// Type of the memory region.  See EFI_MEMORY_TYPE\r
+  /// Type of the memory region.  See EFI_MEMORY_TYPE.\r
   ///\r
   UINT32                Type;\r
   ///\r
@@ -120,13 +120,14 @@ typedef struct {
   @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
+  @param  Memory      The 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
+                                3) Memory is NULL.\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
@@ -205,7 +206,7 @@ EFI_STATUS
 \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
+  @retval EFI_INVALID_PARAMETER PoolType was invalid or Buffer is NULL.\r
 \r
 **/\r
 typedef\r
@@ -219,7 +220,7 @@ EFI_STATUS
 /**\r
   Returns pool memory to the system.\r
 \r
-  @param  Buffer                Pointer to the buffer to free.\r
+  @param  Buffer                The 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
@@ -276,11 +277,13 @@ EFI_STATUS
                                 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_INVALID_PARAMETER ControllerHandle is NULL.\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
+  @retval EFI_SECURITY_VIOLATION \r
+                                The user has no permission to start UEFI device drivers on the device path \r
+                                associated with the ControllerHandle or specified by the RemainingDevicePath.\r
 **/\r
 typedef\r
 EFI_STATUS\r
@@ -306,7 +309,7 @@ EFI_STATUS
                                 2) On entry, no drivers are managing ControllerHandle.\r
                                 3) DriverImageHandle is not NULL, and on entry\r
                                    DriverImageHandle is not managing ControllerHandle.\r
-  @retval EFI_INVALID_PARAMETER 1) ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER 1) ControllerHandle is NULL.\r
                                 2) DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.\r
                                 3) ChildHandle is not NULL, and it is not a valid EFI_HANDLE.\r
                                 4) DriverImageHandle does not support the EFI_DRIVER_BINDING_PROTOCOL.\r
@@ -378,7 +381,7 @@ EFI_STATUS
   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
+  @param  Context               The pointer to the notification function's context,\r
                                 which is implementation-dependent.\r
 \r
 **/\r
@@ -394,10 +397,10 @@ VOID
 \r
   @param  Type                  The type of event to create and its mode and attributes.\r
   @param  NotifyTpl             The task priority level of event notifications, if needed.\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
+  @param  NotifyFunction        The pointer to the event's notification function, if any.\r
+  @param  NotifyContext         The 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
+  @param  Event                 The pointer to the newly created event if the call succeeds; undefined\r
                                 otherwise.\r
 \r
   @retval EFI_SUCCESS           The event structure was created.\r
@@ -420,13 +423,13 @@ EFI_STATUS
 \r
   @param  Type                  The type of event to create and its mode and attributes.\r
   @param  NotifyTpl             The task priority level of event notifications,if needed.\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
+  @param  NotifyFunction        The pointer to the event's notification function, if any.\r
+  @param  NotifyContext         The 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  EventGroup            The pointer to the unique identifier of the group to which this event belongs.\r
                                 If this is NULL, then the function behaves as if the parameters were passed\r
                                 to CreateEvent.\r
-  @param  Event                 Pointer to the newly created event if the call succeeds; undefined\r
+  @param  Event                 The pointer to the newly created event if the call succeeds; undefined\r
                                 otherwise.\r
 \r
   @retval EFI_SUCCESS           The event structure was created.\r
@@ -450,7 +453,7 @@ EFI_STATUS
 ///\r
 typedef enum {\r
   ///\r
-  /// An event's timer settings is to be cancelled and not trigger time is to be set\r
+  /// An event's timer settings is to be cancelled and not trigger time is to be set/\r
   ///\r
   TimerCancel,\r
   ///\r
@@ -506,7 +509,7 @@ EFI_STATUS
 \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
+  @param  Index                 The 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
@@ -592,8 +595,8 @@ VOID
 /**\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  VariableName          A Null-terminated string that is the name of the vendor's\r
+                                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
@@ -628,7 +631,7 @@ EFI_STATUS
   @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
+                                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
@@ -665,7 +668,7 @@ EFI_STATUS
 \r
   @retval EFI_SUCCESS            The firmware has successfully stored the variable and its data as\r
                                  defined by the Attributes.\r
-  @retval EFI_INVALID_PARAMETER  An invalid combination of attribute bits was supplied, or the\r
+  @retval EFI_INVALID_PARAMETER  An invalid combination of attribute bits, name, and GUID was supplied, or the\r
                                  DataSize exceeds the maximum allowed.\r
   @retval EFI_INVALID_PARAMETER  VariableName is an empty string.\r
   @retval EFI_OUT_OF_RESOURCES   Not enough storage is available to hold the variable and its data.\r
@@ -811,7 +814,7 @@ EFI_STATUS
   @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. Ignored if SourceBuffer is NULL.\r
-  @param  ImageHandle           Pointer to the returned image handle that is created when the\r
+  @param  ImageHandle           The 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
@@ -822,7 +825,11 @@ EFI_STATUS
   @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
+  @retval EFI_ACCESS_DENIED     Image was not loaded because the platform policy prohibits the \r
+                                image from being loaded. NULL is returned in *ImageHandle.\r
+  @retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a \r
+                                valid EFI_LOADED_IMAGE_PROTOCOL. However, the current \r
+                                platform policy specifies that the image should not be started.\r
 **/\r
 typedef\r
 EFI_STATUS\r
@@ -839,12 +846,13 @@ EFI_STATUS
   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
+  @param  ExitDataSize          The pointer to the size, in bytes, of ExitData.\r
+  @param  ExitData              The pointer to a pointer to a data buffer that includes a Null-terminated\r
+                                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 EFI_INVALID_PARAMETER  ImageHandle is either an invalid image handle or the image\r
+                                 has already been initialized with StartImage.\r
+  @retval EFI_SECURITY_VIOLATION The current platform policy specifies that the image should not be started.\r
   @return Exit code from image\r
 \r
 **/\r
@@ -859,11 +867,16 @@ EFI_STATUS
 /**\r
   Terminates a loaded EFI image and returns control to boot services.\r
 \r
-  @param  ImageHandle           Handle that identifies the image.\r
+  @param  ImageHandle           Handle that identifies the image. This parameter is passed to the \r
+                                image on entry.\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
+  @param  ExitDataSize          The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS.\r
+  @param  ExitData              The pointer to a data buffer that includes a Null-terminated string,\r
+                                optionally followed by additional binary data. The string is a \r
+                                description that the caller may use to further indicate the reason \r
+                                for the image's exit. ExitData is only valid if ExitStatus \r
+                                is something other than EFI_SUCCESS. The ExitData buffer \r
+                                must be allocated by calling AllocatePool().\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
@@ -933,13 +946,13 @@ EFI_STATUS
   @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
+  @param  WatchdogData          A data buffer that includes a Null-terminated 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
+  @retval EFI_DEVICE_ERROR      The watchdog timer could not be programmed due to a hardware\r
                                 error.\r
 \r
 **/\r
@@ -974,7 +987,15 @@ typedef enum {
   /// state.  If the system does not support this reset type, then when the system\r
   /// is rebooted, it should exhibit the EfiResetCold attributes.\r
   ///\r
-  EfiResetShutdown\r
+  EfiResetShutdown,\r
+  ///\r
+  /// Used to induce a system-wide reset. The exact type of the reset is defined by\r
+  /// the EFI_GUID that follows the Null-terminated Unicode string passed into\r
+  /// ResetData. If the platform does not recognize the EFI_GUID in ResetData the \r
+  /// platform must pick a supported reset type to perform. The platform may\r
+  /// optionally log the parameters from any non-normal reset that occurs.\r
+  ///\r
+  EfiResetPlatformSpecific\r
 } EFI_RESET_TYPE;\r
 \r
 /**\r
@@ -985,7 +1006,7 @@ typedef enum {
   @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
+                                string, optionally followed by additional binary data.\r
 \r
 **/\r
 typedef\r
@@ -1000,7 +1021,7 @@ VOID
 /**\r
   Returns a monotonically increasing count for the platform.\r
 \r
-  @param  Count                 Pointer to returned value.\r
+  @param  Count                 The pointer to returned value.\r
 \r
   @retval EFI_SUCCESS           The next monotonic count was returned.\r
   @retval EFI_INVALID_PARAMETER Count is NULL.\r
@@ -1016,7 +1037,7 @@ EFI_STATUS
 /**\r
   Returns the next high 32 bits of the platform's monotonic counter.\r
 \r
-  @param  HighCount             Pointer to returned value.\r
+  @param  HighCount             The 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
@@ -1055,8 +1076,8 @@ EFI_STATUS
 /**\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  Destination           The pointer to the destination buffer of the memory copy.\r
+  @param  Source                The pointer to the source buffer of the memory copy.\r
   @param  Length                Number of bytes to copy from Source to Destination.\r
 \r
 **/\r
@@ -1071,7 +1092,7 @@ VOID
 /**\r
   The SetMem() function fills a buffer with a specified value.\r
 \r
-  @param  Buffer                Pointer to the buffer to fill.\r
+  @param  Buffer                The 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
@@ -1126,8 +1147,8 @@ EFI_STATUS
 /**\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  Handle                The pointer to a handle to install the new protocol interfaces on,\r
+                                or a pointer to NULL if a new handle is to be allocated.\r
   @param  ...                   A variable argument list containing pairs of protocol GUIDs and protocol\r
                                 interfaces.\r
 \r
@@ -1135,6 +1156,8 @@ EFI_STATUS
   @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
+  @retval EFI_INVALID_PARAMETER Handle is NULL.\r
+  @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.\r
 \r
 **/\r
 typedef\r
@@ -1158,7 +1181,7 @@ EFI_STATUS
   @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 Handle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER Handle is NULL.\r
   @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
 \r
 **/\r
@@ -1184,7 +1207,7 @@ EFI_STATUS
   @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 Handle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER Handle is NULL.\r
   @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
 \r
 **/\r
@@ -1224,7 +1247,7 @@ EFI_STATUS
 \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 Handle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER Handle is NULL.\r
   @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
   @retval EFI_INVALID_PARAMETER Interface is NULL.\r
 \r
@@ -1295,8 +1318,8 @@ EFI_STATUS
                                 that required the protocol interface.\r
 \r
   @retval EFI_SUCCESS           The protocol instance was closed.\r
-  @retval EFI_INVALID_PARAMETER 1) Handle is not a valid EFI_HANDLE.\r
-                                2) AgentHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER 1) Handle is NULL.\r
+                                2) AgentHandle is NULL.\r
                                 3) ControllerHandle is not NULL and ControllerHandle is not a valid EFI_HANDLE.\r
                                 4) Protocol is NULL.\r
   @retval EFI_NOT_FOUND         1) Handle does not support the protocol specified by Protocol.\r
@@ -1483,7 +1506,7 @@ EFI_STATUS
 \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_INVALID_PARAMETER Guid is NULL.\r
   @retval EFI_OUT_OF_RESOURCES  There is not enough memory available to complete the operation.\r
 \r
 **/\r
@@ -1572,7 +1595,7 @@ typedef struct {
 } EFI_CAPSULE_BLOCK_DESCRIPTOR;\r
 \r
 ///\r
-/// EFI Capsule Header\r
+/// EFI Capsule Header.\r
 ///\r
 typedef struct {\r
   ///\r
@@ -1710,24 +1733,30 @@ EFI_STATUS
   OUT UINT64            *MaximumVariableSize\r
   );\r
 \r
+//\r
+// Firmware should stop at a firmware user interface on next boot\r
+//\r
+#define EFI_OS_INDICATIONS_BOOT_TO_FW_UI    0x0000000000000001\r
 \r
 //\r
 // EFI Runtime Services Table\r
 //\r
 #define EFI_SYSTEM_TABLE_SIGNATURE      SIGNATURE_64 ('I','B','I',' ','S','Y','S','T')\r
-#define EFI_SYSTEM_TABLE_REVISION       ((2 << 16) | (10))\r
+#define EFI_2_40_SYSTEM_TABLE_REVISION  ((2 << 16) | (40))\r
+#define EFI_2_31_SYSTEM_TABLE_REVISION  ((2 << 16) | (31))\r
 #define EFI_2_30_SYSTEM_TABLE_REVISION  ((2 << 16) | (30))\r
 #define EFI_2_20_SYSTEM_TABLE_REVISION  ((2 << 16) | (20))\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
+#define EFI_SYSTEM_TABLE_REVISION       EFI_2_31_SYSTEM_TABLE_REVISION\r
 \r
 #define EFI_RUNTIME_SERVICES_SIGNATURE  SIGNATURE_64 ('R','U','N','T','S','E','R','V')\r
-#define EFI_RUNTIME_SERVICES_REVISION   EFI_2_10_SYSTEM_TABLE_REVISION\r
+#define EFI_RUNTIME_SERVICES_REVISION   EFI_2_31_SYSTEM_TABLE_REVISION\r
 \r
 ///\r
-/// EFI Runtime Services Table\r
+/// EFI Runtime Services Table.\r
 ///\r
 typedef struct {\r
   ///\r
@@ -1776,10 +1805,10 @@ typedef struct {
 \r
 \r
 #define EFI_BOOT_SERVICES_SIGNATURE   SIGNATURE_64 ('B','O','O','T','S','E','R','V')\r
-#define EFI_BOOT_SERVICES_REVISION    EFI_2_10_SYSTEM_TABLE_REVISION\r
+#define EFI_BOOT_SERVICES_REVISION    EFI_2_31_SYSTEM_TABLE_REVISION\r
 \r
 ///\r
-/// EFI Boot Services Table\r
+/// EFI Boot Services Table.\r
 ///\r
 typedef struct {\r
   ///\r
@@ -1900,8 +1929,8 @@ typedef struct {
   ///\r
   EFI_TABLE_HEADER                  Hdr;\r
   ///\r
-  /// A pointer to a null terminated Unicode string that identifies\r
-  /// the vendor that produces the system firmware for the platform.\r
+  /// A pointer to a null terminated string that identifies the vendor\r
+  /// that produces the system firmware for the platform.\r
   ///\r
   CHAR16                            *FirmwareVendor;\r
   ///\r
@@ -1966,7 +1995,7 @@ typedef struct {
   @param  SystemTable           A pointer to the EFI System Table.\r
 \r
   @retval EFI_SUCCESS           The operation completed successfully.\r
-  @retval Others                Some unexpected error happened.\r
+  @retval Others                An unexpected error occurred.\r
 **/\r
 typedef\r
 EFI_STATUS\r
@@ -1993,50 +2022,46 @@ EFI_STATUS
 ///\r
 /// EFI Boot Key Data\r
 ///\r
-typedef union {\r
-  struct {\r
-    ///\r
-    /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.\r
-    ///\r
-    UINT32  Revision        : 8;\r
-    ///\r
-    /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).\r
-    ///\r
-    UINT32  ShiftPressed    : 1;\r
-    ///\r
-    /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).\r
-    ///\r
-    UINT32  ControlPressed  : 1;\r
-    ///\r
-    /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).\r
-    ///\r
-    UINT32  AltPressed      : 1;\r
-    ///\r
-    /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).\r
-    ///\r
-    UINT32  LogoPressed     : 1;\r
-    ///\r
-    /// The Menu key must be pressed (1) or must not be pressed (0).\r
-    ///\r
-    UINT32  MenuPressed     : 1;\r
-    ///\r
-    /// The SysReq key must be pressed (1) or must not be pressed (0).\r
-    ///\r
-    UINT32  SysReqPressed    : 1;\r
-    UINT32  Reserved        : 16;\r
-    ///\r
-    /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If\r
-    /// zero, then only the shift state is considered. If more than one, then the boot option will\r
-    /// only be launched if all of the specified keys are pressed with the same shift state.\r
-    ///\r
-    UINT32  InputKeyCount   : 2;\r
-  } Options;\r
-  UINT32  PackedValue;\r
-} EFI_BOOT_KEY_DATA;\r
+typedef UINT32 EFI_BOOT_KEY_DATA;\r
+///\r
+/// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.\r
+///\r
+#define EFI_KEY_OPTION_REVISION_MASK        0x000000FF\r
+///\r
+/// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).\r
+///\r
+#define EFI_KEY_OPTION_SHIFT_PRESSED_MASK   BIT8\r
+///\r
+/// Either the left or right Control keys must be pressed (1) or must not be pressed (0).\r
+///\r
+#define EFI_KEY_OPTION_CONTROL_PRESSED_MASK BIT9\r
+///\r
+/// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).\r
+///\r
+#define EFI_KEY_OPTION_ALT_PRESSED_MASK     BIT10\r
+///\r
+/// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).\r
+///\r
+#define EFI_KEY_OPTION_LOGO_PRESSED_MASK    BIT11\r
+///\r
+/// The Menu key must be pressed (1) or must not be pressed (0).\r
+///\r
+#define EFI_KEY_OPTION_MENU_PRESSED_MASK    BIT12\r
+///\r
+/// The SysReq key must be pressed (1) or must not be pressed (0).\r
+///\r
+#define EFI_KEY_OPTION_SYS_REQ_PRESSED_MASK BIT13\r
+///\r
+/// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If\r
+/// zero, then only the shift state is considered. If more than one, then the boot option will\r
+/// only be launched if all of the specified keys are pressed with the same shift state.\r
+///\r
+#define EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK (BIT30 | BIT31)\r
 \r
 ///\r
-/// EFI Key Option\r
+/// EFI Key Option.\r
 ///\r
+#pragma pack(1)\r
 typedef struct {\r
   ///\r
   /// Specifies options about how the key will be processed.\r
@@ -2060,6 +2085,7 @@ typedef struct {
   ///\r
   //EFI_INPUT_KEY      Keys[];\r
 } EFI_KEY_OPTION;\r
+#pragma pack()\r
 \r
 //\r
 // EFI File location to boot from on removable media devices\r
@@ -2068,6 +2094,7 @@ typedef struct {
 #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_ARM     L"\\EFI\\BOOT\\BOOTARM.EFI"\r
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI"\r
 \r
 #if   defined (MDE_CPU_IA32)\r
   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_IA32\r
@@ -2078,6 +2105,8 @@ typedef struct {
 #elif defined (MDE_CPU_EBC)\r
 #elif defined (MDE_CPU_ARM)\r
   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_ARM\r
+#elif defined (MDE_CPU_AARCH64)\r
+  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64\r
 #else\r
   #error Unknown Processor Type\r
 #endif\r