From 88ab69a3f25d0013afb6a60a45a4b163d8d83f26 Mon Sep 17 00:00:00 2001 From: mdkinney Date: Thu, 14 Jan 2010 04:22:06 +0000 Subject: Put Framework SMM CPU I/O Protocol into its own .h file and add the GUID for this protocol to the DEC file. Some definitions are shared between the Framework SMM CPU I/O Protocol and the PI SMM CPU I/O 2 Protocol, so SmmCpuIo.h include SmmCpuIo2.h from the MdePkg git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9736 6f19259b-4bc3-4df7-8a09-765794883524 --- IntelFrameworkPkg/Include/Framework/SmmCis.h | 53 ---------------- IntelFrameworkPkg/Include/Protocol/SmmCpuIo.h | 88 +++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 53 deletions(-) create mode 100644 IntelFrameworkPkg/Include/Protocol/SmmCpuIo.h (limited to 'IntelFrameworkPkg/Include') diff --git a/IntelFrameworkPkg/Include/Framework/SmmCis.h b/IntelFrameworkPkg/Include/Framework/SmmCis.h index 7fa9884a72..6021802969 100644 --- a/IntelFrameworkPkg/Include/Framework/SmmCis.h +++ b/IntelFrameworkPkg/Include/Framework/SmmCis.h @@ -22,67 +22,14 @@ #include #include -#define EFI_SMM_CPU_IO_GUID \ - { \ - 0x5f439a0b, 0x45d8, 0x4682, {0xa4, 0xf4, 0xf0, 0x57, 0x6b, 0x51, 0x34, 0x41 } \ - } - typedef struct _EFI_SMM_SYSTEM_TABLE EFI_SMM_SYSTEM_TABLE; typedef struct _EFI_SMM_CPU_IO_INTERFACE EFI_SMM_CPU_IO_INTERFACE; - // // SMM Base specification constant and types // #define EFI_SMM_SYSTEM_TABLE_REVISION (0 << 16) | (0x09) -/** - Provides the basic memory and I/O interfaces that are used to - abstract accesses to devices. - - @param This The EFI_SMM_CPU_IO_INTERFACE instance. - @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 (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. - @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SMM_CPU_IO)( - IN EFI_SMM_CPU_IO_INTERFACE *This, - IN EFI_SMM_IO_WIDTH Width, - IN UINT64 Address, - IN UINTN Count, - IN OUT VOID *Buffer - ); - -typedef struct { - 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; -}; - /** Allocates pool memory from SMRAM for IA-32 or runtime memory for the Itanium processor family. diff --git a/IntelFrameworkPkg/Include/Protocol/SmmCpuIo.h b/IntelFrameworkPkg/Include/Protocol/SmmCpuIo.h new file mode 100644 index 0000000000..158f216efb --- /dev/null +++ b/IntelFrameworkPkg/Include/Protocol/SmmCpuIo.h @@ -0,0 +1,88 @@ +/** @file + SMM CPU I/O protocol as defined in the Intel Framework specification. + + This protocol provides CPU I/O and memory access within SMM. + + Copyright (c) 2009 - 2010, 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 + http://opensource.org/licenses/bsd-license.php + + 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_CPU_IO_H_ +#define _SMM_CPU_IO_H_ + +#include + +#define EFI_SMM_CPU_IO_GUID \ + { \ + 0x5f439a0b, 0x45d8, 0x4682, {0xa4, 0xf4, 0xf0, 0x57, 0x6b, 0x51, 0x34, 0x41} \ + } + +typedef struct _EFI_SMM_CPU_IO_INTERFACE EFI_SMM_CPU_IO_INTERFACE; + +/** + Provides the basic memory and I/O interfaces used to abstract accesses to devices. + + The I/O operations are carried out exactly as requested. The caller is + responsible for any alignment and I/O width issues that the bus, device, + platform, or type of I/O might require. + + @param[in] This The EFI_SMM_CPU_IO_INTERFACE instance. + @param[in] Width Signifies the width of the I/O operations. + @param[in] Address The base address of the I/O operations. The caller is + responsible for aligning the Address if required. + @param[in] Count The number of I/O operations to perform. + @param[in,out] Buffer For read operations, the destination buffer to store + the results. For write operations, the source buffer + from which to write data. + + @retval EFI_SUCCESS The data was read from or written to the device. + @retval EFI_UNSUPPORTED The Address is not valid for this system. + @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. + @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack + of resources. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMM_CPU_IO)( + IN EFI_SMM_CPU_IO_INTERFACE *This, + IN EFI_SMM_IO_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ); + +typedef struct { + /// + /// This service provides the various modalities of memory and I/O read. + /// + EFI_SMM_CPU_IO Read; + /// + /// This service provides the various modalities of memory and I/O write. + /// + EFI_SMM_CPU_IO Write; +} EFI_SMM_IO_ACCESS; + +/// +/// SMM CPU I/O Protocol provides CPU I/O and memory access within SMM. +/// +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; +}; + +extern EFI_GUID gEfiSmmCpuIoGuid; + +#endif -- cgit v1.2.3