From 5879b8754ac3c2e7a141bac79f6b2391e6ac0441 Mon Sep 17 00:00:00 2001 From: yshang1 Date: Wed, 13 Jun 2007 11:11:23 +0000 Subject: [PATCH] Add PPI definitions introduced in PI1.0. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2650 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Ppi/BootInRecoveryMode.h | 33 + MdePkg/Include/Ppi/CpuIo.h | 472 ++++++++++ MdePkg/Include/Ppi/Decompress.h | 80 ++ MdePkg/Include/Ppi/DxeIpl.h | 68 ++ MdePkg/Include/Ppi/EndOfPeiPhase.h | 32 + MdePkg/Include/Ppi/FirmwareVolume.h | 268 ++++++ MdePkg/Include/Ppi/FirmwareVolumeInfo.h | 69 ++ MdePkg/Include/Ppi/GuidedSectionExtraction.h | 134 +++ MdePkg/Include/Ppi/LoadFile.h | 149 ++++ MdePkg/Include/Ppi/LoadImage.h | 53 ++ MdePkg/Include/Ppi/MasterBootMode.h | 34 + MdePkg/Include/Ppi/MemoryDiscovered.h | 34 + MdePkg/Include/Ppi/Pcd.h | 865 +++++++++++++++++++ MdePkg/Include/Ppi/PciCfg2.h | 158 ++++ MdePkg/Include/Ppi/ReadOnlyVariable2.h | 137 +++ MdePkg/Include/Ppi/Reset.h | 35 + MdePkg/Include/Ppi/SecPlatformInformation.h | 88 ++ MdePkg/Include/Ppi/Security.h | 73 ++ MdePkg/Include/Ppi/Smbus2.h | 243 ++++++ MdePkg/Include/Ppi/Stall.h | 69 ++ MdePkg/Include/Ppi/StatusCode.h | 42 + MdePkg/Include/Ppi/TemporaryRamSupport.h | 67 ++ 22 files changed, 3203 insertions(+) create mode 100644 MdePkg/Include/Ppi/BootInRecoveryMode.h create mode 100644 MdePkg/Include/Ppi/CpuIo.h create mode 100644 MdePkg/Include/Ppi/Decompress.h create mode 100644 MdePkg/Include/Ppi/DxeIpl.h create mode 100644 MdePkg/Include/Ppi/EndOfPeiPhase.h create mode 100644 MdePkg/Include/Ppi/FirmwareVolume.h create mode 100644 MdePkg/Include/Ppi/FirmwareVolumeInfo.h create mode 100644 MdePkg/Include/Ppi/GuidedSectionExtraction.h create mode 100644 MdePkg/Include/Ppi/LoadFile.h create mode 100644 MdePkg/Include/Ppi/LoadImage.h create mode 100644 MdePkg/Include/Ppi/MasterBootMode.h create mode 100644 MdePkg/Include/Ppi/MemoryDiscovered.h create mode 100644 MdePkg/Include/Ppi/Pcd.h create mode 100644 MdePkg/Include/Ppi/PciCfg2.h create mode 100644 MdePkg/Include/Ppi/ReadOnlyVariable2.h create mode 100644 MdePkg/Include/Ppi/Reset.h create mode 100644 MdePkg/Include/Ppi/SecPlatformInformation.h create mode 100644 MdePkg/Include/Ppi/Security.h create mode 100644 MdePkg/Include/Ppi/Smbus2.h create mode 100644 MdePkg/Include/Ppi/Stall.h create mode 100644 MdePkg/Include/Ppi/StatusCode.h create mode 100644 MdePkg/Include/Ppi/TemporaryRamSupport.h diff --git a/MdePkg/Include/Ppi/BootInRecoveryMode.h b/MdePkg/Include/Ppi/BootInRecoveryMode.h new file mode 100644 index 0000000000..2ffe2d80e5 --- /dev/null +++ b/MdePkg/Include/Ppi/BootInRecoveryMode.h @@ -0,0 +1,33 @@ +/** @file + This PPI is installed by the platform PEIM to designate that a recovery boot + is in progress. + + Copyright (c) 2006, 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. + + Module Name: BootInRecoveryMode.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.0. + +**/ + +#ifndef __BOOT_IN_RECOVERY_MODE_PPI_H__ +#define __BOOT_IN_RECOVERY_MODE_PPI_H__ + +#define EFI_PEI_BOOT_IN_RECOVERY_MODE_PEIM_PPI \ + { \ + 0x17ee496a, 0xd8e4, 0x4b9a, {0x94, 0xd1, 0xce, 0x82, 0x72, 0x30, 0x8, 0x50 } \ + } + + +extern EFI_GUID gEfiPeiBootInRecoveryModePpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/CpuIo.h b/MdePkg/Include/Ppi/CpuIo.h new file mode 100644 index 0000000000..bf3d5f7036 --- /dev/null +++ b/MdePkg/Include/Ppi/CpuIo.h @@ -0,0 +1,472 @@ +/** @file + This file declares CPU IO PPI that abstracts CPU IO access + + Copyright (c) 2006, 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. + + Module Name: CpuIo.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.0. + +**/ + +#ifndef __PEI_CPUIO_PPI_H__ +#define __PEI_CPUIO_PPI_H__ + +#define EFI_PEI_CPU_IO_PPI_INSTALLED_GUID \ + { 0xe6af1f7b, 0xfc3f, 0x46da, {0xa8, 0x28, 0xa3, 0xb4, 0x57, 0xa4, 0x42, 0x82 } } + +typedef struct _EFI_PEI_CPU_IO_PPI EFI_PEI_CPU_IO_PPI; + +// +// ******************************************************* +// EFI_PEI_CPU_IO_PPI_WIDTH +// ******************************************************* +// +typedef enum { + EfiPeiCpuIoWidthUint8, + EfiPeiCpuIoWidthUint16, + EfiPeiCpuIoWidthUint32, + EfiPeiCpuIoWidthUint64, + EfiPeiCpuIoWidthFifoUint8, + EfiPeiCpuIoWidthFifoUint16, + EfiPeiCpuIoWidthFifoUint32, + EfiPeiCpuIoWidthFifoUint64, + EfiPeiCpuIoWidthFillUint8, + EfiPeiCpuIoWidthFillUint16, + EfiPeiCpuIoWidthFillUint32, + EfiPeiCpuIoWidthFillUint64, + EfiPeiCpuIoWidthMaximum +} EFI_PEI_CPU_IO_PPI_WIDTH; + +/** + Memory-based access services and I/O-based access services. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Width The width of the access. Enumerated in bytes. + @param Address The physical address of the access. + @param Count The number of accesses to perform. + @param Buffer A pointer to the buffer of data. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_NOT_YET_AVAILABLE The service has not been installed. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_MEM) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN EFI_PEI_CPU_IO_PPI_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ); + +// +// ******************************************************* +// EFI_PEI_CPU_IO_PPI_ACCESS +// ******************************************************* +// +typedef struct { + EFI_PEI_CPU_IO_PPI_IO_MEM Read; + EFI_PEI_CPU_IO_PPI_IO_MEM Write; +} EFI_PEI_CPU_IO_PPI_ACCESS; + +/** + 8-bit I/O read operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + + @return UINT8 + +**/ +typedef +UINT8 +(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ8) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address + ); + +/** + 16-bit I/O read operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + + @return UINT16 + +**/ +typedef +UINT16 +(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ16) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address + ); + +/** + 32-bit I/O read operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + + @return UINT32 + +**/ +typedef +UINT32 +(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ32) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address + ); + +/** + 64-bit I/O read operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + + @return UINT64 + +**/ +typedef +UINT64 +(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ64) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address + ); + +/** + 8-bit I/O write operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + @param Data The data to write. + + @return None + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE8) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address, + IN UINT8 Data + ); + +/** + 16-bit I/O write operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + @param Data The data to write. + + @return None + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE16) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address, + IN UINT16 Data + ); + +/** + 32-bit I/O write operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + @param Data The data to write. + + @return None + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE32) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address, + IN UINT32 Data + ); + +/** + 64-bit I/O write operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + @param Data The data to write. + + @return None + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE64) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address, + IN UINT64 Data + ); + +/** + 8-bit Memory read operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + + @return UINT8 + +**/ +typedef +UINT8 +(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ8) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address + ); + +/** + 16-bit Memory read operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + + @return UINT16 + +**/ +typedef +UINT16 +(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ16) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address + ); + +/** + 32-bit Memory read operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + + @return UINT32 + +**/ +typedef +UINT32 +(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ32) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address + ); + +/** + 64-bit Memory read operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + + @return UINT64 + +**/ +typedef +UINT64 +(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ64) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address + ); + +/** + 8-bit Memory write operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + @param Data The data to write. + + @return None + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE8) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address, + IN UINT8 Data + ); + +/** + 16-bit Memory write operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + @param Data The data to write. + + @return None + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE16) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address, + IN UINT16 Data + ); + +/** + 32-bit Memory write operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + @param Data The data to write. + + @return None + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE32) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address, + IN UINT32 Data + ); + +/** + 64-bit Memory write operations. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + @param This Pointer to local data for the interface. + @param Address The physical address of the access. + @param Data The data to write. + + @return None + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE64) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_CPU_IO_PPI *This, + IN UINT64 Address, + IN UINT64 Data + ); + +/** + @par Ppi Description: + EFI_PEI_CPU_IO_PPI provides a set of memory and I/O-based services. + The perspective of the services is that of the processor, not the bus or system. + + @param Mem + Collection of memory-access services. + + @param I/O + Collection of I/O-access services. + + @param IoRead8 + 8-bit read service. + + @param IoRead16 + 16-bit read service. + + @param IoRead32 + 32-bit read service. + + @param IoRead64 + 64-bit read service. + + @param IoWrite8 + 8-bit write service. + + @param IoWrite16 + 16-bit write service. + + @param IoWrite32 + 32-bit write service. + + @param IoWrite64 + 64-bit write service. + + @param MemRead8 + 8-bit read service. + + @param MemRead16 + 16-bit read service. + + @param MemRead32 + 32-bit read service. + + @param MemRead64 + 64-bit read service. + + @param MemWrite8 + 8-bit write service. + + @param MemWrite16 + 16-bit write service. + + @param MemWrite32 + 32-bit write service. + + @param MemWrite64 + 64-bit write service. + +**/ +struct _EFI_PEI_CPU_IO_PPI { + EFI_PEI_CPU_IO_PPI_ACCESS Mem; + EFI_PEI_CPU_IO_PPI_ACCESS Io; + EFI_PEI_CPU_IO_PPI_IO_READ8 IoRead8; + EFI_PEI_CPU_IO_PPI_IO_READ16 IoRead16; + EFI_PEI_CPU_IO_PPI_IO_READ32 IoRead32; + EFI_PEI_CPU_IO_PPI_IO_READ64 IoRead64; + EFI_PEI_CPU_IO_PPI_IO_WRITE8 IoWrite8; + EFI_PEI_CPU_IO_PPI_IO_WRITE16 IoWrite16; + EFI_PEI_CPU_IO_PPI_IO_WRITE32 IoWrite32; + EFI_PEI_CPU_IO_PPI_IO_WRITE64 IoWrite64; + EFI_PEI_CPU_IO_PPI_MEM_READ8 MemRead8; + EFI_PEI_CPU_IO_PPI_MEM_READ16 MemRead16; + EFI_PEI_CPU_IO_PPI_MEM_READ32 MemRead32; + EFI_PEI_CPU_IO_PPI_MEM_READ64 MemRead64; + EFI_PEI_CPU_IO_PPI_MEM_WRITE8 MemWrite8; + EFI_PEI_CPU_IO_PPI_MEM_WRITE16 MemWrite16; + EFI_PEI_CPU_IO_PPI_MEM_WRITE32 MemWrite32; + EFI_PEI_CPU_IO_PPI_MEM_WRITE64 MemWrite64; +}; + +extern EFI_GUID gEfiPeiCpuIoPpiInServiceTableGuid; + +#endif diff --git a/MdePkg/Include/Ppi/Decompress.h b/MdePkg/Include/Ppi/Decompress.h new file mode 100644 index 0000000000..21ef964c59 --- /dev/null +++ b/MdePkg/Include/Ppi/Decompress.h @@ -0,0 +1,80 @@ +/* @file + Provides decompression services to the PEI Foundatoin. + + Copyright (c) 2006, 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. + + Module Name: Decompress.h + + @par Revision Reference: + This PPI is defined in PI Version 1.00. + +**/ + +#ifndef __DECOMPRESS_PPI_H__ +#define __DECOMPRESS_PPI_H__ + +#define EFI_PEI_DECOMPRESS_PPI_GUID \ + { 0x1a36e4e7, 0xfab6, 0x476a, { 0x8e, 0x75, 0x69, 0x5a, 0x5, 0x76, 0xfd, 0xd7 } } + +typedef struct _EFI_PEI_DECOMPRESS_PPI EFI_PEI_DECOMPRESS_PPI;; + +/** + Decompresses the data in a compressed section and returns it + as a series of standard PI Firmware File Sections. The + required memory is allocated from permanent memory. + + @param This Points to this instance of the + EFI_PEI_DECOMPRESS_PEI PPI. InputSection Points to + the compressed section. + + @param OutputBuffer Holds the returned pointer to the + decompressed sections. + + @param OutputSize Holds the returned size of the decompress + section streams. + + @retval EFI_SUCCESS The section was decompressed + successfully. OutputBuffer contains the + resulting data and OutputSize contains + the resulting size. + + @retval EFI_OUT_OF_RESOURCES Unable to allocate sufficient + memory to hold the decompressed data. + + @retval EFI_UNSUPPORTED The compression type specified + in the compression header is unsupported. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_DECOMPRESS_DECOMPRESS)( + IN CONST EFI_PEI_DECOMPRESS_PPI *This, + IN CONST EFI_COMPRESSION_SECTION *InputSection, + OUT VOID **OutputBuffer, + OUT UINTN *OutputSize +); + + +/** + This PPI¡¯s single member function decompresses a compression + encapsulated section. It is used by the PEI Foundation to + process sectioned files. Prior to the installation of this PPI, + compression sections will be ignored. + + @param Decompress Decompress a single compression section in + a firmware file. +**/ +struct _EFI_PEI_DECOMPRESS_PPI { + EFI_PEI_DECOMPRESS_DECOMPRESS Decompress; +}; + + +extern EFI_GUID gEfiPeiDecompressPpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/DxeIpl.h b/MdePkg/Include/Ppi/DxeIpl.h new file mode 100644 index 0000000000..5743b8e7d8 --- /dev/null +++ b/MdePkg/Include/Ppi/DxeIpl.h @@ -0,0 +1,68 @@ +/** @file + This file declares DXE Initial Program Load PPI. + When the PEI core is done it calls the DXE IPL via this PPI. + + Copyright (c) 2006, 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. + + Module Name: DxeIpl.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.0. + +**/ + +#ifndef __DXE_IPL_H__ +#define __DXE_IPL_H__ + +#define EFI_DXE_IPL_PPI_GUID \ + { \ + 0xae8ce5d, 0xe448, 0x4437, {0xa8, 0xd7, 0xeb, 0xf5, 0xf1, 0x94, 0xf7, 0x31 } \ + } + +typedef struct _EFI_DXE_IPL_PPI EFI_DXE_IPL_PPI; + +/** + The architectural PPI that the PEI Foundation invokes when + there are no additional PEIMs to invoke. + + @param This Pointer to the DXE IPL PPI instance + @param PeiServices Pointer to the PEI Services Table. + @param HobList Pointer to the list of Hand-Off Block (HOB) entries. + + @retval EFI_SUCCESS Upon this return code, the PEI Foundation should enter + some exception handling.Under normal circumstances, the DXE IPL PPI should not return. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_DXE_IPL_ENTRY) ( + IN EFI_DXE_IPL_PPI *This, + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_HOB_POINTERS HobList + ); + +/** + @par Ppi Description: + Final service to be invoked by the PEI Foundation. + The DXE IPL PPI is responsible for locating and loading the DXE Foundation. + The DXE IPL PPI may use PEI services to locate and load the DXE Foundation. + + @param Entry + The entry point to the DXE IPL PPI. + +**/ +struct _EFI_DXE_IPL_PPI { + EFI_DXE_IPL_ENTRY Entry; +}; + +extern EFI_GUID gEfiDxeIplPpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/EndOfPeiPhase.h b/MdePkg/Include/Ppi/EndOfPeiPhase.h new file mode 100644 index 0000000000..4132dd1aeb --- /dev/null +++ b/MdePkg/Include/Ppi/EndOfPeiPhase.h @@ -0,0 +1,32 @@ +/** @file + PPI to be used to signal when the PEI ownership of the memory map + officially ends and DXE will take over + + Copyright (c) 2006, 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. + + Module Name: EndOfPeiPhase.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.0. + +**/ + +#ifndef __END_OF_PEI_SIGNAL_PPI_H__ +#define __END_OF_PEI_SIGNAL_PPI_H__ + +#define EFI_PEI_END_OF_PEI_PHASE_PPI_GUID \ + { \ + 0x605EA650, 0xC65C, 0x42e1, {0xBA, 0x80, 0x91, 0xA5, 0x2A, 0xB6, 0x18, 0xC6 } \ + } + +extern EFI_GUID gEfiEndOfPeiSignalPpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/FirmwareVolume.h b/MdePkg/Include/Ppi/FirmwareVolume.h new file mode 100644 index 0000000000..3cafd0c003 --- /dev/null +++ b/MdePkg/Include/Ppi/FirmwareVolume.h @@ -0,0 +1,268 @@ +/* @file + This file provides functions for accessing a memory-mapped firmware volume of a specific format. + + Copyright (c) 2006 - 2007, 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. + + Module Name: FirmwareVolume.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.00 + +**/ + +#ifndef __FIRMWARE_VOLUME_PPI_H__ +#define __FIRMWARE_VOLUME_PPI_H__ + +// +// The GUID for this PPI is the same as the firmware volume format GUID. +// can be EFI_FIRMWARE_FILE_SYSTEM2_GUID or the GUID for a user-defined format. The +// EFI_FIRMWARE_FILE_SYSTEM2_GUID is the PI Firmware Volume format. +// + +typedef struct _EFI_PEI_FIRMWARE_VOLUME_PPI EFI_PEI_FIRMWARE_VOLUME_PPI; + + +/** + Create a volume handle from the information in the buffer. For + memory-mapped firmware volumes, Buffer and BufferSize refer to + the start of the firmware volume and the firmware volume size. + For non memory-mapped firmware volumes, this points to a + buffer which contains the necessary information for creating + the firmware volume handle. Normally, these values are derived + from the EFI_FIRMWARE_VOLUME_INFO_PPI. + + + @param This Points to this instance of the + EFI_PEI_FIRMWARE_VOLUME_PPI + @param Buffer Points to the start of the buffer. + @param BufferSize Size of the buffer. + @param FvHandle Points to the returned firmware volume + handle. The firmware volume handle must + be unique within the system. + + + @retval EFI_SUCCESS Firmware volume handle. + @retval EFI_VOLUME_CORRUPTED Volume was corrupt. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FV_PROCESS_FV) ( + IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, + IN CONST VOID *Buffer, + IN CONST UINTN BufferSize, + OUT EFI_PEI_FV_HANDLE *FvHandle +); + + +/** + Create a volume handle from the information in the buffer. For + memory-mapped firmware volumes, Buffer and BufferSize refer to + the start of the firmware volume and the firmware volume size. + For non memory-mapped firmware volumes, this points to a + buffer which contains the necessary information for creating + the firmware volume handle. Normally, these values are derived + from the EFI_FIRMWARE_VOLUME_INFO_PPI. + + + @param This Points to this instance of the + EFI_PEI_FIRMWARE_VOLUME_PPI + @param Buffer Points to the start of the buffer. + @param BufferSize Size of the buffer. + @param FvHandle Points to the returned firmware volume + handle. The firmware volume handle must + be unique within the system. + + + @retval EFI_SUCCESS Firmware volume handle. + @retval EFI_VOLUME_CORRUPTED Volume was corrupt. + +**/ + +/** + This service enables PEI modules to discover additional firmware files. The FileHandle must be + unique within the system. + + @param This Points to this instance of the + EFI_PEI_FIRMWARE_VOLUME_PPI. SearchType A filter + to find only files of this type. Type + EFI_FV_FILETYPE_ALL causes no filtering to be + done. + @param FvHandle Handle of firmware volume in which to + search. + + @param FileHandle Points to the current handle from which to + begin searching or NULL to start at the + beginning of the firmware volume. Updated + upon return to reflect the file found. + + + @retval EFI_SUCCESS The file was found. + @retval EFI_NOT_FOUND The file was not found. FileHandle + contains NULL. +**/ +typedef EFI_STATUS +(EFIAPI *EFI_PEI_FV_FIND_FILE_TYPE) ( + IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, + IN CONST EFI_FV_FILETYPE SearchType, + IN CONST EFI_PEI_FV_HANDLE FvHandle, + IN OUT EFI_PEI_FILE_HANDLE *FileHandle +); + + +/** + + This service searches for files with a specific name, within + either the specified firmware volume or all firmware volumes. + + @param This Points to this instance of the + EFI_PEI_FIRMWARE_VOLUME_PPI. + + @param FileName A pointer to the name of the file to find + within the firmware volume. + + @param FvHandle Upon entry, the pointer to the firmware + volume to search or NULL if all firmware + volumes should be searched. Upon exit, the + actual firmware volume in which the file was + found. + + @param FileHandle Upon exit, points to the found file's + handle or NULL if it could not be found. + + @retval EFI_SUCCESS File was found. + + @param EFI_NOT_FOUND File was not found. + + @param EFI_INVALID_PARAMETER FvHandle or FileHandle or + FileName was NULL. + + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FV_FIND_FILE_NAME) ( + IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, + IN CONST EFI_GUID *FileName, + IN CONST EFI_PEI_FV_HANDLE FvHandle, + OUT EFI_PEI_FILE_HANDLE *FileHandle +); + + +/** + This function returns information about a specific + file, including its file name, type, attributes, starting + address and size. + + @param This Points to this instance of the + EFI_PEI_FIRMWARE_VOLUME_PPI. + + @param FileHandle Handle of the file. + + @param FileInfo Upon exit, points to the file????s + information. + + @retval EFI_SUCCESS File information returned. + + @retval EFI_INVALID_PARAMETER If FileHandle does not + represent a valid file. + EFI_INVALID_PARAMETER If + FileInfo is NULL + +**/ + +typedef +EFI_STATUS (EFIAPI *EFI_PEI_FV_GET_FILE_INFO) ( + IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, + IN CONST EFI_PEI_FILE_HANDLE FileHandle, + OUT EFI_FV_FILE_INFO *FileInfo +); + +/** + This function returns information about the firmware + volume. + + @param This Points to this instance of the + EFI_PEI_FIRMWARE_VOLUME_PPI. + + @param FvHandle Handle to the firmware handle. + + @param VolumeInfo Points to the returned firmware volume + information. + + + @retval EFI_SUCCESS Information returned + successfully. + + @retval EFI_INVALID_PARAMETER FvHandle does not indicate a + valid firmware volume or VolumeInfo is NULL +**/ +typedef +EFI_STATUS (EFIAPI *EFI_PEI_FV_GET_INFO)( + IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, + IN CONST EFI_PEI_FV_HANDLE FvHandle, + OUT EFI_FV_INFO *VolumeInfo +); + +/** + This service enables PEI modules to discover sections of a given type within a valid file. + + @param This Points to this instance of the + EFI_PEI_FIRMWARE_VOLUME_PPI. + + @param SearchType A filter to find only sections of this + type. + + @param FileHandle Handle of firmware file in which to + search. + + @param SectionData Updated upon return to point to the + section found. + + @retval EFI_SUCCESS Section was found. + + @retval EFI_NOT_FOUND Section of the specified type was not + found. SectionData contains NULL. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FV_FIND_SECTION) ( + IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This, + IN CONST EFI_SECTION_TYPE SearchType, + IN CONST EFI_PEI_FILE_HANDLE FileHandle, + OUT VOID **SectionData +); + + + +/* + This PPI provides functions for accessing a memory-mapped firmware volume of a specific format. + + @param ProcessVolume Process a firmware volume and create a volume handle. + @param FindFileByType Find all files of a specific type. + @param FindFileByName Find the file with a specific name. + @param GetFileInfo Return the information about a specific file + @param GetVolumeInfo Return the firmware volume attributes. + @param FindSectionByType Find all sections of a specific type. + +**/ +struct _EFI_PEI_FIRMWARE_VOLUME_PPI { + EFI_PEI_FV_PROCESS_FV ProcessVolume; + EFI_PEI_FV_FIND_FILE_TYPE FindFileByType; + EFI_PEI_FV_FIND_FILE_NAME FindFileByName; + EFI_PEI_FV_GET_FILE_INFO GetFileInfo; + EFI_PEI_FV_GET_INFO GetVolumeInfo; + EFI_PEI_FV_FIND_SECTION FindSectionByType; +} ; + +extern EFI_GUID gEfiPeiFirmwareVolumePpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/FirmwareVolumeInfo.h b/MdePkg/Include/Ppi/FirmwareVolumeInfo.h new file mode 100644 index 0000000000..7f8698d077 --- /dev/null +++ b/MdePkg/Include/Ppi/FirmwareVolumeInfo.h @@ -0,0 +1,69 @@ +/* @file + This file provides location and format of a firmware volume. + + Copyright (c) 2006 - 2007, 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. + + Module Name: FirmwareVolumeInfo.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.00 + +**/ + +#ifndef __EFI_PEI_FIRMWARE_VOLUME_INFO_H__ +#define __EFI_PEI_FIRMWARE_VOLUME_INFO_H__ + + + +#define EFI_PEI_FIRMWARE_VOLUME_INFO_PPI_GUID \ +{ 0x49edb1c1, 0xbf21, 0x4761, { 0xbb, 0x12, 0xeb, 0x0, 0x31, 0xaa, 0xbb, 0x39 } } + +typedef struct _EFI_PEI_FIRMWARE_VOLUME_INFO_PPI EFI_PEI_FIRMWARE_VOLUME_INFO_PPI; + +/** + This PPI describes the location and format of a firmware volume. + The FvFormat can be EFI_FIRMWARE_FILE_SYSTEM2_GUID or the GUID for + a user-defined format. The EFI_FIRMWARE_FILE_SYSTEM2_GUID is + the PI Firmware Volume format. + + @param FvFormat Unique identifier of the format of the memory-mapped firmware volume. + + @param FvInfo Points to a buffer which allows the EFI_PEI_FIRMWARE_VOLUME_PPI to + process the volume. The format of this buffer is + specific to the FvFormat. For memory-mapped firmware volumes, + this typically points to the first byte of the firmware volume. + + @param FvInfoSize Size of the data provided by FvInfo. For memory-mapped firmware volumes, + this is typically the size of the firmware volume. + + @param ParentFvName If the firmware volume originally came from a firmware file, + then these point to the parent firmware volume + name and firmware volume file. If it did not originally come + from a firmware file, these should be NULL. + + @param ParentFileName If the firmware volume originally came from a firmware file, + then these point to the parent firmware volume + name and firmware volume file. If it did not originally come + from a firmware file, these should be NULL. + +**/ +struct _EFI_PEI_FIRMWARE_VOLUME_INFO_PPI { + EFI_GUID FvFormat; + VOID *FvInfo; + UINT32 FvInfoSize; + EFI_GUID *ParentFvName; + EFI_GUID *ParentFileName; +}; + +extern EFI_GUID gEfiPeiFirmwareVolumeInfoPpiGuid; + +#endif + diff --git a/MdePkg/Include/Ppi/GuidedSectionExtraction.h b/MdePkg/Include/Ppi/GuidedSectionExtraction.h new file mode 100644 index 0000000000..bf1716e4eb --- /dev/null +++ b/MdePkg/Include/Ppi/GuidedSectionExtraction.h @@ -0,0 +1,134 @@ +/* @file + If a GUID-defined section is encountered when doing section extraction, + the PEI Foundation or the EFI_PEI_FILE_LOADER_PPI instance + calls the appropriate instance of the GUIDed Section Extraction PPI + to extract the section stream contained therein.. + + Copyright (c) 2006 - 2007, 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. + + Module Name: GuidedSectionExtraction.h + + @par Revision Reference: + This PPI is defined in PI Version 1.00. + +**/ + +#ifndef __EFI_GUIDED_SECTION_EXTRACTION_PPI_H__ +#define __EFI_GUIDED_SECTION_EXTRACTION_PPI_H__ + +// +// Typically, protocol interface structures are identified +// by associating them with a GUID. Each instance of +// a protocol with a given GUID must have +// the same interface structure. While all instances of +// the GUIDed Section Extraction PPI must have +// the same interface structure, they do not all have +// te same GUID. The GUID that is associated with +// an instance of the GUIDed Section Extraction Protocol +// is used to correlate it with the GUIDed section type +// that it is intended to process. +// + + +typedef struct _EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI; + +// +// Bit values for AuthenticationStatus +// +#define EFI_AUTH_STATUS_PLATFORM_OVERRIDE 0x01 +#define EFI_AUTH_STATUS_IMAGE_SIGNED 0x02 +#define EFI_AUTH_STATUS_NOT_TESTED 0x04 +#define EFI_AUTH_STATUS_TEST_FAILED 0x08 + +/** + The ExtractSection() function processes the input section and + returns a pointer to the section contents. If the section being + extracted does not require processing (if the section + GuidedSectionHeader.Attributes has the + EFI_GUIDED_SECTION_PROCESSING_REQUIRED field cleared), then + OutputBuffer is just updated to point to the start of the + section's contents. Otherwise, *Buffer must be allocated + from PEI permanent memory. + + @param This Indicates the + EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI instance. + Buffer containing the input GUIDed section to be + processed. OutputBuffer OutputBuffer is + allocated from PEI permanent memory and contains + the new section stream. + + @param OutputSize A pointer to a caller-allocated + UINTN in which the size of *OutputBuffer + allocation is stored. If the function + returns anything other than EFI_SUCCESS, + the value of OutputSize is undefined. + + @param AuthenticationStatus A pointer to a caller-allocated + UINT32 that indicates the + authentication status of the + output buffer. If the input + section's GuidedSectionHeader. + Attributes field has the + EFI_GUIDED_SECTION_AUTH_STATUS_VALID + bit as clear, + AuthenticationStatus must return + zero. These bits reflect the + status of the extraction + operation. If the function + returns anything other than + EFI_SUCCESS, the value of + AuthenticationStatus is + undefined. + + @retval EFI_SUCCESS The InputSection was + successfully processed and the + section contents were returned. + + @retval EFI_OUT_OF_RESOURCES The system has insufficient + resources to process the request. + + @reteval EFI_INVALID_PARAMETER The GUID in InputSection does + not match this instance of the + GUIDed Section Extraction PPI. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_EXTRACT_GUIDED_SECTION)( + IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This, + IN CONST VOID *InputSection, + OUT VOID **OutputBuffer, + OUT UINTN *OutputSize, + OUT UINT32 *AuthenticationStatus +); + + + +/** + If a GUID-defined section is encountered when doing section extraction, + the PEI Foundation or the EFI_PEI_FILE_LOADER_PPI instance + calls the appropriate instance of the GUIDed Section + Extraction PPI to extract the section stream contained + therein. + + + @param ExtractSection Takes the GUIDed section as input and + produces the section stream data. See + the ExtractSection() function + description. + +**/ +struct _EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI { + EFI_PEI_EXTRACT_GUIDED_SECTION ExtractSection; +}; + + + +#endif + diff --git a/MdePkg/Include/Ppi/LoadFile.h b/MdePkg/Include/Ppi/LoadFile.h new file mode 100644 index 0000000000..0417221665 --- /dev/null +++ b/MdePkg/Include/Ppi/LoadFile.h @@ -0,0 +1,149 @@ +/** @file + Load image file from fv to memory. + + Copyright (c) 2006, 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. + + Module Name: LoadFile.h + + @par Revision Reference: + This PPI is defined in PI Version 1.00. + +**/ + +#ifndef __FV_FILE_LOADER_PPI_H__ +#define __FV_FILE_LOADER_PPI_H__ + +#define EFI_PEI_LOAD_FILE_PPI_GUID \ + { 0xb9e0abfe, 0x5979, 0x4914, { 0x97, 0x7f, 0x6d, 0xee, 0x78, 0xc2, 0x78, 0xa6 } } + + +typedef struct _EFI_PEI_LOAD_FILE_PPI EFI_PEI_LOAD_FILE_PPI; + +/** + This service is the single member function of EFI_LOAD_FILE_PPI. This service separates + image loading and relocating from the PEI Foundation. + + @param This Interface pointer that implements + the Load File PPI instance. + + @param FileHandle File handle of the file to load. + Type EFI_PEI_FILE_HANDLE is defined in + FfsFindNextFile(). + + @param ImageAddress Pointer to the address of the + loaded image. + + @param ImageSize Pointer to the size of the loaded + image. + + @param EntryPoint Pointer to the entry point of the + image. + + @param AuthenticationState On exit, points to the attestation + authentication state of the image + or 0 if no attestation was + performed. The format of + AuthenticationState is defined in + EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI.ExtractSection() + + + @retval EFI_SUCCESS The image was loaded successfully. + + @retval EFI_OUT_OF_RESOURCES There was not enough memory. + + @retval EFI_LOAD_ERROR There was no supported image in + the file EFI_INVALID_PARAMETER + FileHandle was not a valid + firmware file handle. + @retval EFI_INVALID_PARAMETER EntryPoint was NULL. + + @retval EFI_NOT_SUPPORTED An image requires relocations or + is not memory mapped. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_LOAD_FILE) ( + IN CONST EFI_PEI_LOAD_FILE_PPI *This, + IN CONST EFI_PEI_FILE_HANDLE FileHandle, + OUT EFI_PHYSICAL_ADDRESS *ImageAddress, + OUT UINT64 *ImageSize, + OUT EFI_PHYSICAL_ADDRESS *EntryPoint, + OUT UINT32 *AuthenticationState +); + + +/** + This PPI is a pointer to the Load File service. + This service will be published by a PEIM. The PEI Foundation + will use this service to launch the known PEI module images. + + + @param LoadFile Loads a PEIM into memory for subsequent + execution. See the LoadFile() function + description. + +**/ +struct _EFI_PEI_LOAD_FILE_PPI { + EFI_PEI_LOAD_FILE LoadFile; +}; + + + +#define EFI_PEI_FV_FILE_LOADER_GUID \ + { \ + 0x7e1f0d85, 0x4ff, 0x4bb2, {0x86, 0x6a, 0x31, 0xa2, 0x99, 0x6a, 0x48, 0xa8 } \ + } + +typedef struct _EFI_PEI_FV_FILE_LOADER_PPI EFI_PEI_FV_FILE_LOADER_PPI; + +/** + Loads a PEIM into memory for subsequent execution. + + @param This Interface pointer that implements the Load File PPI instance. + @param FfsHeader Pointer to the FFS header of the file to load. + @param ImageAddress Pointer to the address of the loaded Image + @param ImageSize Pointer to the size of the loaded image. + @param EntryPoint Pointer to the entry point of the image. + + @retval EFI_SUCCESS The image was loaded successfully. + @retval EFI_OUT_OF_RESOURCES There was not enough memory. + @retval EFI_INVALID_PARAMETER The contents of the FFS file did not + contain a valid PE/COFF image that could be loaded. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FV_LOAD_FILE) ( + IN EFI_PEI_FV_FILE_LOADER_PPI *This, + IN EFI_FFS_FILE_HEADER *FfsHeader, + OUT EFI_PHYSICAL_ADDRESS *ImageAddress, + OUT UINT64 *ImageSize, + OUT EFI_PHYSICAL_ADDRESS *EntryPoint + ); + +/** + @par Ppi Description: + This PPI is a pointer to the Load File service. This service will be + published by a PEIM.The PEI Foundation will use this service to + launch the known non-XIP PE/COFF PEIM images. This service may + depend upon the presence of the EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI. + + @param FvLoadFile + Loads a PEIM into memory for subsequent execution + +**/ +struct _EFI_PEI_FV_FILE_LOADER_PPI { + EFI_PEI_FV_LOAD_FILE FvLoadFile; +}; + +extern EFI_GUID gEfiPeiFvFileLoaderPpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/LoadImage.h b/MdePkg/Include/Ppi/LoadImage.h new file mode 100644 index 0000000000..40fc7ea289 --- /dev/null +++ b/MdePkg/Include/Ppi/LoadImage.h @@ -0,0 +1,53 @@ +/* @file + The file descript the PPI which notifies other drivers + of the PEIM being initialized by the PEI Dispatcher. + + Copyright (c) 2006 - 2007, 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. + + Module Name: LoadImage.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.00. + +**/ + +#ifndef __LOADED_IMAGE_PPI_H__ +#define __LOADED_IMAGE_PPI_H__ + +#define EFI_PEI_LOADED_IMAGE_PPI_GUID \ + { 0xc1fcd448, 0x6300, 0x4458, { 0xb8, 0x64, 0x28, 0xdf, 0x1, 0x53, 0x64, 0xbc } } + + +typedef struct _EFI_PEI_LOADED_IMAGE_PPI EFI_PEI_LOADED_IMAGE_PPI; + +/* + This interface is installed by the PEI Dispatcher after the image has been + loaded and after all security checks have been performed, + to notify other PEIMs of the files which are being loaded. + + @param ImageAddress Address of the image at the address where it will be executed. + + @param ImageSize Size of the image as it will be executed. + + @param FileHandle File handle from which the image was loaded. Can be NULL, + indicating the image was not loaded from a handle. + +**/ +struct _EFI_PEI_LOADED_IMAGE_PPI { + EFI_PHYSICAL_ADDRESS ImageAddress; + UINT64 ImageSize; + EFI_PEI_FILE_HANDLE FileHandle; +}; + + +extern EFI_GUID gEfiPeiLoadedImagePpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/MasterBootMode.h b/MdePkg/Include/Ppi/MasterBootMode.h new file mode 100644 index 0000000000..08d9aef148 --- /dev/null +++ b/MdePkg/Include/Ppi/MasterBootMode.h @@ -0,0 +1,34 @@ +/** @file + This file declares Boot Mode PPI + The Master Boot Mode PPI is installed by a PEIM to signal that a final + boot has been determined and set. This signal is useful in that PEIMs + with boot-mode-specific behavior can put this PPI in their dependency expression. + + Copyright (c) 2006, 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. + + Module Name: MasterBootMode.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.0. + +**/ + +#ifndef __MASTER_BOOT_MODE_PPI_H__ +#define __MASTER_BOOT_MODE_PPI_H__ + +#define EFI_PEI_MASTER_BOOT_MODE_PEIM_PPI \ + { \ + 0x7408d748, 0xfc8c, 0x4ee6, {0x92, 0x88, 0xc4, 0xbe, 0xc0, 0x92, 0xa4, 0x10 } \ + } + +extern EFI_GUID gEfiPeiMasterBootModePpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/MemoryDiscovered.h b/MdePkg/Include/Ppi/MemoryDiscovered.h new file mode 100644 index 0000000000..414926c265 --- /dev/null +++ b/MdePkg/Include/Ppi/MemoryDiscovered.h @@ -0,0 +1,34 @@ +/** @file + This file declares Memory Discovered PPI. + This PPI is installed by the PEI Foundation at the point of system + evolution when the permanent memory size has been registered and + waiting PEIMs can use the main memory store. + + Copyright (c) 2006, 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. + + Module Name: MemoryDiscovered.h + + @par Revision Reference: + This PPI is defined in PEI CIS + Version 0.91. + +**/ + +#ifndef __PEI_MEMORY_DISCOVERED_PPI_H__ +#define __PEI_MEMORY_DISCOVERED_PPI_H__ + +#define EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI_GUID \ + { \ + 0xf894643d, 0xc449, 0x42d1, {0x8e, 0xa8, 0x85, 0xbd, 0xd8, 0xc6, 0x5b, 0xde } \ + } + +extern EFI_GUID gEfiPeiMemoryDiscoveredPpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/Pcd.h b/MdePkg/Include/Ppi/Pcd.h new file mode 100644 index 0000000000..e2cde6878b --- /dev/null +++ b/MdePkg/Include/Ppi/Pcd.h @@ -0,0 +1,865 @@ +/* @file + Platform Configuration Database (PCD) PPI + + Copyright (c) 2006 - 2007, 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. + + Module Name: Pcd.h + +**/ + +#ifndef __PCD_PPI_H__ +#define __PCD_PPI_H__ + + +#define PCD_PPI_GUID \ + { 0x6e81c58, 0x4ad7, 0x44bc, { 0x83, 0x90, 0xf1, 0x2, 0x65, 0xf7, 0x24, 0x80 } } + +#define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0) + + + +/** + Sets the SKU value for subsequent calls to set or get PCD token values. + + SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. + SetSku() is normally called only once by the system. + + For each item (token), the database can hold a single value that applies to all SKUs, + or multiple values, where each value is associated with a specific SKU Id. Items with multiple, + SKU-specific values are called SKU enabled. + + The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. + For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the + single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the + last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token, + the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been + set for that Id, the results are unpredictable. + + @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and + set values associated with a PCD token. + + @retval VOID + +**/ +typedef +VOID +(EFIAPI *PCD_PPI_SET_SKU) ( + IN UINTN SkuId + ); + + + +/** + Retrieves an 8-bit value for a given PCD token. + + Retrieves the current byte-sized value for a PCD token number. + If the TokenNumber is invalid, the results are unpredictable. + + @param[in] TokenNumber The PCD token number. + + @return The UINT8 value. + +**/ +typedef +UINT8 +(EFIAPI *PCD_PPI_GET8) ( + IN UINTN TokenNumber + ); + + + +/** + Retrieves an 16-bit value for a given PCD token. + + Retrieves the current 16-bits value for a PCD token number. + If the TokenNumber is invalid, the results are unpredictable. + + @param[in] TokenNumber The PCD token number. + + @return The UINT16 value. + +**/ +typedef +UINT16 +(EFIAPI *PCD_PPI_GET16) ( + IN UINTN TokenNumber + ); + + + +/** + Retrieves an 32-bit value for a given PCD token. + + Retrieves the current 32-bits value for a PCD token number. + If the TokenNumber is invalid, the results are unpredictable. + + @param[in] TokenNumber The PCD token number. + + @return The UINT32 value. + +**/ +typedef +UINT32 +(EFIAPI *PCD_PPI_GET32) ( + IN UINTN TokenNumber + ); + + + +/** + Retrieves an 64-bit value for a given PCD token. + + Retrieves the current 64-bits value for a PCD token number. + If the TokenNumber is invalid, the results are unpredictable. + + @param[in] TokenNumber The PCD token number. + + @return The UINT64 value. + +**/ +typedef +UINT64 +(EFIAPI *PCD_PPI_GET64) ( + IN UINTN TokenNumber + ); + + + +/** + Retrieves a pointer to a value for a given PCD token. + + Retrieves the current pointer to the buffer for a PCD token number. + Do not make any assumptions about the alignment of the pointer that + is returned by this function call. If the TokenNumber is invalid, + the results are unpredictable. + + @param[in] TokenNumber The PCD token number. + + @return The pointer to the buffer to be retrived. + +**/ +typedef +VOID * +(EFIAPI *PCD_PPI_GET_POINTER) ( + IN UINTN TokenNumber + ); + + + +/** + Retrieves a Boolean value for a given PCD token. + + Retrieves the current boolean value for a PCD token number. + Do not make any assumptions about the alignment of the pointer that + is returned by this function call. If the TokenNumber is invalid, + the results are unpredictable. + + @param[in] TokenNumber The PCD token number. + + @return The Boolean value. + +**/ +typedef +BOOLEAN +(EFIAPI *PCD_PPI_GET_BOOLEAN) ( + IN UINTN TokenNumber + ); + + + +/** + Retrieves the size of the value for a given PCD token. + + Retrieves the current size of a particular PCD token. + If the TokenNumber is invalid, the results are unpredictable. + + @param[in] TokenNumber The PCD token number. + + @return The size of the value for the PCD token. + +**/ +typedef +UINTN +(EFIAPI *PCD_PPI_GET_SIZE) ( + IN UINTN TokenNumber + ); + + + +/** + Retrieves an 8-bit value for a given PCD token. + + Retrieves the 8-bit value of a particular PCD token. + If the TokenNumber is invalid or the token space + specified by Guid does not exist, the results are + unpredictable. + + @param[in] Guid The token space for the token number. + @param[in] TokenNumber The PCD token number. + + @return The size 8-bit value for the PCD token. + +**/ +typedef +UINT8 +(EFIAPI *PCD_PPI_GET_EX_8) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber + ); + + + +/** + Retrieves an 16-bit value for a given PCD token. + + Retrieves the 16-bit value of a particular PCD token. + If the TokenNumber is invalid or the token space + specified by Guid does not exist, the results are + unpredictable. + + @param[in] Guid The token space for the token number. + @param[in] TokenNumber The PCD token number. + + @return The size 16-bit value for the PCD token. + +**/ +typedef +UINT16 +(EFIAPI *PCD_PPI_GET_EX_16) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber + ); + + + +/** + Retrieves an 32-bit value for a given PCD token. + + Retrieves the 32-bit value of a particular PCD token. + If the TokenNumber is invalid or the token space + specified by Guid does not exist, the results are + unpredictable. + + @param[in] Guid The token space for the token number. + @param[in] TokenNumber The PCD token number. + + @return The size 32-bit value for the PCD token. + +**/ +typedef +UINT32 +(EFIAPI *PCD_PPI_GET_EX_32) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber + ); + + + +/** + Retrieves an 64-bit value for a given PCD token. + + Retrieves the 64-bit value of a particular PCD token. + If the TokenNumber is invalid or the token space + specified by Guid does not exist, the results are + unpredictable. + + @param[in] Guid The token space for the token number. + @param[in] TokenNumber The PCD token number. + + @return The size 64-bit value for the PCD token. + +**/ +typedef +UINT64 +(EFIAPI *PCD_PPI_GET_EX_64) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber + ); + + + +/** + Retrieves a pointer to a value for a given PCD token. + + Retrieves the current pointer to the buffer for a PCD token number. + Do not make any assumptions about the alignment of the pointer that + is returned by this function call. If the TokenNumber is invalid, + the results are unpredictable. + + @param[in] Guid The token space for the token number. + @param[in] TokenNumber The PCD token number. + + @return The pointer to the buffer to be retrived. + +**/ +typedef +VOID * +(EFIAPI *PCD_PPI_GET_EX_POINTER) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber + ); + + + +/** + Retrieves an Boolean value for a given PCD token. + + Retrieves the Boolean value of a particular PCD token. + If the TokenNumber is invalid or the token space + specified by Guid does not exist, the results are + unpredictable. + + @param[in] Guid The token space for the token number. + @param[in] TokenNumber The PCD token number. + + @return The size Boolean value for the PCD token. + +**/ +typedef +BOOLEAN +(EFIAPI *PCD_PPI_GET_EX_BOOLEAN) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber + ); + + + +/** + Retrieves the size of the value for a given PCD token. + + Retrieves the current size of a particular PCD token. + If the TokenNumber is invalid, the results are unpredictable. + + @param[in] Guid The token space for the token number. + @param[in] TokenNumber The PCD token number. + + @return The size of the value for the PCD token. + +**/ +typedef +UINTN +(EFIAPI *PCD_PPI_GET_EX_SIZE) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber + ); + + + +/** + Sets an 8-bit value for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] TokenNumber The PCD token number. + @param[in] Value The value to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET8) ( + IN UINTN TokenNumber, + IN UINT8 Value + ); + + + +/** + Sets an 16-bit value for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] TokenNumber The PCD token number. + @param[in] Value The value to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET16) ( + IN UINTN TokenNumber, + IN UINT16 Value + ); + + + +/** + Sets an 32-bit value for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] TokenNumber The PCD token number. + @param[in] Value The value to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET32) ( + IN UINTN TokenNumber, + IN UINT32 Value + ); + + + +/** + Sets an 64-bit value for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] TokenNumber The PCD token number. + @param[in] Value The value to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET64) ( + IN UINTN TokenNumber, + IN UINT64 Value + ); + + + + +/** + Sets a value of a specified size for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] TokenNumber The PCD token number. + @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. + On input, if the SizeOfValue is greater than the maximum size supported + for this TokenNumber then the output value of SizeOfValue will reflect + the maximum size supported for this TokenNumber. + @param[in] Buffer The buffer to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET_POINTER) ( + IN UINTN TokenNumber, + IN OUT UINTN *SizeOfBuffer, + IN VOID *Buffer + ); + + + +/** + Sets an Boolean value for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] TokenNumber The PCD token number. + @param[in] Value The value to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET_BOOLEAN) ( + IN UINTN TokenNumber, + IN BOOLEAN Value + ); + + + +/** + Sets an 8-bit value for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. + @param[in] TokenNumber The PCD token number. + @param[in] Value The value to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET_EX_8) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber, + IN UINT8 Value + ); + + + +/** + Sets an 16-bit value for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. + @param[in] TokenNumber The PCD token number. + @param[in] Value The value to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET_EX_16) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber, + IN UINT16 Value + ); + + + +/** + Sets an 32-bit value for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. + @param[in] TokenNumber The PCD token number. + @param[in] Value The value to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET_EX_32) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber, + IN UINT32 Value + ); + + + +/** + Sets an 64-bit value for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. + @param[in] TokenNumber The PCD token number. + @param[in] Value The value to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET_EX_64) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber, + IN UINT64 Value + ); + + + +/** + Sets a value of a specified size for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. + @param[in] TokenNumber The PCD token number. + @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. + On input, if the SizeOfValue is greater than the maximum size supported + for this TokenNumber then the output value of SizeOfValue will reflect + the maximum size supported for this TokenNumber. + @param[in] Buffer The buffer to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET_EX_POINTER) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber, + IN OUT UINTN *SizeOfBuffer, + IN VOID *Buffer + ); + + + +/** + Sets an Boolean value for a given PCD token. + + When the PCD service sets a value, it will check to ensure that the + size of the value being set is compatible with the Token's existing definition. + If it is not, an error will be returned. + + @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. + @param[in] TokenNumber The PCD token number. + @param[in] Value The value to set for the PCD token. + + @retval EFI_SUCCESS Procedure returned successfully. + @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data + being set was incompatible with a call to this function. + Use GetSize() to retrieve the size of the target data. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_SET_EX_BOOLEAN) ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber, + IN BOOLEAN Value + ); + + + +/** + Callback on SET function prototype definition. + + This notification function serves two purposes. Firstly, it notifies the module + which did the registration that the value of this PCD token has been set. Secondly, + it provides a mechanism for the module which did the registration to intercept the set + operation and override the value been set if necessary. After the invocation of the + callback function, TokenData will be used by PCD service PEIM to modify the internal data + in PCD database. + + @param[in] CallBackGuid The PCD token GUID being set. + @param[in] CallBackToken The PCD token number being set. + @param[in, out] TokenData A pointer to the token data being set. + @param[in] TokenDataSize The size, in bytes, of the data being set. + + @retval VOID + +**/ +typedef +VOID +(EFIAPI *PCD_PPI_CALLBACK) ( + IN CONST EFI_GUID *CallBackGuid, OPTIONAL + IN UINTN CallBackToken, + IN OUT VOID *TokenData, + IN UINTN TokenDataSize + ); + + + +/** + Specifies a function to be called anytime the value of a designated token is changed. + + @param[in] TokenNumber The PCD token number. + @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. + @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set. + + @retval EFI_SUCCESS The PCD service has successfully established a call event + for the CallBackToken requested. + @retval EFI_NOT_FOUND The PCD service could not find the referenced token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_CALLBACK_ONSET) ( + IN CONST EFI_GUID *Guid, OPTIONAL + IN UINTN TokenNumber, + IN PCD_PPI_CALLBACK CallBackFunction + ); + + + +/** + Cancels a previously set callback function for a particular PCD token number. + + @param[in] TokenNumber The PCD token number. + @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. + @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set. + + @retval EFI_SUCCESS The PCD service has successfully established a call event + for the CallBackToken requested. + @retval EFI_NOT_FOUND The PCD service could not find the referenced token number. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_CANCEL_CALLBACK) ( + IN CONST EFI_GUID *Guid, OPTIONAL + IN UINTN TokenNumber, + IN PCD_PPI_CALLBACK CallBackFunction + ); + + + +/** + Retrieves the next valid PCD token for a given namespace. + + @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. + @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number. + If the input token namespace or token number does not exist on the platform, an error is + returned and the value of *TokenNumber is undefined. To retrieve the "first" token, + have the pointer reference a TokenNumber value of 0. If the input token number is 0 + and there is no valid token number for this token namespace, *TokenNumber will be + assigned to 0 and the function return EFI_SUCCESS. If the token number is the last valid + token number, *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS. + + @retval EFI_SUCCESS The PCD service has retrieved the next valid token number. + Or the input token number is already the last valid token number in the PCD database. + In the later case, *TokenNumber is updated with the value of 0. + @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_GET_NEXT_TOKEN) ( + IN CONST EFI_GUID *Guid, OPTIONAL + IN OUT UINTN *TokenNumber + ); + + + +/** + Retrieves the next valid PCD token namespace for a given namespace. + + @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known + token namespace from which the search will start. On output, it designates + the next valid token namespace on the platform. If the input token namespace + does not exist on the platform, an error is returned and the value of *Guid is + undefined. If *Guid is NULL, then the GUID of the first token space of the + current platform is assigned to *Guid the function return EFI_SUCCESS. + If *Guid is NULL and there is no namespace exist in the platform other than the default + (NULL) tokennamespace, *Guid is unchanged and the function return EFI_SUCCESS. + If this input token namespace is the last namespace on the platform, + *Guid will be assigned to NULL and the function return EFI_SUCCESS. + + @retval EFI_SUCCESS The PCD service has retrieved the next valid token namespace. + Or the input token namespace is already the last valid token + number in the PCD database. In the later case, *Guid is updated + with the value of NULL. Or the input token name space is NULL and there + is no valid token namespace other than the default namespace (NULL). + @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform. + +**/ +typedef +EFI_STATUS +(EFIAPI *PCD_PPI_GET_NEXT_TOKENSPACE) ( + IN OUT CONST EFI_GUID **Guid + ); + + + +// +// Interface structure for the PCD PPI +// +typedef struct { + PCD_PPI_SET_SKU SetSku; + + PCD_PPI_GET8 Get8; + PCD_PPI_GET16 Get16; + PCD_PPI_GET32 Get32; + PCD_PPI_GET64 Get64; + PCD_PPI_GET_POINTER GetPtr; + PCD_PPI_GET_BOOLEAN GetBool; + PCD_PPI_GET_SIZE GetSize; + + PCD_PPI_GET_EX_8 Get8Ex; + PCD_PPI_GET_EX_16 Get16Ex; + PCD_PPI_GET_EX_32 Get32Ex; + PCD_PPI_GET_EX_64 Get64Ex; + PCD_PPI_GET_EX_POINTER GetPtrEx; + PCD_PPI_GET_EX_BOOLEAN GetBoolEx; + PCD_PPI_GET_EX_SIZE GetSizeEx; + + PCD_PPI_SET8 Set8; + PCD_PPI_SET16 Set16; + PCD_PPI_SET32 Set32; + PCD_PPI_SET64 Set64; + PCD_PPI_SET_POINTER SetPtr; + PCD_PPI_SET_BOOLEAN SetBool; + + PCD_PPI_SET_EX_8 Set8Ex; + PCD_PPI_SET_EX_16 Set16Ex; + PCD_PPI_SET_EX_32 Set32Ex; + PCD_PPI_SET_EX_64 Set64Ex; + PCD_PPI_SET_EX_POINTER SetPtrEx; + PCD_PPI_SET_EX_BOOLEAN SetBoolEx; + + PCD_PPI_CALLBACK_ONSET CallbackOnSet; + PCD_PPI_CANCEL_CALLBACK CancelCallback; + PCD_PPI_GET_NEXT_TOKEN GetNextToken; + PCD_PPI_GET_NEXT_TOKENSPACE GetNextTokenSpace; +} PCD_PPI; + + +extern EFI_GUID gPcdPpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/PciCfg2.h b/MdePkg/Include/Ppi/PciCfg2.h new file mode 100644 index 0000000000..c778e69a49 --- /dev/null +++ b/MdePkg/Include/Ppi/PciCfg2.h @@ -0,0 +1,158 @@ +/** @file + This file declares PciCfg PPI used to access PCI configuration space in PEI + + Copyright (c) 2006 - 2007, 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. + + Module Name: PciCfg.h + + @par Revision Reference: + This PPI is defined in PI + Version 1.00. + +**/ + +#ifndef __PEI_PCI_CFG2_H__ +#define __PEI_PCI_CFG2_H__ + + +#define EFI_PEI_PCI_CFG2_PPI_GUID \ + { 0x57a449a, 0x1fdc, 0x4c06, { 0xbf, 0xc9, 0xf5, 0x3f, 0x6a, 0x99, 0xbb, 0x92 } } + + +typedef struct _EFI_PEI_PCI_CFG2_PPI EFI_PEI_PCI_CFG2_PPI; + +#define EFI_PEI_PCI_CFG_ADDRESS(bus,dev,func,reg) \ + (((bus) << 24) | \ + ((dev) << 16) | \ + ((func) << 8) | \ + ((reg) < 256 ? (reg) : ((UINT64) (reg) << 32))); + +// +// EFI_PEI_PCI_CFG_PPI_WIDTH +// +typedef enum { + EfiPeiPciCfgWidthUint8 = 0, + EfiPeiPciCfgWidthUint16 = 1, + EfiPeiPciCfgWidthUint32 = 2, + EfiPeiPciCfgWidthUint64 = 3, + EfiPeiPciCfgWidthMaximum +} EFI_PEI_PCI_CFG_PPI_WIDTH; + +// +// EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS +// +typedef struct { + UINT8 Register; + UINT8 Function; + UINT8 Device; + UINT8 Bus; + UINT32 ExtendedRegister; +} EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS; + +/** + Reads from or write to a given location in the PCI configuration space. + + @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. + + @param This Pointer to local data for the interface. + + @param Width The width of the access. Enumerated in bytes. + See EFI_PEI_PCI_CFG_PPI_WIDTH above. + + @param Address The physical address of the access. The format of + the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS. + + @param Buffer A pointer to the buffer of data.. + + + @retval EFI_SUCCESS The function completed successfully. + + @retval EFI_DEVICE_ERROR There was a problem with the transaction. + + @retval EFI_DEVICE_NOT_READY The device is not capable of supporting the operation at this + time. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_PCI_CFG_PPI_IO) ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_PEI_PCI_CFG2_PPI *This, + IN CONST EFI_PEI_PCI_CFG_PPI_WIDTH Width, + IN CONST UINT64 Address, + IN OUT VOID *Buffer +); + + +/** + PCI read-modify-write operation. + + @param PeiServices An indirect pointer to the PEI Services Table + published by the PEI Foundation. + + @param This Pointer to local data for the interface. + + @param Width The width of the access. Enumerated in bytes. Type + EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read(). + + @param Address The physical address of the access. + + @param SetBits Points to value to bitwise-OR with the read configuration value. + + The size of the value is determined by Width. + + @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value. + The size of the value is determined by Width. + + + @retval EFI_SUCCESS The function completed successfully. + + @retval EFI_DEVICE_ERROR There was a problem with the transaction. + + @retval EFI_DEVICE_NOT_READY The device is not capable of supporting + the operation at this time. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_PCI_CFG_PPI_RW) ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_PEI_PCI_CFG2_PPI *This, + IN CONST EFI_PEI_PCI_CFG_PPI_WIDTH Width, + IN CONST UINT64 Address, + IN CONST VOID *SetBits, + IN CONST VOID *ClearBits +); + +/** + @par Ppi Description: + The EFI_PEI_PCI_CFG_PPI interfaces are used to abstract accesses to PCI + controllers behind a PCI root bridge controller. + + @param Read PCI read services. See the Read() function description. + + @param Write PCI write services. See the Write() function description. + + @param Modify PCI read-modify-write services. See the Modify() function description. + + @param Segment The PCI bus segment which the specified functions will access. + +**/ +struct _EFI_PEI_PCI_CFG2_PPI { + EFI_PEI_PCI_CFG_PPI_IO Read; + EFI_PEI_PCI_CFG_PPI_IO Write; + EFI_PEI_PCI_CFG_PPI_RW Modify; + UINT16 Segment; +}; + + +extern EFI_GUID gEfiPciCfg2PpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/ReadOnlyVariable2.h b/MdePkg/Include/Ppi/ReadOnlyVariable2.h new file mode 100644 index 0000000000..fb76ce2984 --- /dev/null +++ b/MdePkg/Include/Ppi/ReadOnlyVariable2.h @@ -0,0 +1,137 @@ +/** @file + This file declares Read-only Variable Service PPI + + Copyright (c) 2006 - 2007, 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. + + Module Name: ReadOnlyVariable.h + + @par Revision Reference: + This PPI is defined in PI + Version 1.00. + +**/ + +#ifndef __PEI_READ_ONLY_VARIABLE2_PPI_H__ +#define __PEI_READ_ONLY_VARIABLE2_PPI_H__ + +#define EFI_PEI_READ_ONLY_VARIABLE2_PPI_GUID \ + { 0x2ab86ef5, 0xecb5, 0x4134, { 0xb5, 0x56, 0x38, 0x54, 0xca, 0x1f, 0xe1, 0xb4 } } + + +typedef struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI EFI_PEI_READ_ONLY_VARIABLE2_PPI; + +/** + Read the specified variable from the UEFI variable store. If the Data + buffer is too small to hold the contents of the variable, + the error EFI_BUFFER_TOO_SMALL is returned and DataSize is set to the + required buffer size to obtain the data. + + @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI. + + @param VariableName A pointer to a null-terminated string that is the variable¡¯s name. + + @param VendorGuid A pointer to an EFI_GUID that is the variable¡¯s GUID. The combination of + VariableGuid and VariableName must be unique. + + @param Attributes If non-NULL, on return, points to the variable¡¯s attributes. See ¡°Related Definitons¡± + below for possible attribute values. + + @param DataSize On entry, points to the size in bytes of the Data buffer. On return, points to the size of + the data returned in Data. + + @param Data Points to the buffer which will hold the returned variable value. + + + @retval EFI_SUCCESS The function completed successfully. + + @retval EFI_NOT_FOUND The variable was not found. + + @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the resulting data. + DataSize is updated with the size required for + the specified variable. + + @retval EFI_INVALID_PARAMETER VariableName, VariableGuid, DataSize or Data is NULL. + + @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_GET_VARIABLE2)( + IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This, + IN CONST CHAR16 *VariableName, + IN CONST EFI_GUID *VariableGuid, + OUT UINT32 *Attributes, + IN OUT UINTN *DataSize, + OUT VOID *Data +); + + +/** + This function is called multiple times to retrieve the VariableName + and VariableGuid of all variables currently available in the system. + On each call, the previous results are passed into the interface, + and, on return, the interface returns the data for the next + interface. When the entire variable list has been returned, + EFI_NOT_FOUND is returned. + + @param This A pointer to this instance of the EFI_PEI_READ_ONLY_VARIABLE2_PPI. + + @param VariableNameSize On entry, points to the size of the buffer pointed to by VariableName. + + @param VariableName On entry, a pointer to a null-terminated string that is the variable¡¯s name. + On return, points to the next variable¡¯s null-terminated name string. + + @param VendorGuid On entry, a pointer to an UEFI _GUID that is the variable¡¯s GUID. + On return, a pointer to the next variable¡¯s GUID. + + + @retval EFI_SUCCESS The variable was read successfully. + + @retval EFI_NOT_FOUND The variable could not be found. + + @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the resulting + data. VariableNameSize is updated with the size + required for the specified variable. + + @retval EFI_INVALID_PARAMETER VariableName, VariableGuid or + VariableNameSize is NULL. + + @retval EFI_DEVICE_ERROR The variable could not be retrieved because of a device error. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_NEXT_VARIABLE_NAME2) ( + IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This, + IN OUT UINTN *VariableNameSize, + IN OUT CHAR16 *VariableName, + IN OUT EFI_GUID *VariableGuid +); + +/** + This PPI provides a lightweight, read-only variant of the full EFI + variable services. + + @param GetVariable + A service to ascertain a given variable name. + + @param GetNextVariableName + A service to ascertain a variable based upon a given, known variable + +**/ +struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI { + EFI_PEI_GET_VARIABLE2 GetVariable; + EFI_PEI_NEXT_VARIABLE_NAME2 NextVariableName; +}; + +extern EFI_GUID gEfiPeiReadOnlyVariable2PpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/Reset.h b/MdePkg/Include/Ppi/Reset.h new file mode 100644 index 0000000000..3b176ec62f --- /dev/null +++ b/MdePkg/Include/Ppi/Reset.h @@ -0,0 +1,35 @@ +/** @file + This file declares Reset PPI used to reset the platform + + Copyright (c) 2006, 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. + + Module Name: Reset.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.0. + +**/ + +#ifndef __RESET_PPI_H__ +#define __RESET_PPI_H__ + +#define EFI_PEI_RESET_PPI_GUID \ + { \ + 0xef398d58, 0x9dfd, 0x4103, {0xbf, 0x94, 0x78, 0xc6, 0xf4, 0xfe, 0x71, 0x2f } \ + } + +typedef struct { + EFI_PEI_RESET_SYSTEM ResetSystem; +} EFI_PEI_RESET_PPI; + +extern EFI_GUID gEfiPeiResetPpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/SecPlatformInformation.h b/MdePkg/Include/Ppi/SecPlatformInformation.h new file mode 100644 index 0000000000..ce4dda60b5 --- /dev/null +++ b/MdePkg/Include/Ppi/SecPlatformInformation.h @@ -0,0 +1,88 @@ +/** @file + This file declares Sec Platform Information PPI. + + Copyright (c) 2006 - 2007, 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. + + Module Name: SecPlatformInformation.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.00. + +**/ + +#ifndef __SEC_PLATFORM_INFORMATION_PPI_H__ +#define __SEC_PLATFORM_INFORMATION_PPI_H__ + +#define EFI_SEC_PLATFORM_INFORMATION_GUID \ + { \ + 0x6f8c2b35, 0xfef4, 0x448d, {0x82, 0x56, 0xe1, 0x1b, 0x19, 0xd6, 0x10, 0x77 } \ + } + +typedef struct _EFI_SEC_PLATFORM_INFORMATION_PPI EFI_SEC_PLATFORM_INFORMATION_PPI; + + +/// +/// EFI_HEALTH_FLAGS +/// +typedef union { + struct { + UINT32 Status : 2; + UINT32 Tested : 1; + UINT32 Reserved1 :13; + UINT32 VirtualMemoryUnavailable : 1; + UINT32 Ia32ExecutionUnavailable : 1; + UINT32 FloatingPointUnavailable : 1; + UINT32 MiscFeaturesUnavailable : 1; + UINT32 Reserved2 :12; + } Bits; + UINT32 Uint32; +} EFI_HEALTH_FLAGS; + +typedef struct { + EFI_HEALTH_FLAGS HealthFlags; +} EFI_SEC_PLATFORM_INFORMATION_RECORD; + + + +/** + This interface conveys state information out of the Security (SEC) phase into PEI. + + @param PeiServices Pointer to the PEI Services Table. + @param StructureSize Pointer to the variable describing size of the input buffer. + @param PlatformInformationRecord Pointer to the EFI_SEC_PLATFORM_INFORMATION_RECORD. + + @retval EFI_SUCCESS The data was successfully returned. + @retval EFI_BUFFER_TOO_SMALL The buffer was too small. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SEC_PLATFORM_INFORMATION) ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN OUT UINT64 *StructureSize, + OUT EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord +); + + +/** + Ppi Description: + + @param Name + +**/ +struct _EFI_SEC_PLATFORM_INFORMATION_PPI { + EFI_SEC_PLATFORM_INFORMATION PlatformInformation; +}; + + +extern EFI_GUID gEfiSecPlatformInformationPpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/Security.h b/MdePkg/Include/Ppi/Security.h new file mode 100644 index 0000000000..814a18ee4b --- /dev/null +++ b/MdePkg/Include/Ppi/Security.h @@ -0,0 +1,73 @@ +/** @file + This file declares Security Architectural PPI. + + Copyright (c) 2006, 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. + + Module Name: Security.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.0. + +**/ + +#ifndef __SECURITY_PPI_H__ +#define __SECURITY_PPI_H__ + +#define EFI_PEI_SECURITY_PPI_GUID \ + { \ + 0x1388066e, 0x3a57, 0x4efa, {0x98, 0xf3, 0xc1, 0x2f, 0x3a, 0x95, 0x8a, 0x29 } \ + } + +typedef struct _EFI_PEI_SECURITY_PPI EFI_PEI_SECURITY_PPI; + +/** + Allows the platform builder to implement a security policy in response + to varying file authentication states. + + @param PeiServices Pointer to the PEI Services Table. + @param This Interface pointer that implements the particular EFI_PEI_SECURITY_PPI instance. + @param AuthenticationStatus + Status returned by the verification service as part of section extraction. + @param FfsFileHeader Pointer to the file under review. + @param DeferExecution Pointer to a variable that alerts the PEI Foundation to defer execution of a PEIM. + + @retval EFI_SUCCESS The service performed its action successfully. + @retval EFI_SECURITY_VIOLATION The object cannot be trusted + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_SECURITY_AUTHENTICATION_STATE) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_SECURITY_PPI *This, + IN UINT32 AuthenticationStatus, + IN EFI_FFS_FILE_HEADER *FfsFileHeader, + IN OUT BOOLEAN *StartCrisisRecovery + ); + +/** + @par Ppi Description: + This PPI is installed by some platform PEIM that abstracts the security + policy to the PEI Foundation, namely the case of a PEIM's authentication + state being returned during the PEI section extraction process. + + @param AuthenticationState + Allows the platform builder to implement a security policy in response + to varying file authentication states. + +**/ +struct _EFI_PEI_SECURITY_PPI { + EFI_PEI_SECURITY_AUTHENTICATION_STATE AuthenticationState; +}; + +extern EFI_GUID gEfiPeiSecurityPpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/Smbus2.h b/MdePkg/Include/Ppi/Smbus2.h new file mode 100644 index 0000000000..b5e2631aa2 --- /dev/null +++ b/MdePkg/Include/Ppi/Smbus2.h @@ -0,0 +1,243 @@ +/** @file + This file declares Smbus2 PPI. + + Copyright (c) 2006 - 2007, 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. + + Module Name: Smbus2.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.00 + +**/ + +#ifndef _PEI_SMBUS2_PPI_H +#define _PEI_SMBUS2_PPI_H + +#include + +#define EFI_PEI_SMBUS2_PPI_GUID \ + { 0x9ca93627, 0xb65b, 0x4324, { 0xa2, 0x2, 0xc0, 0xb4, 0x61, 0x76, 0x45, 0x43 } } + + +typedef struct _EFI_PEI_SMBUS2_PPI EFI_PEI_SMBUS2_PPI; + +// +// EFI_SMBUS_DEVICE_COMMAND +// +typedef UINTN EFI_SMBUS_DEVICE_COMMAND; + + +/* + Executes an SMBus operation to an SMBus controller. + + @param This A pointer to the EFI_PEI_SMBUS2_PPI instance. + @param SlaveAddress The SMBUS hardware address to which the SMBUS device is preassigned or + allocated. + @param Command This command is transmitted by the SMBus host controller to the SMBus slave + device and the interpretation is SMBus slave device specific. + It can mean the offset to a list of functions inside + an SMBus slave device. Not all operations or slave devices support + this command's registers. + + @param Operation Signifies which particular SMBus hardware protocol instance that it + will use to execute the SMBus transactions. + This SMBus hardware protocol is defined by the System Management Bus (SMBus) + Specification and is not related to UEFI. + + @param PecCheck Defines if Packet Error Code (PEC) checking is required for this operation. + + @param Length Signifies the number of bytes that this operation will do. + The maximum number of bytes can be revision specific and operation specific. + This parameter will contain the actual number of bytes that are executed + for this operation. Not all operations require this argument. + + @param Buffer Contains the value of data to execute to the SMBus slave device. + Not all operations require this argument. + The length of this buffer is identified by Length. + + + @retval EFI_SUCCESS The last data that was returned from the access + matched the poll exit criteria. + @retval EFI_CRC_ERROR The checksum is not correct (PEC is incorrect) + @retval EFI_TIMEOUT Timeout expired before the operation was completed. + Timeout is determined by the SMBus host controller device. + @retval EFI_OUT_OF_RESOURCES The request could not be completed + due to a lack of resources. + @retval EFI_DEVICE_ERROR The request was not completed because + a failure reflected in the Host Status Register bit. + @retval EFI_INVALID_PARAMETER Operation is not defined in EFI_SMBUS_OPERATION. + Or Length/Buffer is NULL for operations except for EfiSmbusQuickRead and + EfiSmbusQuickWrite. Length is outside the range of valid values. + @retval EFI_UNSUPPORTED The SMBus operation or PEC is not supported. + @retval EFI_BUFFER_TOO_SMALL Buffer is not sufficient for this operation. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION) ( + IN CONST EFI_PEI_SMBUS2_PPI *This, + IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, + IN CONST EFI_SMBUS_DEVICE_COMMAND Command, + IN CONST EFI_SMBUS_OPERATION Operation, + IN CONST BOOLEAN PecCheck, + IN OUT UINTN *Length, + IN OUT VOID *Buffer +); + + +typedef struct { + UINT32 VendorSpecificId; + UINT16 SubsystemDeviceId; + UINT16 SubsystemVendorId; + UINT16 Interface; + UINT16 DeviceId; + UINT16 VendorId; + UINT8 VendorRevision; + UINT8 DeviceCapabilities; +} EFI_SMBUS_UDID; + +/** + CallBack function can be registered in EFI_PEI_SMBUS_PPI_NOTIFY. + + @param This A pointer to the EFI_PEI_SMBUS_PPI instance. + @param SlaveAddress The SMBUS hardware address to which the SMBUS + device is preassigned or allocated. + @param Data Data of the SMBus host notify command that + the caller wants to be called. + + @return Status Code + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_SMBUS_NOTIFY2_FUNCTION) ( + IN CONST EFI_PEI_SMBUS2_PPI *SmbusPpi, + IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, + IN CONST UINTN Data +); +/** + The ArpDevice() function enumerates the entire bus or enumerates a specific + device that is identified by SmbusUdid. + + @param This A pointer to the EFI_PEI_SMBUS_PPI instance. + @param ArpAll A Boolean expression that indicates if the host drivers need + to enumerate all the devices or enumerate only the device that is identified + by SmbusUdid. If ArpAll is TRUE, SmbusUdid and SlaveAddress are optional. + If ArpAll is FALSE, ArpDevice will enumerate SmbusUdid and the address + will be at SlaveAddress. + @param SmbusUdid The targeted SMBus Unique Device Identifier (UDID). + The UDID may not exist for SMBus devices with fixed addresses. + @param SlaveAddress The new SMBus address for the slave device for + which the operation is targeted. + + @retval EFI_SUCCESS The SMBus slave device address was set. + @retval EFI_INVALID_PARAMETER SlaveAddress is NULL. + @retval EFI_OUT_OF_RESOURCES The request could not be completed + due to a lack of resources. + @retval EFI_TIMEOUT The SMBus slave device did not respond. + @retval EFI_DEVICE_ERROR The request was not completed because the transaction failed. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_SMBUS2_PPI_ARP_DEVICE) ( + IN CONST EFI_PEI_SMBUS2_PPI *This, + IN CONST BOOLEAN ArpAll, + IN CONST EFI_SMBUS_UDID *SmbusUdid, OPTIONAL + IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL +); + + +typedef struct { + EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress; + EFI_SMBUS_UDID SmbusDeviceUdid; +} EFI_SMBUS_DEVICE_MAP; + +/** + The GetArpMap() function returns the mapping of all the SMBus devices + that are enumerated by the SMBus host driver. + + @param This A pointer to the EFI_PEI_SMBUS_PPI instance. + @param Length Size of the buffer that contains the SMBus device map. + @param SmbusDeviceMap The pointer to the device map as enumerated + by the SMBus controller driver. + + @retval EFI_SUCCESS The device map was returned correctly in the buffer. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_SMBUS2_PPI_GET_ARP_MAP) ( + IN CONST EFI_PEI_SMBUS2_PPI *This, + IN OUT UINTN *Length, + IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap +); + + +/** + The Notify() function registers all the callback functions to allow the + bus driver to call these functions when the SlaveAddress/Data pair happens. + + @param PeiServices A pointer to the system PEI Services Table. + @param This A pointer to the EFI_PEI_SMBUS_PPI instance. + @param SlaveAddress Address that the host controller detects as + sending a message and calls all the registered functions. + @param Data Data that the host controller detects as sending a message + and calls all the registered functions. + @param NotifyFunction The function to call when the bus driver + detects the SlaveAddress and Data pair. + + @retval EFI_SUCCESS NotifyFunction has been registered. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_SMBUS2_PPI_NOTIFY) ( + IN CONST EFI_PEI_SMBUS2_PPI *This, + IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, + IN CONST UINTN Data, + IN CONST EFI_PEI_SMBUS_NOTIFY2_FUNCTION NotifyFunction +); + +/** + @par Ppi Description: + Provides the basic I/O interfaces that a PEIM uses to access + its SMBus controller and the slave devices attached to it. + + @param Execute + Executes the SMBus operation to an SMBus slave device. + + @param ArpDevice + Allows an SMBus 2.0 device(s) to be Address Resolution Protocol (ARP) + + @param GetArpMap + Allows a PEIM to retrieve the address that was allocated by the SMBus + host controller during enumeration/ARP. + + @param Notify + Allows a driver to register for a callback to the SMBus host + controller driver when the bus issues a notification to the bus controller PEIM. + + @param Identifier + Identifier which uniquely identifies this SMBus controller in a system. + +**/ +struct _EFI_PEI_SMBUS2_PPI { + EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION Execute; + EFI_PEI_SMBUS2_PPI_ARP_DEVICE ArpDevice; + EFI_PEI_SMBUS2_PPI_GET_ARP_MAP GetArpMap; + EFI_PEI_SMBUS2_PPI_NOTIFY Notify; + EFI_GUID Identifier; +}; + +extern EFI_GUID gEfiPeiSmbus2PpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/Stall.h b/MdePkg/Include/Ppi/Stall.h new file mode 100644 index 0000000000..b608f3af11 --- /dev/null +++ b/MdePkg/Include/Ppi/Stall.h @@ -0,0 +1,69 @@ +/** @file + This file declares Stall PPI. + + This code abstracts the PEI core to provide Stall services. + + Copyright (c) 2006 - 2007, 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. + + Module Name: Stall.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.00. + +**/ + +#ifndef __STALL_PPI_H__ +#define __STALL_PPI_H__ + +#define EFI_PEI_STALL_PPI_GUID \ + { 0x1f4c6f90, 0xb06b, 0x48d8, {0xa2, 0x01, 0xba, 0xe5, 0xf1, 0xcd, 0x7d, 0x56 } } + +typedef struct _EFI_PEI_STALL_PPI EFI_PEI_STALL_PPI; + +/** + The Stall() function provides a blocking stall for at least the number + of microseconds stipulated in the final argument of the API. + + @param PeiServices An indirect pointer to the PEI Services Table + published by the PEI Foundation. + @param This Pointer to the local data for the interface. + @param Microseconds Number of microseconds for which to stall. + + @retval EFI_SUCCESS The service provided at least the required delay. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_STALL) ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_STALL_PPI *This, + IN UINTN Microseconds + ); + +/** + @par Ppi Description: + This service provides a simple, blocking stall with platform-specific resolution. + + @param Resolution + The resolution in microseconds of the stall services. + + @param Stall + The actual stall procedure call. + +**/ +struct _EFI_PEI_STALL_PPI { + UINTN Resolution; + EFI_PEI_STALL Stall; +}; + +extern EFI_GUID gEfiPeiStallPpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/StatusCode.h b/MdePkg/Include/Ppi/StatusCode.h new file mode 100644 index 0000000000..21eec0fe79 --- /dev/null +++ b/MdePkg/Include/Ppi/StatusCode.h @@ -0,0 +1,42 @@ +/** @file + This file declares Status Code PPI. + + Copyright (c) 2006, 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. + + Module Name: StatusCode.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.00. + +**/ + +#ifndef __STATUS_CODE_PPI_H__ +#define __STATUS_CODE_PPI_H__ + +#define EFI_PEI_REPORT_PROGRESS_CODE_PPI_GUID \ + { 0x229832d3, 0x7a30, 0x4b36, {0xb8, 0x27, 0xf4, 0xc, 0xb7, 0xd4, 0x54, 0x36 } } + +/** + @par Ppi Description: + This ppi provides the sevice to report status code. There can be only one instance + of this service in the system. + + @param ReportStatusCode + Service that allows PEIMs to report status codes. This function is defined in Peicis.h + +**/ +typedef struct { + EFI_PEI_REPORT_STATUS_CODE ReportStatusCode; +} EFI_PEI_PROGRESS_CODE_PPI; + +extern EFI_GUID gEfiPeiStatusCodePpiGuid; + +#endif diff --git a/MdePkg/Include/Ppi/TemporaryRamSupport.h b/MdePkg/Include/Ppi/TemporaryRamSupport.h new file mode 100644 index 0000000000..9ecf505aec --- /dev/null +++ b/MdePkg/Include/Ppi/TemporaryRamSupport.h @@ -0,0 +1,67 @@ +/* @file + This file declares Temporary RAM Support PPI. + + Copyright (c) 2006 - 2007, 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. + + Module Name: TemporaryRamSupport.h + + @par Revision Reference: + This PPI is defined in PI. + Version 1.00. + +**/ + +#ifndef __TEMPORARY_RAM_SUPPORT_H__ +#define __TEMPORARY_RAM_SUPPORT_H__ + +#define TEMPORARY_RAM_SUPPORT_PPI_GUID \ + { 0xdbe23aa9, 0xa345, 0x4b97, {0x85, 0xb6, 0xb2, 0x26, 0xf1, 0x61, 0x73, 0x89} } + + +/* + This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into + permanent memory. + + @param PeiServices Pointer to the PEI Services Table. + + @param TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the + Temporary RAM contents. + + @param PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the + Temporary RAM contents. + + @param CopySize Amount of memory to migrate from temporary to permanent memory. + + + + @retval EFI_SUCCESS The data was successfully returned. + + @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > + TemporaryMemoryBase when TemporaryMemoryBase > + PermanentMemoryBase. + +**/ +typedef +EFI_STATUS +(EFIAPI * TEMPORARY_RAM_MIGRATION) ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase, + IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase, + IN UINTN CopySize +); + + +typedef struct { + TEMPORARY_RAM_MIGRATION TemporaryRamMigration; +} TEMPORARY_RAM_SUPPORT_PPI; + +extern EFI_GUID gEfiPeiTemporaryRamSupportPpiGuid; + +#endif -- 2.39.2