]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Uefi/UefiSpec.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Uefi / UefiSpec.h
index 57cb4e804f703e7e21c1cf6ca1b23b3aa65386ab..fca8df6751f1ec47e57948eb1419646d0e12e673 100644 (file)
@@ -1,18 +1,12 @@
 /** @file\r
   Include file that supports UEFI.\r
 \r
-  This include file must contain things defined in the UEFI 2.6 specification.\r
-  If a code construct is defined in the UEFI 2.6 specification it must be included\r
+  This include file must contain things defined in the UEFI 2.7 specification.\r
+  If a code construct is defined in the UEFI 2.7 specification it must be included\r
   by this include file.\r
 \r
-Copyright (c) 2006 - 2016, 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
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -35,7 +29,7 @@ typedef enum {
   ///\r
   AllocateAnyPages,\r
   ///\r
-  /// Allocate any available range of pages whose uppermost address is less than \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
@@ -79,7 +73,7 @@ typedef enum {
 #define EFI_MEMORY_XP               0x0000000000004000ULL\r
 #define EFI_MEMORY_RO               0x0000000000020000ULL\r
 //\r
-// Physical memory persistence attribute. \r
+// Physical memory persistence attribute.\r
 // The memory region supports byte-addressable non-volatility.\r
 //\r
 #define EFI_MEMORY_NV               0x0000000000008000ULL\r
@@ -103,26 +97,33 @@ typedef enum {
 ///\r
 typedef struct {\r
   ///\r
-  /// Type of the memory region.  See EFI_MEMORY_TYPE.\r
+  /// Type of the memory region.\r
+  /// Type EFI_MEMORY_TYPE is defined in the\r
+  /// AllocatePages() function description.\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
+  /// Physical address of the first byte in the memory region. PhysicalStart must be\r
+  /// aligned on a 4 KiB boundary, and must not be above 0xfffffffffffff000. Type\r
+  /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function description\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
+  /// Virtual address of the first byte in the memory region.\r
+  /// VirtualStart must be aligned on a 4 KiB boundary,\r
+  /// and must not be above 0xfffffffffffff000.\r
   ///\r
   EFI_VIRTUAL_ADDRESS   VirtualStart;\r
   ///\r
-  /// Number of 4KB pages in the memory region.\r
+  /// NumberOfPagesNumber of 4 KiB pages in the memory region.\r
+  /// NumberOfPages must not be 0, and must not be any value\r
+  /// that would represent a memory page with a start address,\r
+  /// either physical or virtual, above 0xfffffffffffff000.\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
+  /// for that memory region, and not necessarily the current settings for that\r
   /// memory region.\r
   ///\r
   UINT64                Attribute;\r
@@ -306,8 +307,8 @@ EFI_STATUS
   @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
-  @retval EFI_SECURITY_VIOLATION \r
-                                The user has no permission to start UEFI device drivers on the device path \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
@@ -654,7 +655,8 @@ EFI_STATUS
 /**\r
   Enumerates the current variable names.\r
 \r
-  @param[in, out]  VariableNameSize The size of the VariableName buffer.\r
+  @param[in, out]  VariableNameSize The size of the VariableName buffer. The size must be large\r
+                                    enough to fit input string supplied in VariableName buffer.\r
   @param[in, out]  VariableName     On input, supplies the last VariableName that was returned\r
                                     by GetNextVariableName(). On output, returns the Nullterminated\r
                                     string of the current variable.\r
@@ -665,9 +667,14 @@ EFI_STATUS
   @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
+                                VariableNameSize has been updated with the size needed to complete the request.\r
   @retval EFI_INVALID_PARAMETER VariableNameSize is NULL.\r
   @retval EFI_INVALID_PARAMETER VariableName is NULL.\r
   @retval EFI_INVALID_PARAMETER VendorGuid is NULL.\r
+  @retval EFI_INVALID_PARAMETER The input values of VariableName and VendorGuid are not a name and\r
+                                GUID of an existing variable.\r
+  @retval EFI_INVALID_PARAMETER Null-terminator is not found in the first VariableNameSize bytes of\r
+                                the input VariableName buffer.\r
   @retval EFI_DEVICE_ERROR      The variable could not be retrieved due to a hardware error.\r
 \r
 **/\r
@@ -688,15 +695,14 @@ EFI_STATUS
                                  then EFI_INVALID_PARAMETER is returned.\r
   @param[in]  VendorGuid         A unique identifier for the vendor.\r
   @param[in]  Attributes         Attributes bitmask to set for the variable.\r
-  @param[in]  DataSize           The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE, \r
-                                 EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, or \r
-                                 EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero \r
-                                 causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is \r
-                                 set, then a SetVariable() call with a DataSize of zero will not cause any change to \r
-                                 the variable value (the timestamp associated with the variable may be updated however \r
-                                 even if no new data value is provided,see the description of the \r
-                                 EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not \r
-                                 be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated). \r
+  @param[in]  DataSize           The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE or\r
+                                 EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero\r
+                                 causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is\r
+                                 set, then a SetVariable() call with a DataSize of zero will not cause any change to\r
+                                 the variable value (the timestamp associated with the variable may be updated however\r
+                                 even if no new data value is provided,see the description of the\r
+                                 EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not\r
+                                 be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated).\r
   @param[in]  Data               The contents for the variable.\r
 \r
   @retval EFI_SUCCESS            The firmware has successfully stored the variable and its data as\r
@@ -708,10 +714,9 @@ EFI_STATUS
   @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 written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS \r
-                                 or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo \r
-                                 does NOT pass the validation check carried out by the firmware.\r
-  \r
+  @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set,\r
+                                 but the AuthInfo does NOT pass the validation check carried out by the firmware.\r
+\r
   @retval EFI_NOT_FOUND          The variable trying to be updated or deleted was not found.\r
 \r
 **/\r
@@ -859,10 +864,10 @@ 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
-  @retval EFI_ACCESS_DENIED      Image was not loaded because the platform policy prohibits the \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
+  @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
@@ -901,15 +906,15 @@ EFI_STATUS
 /**\r
   Terminates a loaded EFI image and returns control to boot services.\r
 \r
-  @param[in]  ImageHandle       Handle that identifies the image. This parameter is passed to the \r
+  @param[in]  ImageHandle       Handle that identifies the image. This parameter is passed to the\r
                                 image on entry.\r
   @param[in]  ExitStatus        The image's exit code.\r
   @param[in]  ExitDataSize      The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS.\r
   @param[in]  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
+                                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
@@ -1013,6 +1018,9 @@ EFI_STATUS
                                 valid if ResetStatus is something other than EFI_SUCCESS\r
                                 unless the ResetType is EfiResetPlatformSpecific\r
                                 where a minimum amount of ResetData is always required.\r
+                                For a ResetType of EfiResetPlatformSpecific the data buffer\r
+                                also starts with a Null-terminated string that is followed\r
+                                by an EFI_GUID that describes the specific type of reset to perform.\r
 **/\r
 typedef\r
 VOID\r
@@ -1440,7 +1448,7 @@ typedef enum {
   ///\r
   ByRegisterNotify,\r
   ///\r
-  /// Retrieve the set of handles from the handle database that support a \r
+  /// Retrieve the set of handles from the handle database that support a\r
   /// specified protocol.\r
   ///\r
   ByProtocol\r
@@ -1565,6 +1573,7 @@ EFI_STATUS
   @retval EFI_NOT_FOUND         No protocol instances were found that match Protocol and\r
                                 Registration.\r
   @retval EFI_INVALID_PARAMETER Interface is NULL.\r
+                                Protocol is NULL.\r
 \r
 **/\r
 typedef\r
@@ -1668,10 +1677,10 @@ typedef struct {
   @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_UNSUPPORTED       The capsule type is not supported on this platform.\r
-  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has been previously called this error indicates the capsule \r
-                                is compatible with this platform but is not capable of being submitted or processed \r
+  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has been previously called this error indicates the capsule\r
+                                is compatible with this platform but is not capable of being submitted or processed\r
                                 in runtime. The caller may resubmit the capsule prior to ExitBootServices().\r
-  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates \r
+  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates\r
                                 the capsule is compatible with this platform but there are insufficient resources to process.\r
 \r
 **/\r
@@ -1699,10 +1708,10 @@ EFI_STATUS
   @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
-  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has been previously called this error indicates the capsule \r
-                                is compatible with this platform but is not capable of being submitted or processed \r
+  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has been previously called this error indicates the capsule\r
+                                is compatible with this platform but is not capable of being submitted or processed\r
                                 in runtime. The caller may resubmit the capsule prior to ExitBootServices().\r
-  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates \r
+  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates\r
                                 the capsule is compatible with this platform but there are insufficient resources to process.\r
 \r
 **/\r
@@ -1760,6 +1769,7 @@ EFI_STATUS
 // EFI Runtime Services Table\r
 //\r
 #define EFI_SYSTEM_TABLE_SIGNATURE      SIGNATURE_64 ('I','B','I',' ','S','Y','S','T')\r
+#define EFI_2_70_SYSTEM_TABLE_REVISION  ((2 << 16) | (70))\r
 #define EFI_2_60_SYSTEM_TABLE_REVISION  ((2 << 16) | (60))\r
 #define EFI_2_50_SYSTEM_TABLE_REVISION  ((2 << 16) | (50))\r
 #define EFI_2_40_SYSTEM_TABLE_REVISION  ((2 << 16) | (40))\r
@@ -1770,7 +1780,7 @@ EFI_STATUS
 #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_60_SYSTEM_TABLE_REVISION\r
+#define EFI_SYSTEM_TABLE_REVISION       EFI_2_70_SYSTEM_TABLE_REVISION\r
 #define EFI_SPECIFICATION_VERSION       EFI_SYSTEM_TABLE_REVISION\r
 \r
 #define EFI_RUNTIME_SERVICES_SIGNATURE  SIGNATURE_64 ('R','U','N','T','S','E','R','V')\r
@@ -2174,8 +2184,6 @@ typedef struct {
 \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
@@ -2187,6 +2195,11 @@ typedef struct {
   #error Unknown Processor Type\r
 #endif\r
 \r
+//\r
+// The directory within the active EFI System Partition defined for delivery of capsule to firmware\r
+//\r
+#define EFI_CAPSULE_FILE_DIRECTORY            L"\\EFI\\UpdateCapsule\\"\r
+\r
 #include <Uefi/UefiPxe.h>\r
 #include <Uefi/UefiGpt.h>\r
 #include <Uefi/UefiInternalFormRepresentation.h>\r