]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkPkg/Include/Framework/SmmCis.h
IntelFrameworkPkg: Clean up source files
[mirror_edk2.git] / IntelFrameworkPkg / Include / Framework / SmmCis.h
index b8fce5494e2e0ac4dd8b39d1c12a19deb969061c..6b47334aa19cc7fdf7b3e2eb8986d33dff972631 100644 (file)
 /** @file\r
   Include file for definitions in the Intel Platform Innovation Framework for EFI\r
-  System Management Mode Core Interface Specification (SMM CIS) version 0.90.\r
+  System Management Mode Core Interface Specification (SMM CIS) version 0.91.\r
 \r
-  Copyright (c) 2007 - 2009, 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
+Copyright (c) 2007 - 2018, 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
+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
 #ifndef _SMM_CIS_H_\r
 #define _SMM_CIS_H_\r
 \r
-#define EFI_SMM_CPU_IO_GUID \\r
-  { \\r
-    0x5f439a0b, 0x45d8, 0x4682, {0xa4, 0xf4, 0xf0, 0x57, 0x6b, 0x51, 0x34, 0x41 } \\r
-  }\r
+//\r
+// Share some common definitions with PI SMM\r
+//\r
+#include <Pi/PiSmmCis.h>\r
+#include <Protocol/SmmCpuIo.h>\r
 \r
 typedef struct _EFI_SMM_SYSTEM_TABLE      EFI_SMM_SYSTEM_TABLE;\r
-typedef struct _EFI_SMM_CPU_IO_INTERFACE  EFI_SMM_CPU_IO_INTERFACE;\r
-\r
 \r
 //\r
 // SMM Base specification constant and types\r
 //\r
-#define SMM_SMST_SIGNATURE            SIGNATURE_32 ('S', 'M', 'S', 'T')\r
 #define EFI_SMM_SYSTEM_TABLE_REVISION (0 << 16) | (0x09)\r
 \r
-//\r
-// *******************************************************\r
-// EFI_SMM_IO_WIDTH\r
-// *******************************************************\r
-//\r
-typedef enum {\r
-  SMM_IO_UINT8  = 0,\r
-  SMM_IO_UINT16 = 1,\r
-  SMM_IO_UINT32 = 2,\r
-  SMM_IO_UINT64 = 3\r
-} EFI_SMM_IO_WIDTH;\r
-\r
-/**\r
-  Provides the basic memory and I/O interfaces that are used to\r
-  abstract accesses to devices.\r
-\r
-  @param  This             The EFI_SMM_CPU_IO_INTERFACE instance.\r
-  @param  Width            Signifies the width of the I/O operations.\r
-  @param  Address          The base address of the I/O operations.\r
-  @param  Count            The number of I/O operations to perform.\r
-  @param  Buffer           For read operations, the destination buffer to store the results (out parameter).\r
-                           For write operations, the source buffer from which to write data (in parameter).\r
-\r
-  @retval EFI_SUCCESS           The data was read from or written to the device.\r
-  @retval EFI_UNSUPPORTED       The Address is not valid for this system.\r
-  @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.\r
-  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_SMM_CPU_IO)(\r
-  IN EFI_SMM_CPU_IO_INTERFACE         *This,\r
-  IN EFI_SMM_IO_WIDTH                 Width,\r
-  IN UINT64                           Address,\r
-  IN UINTN                            Count,\r
-  IN OUT VOID                         *Buffer\r
-  );\r
-\r
-typedef struct {\r
-  EFI_SMM_CPU_IO  Read;  ///< This service provides the various modalities of memory and I/O read.\r
-  EFI_SMM_CPU_IO  Write; ///< This service provides the various modalities of memory and I/O write.\r
-} EFI_SMM_IO_ACCESS;\r
-\r
-///\r
-/// The EFI_SMM_CPU_IO_INTERFACE service provides the basic memory, I/O, and PCI\r
-/// interfaces that are used to abstract accesses to devices.\r
-///\r
-struct _EFI_SMM_CPU_IO_INTERFACE {\r
-  ///\r
-  /// Allows reads and writes to memory-mapped I/O space. \r
-  ///\r
-  EFI_SMM_IO_ACCESS Mem;\r
-  ///\r
-  /// Allows reads and writes to I/O space. \r
-  ///\r
-  EFI_SMM_IO_ACCESS Io;\r
-};\r
-\r
 /**\r
-  Allocates pool memory from SMRAM for IA-32 or runtime memory for\r
+  Allocates pool memory from SMRAM for IA-32, or runtime memory for\r
   the Itanium processor family.\r
 \r
-  @param  PoolType         The type of pool to allocate. The only supported type is EfiRuntimeServicesData\r
+  @param  PoolType         The type of pool to allocate. The only supported type\r
+                           is EfiRuntimeServicesData.\r
   @param  Size             The number of bytes to allocate from the pool.\r
-  @param  Buffer           A pointer to a pointer to the allocated buffer if the call\r
-                           succeeds; undefined otherwise.\r
+  @param  Buffer           A pointer to a pointer to the allocated buffer if the\r
+                           call succeeds.  Otherwise, undefined.\r
 \r
   @retval EFI_SUCCESS           The requested number of bytes was allocated.\r
   @retval EFI_OUT_OF_RESOURCES  The pool requested could not be allocated.\r
   @retval EFI_UNSUPPORTED       In runtime.\r
-  @note: Inconsistent with specification here:\r
-         In Framework Spec, this definition is named EFI_SMM_ALLOCATE_POOL.  \r
+  @note  Inconsistent with specification here:\r
+         In Framework Spec, this definition is named EFI_SMM_ALLOCATE_POOL.\r
          To avoid a naming conflict, the definition is renamed.\r
 **/\r
 typedef\r
@@ -117,14 +57,14 @@ 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
   @retval EFI_UNSUPPORTED       In runtime.\r
-  @note: Inconsistent with specification here:\r
-         In Framework Spec, this definition is named EFI_SMM_FREE_POOL.  \r
-         To avoid a naming conflict, the definition is renamed. \r
+  @note  Inconsistent with specification here:\r
+         In Framework Spec, this definition is named EFI_SMM_FREE_POOL.\r
+         To avoid a naming conflict, the definition is renamed.\r
 **/\r
 typedef\r
 EFI_STATUS\r
@@ -136,8 +76,8 @@ EFI_STATUS
   Allocates memory pages from the system.\r
 \r
   @param  Type             The type of allocation to perform.\r
-  @param  MemoryType       The only supported type is EfiRuntimeServicesData\r
-  @param  NumberofPages    The number of contiguous 4 KB pages to allocate\r
+  @param  MemoryType       The only supported type is EfiRuntimeServicesData.\r
+  @param  NumberofPages    The number of contiguous 4 KB pages to allocate.\r
   @param  Memory           Pointer to a physical address. On input, the way in which\r
                            the address is used depends on the value of Type. On output, the address\r
                            is set to the base of the page range that was allocated.\r
@@ -146,9 +86,9 @@ EFI_STATUS
   @retval EFI_OUT_OF_RESOURCES  The pages requested could not be allocated.\r
   @retval EFI_NOT_FOUND         The requested pages could not be found.\r
   @retval EFI_INVALID_PARAMETER Type is not AllocateAnyPages or AllocateMaxAddress\r
-                                or AllocateAddress. Or MemoryType is in the range EfiMaxMemoryType..0x7FFFFFFF.\r
-  @note: Inconsistent with specification here:\r
-         In the Framework Spec, this definition is named EFI_SMM_ALLOCATE_PAGES.  \r
+                                or AllocateAddress. Or, MemoryType is in the range EfiMaxMemoryType..0x7FFFFFFF.\r
+  @note  Inconsistent with specification here:\r
+         In the Framework Spec, this definition is named EFI_SMM_ALLOCATE_PAGES.\r
          To avoid a naming conflict, the definition here is renamed.\r
 **/\r
 typedef\r
@@ -163,15 +103,15 @@ EFI_STATUS
 /**\r
   Frees memory pages for the system.\r
 \r
-  @param  Memory           The base physical address of the pages to be freed\r
+  @param  Memory           The base physical address of the pages to be freed.\r
   @param  NumberOfPages    The number of contiguous 4 KB pages to free.\r
 \r
   @retval EFI_SUCCESS           The requested memory pages were freed.\r
   @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or NumberOfPages is invalid.\r
   @retval EFI_NOT_FOUND         The requested memory pages were not allocated with SmmAllocatePages().\r
-  \r
-  @note: Inconsistent with specification here:\r
-         In the Framework Spec, this definition is named EFI_SMM_FREE_PAGES.  \r
+\r
+  @note  Inconsistent with specification here:\r
+         In the Framework Spec, this definition is named EFI_SMM_FREE_PAGES.\r
          To avoid a naming conflict, the definition here is renamed.\r
 **/\r
 typedef\r
@@ -181,35 +121,6 @@ EFI_STATUS
   IN UINTN                  NumberOfPages\r
   );\r
 \r
-/**\r
-  Lets the caller get one distinct application processor (AP) in the enabled processor pool to execite a \r
-  caller-provided code stream while in SMM. \r
-\r
-  @param  Procedure         A pointer to the code stream to be run on the designated AP of the system.\r
-  @param  CpuNumber         The zero-based index of the processor number of the AP on which the code stream is\r
-                            supposed to run. If the processor number points to the current processor or a disabled\r
-                            processor, then it will not run the supplied code.\r
-  @param  ProcArguments     Allows the caller to pass a list of parameters to the code that is run by\r
-                            the AP. It is an optional common mailbox between APs and the BSP to share information.\r
-\r
-  @retval EFI_SUCCESS           The call was successful and the return parameters are valid.\r
-  @retval EFI_INVALID_PARAMETER The input arguments are out of range.\r
-  @retval EFI_INVALID_PARAMETER The CPU requested is not available on this SMI invocation.\r
-  @retval EFI_INVALID_PARAMETER The CPU cannot support an additional service invocation.\r
-  \r
-  @note: Inconsistent with specification here:\r
-         In Framework Spec, this definition does not exist. This method is introduced in PI1.0 spec for \r
-         implementation needs.\r
-         \r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_SMM_STARTUP_THIS_AP)(\r
-  IN  FRAMEWORK_EFI_AP_PROCEDURE          Procedure,\r
-  IN  UINTN                               CpuNumber,\r
-  IN  OUT VOID                            *ProcArguments OPTIONAL\r
-  );\r
-\r
 ///\r
 /// The processor save-state information for IA-32 processors. This information is important in that the\r
 /// SMM drivers may need to ascertain the state of the processor before invoking the SMI.\r
@@ -244,7 +155,7 @@ typedef struct {
   UINT8                 Reserved2[164];\r
 \r
   //\r
-  // Registers in IA-32 processors. \r
+  // Registers in IA-32 processors.\r
   //\r
   UINT32                ES;\r
   UINT32                CS;\r
@@ -274,7 +185,7 @@ typedef struct {
 /// The processor save-state information for the Itanium processor family. This information is\r
 /// important in that the SMM drivers may need to ascertain the state of the processor before invoking\r
 /// the PMI. This structure is mandatory and must be 512 byte aligned.\r
-/// \r
+///\r
 typedef struct {\r
   UINT64   reserved;\r
   UINT64   r1;\r
@@ -392,13 +303,15 @@ typedef struct {
 ///\r
 typedef union {\r
   ///\r
-  /// The processor save-state information for IA-32 processors. \r
+  /// The processor save-state information for IA-32 processors.\r
   ///\r
   EFI_SMI_CPU_SAVE_STATE     Ia32SaveState;\r
   ///\r
+  /// Note: Inconsistency with the Framework SMM CIS spec - Itanium save state not included.\r
+  ///\r
   /// The processor save-state information for Itanium processors.\r
   ///\r
-  EFI_PMI_SYSTEM_CONTEXT     ItaniumSaveState;\r
+  /// EFI_PMI_SYSTEM_CONTEXT ItaniumSaveState;\r
 } EFI_SMM_CPU_SAVE_STATE;\r
 \r
 ///\r
@@ -429,8 +342,8 @@ typedef struct {
 \r
 ///\r
 /// The optional floating point save-state information for the Itanium processor family. If the optional\r
-/// floating point save is indicated for any handler, then this data structure must be preserved. \r
-/// \r
+/// floating point save is indicated for any handler, then this data structure must be preserved.\r
+///\r
 typedef struct {\r
   UINT64   f2[2];\r
   UINT64   f3[2];\r
@@ -469,12 +382,12 @@ typedef struct {
 /// point save is indicated for any handler, then this data structure must be preserved.\r
 ///\r
 typedef union {\r
-  /// \r
-  /// The optional floating point save-state information for IA-32 processors. \r
+  ///\r
+  /// The optional floating point save-state information for IA-32 processors.\r
   ///\r
   EFI_SMI_OPTIONAL_FPSAVE_STATE             Ia32FpSave;\r
   ///\r
-  /// The optional floating point save-state information for Itanium processors. \r
+  /// The optional floating point save-state information for Itanium processors.\r
   ///\r
   EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT   ItaniumFpSave;\r
 } EFI_SMM_FLOATING_POINT_SAVE_STATE;\r
@@ -534,7 +447,7 @@ EFI_STATUS
 //\r
 struct _EFI_SMM_SYSTEM_TABLE {\r
   ///\r
-  /// The table header for the System Management System Table (SMST). \r
+  /// The table header for the System Management System Table (SMST).\r
   ///\r
   EFI_TABLE_HEADER                    Hdr;\r
 \r
@@ -549,7 +462,7 @@ struct _EFI_SMM_SYSTEM_TABLE {
   UINT32                              SmmFirmwareRevision;\r
 \r
   ///\r
-  /// Adds, updates, or removes a configuration table entry from the SMST. \r
+  /// Adds, updates, or removes a configuration table entry from the SMST.\r
   ///\r
   EFI_SMM_INSTALL_CONFIGURATION_TABLE SmmInstallConfigurationTable;\r
 \r
@@ -557,7 +470,7 @@ struct _EFI_SMM_SYSTEM_TABLE {
   // I/O Services\r
   //\r
   ///\r
-  /// A GUID that designates the particular CPU I/O services. \r
+  /// A GUID that designates the particular CPU I/O services.\r
   ///\r
   EFI_GUID                            EfiSmmCpuIoGuid;\r
   ///\r
@@ -576,11 +489,11 @@ struct _EFI_SMM_SYSTEM_TABLE {
   ///\r
   EFI_SMMCORE_ALLOCATE_POOL           SmmAllocatePool;\r
   ///\r
-  /// Returns pool memory to the system. \r
+  /// Returns pool memory to the system.\r
   ///\r
   EFI_SMMCORE_FREE_POOL               SmmFreePool;\r
   ///\r
-  /// Allocates memory pages from the system. \r
+  /// Allocates memory pages from the system.\r
   ///\r
   EFI_SMMCORE_ALLOCATE_PAGES          SmmAllocatePages;\r
   ///\r
@@ -591,10 +504,10 @@ struct _EFI_SMM_SYSTEM_TABLE {
   //\r
   // MP service\r
   //\r
-  \r
-  ///Inconsistent with specification here:\r
-  ///  In Framework Spec, this definition does not exist. This method is introduced in PI1.1 spec for \r
-  ///  implementation needed.\r
+\r
+  /// Inconsistent with specification here:\r
+  ///  In Framework Spec, this definition does not exist. This method is introduced in PI1.1 specification for\r
+  ///  the implementation needed.\r
   EFI_SMM_STARTUP_THIS_AP             SmmStartupThisAp;\r
 \r
   //\r