]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/IndustryStandard/Sal.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Sal.h
index 18225ba7b83bad88d98b1c7f0b16adc6535576c4..ae9c4c5263ebe432ac497ea82047be97bbd27379 100644 (file)
@@ -2,14 +2,8 @@
   Main SAL API's defined in Intel Itanium Processor Family System Abstraction\r
   Layer Specification Revision 3.2 (December 2003)\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 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 #define __SAL_API_H__\r
 \r
 ///\r
-/// SAL return status type \r
+/// SAL return status type\r
 ///\r
-typedef UINTN EFI_SAL_STATUS;\r
+typedef INTN EFI_SAL_STATUS;\r
 \r
 ///\r
-/// Call completed without error. \r
+/// Call completed without error.\r
 ///\r
 #define EFI_SAL_SUCCESS               ((EFI_SAL_STATUS) 0)\r
 ///\r
-/// Call completed without error but some information was lost due to overflow. \r
+/// Call completed without error, but some information was lost due to overflow.\r
 ///\r
 #define EFI_SAL_OVERFLOW              ((EFI_SAL_STATUS) 1)\r
 ///\r
@@ -34,7 +28,7 @@ typedef UINTN EFI_SAL_STATUS;
 ///\r
 #define EFI_SAL_WARM_BOOT_NEEDED      ((EFI_SAL_STATUS) 2)\r
 ///\r
-/// More information is available for retrieval. \r
+/// More information is available for retrieval.\r
 ///\r
 #define EFI_SAL_MORE_RECORDS          ((EFI_SAL_STATUS) 3)\r
 ///\r
@@ -46,15 +40,15 @@ typedef UINTN EFI_SAL_STATUS;
 ///\r
 #define EFI_SAL_INVALID_ARGUMENT      ((EFI_SAL_STATUS) - 2)\r
 ///\r
-/// Call completed without error. \r
+/// Call completed without error.\r
 ///\r
 #define EFI_SAL_ERROR                 ((EFI_SAL_STATUS) - 3)\r
 ///\r
-/// Virtual address not registered. \r
+/// Virtual address not registered.\r
 ///\r
 #define EFI_SAL_VIRTUAL_ADDRESS_ERROR ((EFI_SAL_STATUS) - 4)\r
 ///\r
-/// No information available. \r
+/// No information available.\r
 ///\r
 #define EFI_SAL_NO_INFORMATION        ((EFI_SAL_STATUS) - 5)\r
 ///\r
@@ -63,23 +57,23 @@ typedef UINTN EFI_SAL_STATUS;
 #define EFI_SAL_NOT_ENOUGH_SCRATCH    ((EFI_SAL_STATUS) - 9)\r
 \r
 ///\r
-/// Return registers from SAL\r
+/// Return registers from SAL.\r
 ///\r
 typedef struct {\r
   ///\r
-  /// SAL return status value in r8\r
+  /// SAL return status value in r8.\r
   ///\r
   EFI_SAL_STATUS  Status;\r
   ///\r
-  /// SAL returned value in r9\r
+  /// SAL returned value in r9.\r
   ///\r
   UINTN           r9;\r
   ///\r
-  /// SAL returned value in r10\r
+  /// SAL returned value in r10.\r
   ///\r
   UINTN           r10;\r
   ///\r
-  /// SAL returned value in r11\r
+  /// SAL returned value in r11.\r
   ///\r
   UINTN           r11;\r
 } SAL_RETURN_REGS;\r
@@ -87,20 +81,20 @@ typedef struct {
 /**\r
   Prototype of SAL procedures.\r
 \r
-  @param  Arg0               Functional identifier.\r
+  @param  FunctionId         Functional identifier.\r
                              The upper 32 bits are ignored and only the lower 32 bits\r
                              are used. The following functional identifiers are defined:\r
-                             0x01XXXXXX \96 Architected SAL functional group.\r
-                             0x02XXXXXX to 0x03XXXXXX \96 OEM SAL functional group. Each OEM is\r
+                             0x01XXXXXX - Architected SAL functional group.\r
+                             0x02XXXXXX to 0x03XXXXXX - OEM SAL functional group. Each OEM is\r
                              allowed to use the entire range in the 0x02XXXXXX to 0x03XXXXXX range.\r
-                             0x04XXXXXX to 0xFFFFFFFF \96 Reserved.\r
+                             0x04XXXXXX to 0xFFFFFFFF - Reserved.\r
   @param  Arg1               The first parameter of the architected/OEM specific SAL functions.\r
   @param  Arg2               The second parameter of the architected/OEM specific SAL functions.\r
-  @param  Arg3               The third parameter passed to the ESAL function based\r
-  @param  Arg4               The fourth parameter passed to the ESAL function based\r
-  @param  Arg5               The fifth parameter passed to the ESAL function based\r
-  @param  Arg6               The sixth parameter passed to the ESAL function\r
-  @param  Arg7               The seventh parameter passed to the ESAL function based\r
+  @param  Arg3               The third parameter passed to the ESAL function based.\r
+  @param  Arg4               The fourth parameter passed to the ESAL function based.\r
+  @param  Arg5               The fifth parameter passed to the ESAL function based.\r
+  @param  Arg6               The sixth parameter passed to the ESAL function.\r
+  @param  Arg7               The seventh parameter passed to the ESAL function based.\r
 \r
   @return r8                 Return status: positive number indicates successful,\r
                              negative number indicates failure.\r
@@ -111,15 +105,15 @@ typedef struct {
 **/\r
 typedef\r
 SAL_RETURN_REGS\r
-(EFIAPI *SAL_PROC) (\r
+(EFIAPI *SAL_PROC)(\r
   IN UINT64 FunctionId,\r
+  IN UINT64 Arg1,\r
   IN UINT64 Arg2,\r
   IN UINT64 Arg3,\r
   IN UINT64 Arg4,\r
   IN UINT64 Arg5,\r
   IN UINT64 Arg6,\r
-  IN UINT64 Arg7,\r
-  IN UINT64 Arg8\r
+  IN UINT64 Arg7\r
   );\r
 \r
 //\r
@@ -201,7 +195,7 @@ SAL_RETURN_REGS
 #define EFI_SAL_SET_INIT_VECTOR         0x1\r
 #define EFI_SAL_SET_BOOT_RENDEZ_VECTOR  0x2\r
 ///\r
-/// Format of length_cs_n argument.\r
+/// The format of a length_cs_n argument.\r
 ///\r
 typedef struct {\r
   UINT64  Length : 32;\r
@@ -213,7 +207,7 @@ typedef struct {
 \r
 //\r
 // Parameter of EFI_SAL_GET_STATE_INFO, EFI_SAL_GET_STATE_INFO_SIZE, and EFI_SAL_CLEAR_STATE_INFO\r
-// \r
+//\r
 // Type of information\r
 //\r
 #define EFI_SAL_MCA_STATE_INFO  0x0\r
@@ -267,7 +261,7 @@ typedef struct {
 #define EFI_SAL_PCI_COMPATIBLE_ADDRESS         0x0\r
 #define EFI_SAL_PCI_EXTENDED_REGISTER_ADDRESS  0x1\r
 ///\r
-/// Format of PCI Compatible Address\r
+/// The format of PCI Compatible Address.\r
 ///\r
 typedef struct {\r
   UINT64  Register : 8;\r
@@ -278,7 +272,7 @@ typedef struct {
   UINT64  Reserved : 32;\r
 } SAL_PCI_ADDRESS;\r
 ///\r
-/// Format of Extended Register Address\r
+/// The format of Extended Register Address.\r
 ///\r
 typedef struct {\r
   UINT64  Register : 8;\r
@@ -303,7 +297,7 @@ typedef struct {
 // Parameter and return value of EFI_SAL_UPDATE_PAL\r
 //\r
 // Return parameter provides additional information on the\r
-// failure when the status field contains a value of \963,\r
+// failure when the status field contains a value of -3,\r
 // returned in r9.\r
 //\r
 #define EFI_SAL_UPDATE_BAD_PAL_VERSION  ((UINT64) -1)\r
@@ -324,9 +318,10 @@ typedef struct {
   UINT8   Type;\r
   UINT8   Reserved[5];\r
   UINT64  FwVendorId;\r
+  UINT8   Reserved2[40];\r
 } SAL_UPDATE_PAL_DATA_BLOCK;\r
 ///\r
-/// Data structure pointed by parameter param_buf.\r
+/// Data structure pointed by the parameter param_buf.\r
 /// It is a 16-byte aligned data structure in memory with a length of 32 bytes\r
 /// that describes the new firmware. This information is organized in the form\r
 /// of a linked list with each element describing one firmware component.\r
@@ -339,12 +334,12 @@ typedef struct _SAL_UPDATE_PAL_INFO_BLOCK {
 } SAL_UPDATE_PAL_INFO_BLOCK;\r
 \r
 ///\r
-/// SAL System Table Definitions\r
+/// SAL System Table Definitions.\r
 ///\r
 #pragma pack(1)\r
 typedef struct {\r
   ///\r
-  /// The ASCII string representation of \93SST_\94, which confirms the presence of the table.\r
+  /// The ASCII string representation of "SST_" that confirms the presence of the table.\r
   ///\r
   UINT32  Signature;\r
   ///\r
@@ -354,7 +349,7 @@ typedef struct {
   UINT32  Length;\r
   ///\r
   /// The revision number of the Itanium Processor Family System Abstraction Layer\r
-  /// Specification supported by the SAL implementation in binary coded decimal (BCD) format.\r
+  /// Specification supported by the SAL implementation, in binary coded decimal (BCD) format.\r
   ///\r
   UINT16  SalRevision;\r
   ///\r
@@ -392,7 +387,6 @@ typedef struct {
   ///\r
   UINT8   Reserved2[8];\r
 } SAL_SYSTEM_TABLE_HEADER;\r
-#pragma pack()\r
 \r
 #define EFI_SAL_ST_HEADER_SIGNATURE "SST_"\r
 #define EFI_SAL_REVISION            0x0320\r
@@ -416,12 +410,11 @@ typedef struct {
 #define EFI_SAL_ST_PTC_SIZE                16\r
 #define EFI_SAL_ST_AP_WAKEUP_SIZE          16\r
 \r
-#pragma pack(1)\r
 ///\r
-/// Format Entrypoint Descriptor Entry\r
+/// Format of Entrypoint Descriptor Entry.\r
 ///\r
 typedef struct {\r
-  UINT8   Type;         ///< Type here should be 0\r
+  UINT8   Type;         ///< Type here should be 0.\r
   UINT8   Reserved[7];\r
   UINT64  PalProcEntry;\r
   UINT64  SalProcEntry;\r
@@ -429,16 +422,15 @@ typedef struct {
   UINT64  Reserved2[2];\r
 } SAL_ST_ENTRY_POINT_DESCRIPTOR;\r
 \r
-#pragma pack(1)\r
 ///\r
-/// Format Platform Features Descriptor Entry\r
+/// Format of Platform Features Descriptor Entry.\r
 ///\r
 typedef struct {\r
-  UINT8 Type;           ///< Type here should be 2\r
+  UINT8 Type;           ///< Type here should be 2.\r
   UINT8 PlatformFeatures;\r
   UINT8 Reserved[14];\r
 } SAL_ST_PLATFORM_FEATURES;\r
-#pragma pack()\r
+\r
 //\r
 // Value of Platform Feature List\r
 //\r
@@ -446,12 +438,11 @@ typedef struct {
 #define SAL_PLAT_FEAT_PLAT_IPI_HINT 0x02\r
 #define SAL_PLAT_FEAT_PROC_IPI_HINT 0x04\r
 \r
-#pragma pack(1)\r
 ///\r
-/// Format of Translation Register Descriptor Entry\r
+/// Format of Translation Register Descriptor Entry.\r
 ///\r
 typedef struct {\r
-  UINT8   Type;         ///< Type here should be 3\r
+  UINT8   Type;         ///< Type here should be 3.\r
   UINT8   TRType;\r
   UINT8   TRNumber;\r
   UINT8   Reserved[5];\r
@@ -459,49 +450,43 @@ typedef struct {
   UINT64  EncodedPageSize;\r
   UINT64  Reserved1;\r
 } SAL_ST_TR_DECRIPTOR;\r
-#pragma pack()\r
+\r
 //\r
 // Type of Translation Register\r
 //\r
 #define EFI_SAL_ST_TR_USAGE_INSTRUCTION 00\r
 #define EFI_SAL_ST_TR_USAGE_DATA        01\r
 \r
-#pragma pack(1)\r
 ///\r
-/// Definition of Coherence Domain Information\r
+/// Definition of Coherence Domain Information.\r
 ///\r
 typedef struct {\r
   UINT64  NumberOfProcessors;\r
   UINT64  LocalIDRegister;\r
 } SAL_COHERENCE_DOMAIN_INFO;\r
-#pragma pack()\r
 \r
-#pragma pack(1)\r
 ///\r
-/// Format of Purge Translation Cache Coherence Domain Entry\r
+/// Format of Purge Translation Cache Coherence Domain Entry.\r
 ///\r
 typedef struct {\r
-  UINT8                     Type;       ///< Type here should be 4\r
+  UINT8                     Type;       ///< Type here should be 4.\r
   UINT8                     Reserved[3];\r
   UINT32                    NumberOfDomains;\r
   SAL_COHERENCE_DOMAIN_INFO *DomainInformation;\r
 } SAL_ST_CACHE_COHERENCE_DECRIPTOR;\r
-#pragma pack()\r
 \r
-#pragma pack(1)\r
 ///\r
-/// Format of Application Processor Wake-Up Descriptor Entry\r
+/// Format of Application Processor Wake-Up Descriptor Entry.\r
 ///\r
 typedef struct {\r
-  UINT8   Type;                   ///< Type here should be 5\r
+  UINT8   Type;                   ///< Type here should be 5.\r
   UINT8   WakeUpType;\r
   UINT8   Reserved[6];\r
   UINT64  ExternalInterruptVector;\r
 } SAL_ST_AP_WAKEUP_DECRIPTOR;\r
-#pragma pack()\r
 \r
 ///\r
-/// Format of Firmware Interface Table (FIT) Entry\r
+/// Format of Firmware Interface Table (FIT) Entry.\r
 ///\r
 typedef struct {\r
   UINT64  Address;\r
@@ -513,7 +498,7 @@ typedef struct {
   UINT8   CheckSum;\r
 } EFI_SAL_FIT_ENTRY;\r
 //\r
-// FIT Types \r
+// FIT Types\r
 //\r
 #define EFI_SAL_FIT_FIT_HEADER_TYPE                0x00\r
 #define EFI_SAL_FIT_PAL_B_TYPE                     0x01\r
@@ -541,7 +526,7 @@ typedef struct {
 //\r
 \r
 ///\r
-/// Format of TimeStamp field in Record Header\r
+/// Format of TimeStamp field in Record Header.\r
 ///\r
 typedef struct {\r
   UINT8 Seconds;\r
@@ -554,7 +539,7 @@ typedef struct {
   UINT8 Century;\r
 } SAL_TIME_STAMP;\r
 ///\r
-/// Definition of Record Header\r
+/// Definition of Record Header.\r
 ///\r
 typedef struct {\r
   UINT64          RecordId;\r
@@ -566,7 +551,7 @@ typedef struct {
   UINT8           OemPlatformId[16];\r
 } SAL_RECORD_HEADER;\r
 ///\r
-/// Definition of Section Header\r
+/// Definition of Section Header.\r
 ///\r
 typedef struct {\r
   GUID      Guid;\r
@@ -577,7 +562,7 @@ typedef struct {
 } SAL_SEC_HEADER;\r
 \r
 ///\r
-/// GUID of Processor Machine Check Errors\r
+/// GUID of Processor Machine Check Errors.\r
 ///\r
 #define SAL_PROCESSOR_ERROR_RECORD_INFO \\r
   { \\r
@@ -592,7 +577,7 @@ typedef struct {
 #define TARGER_ID_VALID_BIT_MASK    0x8\r
 #define PRECISE_IP_VALID_BIT_MASK   0x10\r
 ///\r
-/// Definition of MOD_ERROR_INFO_STRUCT\r
+/// Definition of MOD_ERROR_INFO_STRUCT.\r
 ///\r
 typedef struct {\r
   UINT64  InfoValid : 1;\r
@@ -608,7 +593,7 @@ typedef struct {
   UINT64  Ip;\r
 } MOD_ERROR_INFO;\r
 ///\r
-/// Definition of CPUID_INFO_STRUCT\r
+/// Definition of CPUID_INFO_STRUCT.\r
 ///\r
 typedef struct {\r
   UINT8 CpuidInfo[40];\r
@@ -629,7 +614,7 @@ typedef struct {
 #define RR_VALID_BIT_MASK         0x10\r
 #define FR_VALID_BIT_MASK         0x20\r
 ///\r
-/// Definition of PSI_STATIC_STRUCT\r
+/// Definition of PSI_STATIC_STRUCT.\r
 ///\r
 typedef struct {\r
   UINT64    ValidFieldBits;\r
@@ -649,7 +634,7 @@ typedef struct {
 #define PROC_STATIC_STRUCT_VALID_BIT_MASK   0x8\r
 #define CPU_INFO_VALID_BIT_MASK             0x1000000\r
 ///\r
-/// Definition of Processor Machine Check Error Record\r
+/// Definition of Processor Machine Check Error Record.\r
 ///\r
 typedef struct {\r
   SAL_SEC_HEADER    SectionHeader;\r
@@ -667,7 +652,7 @@ typedef struct {
 } SAL_PROCESSOR_ERROR_RECORD;\r
 \r
 ///\r
-/// GUID of Platform Memory Device Error Info\r
+/// GUID of Platform Memory Device Error Info.\r
 ///\r
 #define SAL_MEMORY_ERROR_RECORD_INFO \\r
   { \\r
@@ -694,7 +679,7 @@ typedef struct {
 #define MEMORY_PLATFORM_OEM_ID_VALID_BIT_MASK             0x8000\r
 #define MEMORY_PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK    0x10000\r
 ///\r
-/// Definition of Platform Memory Device Error Info Record\r
+/// Definition of Platform Memory Device Error Info Record.\r
 ///\r
 typedef struct {\r
   SAL_SEC_HEADER  SectionHeader;\r
@@ -718,7 +703,7 @@ typedef struct {
 } SAL_MEMORY_ERROR_RECORD;\r
 \r
 ///\r
-/// GUID of Platform PCI Bus Error Info\r
+/// GUID of Platform PCI Bus Error Info.\r
 ///\r
 #define SAL_PCI_BUS_ERROR_RECORD_INFO \\r
   { \\r
@@ -739,12 +724,16 @@ typedef struct {
 #define PCI_BUS_OEM_ID_VALID_BIT_MASK           0x200\r
 #define PCI_BUS_OEM_DATA_STRUCT_VALID_BIT_MASK  0x400\r
 \r
+///\r
+/// Designated PCI Bus identifier.\r
+///\r
 typedef struct {\r
   UINT8 BusNumber;\r
   UINT8 SegmentNumber;\r
 } PCI_BUS_ID;\r
+\r
 ///\r
-/// Definition of Platform PCI Bus Error Info Record\r
+/// Definition of Platform PCI Bus Error Info Record.\r
 ///\r
 typedef struct {\r
   SAL_SEC_HEADER  SectionHeader;\r
@@ -763,7 +752,7 @@ typedef struct {
 } SAL_PCI_BUS_ERROR_RECORD;\r
 \r
 ///\r
-/// GUID of Platform PCI Component Error Info\r
+/// GUID of Platform PCI Component Error Info.\r
 ///\r
 #define SAL_PCI_COMP_ERROR_RECORD_INFO \\r
   { \\r
@@ -779,7 +768,7 @@ typedef struct {
 #define PCI_COMP_REG_DATA_PAIR_VALID_BIT_MASK   0x10\r
 #define PCI_COMP_OEM_DATA_STRUCT_VALID_BIT_MASK 0x20\r
 ///\r
-/// Format of PCI Component Information to identify the device\r
+/// Format of PCI Component Information to identify the device.\r
 ///\r
 typedef struct {\r
   UINT16  VendorId;\r
@@ -792,7 +781,7 @@ typedef struct {
   UINT8   Reserved[5];\r
 } PCI_COMP_INFO;\r
 ///\r
-/// Definition of Platform PCI Component Error Info\r
+/// Definition of Platform PCI Component Error Info.\r
 ///\r
 typedef struct {\r
   SAL_SEC_HEADER  SectionHeader;\r
@@ -805,7 +794,7 @@ typedef struct {
 } SAL_PCI_COMPONENT_ERROR_RECORD;\r
 \r
 ///\r
-/// Platform SEL Device Error Info\r
+/// Platform SEL Device Error Info.\r
 ///\r
 #define SAL_SEL_DEVICE_ERROR_RECORD_INFO \\r
   { \\r
@@ -825,7 +814,7 @@ typedef struct {
 #define SEL_EVENT_DATA2_VALID_BIT_MASK    0x100;\r
 #define SEL_EVENT_DATA3_VALID_BIT_MASK    0x200;\r
 ///\r
-/// Definition of Platform SEL Device Error Info Record\r
+/// Definition of Platform SEL Device Error Info Record.\r
 ///\r
 typedef struct {\r
   SAL_SEC_HEADER  SectionHeader;\r
@@ -844,7 +833,7 @@ typedef struct {
 } SAL_SEL_DEVICE_ERROR_RECORD;\r
 \r
 ///\r
-/// GUID of Platform SMBIOS Device Error Info\r
+/// GUID of Platform SMBIOS Device Error Info.\r
 ///\r
 #define SAL_SMBIOS_ERROR_RECORD_INFO \\r
   { \\r
@@ -858,7 +847,7 @@ typedef struct {
 #define SMBIOS_TIME_STAMP_VALID_BIT_MASK  0x4\r
 #define SMBIOS_DATA_VALID_BIT_MASK        0x8\r
 ///\r
-/// Definition of Platform SMBIOS Device Error Info Record\r
+/// Definition of Platform SMBIOS Device Error Info Record.\r
 ///\r
 typedef struct {\r
   SAL_SEC_HEADER  SectionHeader;\r
@@ -869,7 +858,7 @@ typedef struct {
 } SAL_SMBIOS_DEVICE_ERROR_RECORD;\r
 \r
 ///\r
-/// GUID of Platform Specific Error Info\r
+/// GUID of Platform Specific Error Info.\r
 ///\r
 #define SAL_PLATFORM_ERROR_RECORD_INFO \\r
   { \\r
@@ -887,7 +876,7 @@ typedef struct {
 #define PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK 0x40\r
 #define PLATFORM_OEM_DEVICE_PATH_VALID_BIT_MASK 0x80\r
 ///\r
-/// Definition of Platform Specific Error Info Record\r
+/// Definition of Platform Specific Error Info Record.\r
 ///\r
 typedef struct {\r
   SAL_SEC_HEADER  SectionHeader;\r
@@ -901,7 +890,7 @@ typedef struct {
 } SAL_PLATFORM_SPECIFIC_ERROR_RECORD;\r
 \r
 ///\r
-/// Union of all the possible SAL Error Record Types\r
+/// Union of all the possible SAL Error Record Types.\r
 ///\r
 typedef union {\r
   SAL_RECORD_HEADER                   *RecordHeader;\r