]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Uefi/UefiSpec.h
Grammatical and disclaimer changes (does not follow internal C coding stds.)
[mirror_edk2.git] / MdePkg / Include / Uefi / UefiSpec.h
index 5d7328e4df15f528707abeff039bbb53811e6acb..ac1604010822b55c16ea0a94c27681ccd518057f 100644 (file)
@@ -5,14 +5,14 @@
   If a code construct is defined in the UEFI 2.1 specification it must be included\r
   by this include file.\r
 \r
-  Copyright (c) 2006 - 2008, 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
+Copyright (c) 2006 - 2010, 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
 #include <Protocol/SimpleTextOut.h>\r
 \r
 ///\r
-/// Enumeration of memory allocation.\r
+/// Enumeration of EFI memory allocation types.\r
 ///\r
 typedef enum {\r
+  ///\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
+  ///\r
   AllocateMaxAddress,\r
+  ///\r
+  /// Allocate pages at a specified address.\r
+  ///\r
   AllocateAddress,\r
+  ///\r
+  /// Maximum enumeration value that may be used for bounds checking.\r
+  ///\r
   MaxAllocateType\r
 } EFI_ALLOCATE_TYPE;\r
 \r
@@ -42,7 +55,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
@@ -66,38 +79,47 @@ 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 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
+  ///\r
   UINT32                Type;\r
+  ///\r
+  /// Physical address of the first byte of the memory region.  Must aligned \r
+  /// on a 4 KB boundary.\r
+  ///\r
   EFI_PHYSICAL_ADDRESS  PhysicalStart;\r
+  ///\r
+  /// Virtual address of the first byte of the memory region.  Must aligned \r
+  /// on a 4 KB boundary.\r
+  ///\r
   EFI_VIRTUAL_ADDRESS   VirtualStart;\r
+  ///\r
+  /// Number of 4KB pages in the memory region.\r
+  ///\r
   UINT64                NumberOfPages;\r
+  ///\r
+  /// Attributes of the memory region that describe the bit mask of capabilities\r
+  /// for that memory region, and not necessarily the current settings for that \r
+  /// memory region.\r
+  ///\r
   UINT64                Attribute;\r
 } EFI_MEMORY_DESCRIPTOR;\r
 \r
-///\r
-/// Build macros to find next EFI_MEMORY_DESCRIPTOR.\r
-///\r
-#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size)   ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_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
+  @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
@@ -196,7 +218,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
@@ -306,7 +328,6 @@ EFI_STATUS
 // 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
@@ -356,7 +377,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
@@ -372,10 +393,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
@@ -398,13 +419,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
@@ -427,8 +448,17 @@ EFI_STATUS
 /// Timer delay types\r
 ///\r
 typedef enum {\r
+  ///\r
+  /// An event's timer settings is to be cancelled and not trigger time is to be set/\r
+  ///\r
   TimerCancel,\r
+  ///\r
+  /// An event is to be signalled periodically at a specified interval from the current time.\r
+  ///\r
   TimerPeriodic,\r
+  ///\r
+  /// An event is to be signalled once at a specified interval from the current time.\r
+  ///\r
   TimerRelative\r
 } EFI_TIMER_DELAY;\r
 \r
@@ -475,7 +505,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
@@ -561,8 +591,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
@@ -597,7 +627,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
@@ -622,23 +652,28 @@ EFI_STATUS
 /**\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
+  @param  VariableName           A Null-terminated string that is the name of the vendor's variable.\r
+                                 Each VariableName is unique for each VendorGuid. VariableName must\r
+                                 contain 1 or more characters. If VariableName is an empty string,\r
+                                 then EFI_INVALID_PARAMETER is returned.\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. A size of zero causes the\r
+                                 variable to be deleted.\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_INVALID_PARAMETER  An invalid combination of attribute bits was supplied, or the\r
                                  DataSize exceeds the maximum allowed.\r
-  @retval EFI_INVALID_PARAMETER  VariableName is an empty Unicode string.\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
   @retval EFI_DEVICE_ERROR       The variable could not be retrieved due to a hardware error.\r
   @retval EFI_WRITE_PROTECTED    The variable in question is read-only.\r
   @retval EFI_WRITE_PROTECTED    The variable in question cannot be deleted.\r
-  @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.\r
+  @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\r
+                                 set but the AuthInfo does NOT pass the validation check carried out\r
+                                 by the firmware.\r
   @retval EFI_NOT_FOUND          The variable trying to be updated or deleted was not found.\r
 \r
 **/\r
@@ -658,8 +693,27 @@ EFI_STATUS
 /// real time clock device as exposed through the EFI interfaces.\r
 ///\r
 typedef struct {\r
+  ///\r
+  /// Provides the reporting resolution of the real-time clock device in\r
+  /// counts per second. For a normal PC-AT CMOS RTC device, this\r
+  /// value would be 1 Hz, or 1, to indicate that the device only reports\r
+  /// the time to the resolution of 1 second.\r
+  ///\r
   UINT32    Resolution;\r
+  ///\r
+  /// Provides the timekeeping accuracy of the real-time clock in an\r
+  /// error rate of 1E-6 parts per million. For a clock with an accuracy\r
+  /// of 50 parts per million, the value in this field would be\r
+  /// 50,000,000.\r
+  ///\r
   UINT32    Accuracy;\r
+  ///\r
+  /// A TRUE indicates that a time set operation clears the device's\r
+  /// time below the Resolution reporting level. A FALSE\r
+  /// indicates that the state below the Resolution level of the\r
+  /// device is not cleared when the time is set. Normal PC-AT CMOS\r
+  /// RTC devices set this value to FALSE.\r
+  ///\r
   BOOLEAN   SetsToZero;\r
 } EFI_TIME_CAPABILITIES;\r
 \r
@@ -743,24 +797,6 @@ EFI_STATUS
   IN  EFI_TIME                     *Time   OPTIONAL\r
   );\r
 \r
-/**\r
-  This is the declaration of an EFI image entry point. This entry point is\r
-  the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r
-  both device drivers and bus drivers.\r
-\r
-  @param  ImageHandle           The firmware allocated handle for the UEFI image.\r
-  @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
-**/\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
@@ -774,7 +810,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
@@ -802,12 +838,12 @@ 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
+                                has already been initialized with StartImage.\r
   @return Exit code from image\r
 \r
 **/\r
@@ -822,11 +858,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
@@ -850,8 +891,6 @@ EFI_STATUS
 \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
-  @return Exit code from the image's unload handler\r
 \r
 **/\r
 typedef\r
@@ -898,13 +937,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
@@ -921,10 +960,25 @@ EFI_STATUS
 /// Enumeration of reset types.\r
 ///\r
 typedef enum {\r
+  ///\r
+  /// Used to induce a system-wide reset. This sets all circuitry within the \r
+  /// system to its initial state.  This type of reset is asynchronous to system\r
+  /// operation and operates withgout regard to cycle boundaries.  EfiColdReset \r
+  /// is tantamount to a system power cycle.\r
+  ///\r
   EfiResetCold,\r
+  ///\r
+  /// Used to induce a system-wide initialization. The processors are set to their\r
+  /// initial state, and pending cycles are not corrupted.  If the system does \r
+  /// not support this reset type, then an EfiResetCold must be performed.\r
+  ///\r
   EfiResetWarm,\r
-  EfiResetShutdown,\r
-  EfiResetUpdate\r
+  ///\r
+  /// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3\r
+  /// 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
 } EFI_RESET_TYPE;\r
 \r
 /**\r
@@ -935,7 +989,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
@@ -950,7 +1004,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
@@ -966,7 +1020,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
@@ -1005,8 +1059,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
@@ -1021,7 +1075,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
@@ -1034,11 +1088,13 @@ VOID
   IN UINT8    Value\r
   );\r
 \r
-\r
-//\r
-// Protocol handler functions\r
-//\r
+///\r
+/// Enumeration of EFI Interface Types\r
+///\r
 typedef enum {\r
+  ///\r
+  /// Indicates that the supplied protocol interface is supplied in native form.\r
+  ///\r
   EFI_NATIVE_INTERFACE\r
 } EFI_INTERFACE_TYPE;\r
 \r
@@ -1261,7 +1317,9 @@ EFI_STATUS
   IN EFI_HANDLE               ControllerHandle\r
   );\r
 \r
-\r
+///\r
+/// EFI Oprn Protocol Information Entry\r
+///\r
 typedef struct {\r
   EFI_HANDLE  AgentHandle;\r
   EFI_HANDLE  ControllerHandle;\r
@@ -1345,10 +1403,22 @@ EFI_STATUS
   OUT VOID                     **Registration\r
   );\r
 \r
-\r
+///\r
+/// Enumeration of EFI Locate Search Types\r
+///\r
 typedef enum {\r
+  ///\r
+  /// Retrieve all the handles in the handle database.\r
+  ///\r
   AllHandles,\r
+  ///\r
+  /// Retrieve the next handle fron a RegisterProtocolNotify() event.\r
+  ///\r
   ByRegisterNotify,\r
+  ///\r
+  /// Retrieve the set of handles from the handle database that support a \r
+  /// specified protocol.\r
+  ///\r
   ByProtocol\r
 } EFI_LOCATE_SEARCH_TYPE;\r
 \r
@@ -1428,7 +1498,6 @@ EFI_STATUS
   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
@@ -1482,33 +1551,75 @@ EFI_STATUS
   OUT VOID      **Interface\r
   );\r
 \r
+///\r
+/// EFI Capsule Block Descriptor\r
+///\r
 typedef struct {\r
-  UINT64                            Length;\r
+  ///\r
+  /// Length in bytes of the data pointed to by DataBlock/ContinuationPointer.\r
+  ///\r
+  UINT64                  Length;\r
   union {\r
+    ///\r
+    /// Physical address of the data block. This member of the union is\r
+    /// used if Length is not equal to zero.\r
+    ///\r
     EFI_PHYSICAL_ADDRESS  DataBlock;\r
+    ///\r
+    /// Physical address of another block of\r
+    /// EFI_CAPSULE_BLOCK_DESCRIPTOR structures. This\r
+    /// member of the union is used if Length is equal to zero. If\r
+    /// ContinuationPointer is zero this entry represents the end of the list.\r
+    ///\r
     EFI_PHYSICAL_ADDRESS  ContinuationPointer;\r
   } Union;\r
 } EFI_CAPSULE_BLOCK_DESCRIPTOR;\r
 \r
+///\r
+/// EFI Capsule Header.\r
+///\r
 typedef struct {\r
+  ///\r
+  /// A GUID that defines the contents of a capsule.\r
+  ///\r
   EFI_GUID          CapsuleGuid;\r
+  ///\r
+  /// The size of the capsule header. This may be larger than the size of\r
+  /// the EFI_CAPSULE_HEADER since CapsuleGuid may imply\r
+  /// extended header entries\r
+  ///\r
   UINT32            HeaderSize;\r
+  ///\r
+  /// Bit-mapped list describing the capsule attributes. The Flag values\r
+  /// of 0x0000 - 0xFFFF are defined by CapsuleGuid. Flag values\r
+  /// of 0x10000 - 0xFFFFFFFF are defined by this specification\r
+  ///\r
   UINT32            Flags;\r
+  ///\r
+  /// Size in bytes of the capsule.\r
+  ///\r
   UINT32            CapsuleImageSize;\r
 } EFI_CAPSULE_HEADER;\r
 \r
-//\r
-// The EFI System Table entry must point to an array of capsules\r
-// that contain the same CapsuleGuid value. The array must be\r
-// prefixed by a UINT32 that represents the size of the array of capsules.\r
-//\r
+///\r
+/// The EFI System Table entry must point to an array of capsules\r
+/// that contain the same CapsuleGuid value. The array must be\r
+/// prefixed by a UINT32 that represents the size of the array of capsules.\r
+///\r
 typedef struct {\r
+  ///\r
+  /// the size of the array of capsules.\r
+  ///\r
   UINT32   CapsuleArrayNumber;\r
+  ///\r
+  /// Point to an array of capsules that contain the same CapsuleGuid value.\r
+  ///\r
   VOID*    CapsulePtr[1];\r
 } EFI_CAPSULE_TABLE;\r
 \r
 #define CAPSULE_FLAGS_PERSIST_ACROSS_RESET          0x00010000\r
 #define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE         0x00020000\r
+#define CAPSULE_FLAGS_INITIATE_RESET                0x00040000\r
 \r
 /**\r
   Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended\r
@@ -1528,8 +1639,10 @@ typedef struct {
   @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_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were\r
+                                set in the capsule header.\r
+  @retval EFI_INVALID_PARAMETER CapsuleCount is 0.\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
   @retval EFI_UNSUPPORTED       The capsule type is not supported on this platform.\r
   @retval EFI_OUT_OF_RESOURCES  There were insufficient resources to process the capsule.\r
 \r
@@ -1605,18 +1718,20 @@ EFI_STATUS
 //\r
 // EFI Runtime Services Table\r
 //\r
-#define EFI_SYSTEM_TABLE_SIGNATURE      0x5453595320494249ULL\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  0x56524553544e5552ULL\r
-#define EFI_RUNTIME_SERVICES_REVISION   EFI_2_10_SYSTEM_TABLE_REVISION\r
+#define EFI_SYSTEM_TABLE_SIGNATURE      SIGNATURE_64 ('I','B','I',' ','S','Y','S','T')\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_30_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_30_SYSTEM_TABLE_REVISION\r
 \r
 ///\r
-/// EFI Runtime Services Table\r
+/// EFI Runtime Services Table.\r
 ///\r
 typedef struct {\r
   ///\r
@@ -1664,11 +1779,11 @@ typedef struct {
 } EFI_RUNTIME_SERVICES;\r
 \r
 \r
-#define EFI_BOOT_SERVICES_SIGNATURE   0x56524553544f4f42ULL\r
-#define EFI_BOOT_SERVICES_REVISION    EFI_2_10_SYSTEM_TABLE_REVISION\r
+#define EFI_BOOT_SERVICES_SIGNATURE   SIGNATURE_64 ('B','O','O','T','S','E','R','V')\r
+#define EFI_BOOT_SERVICES_REVISION    EFI_2_30_SYSTEM_TABLE_REVISION\r
 \r
 ///\r
-/// EFI Boot Services Table\r
+/// EFI Boot Services Table.\r
 ///\r
 typedef struct {\r
   ///\r
@@ -1769,7 +1884,7 @@ typedef struct {
 /// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the\r
 /// EFI System Table.\r
 ///\r
-typedef struct{\r
+typedef struct {\r
   ///\r
   /// The 128-bit GUID value that uniquely identifies the system configuration table.\r
   ///\r
@@ -1783,14 +1898,14 @@ typedef struct{
 ///\r
 /// EFI System Table\r
 ///\r
-struct _EFI_SYSTEM_TABLE {\r
+typedef struct {\r
   ///\r
   /// The table header for the EFI System Table.\r
   ///\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
@@ -1799,11 +1914,12 @@ struct _EFI_SYSTEM_TABLE {
   ///\r
   UINT32                            FirmwareRevision;\r
   ///\r
-  /// The handle for the active console input device.\r
+  /// The handle for the active console input device. This handle must support\r
+  /// EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.\r
   ///\r
   EFI_HANDLE                        ConsoleInHandle;\r
   ///\r
-  /// A pointer to the SIMPLE_INPUT_PROTOCOL interface that is\r
+  /// A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is\r
   /// associated with ConsoleInHandle.\r
   ///\r
   EFI_SIMPLE_TEXT_INPUT_PROTOCOL    *ConIn;\r
@@ -1812,16 +1928,17 @@ struct _EFI_SYSTEM_TABLE {
   ///\r
   EFI_HANDLE                        ConsoleOutHandle;\r
   ///\r
-  /// A pointer to the SIMPLE_TEXT_OUTPUT_PROTOCOL interface\r
+  /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface\r
   /// that is associated with ConsoleOutHandle.\r
   ///\r
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *ConOut;\r
   ///\r
   /// The handle for the active standard error console device.\r
+  /// This handle must support the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.\r
   ///\r
   EFI_HANDLE                        StandardErrorHandle;\r
   ///\r
-  /// A pointer to the SIMPLE_TEXT_OUTPUT_PROTOCOL interface\r
+  /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface\r
   /// that is associated with StandardErrorHandle.\r
   ///\r
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *StdErr;\r
@@ -1842,7 +1959,25 @@ struct _EFI_SYSTEM_TABLE {
   /// The number of entries in the table is NumberOfTableEntries.\r
   ///\r
   EFI_CONFIGURATION_TABLE           *ConfigurationTable;\r
-};\r
+} EFI_SYSTEM_TABLE;\r
+\r
+/**\r
+  This is the declaration of an EFI image entry point. This entry point is\r
+  the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r
+  both device drivers and bus drivers.\r
+\r
+  @param  ImageHandle           The firmware allocated handle for the UEFI image.\r
+  @param  SystemTable           A pointer to the EFI System Table.\r
+\r
+  @retval EFI_SUCCESS           The operation completed successfully.\r
+  @retval Others                An unexpected error occurred.\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
 // EFI Load Options Attributes\r
@@ -1859,43 +1994,84 @@ struct _EFI_SYSTEM_TABLE {
 #define EFI_BOOT_OPTION_SUPPORT_APP   0x00000002\r
 #define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300\r
 \r
+///\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
-    UINT32  SysReqPessed    : 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
-} HOT_KEY_EFI_KEY_DATA;\r
+} EFI_BOOT_KEY_DATA;\r
 \r
+///\r
+/// EFI Key Option.\r
+///\r
 typedef struct {\r
-  HOT_KEY_EFI_KEY_DATA  KeyOptions;\r
-  UINT32                BootOptionCrc;\r
-  UINT16                BootOption;\r
-//EFI_INPUT_KEY         Keys[];\r
+  ///\r
+  /// Specifies options about how the key will be processed.\r
+  ///\r
+  EFI_BOOT_KEY_DATA  KeyData;\r
+  ///\r
+  /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to\r
+  /// which BootOption refers. If the CRC-32s do not match this value, then this key\r
+  /// option is ignored.\r
+  ///\r
+  UINT32             BootOptionCrc;\r
+  ///\r
+  /// The Boot#### option which will be invoked if this key is pressed and the boot option\r
+  /// is active (LOAD_OPTION_ACTIVE is set).\r
+  ///\r
+  UINT16             BootOption;\r
+  ///\r
+  /// The key codes to compare against those returned by the\r
+  /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.\r
+  /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.\r
+  ///\r
+  //EFI_INPUT_KEY      Keys[];\r
 } EFI_KEY_OPTION;\r
 \r
-#define EFI_KEY_OPTION_SHIFT     0x00000001\r
-#define EFI_KEY_OPTION_CONTROL   0x00000002\r
-#define EFI_KEY_OPTION_ALT       0x00000004\r
-#define EFI_KEY_OPTION_LOGO      0x00000008\r
-#define EFI_KEY_OPTION_MENU      0x00000010\r
-#define EFI_KEY_OPTION_SYSREQ    0x00000020\r
-#define EFI_KEY_CODE_COUNT       0x00000300\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_ARM     L"\\EFI\\BOOT\\BOOTARM.EFI"\r
 \r
 #if   defined (MDE_CPU_IA32)\r
   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_IA32\r
@@ -1904,6 +2080,8 @@ typedef struct {
 #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
+#elif defined (MDE_CPU_ARM)\r
+  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_ARM\r
 #else\r
   #error Unknown Processor Type\r
 #endif\r