/** @file
Include file for definitions in the Intel Platform Innovation Framework for EFI
System Management Mode Core Interface Specification (SMM CIS) version 0.91.
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _SMM_CIS_H_
#define _SMM_CIS_H_
//
// Share some common definitions with PI SMM
//
#include <Pi/PiSmmCis.h>
#include <Protocol/SmmCpuIo.h>
//
// SMM Base specification constant and types
//
/**
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 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. Otherwise, undefined.
@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 named EFI_SMM_ALLOCATE_POOL.
To avoid a naming conflict, the definition is renamed.
**/
typedef
);
/**
Returns pool memory to the system.
@param Buffer The pointer to the buffer to free.
@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 Framework Spec, this definition is named EFI_SMM_FREE_POOL.
To avoid a naming conflict, the definition is renamed.
**/
typedef
);
/**
Allocates memory pages from the system.
@param Type The type of allocation to perform.
@param MemoryType The only supported type is EfiRuntimeServicesData.
@param NumberofPages The number of contiguous 4 KB pages to allocate.
@param Memory Pointer to a physical address. On input, the way in which
the address is used depends on the value of Type. On output, the address
is set to the base of the page range that was allocated.
@retval EFI_SUCCESS The requested pages were allocated.
@retval EFI_OUT_OF_RESOURCES The pages requested could not be allocated.
@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
);
/**
Frees memory pages for the system.
@param Memory The base physical address of the pages to be freed.
@param NumberOfPages The number of contiguous 4 KB pages to free.
@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
);
///
/// 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.
///
///
/// The location of the processor SMBASE, which is the location where the processor
/// will pass control upon receipt of an SMI.
///
///
/// The revision of the SMM save state. This value is set by the processor.
///
///
/// The value of the I/O restart field. Allows for restarting an in-process I/O instruction.
///
///
/// Describes behavior that should be commenced in response to a halt instruction.
///
///
/// Reserved for future processors. As such, software should not attempt to interpret or
/// write to this region.
///
//
// Registers in IA-32 processors.
//
///
/// 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 {
// application registers
// control registers
// debug registers
// virtual registers
///
/// 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.
///
///
/// Note: Inconsistency with the Framework SMM CIS spec - Itanium save state not included.
///
/// The processor save-state information for Itanium processors.
///
/// EFI_PMI_SYSTEM_CONTEXT ItaniumSaveState;
///
/// 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 {
///
/// 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 {
///
/// 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.
///
///
/// The optional floating point save-state information for Itanium processors.
///
/**
This function is the main entry point for an SMM handler dispatch
or communicate-based callback.
@param SmmImageHandle A unique value returned by the SMM infrastructure
in response to registration for a communicate-based callback or dispatch.
@param CommunicationBuffer
An optional buffer that will be populated
by the SMM infrastructure in response to a non-SMM agent (preboot or runtime)
invoking the EFI_SMM_BASE_PROTOCOL.Communicate() service.
@param SourceSize If CommunicationBuffer is non-NULL, this field
indicates the size of the data payload in this buffer.
@return Status Code
**/
typedef
);
/**
The SmmInstallConfigurationTable() function is used to maintain the list
of configuration tables that are stored in the System Management System
Table. The list is stored as an array of (GUID, Pointer) pairs. The list
must be allocated from pool memory with PoolType set to EfiRuntimeServicesData.
@param SystemTable A pointer to the SMM System Table.
@param Guid A pointer to the GUID for the entry to add, update, or remove.
@param Table A pointer to the buffer of the table to add.
@param TableSize The size of the table to install.
@retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.
@retval EFI_INVALID_PARAMETER Guid is not valid.
@retval EFI_NOT_FOUND An attempt was made to delete a non-existent entry.
@retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.
**/
typedef
);
//
// System Management System Table (SMST)
//
struct _EFI_SMM_SYSTEM_TABLE {
///
/// The table header for the System Management System Table (SMST).
///
///
/// A pointer to a NULL-terminated Unicode string containing the vendor name. It is
/// permissible for this pointer to be NULL.
///
///
/// The particular revision of the firmware.
///
///
/// Adds, updates, or removes a configuration table entry from the SMST.
///
//
// I/O Services
//
///
/// A GUID that designates the particular CPU I/O services.
///
///
/// Provides the basic memory and I/O interfaces that are used to abstract accesses to
/// devices.
///
//
// Runtime memory service
//
///
///
/// Allocates pool memory from SMRAM for IA-32 or runtime memory for the
/// Itanium processor family.
///
///
/// Returns pool memory to the system.
///
///
/// Allocates memory pages from the system.
///
///
/// Frees memory pages for the system.
///
//
// MP service
//
/// Inconsistent with specification here:
/// In Framework Spec, this definition does not exist. This method is introduced in PI1.1 specification for
/// the implementation needed.
//
// 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.
///
///
/// The number of EFI Configuration Tables in the buffer
/// SmmConfigurationTable.
///
///
/// A pointer to the EFI Configuration Tables. The number of entries in the table is
/// NumberOfTableEntries.
///
///
/// 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.
///
//
// Extensibility table
//
///
/// The number of EFI Configuration Tables in the buffer
/// SmmConfigurationTable.
///
///
/// A pointer to the EFI Configuration Tables. The number of entries in the table is
/// NumberOfTableEntries.
///
};
#endif