X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=IntelFrameworkPkg%2FInclude%2FFramework%2FSmmCis.h;h=708e4b1c59ba2f25ab7499d370b6cd1abe3483b8;hb=5259c97d7ac7f464c134c3a15186b30e8e8eadff;hp=c246b8366b01192269fe0606e386032b1b95785e;hpb=f55d5b188e7b8e434c4a07d1cc566cd23d3f2246;p=mirror_edk2.git diff --git a/IntelFrameworkPkg/Include/Framework/SmmCis.h b/IntelFrameworkPkg/Include/Framework/SmmCis.h index c246b8366b..708e4b1c59 100644 --- a/IntelFrameworkPkg/Include/Framework/SmmCis.h +++ b/IntelFrameworkPkg/Include/Framework/SmmCis.h @@ -1,7 +1,8 @@ /** @file - Include file matches things in the Smm CIS spec. + Include file for definitions in the Intel Platform Innovation Framework for EFI + System Management Mode Core Interface Specification (SMM CIS) version 0.90. - Copyright (c) 2007, Intel Corporation + Copyright (c) 2007 - 2009, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -10,17 +11,10 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - Module Name: FrameworkSmmCis.h - - @par Revision Reference: - VOLUME 4: Platform Initialization Specification,System Management Mode Core Interface, Version 1.1. - **/ -#ifndef _FRAMEWORK_SMM_CIS_H_ -#define _FRAMEWORK_SMM_CIS_H_ - -#include +#ifndef _SMM_CIS_H_ +#define _SMM_CIS_H_ #define EFI_SMM_CPU_IO_GUID \ { \ @@ -57,8 +51,8 @@ typedef enum { @param Width Signifies the width of the I/O operations. @param Address The base address of the I/O operations. @param Count The number of I/O operations to perform. - @param Buffer For read operations, the destination buffer to store the results. - For write operations, the source buffer from which to write data. + @param Buffer For read operations, the destination buffer to store the results (out parameter). + For write operations, the source buffer from which to write data (in parameter). @retval EFI_SUCCESS The data was read from or written to the device. @retval EFI_UNSUPPORTED The Address is not valid for this system. @@ -77,12 +71,22 @@ EFI_STATUS ); typedef struct { - EFI_SMM_CPU_IO Read; - EFI_SMM_CPU_IO Write; + EFI_SMM_CPU_IO Read; ///< This service provides the various modalities of memory and I/O read. + EFI_SMM_CPU_IO Write; ///< This service provides the various modalities of memory and I/O write. } EFI_SMM_IO_ACCESS; +/// +/// The EFI_SMM_CPU_IO_INTERFACE service provides the basic memory, I/O, and PCI +/// interfaces that are used to abstract accesses to devices. +/// struct _EFI_SMM_CPU_IO_INTERFACE { + /// + /// Allows reads and writes to memory-mapped I/O space. + /// EFI_SMM_IO_ACCESS Mem; + /// + /// Allows reads and writes to I/O space. + /// EFI_SMM_IO_ACCESS Io; }; @@ -90,7 +94,7 @@ struct _EFI_SMM_CPU_IO_INTERFACE { Allocates pool memory from SMRAM for IA-32 or runtime memory for the Itanium processor family. - @param PoolType The type of pool to allocate.The only supported type is EfiRuntimeServicesData + @param PoolType The type of pool to allocate. The only supported type is EfiRuntimeServicesData @param Size The number of bytes to allocate from the pool. @param Buffer A pointer to a pointer to the allocated buffer if the call succeeds; undefined otherwise. @@ -98,7 +102,9 @@ struct _EFI_SMM_CPU_IO_INTERFACE { @retval EFI_SUCCESS The requested number of bytes was allocated. @retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated. @retval EFI_UNSUPPORTED In runtime. - + @note: Inconsistent with specification here: + In Framework Spec, This definition is naming EFI_SMM_ALLOCATE_POOL. However, + To avoid the naming conflict, the definition is renamed. **/ typedef EFI_STATUS @@ -116,7 +122,9 @@ EFI_STATUS @retval EFI_SUCCESS The memory was returned to the system. @retval EFI_INVALID_PARAMETER Buffer was invalid. @retval EFI_UNSUPPORTED In runtime. - + @note: Inconsistent with specification here: + In the Framework Spec, this definition is named EFI_SMM_FREE_POOL. + To avoid a naming conflict, the definition here is renamed. **/ typedef EFI_STATUS @@ -139,7 +147,9 @@ EFI_STATUS @retval EFI_NOT_FOUND The requested pages could not be found. @retval EFI_INVALID_PARAMETER Type is not AllocateAnyPages or AllocateMaxAddress or AllocateAddress. Or MemoryType is in the range EfiMaxMemoryType..0x7FFFFFFF. - + @note: Inconsistent with specification here: + In the Framework Spec, this definition is named EFI_SMM_ALLOCATE_PAGES. + To avoid a naming conflict, the definition here is renamed. **/ typedef EFI_STATUS @@ -159,7 +169,10 @@ EFI_STATUS @retval EFI_SUCCESS The requested memory pages were freed. @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or NumberOfPages is invalid. @retval EFI_NOT_FOUND The requested memory pages were not allocated with SmmAllocatePages(). - + + @note: Inconsistent with specification here: + In the Framework Spec, this definition is named EFI_SMM_FREE_PAGES. + To avoid a naming conflict, the definition here is renamed. **/ typedef EFI_STATUS @@ -168,21 +181,70 @@ EFI_STATUS IN UINTN NumberOfPages ); +/** + Frees memory pages for the system. + + @param Procedure A pointer to the code stream to be run on the designated AP of the system. + @param CpuNumber The zero-based index of the processor number of the AP on which the code stream is + supposed to run. If the processor number points to the current processor or a disabled + processor, then it will not run the supplied code. + @param ProcArguments Allows the caller to pass a list of parameters to the code that is run by + the AP. It is an optional common mailbox between APs and the BSP to share information. + + @retval EFI_SUCCESS The call was successful and the return parameters are valid. + @retval EFI_INVALID_PARAMETER The input arguments are out of range. + @retval EFI_INVALID_PARAMETER The CPU requested is not available on this SMI invocation. + @retval EFI_INVALID_PARAMETER The CPU cannot support an additional service invocation. + + @note: Inconsistent with specification here: + In Framework Spec, this definition does not exist. This method is introduced in PI1.0 spec for + implementation needs. + +**/ typedef EFI_STATUS (EFIAPI *EFI_SMM_STARTUP_THIS_AP)( - IN EFI_AP_PROCEDURE Procedure, + IN FRAMEWORK_EFI_AP_PROCEDURE Procedure, IN UINTN CpuNumber, IN OUT VOID *ProcArguments OPTIONAL ); +/// +/// The processor save-state information for IA-32 processors. This information is important in that the +/// SMM drivers may need to ascertain the state of the processor before invoking the SMI. +/// typedef struct { + /// + /// Reserved for future processors. As such, software should not attempt to interpret or + /// write to this region. + /// UINT8 Reserved1[248]; + /// + /// The location of the processor SMBASE, which is the location where the processor + /// will pass control upon receipt of an SMI. + /// UINT32 SMBASE; + /// + /// The revision of the SMM save state. This value is set by the processor. + /// UINT32 SMMRevId; + /// + /// The value of the I/O restart field. Allows for restarting an in-process I/O instruction. + /// UINT16 IORestart; + /// + /// Describes behavior that should be commenced in response to a halt instruction. + /// UINT16 AutoHALTRestart; + /// + /// Reserved for future processors. As such, software should not attempt to interpret or + /// write to this region. + /// UINT8 Reserved2[164]; + + // + // Registers in IA-32 processors. + // UINT32 ES; UINT32 CS; UINT32 SS; @@ -207,6 +269,11 @@ typedef struct { UINT32 CR0; } EFI_SMI_CPU_SAVE_STATE; +/// +/// The processor save-state information for the Itanium processor family. This information is +/// important in that the SMM drivers may need to ascertain the state of the processor before invoking +/// the PMI. This structure is mandatory and must be 512 byte aligned. +/// typedef struct { UINT64 reserved; UINT64 r1; @@ -317,11 +384,26 @@ typedef struct { } EFI_PMI_SYSTEM_CONTEXT; +/// +/// The processor save-state information for IA-32 and Itanium processors. This information is +/// important in that the SMM drivers may need to ascertain the state of the processor before invoking +/// the SMI or PMI. +/// typedef union { + /// + /// The processor save-state information for IA-32 processors. + /// EFI_SMI_CPU_SAVE_STATE Ia32SaveState; + /// + /// The processor save-state information for Itanium processors. + /// EFI_PMI_SYSTEM_CONTEXT ItaniumSaveState; } EFI_SMM_CPU_SAVE_STATE; +/// +/// The optional floating point save-state information for IA-32 processors. If the optional floating +/// point save is indicated for any handler, the following data structure must be preserved. +/// typedef struct { UINT16 Fcw; UINT16 Fsw; @@ -344,6 +426,10 @@ typedef struct { UINT8 Rsvd11[22*16]; } EFI_SMI_OPTIONAL_FPSAVE_STATE; +/// +/// The optional floating point save-state information for the Itanium processor family. If the optional +/// floating point save is indicated for any handler, then this data structure must be preserved. +/// typedef struct { UINT64 f2[2]; UINT64 f3[2]; @@ -377,8 +463,18 @@ typedef struct { UINT64 f31[2]; } EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT; +/// +/// The processor save-state information for IA-32 and Itanium processors. If the optional floating +/// point save is indicated for any handler, then this data structure must be preserved. +/// typedef union { + /// + /// The optional floating point save-state information for IA-32 processors. + /// EFI_SMI_OPTIONAL_FPSAVE_STATE Ia32FpSave; + /// + /// The optional floating point save-state information for Itanium processors. + /// EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT ItaniumFpSave; } EFI_SMM_FLOATING_POINT_SAVE_STATE; @@ -436,44 +532,111 @@ EFI_STATUS // System Management System Table (SMST) // struct _EFI_SMM_SYSTEM_TABLE { + /// + /// The table header for the System Management System Table (SMST). + /// EFI_TABLE_HEADER Hdr; + /// + /// A pointer to a NULL-terminated Unicode string containing the vendor name. It is + /// permissible for this pointer to be NULL. + /// CHAR16 *SmmFirmwareVendor; + /// + /// The particular revision of the firmware. + /// UINT32 SmmFirmwareRevision; + /// + /// Adds, updates, or removes a configuration table entry from the SMST. + /// EFI_SMM_INSTALL_CONFIGURATION_TABLE SmmInstallConfigurationTable; // // I/O Services // + /// + /// A GUID that designates the particular CPU I/O services. + /// EFI_GUID EfiSmmCpuIoGuid; + /// + /// Provides the basic memory and I/O interfaces that are used to abstract accesses to + /// devices. + /// EFI_SMM_CPU_IO_INTERFACE SmmIo; // // Runtime memory service // + /// + /// + /// Allocates pool memory from SMRAM for IA-32 or runtime memory for the + /// Itanium processor family. + /// EFI_SMMCORE_ALLOCATE_POOL SmmAllocatePool; + /// + /// Returns pool memory to the system. + /// EFI_SMMCORE_FREE_POOL SmmFreePool; + /// + /// Allocates memory pages from the system. + /// EFI_SMMCORE_ALLOCATE_PAGES SmmAllocatePages; + /// + /// Frees memory pages for the system. + /// EFI_SMMCORE_FREE_PAGES SmmFreePages; // // MP service // + + ///Inconsistent with specification here: + /// In Framework Spec, this definition does not exist. This method is introduced in PI1.0 spec for + /// implementation needed. EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp; // // CPU information records // + /// + /// A 1-relative number between 1 and the NumberOfCpus field. This field designates + /// which processor is executing the SMM infrastructure. This number also serves as an + /// index into the CpuSaveState and CpuOptionalFloatingPointState + /// fields. + /// UINTN CurrentlyExecutingCpu; + /// + /// The number of EFI Configuration Tables in the buffer + /// SmmConfigurationTable. + /// UINTN NumberOfCpus; + /// + /// A pointer to the EFI Configuration Tables. The number of entries in the table is + /// NumberOfTableEntries. + /// EFI_SMM_CPU_SAVE_STATE *CpuSaveState; + /// + /// A pointer to a catenation of the EFI_SMM_FLOATING_POINT_SAVE_STATE. + /// The size of this entire table is NumberOfCpus* size of the + /// EFI_SMM_FLOATING_POINT_SAVE_STATE. These fields are populated only if + /// there is at least one SMM driver that has registered for a callback with the + /// FloatingPointSave field in EFI_SMM_BASE_PROTOCOL.RegisterCallback() set to TRUE. + /// EFI_SMM_FLOATING_POINT_SAVE_STATE *CpuOptionalFloatingPointState; // // Extensibility table // + /// + /// The number of EFI Configuration Tables in the buffer + /// SmmConfigurationTable. + /// UINTN NumberOfTableEntries; + /// + /// A pointer to the EFI Configuration Tables. The number of entries in the table is + /// NumberOfTableEntries. + /// EFI_CONFIGURATION_TABLE *SmmConfigurationTable; };