diff options
author | Jonathan Zhang <jonzhang@fb.com> | 2020-06-09 17:56:53 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-06-25 11:57:06 +0000 |
commit | 6d27778973edf6bdebfa812eac8893d52961a891 (patch) | |
tree | 8023f5c4d98247b5ef3ceb18b8820e1131753f7e /src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi | |
parent | c9222f956763d20397152a44985bdb4abdb19e2d (diff) | |
download | coreboot-6d27778973edf6bdebfa812eac8893d52961a891.tar.xz |
vendorcode/intel: Add edk2-stable202005 support
This patch includes (edk2/edk2-stable202005) all required headers
for edk2-stable202005 quarterly EDK2 tag from EDK2 github project
using below command:
>> git clone https://github.com/tianocore/edk2.git vedk2-stable202005
Only include necessary header files.
MdePkg/Include/Base.h was updated to avoid compilation errors through
safeguarding definitions for MIN, MAX, NULL, ABS, ARRAY_SIZE.
Signed-off-by: Jonathan Zhang <jonzhang@fb.com>
Change-Id: I3172505d9b829647ee1208c87623172f10b39310
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42239
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi')
13 files changed, 5445 insertions, 0 deletions
diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiBootMode.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiBootMode.h new file mode 100644 index 0000000000..74b499a604 --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiBootMode.h @@ -0,0 +1,36 @@ +/** @file + Present the boot mode values in PI. + + Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + PI Version 1.2.1A + +**/ + +#ifndef __PI_BOOT_MODE_H__ +#define __PI_BOOT_MODE_H__ + +/// +/// EFI boot mode +/// +typedef UINT32 EFI_BOOT_MODE; + +// +// 0x21 - 0xf..f are reserved. +// +#define BOOT_WITH_FULL_CONFIGURATION 0x00 +#define BOOT_WITH_MINIMAL_CONFIGURATION 0x01 +#define BOOT_ASSUMING_NO_CONFIGURATION_CHANGES 0x02 +#define BOOT_WITH_FULL_CONFIGURATION_PLUS_DIAGNOSTICS 0x03 +#define BOOT_WITH_DEFAULT_SETTINGS 0x04 +#define BOOT_ON_S4_RESUME 0x05 +#define BOOT_ON_S5_RESUME 0x06 +#define BOOT_WITH_MFG_MODE_SETTINGS 0x07 +#define BOOT_ON_S2_RESUME 0x10 +#define BOOT_ON_S3_RESUME 0x11 +#define BOOT_ON_FLASH_UPDATE 0x12 +#define BOOT_IN_RECOVERY_MODE 0x20 + +#endif diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiDependency.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiDependency.h new file mode 100644 index 0000000000..82d59175ab --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiDependency.h @@ -0,0 +1,41 @@ +/** @file + Present the dependency expression values in PI. + + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + PI Version 1.0 + +**/ +#ifndef __PI_DEPENDENCY_H__ +#define __PI_DEPENDENCY_H__ + +/// +/// If present, this must be the first and only opcode, +/// EFI_DEP_BEFORE may be used by DXE and SMM drivers. +/// +#define EFI_DEP_BEFORE 0x00 + +/// +/// If present, this must be the first and only opcode, +/// EFI_DEP_AFTER may be used by DXE and SMM drivers. +/// +#define EFI_DEP_AFTER 0x01 + +#define EFI_DEP_PUSH 0x02 +#define EFI_DEP_AND 0x03 +#define EFI_DEP_OR 0x04 +#define EFI_DEP_NOT 0x05 +#define EFI_DEP_TRUE 0x06 +#define EFI_DEP_FALSE 0x07 +#define EFI_DEP_END 0x08 + + +/// +/// If present, this must be the first opcode, +/// EFI_DEP_SOR is only used by DXE driver. +/// +#define EFI_DEP_SOR 0x09 + +#endif diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiDxeCis.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiDxeCis.h new file mode 100644 index 0000000000..d69ec89635 --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiDxeCis.h @@ -0,0 +1,738 @@ +/** @file + Include file matches things in PI. + +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> +SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + PI Version 1.7 + +**/ + +#ifndef __PI_DXECIS_H__ +#define __PI_DXECIS_H__ + +#include <Uefi/UefiMultiPhase.h> +#include <Pi/PiMultiPhase.h> + +/// +/// Global Coherencey Domain types - Memory type. +/// +typedef enum { + /// + /// A memory region that is visible to the boot processor. However, there are no system + /// components that are currently decoding this memory region. + /// + EfiGcdMemoryTypeNonExistent, + /// + /// A memory region that is visible to the boot processor. This memory region is being + /// decoded by a system component, but the memory region is not considered to be either + /// system memory or memory-mapped I/O. + /// + EfiGcdMemoryTypeReserved, + /// + /// A memory region that is visible to the boot processor. A memory controller is + /// currently decoding this memory region and the memory controller is producing a + /// tested system memory region that is available to the memory services. + /// + EfiGcdMemoryTypeSystemMemory, + /// + /// A memory region that is visible to the boot processor. This memory region is + /// currently being decoded by a component as memory-mapped I/O that can be used to + /// access I/O devices in the platform. + /// + EfiGcdMemoryTypeMemoryMappedIo, + /// + /// A memory region that is visible to the boot processor. + /// This memory supports byte-addressable non-volatility. + /// + EfiGcdMemoryTypePersistent, + // + // Keep original one for the compatibility. + // + EfiGcdMemoryTypePersistentMemory = EfiGcdMemoryTypePersistent, + /// + /// A memory region that provides higher reliability relative to other memory in the + /// system. If all memory has the same reliability, then this bit is not used. + /// + EfiGcdMemoryTypeMoreReliable, + EfiGcdMemoryTypeMaximum +} EFI_GCD_MEMORY_TYPE; + +/// +/// Global Coherencey Domain types - IO type. +/// +typedef enum { + /// + /// An I/O region that is visible to the boot processor. However, there are no system + /// components that are currently decoding this I/O region. + /// + EfiGcdIoTypeNonExistent, + /// + /// An I/O region that is visible to the boot processor. This I/O region is currently being + /// decoded by a system component, but the I/O region cannot be used to access I/O devices. + /// + EfiGcdIoTypeReserved, + /// + /// An I/O region that is visible to the boot processor. This I/O region is currently being + /// decoded by a system component that is producing I/O ports that can be used to access I/O devices. + /// + EfiGcdIoTypeIo, + EfiGcdIoTypeMaximum +} EFI_GCD_IO_TYPE; + +/// +/// The type of allocation to perform. +/// +typedef enum { + /// + /// The GCD memory space map is searched from the lowest address up to the highest address + /// looking for unallocated memory ranges. + /// + EfiGcdAllocateAnySearchBottomUp, + /// + /// The GCD memory space map is searched from the lowest address up + /// to the specified MaxAddress looking for unallocated memory ranges. + /// + EfiGcdAllocateMaxAddressSearchBottomUp, + /// + /// The GCD memory space map is checked to see if the memory range starting + /// at the specified Address is available. + /// + EfiGcdAllocateAddress, + /// + /// The GCD memory space map is searched from the highest address down to the lowest address + /// looking for unallocated memory ranges. + /// + EfiGcdAllocateAnySearchTopDown, + /// + /// The GCD memory space map is searched from the specified MaxAddress + /// down to the lowest address looking for unallocated memory ranges. + /// + EfiGcdAllocateMaxAddressSearchTopDown, + EfiGcdMaxAllocateType +} EFI_GCD_ALLOCATE_TYPE; + +/// +/// EFI_GCD_MEMORY_SPACE_DESCRIPTOR. +/// +typedef struct { + /// + /// The physical address of the first byte in the memory region. Type + /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function + /// description in the UEFI 2.0 specification. + /// + EFI_PHYSICAL_ADDRESS BaseAddress; + + /// + /// The number of bytes in the memory region. + /// + UINT64 Length; + + /// + /// The bit mask of attributes that the memory region is capable of supporting. The bit + /// mask of available attributes is defined in the GetMemoryMap() function description + /// in the UEFI 2.0 specification. + /// + UINT64 Capabilities; + /// + /// The bit mask of attributes that the memory region is currently using. The bit mask of + /// available attributes is defined in GetMemoryMap(). + /// + UINT64 Attributes; + /// + /// Type of the memory region. Type EFI_GCD_MEMORY_TYPE is defined in the + /// AddMemorySpace() function description. + /// + EFI_GCD_MEMORY_TYPE GcdMemoryType; + + /// + /// The image handle of the agent that allocated the memory resource described by + /// PhysicalStart and NumberOfBytes. If this field is NULL, then the memory + /// resource is not currently allocated. Type EFI_HANDLE is defined in + /// InstallProtocolInterface() in the UEFI 2.0 specification. + /// + EFI_HANDLE ImageHandle; + + /// + /// The device handle for which the memory resource has been allocated. If + /// ImageHandle is NULL, then the memory resource is not currently allocated. If this + /// field is NULL, then the memory resource is not associated with a device that is + /// described by a device handle. Type EFI_HANDLE is defined in + /// InstallProtocolInterface() in the UEFI 2.0 specification. + /// + EFI_HANDLE DeviceHandle; +} EFI_GCD_MEMORY_SPACE_DESCRIPTOR; + +/// +/// EFI_GCD_IO_SPACE_DESCRIPTOR. +/// +typedef struct { + /// + /// Physical address of the first byte in the I/O region. Type + /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function + /// description in the UEFI 2.0 specification. + /// + EFI_PHYSICAL_ADDRESS BaseAddress; + + /// + /// Number of bytes in the I/O region. + /// + UINT64 Length; + + /// + /// Type of the I/O region. Type EFI_GCD_IO_TYPE is defined in the + /// AddIoSpace() function description. + /// + EFI_GCD_IO_TYPE GcdIoType; + + /// + /// The image handle of the agent that allocated the I/O resource described by + /// PhysicalStart and NumberOfBytes. If this field is NULL, then the I/O + /// resource is not currently allocated. Type EFI_HANDLE is defined in + /// InstallProtocolInterface() in the UEFI 2.0 specification. + /// + EFI_HANDLE ImageHandle; + + /// + /// The device handle for which the I/O resource has been allocated. If ImageHandle + /// is NULL, then the I/O resource is not currently allocated. If this field is NULL, then + /// the I/O resource is not associated with a device that is described by a device handle. + /// Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI + /// 2.0 specification. + /// + EFI_HANDLE DeviceHandle; +} EFI_GCD_IO_SPACE_DESCRIPTOR; + + +/** + Adds reserved memory, system memory, or memory-mapped I/O resources to the + global coherency domain of the processor. + + @param GcdMemoryType The type of memory resource being added. + @param BaseAddress The physical address that is the start address + of the memory resource being added. + @param Length The size, in bytes, of the memory resource that + is being added. + @param Capabilities The bit mask of attributes that the memory + resource region supports. + + @retval EFI_SUCCESS The memory resource was added to the global + coherency domain of the processor. + @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid. + @retval EFI_INVALID_PARAMETER Length is zero. + @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add + the memory resource to the global coherency + domain of the processor. + @retval EFI_UNSUPPORTED The processor does not support one or more bytes + of the memory resource range specified by + BaseAddress and Length. + @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range + specified by BaseAddress and Length conflicts + with a memory resource range that was previously + added to the global coherency domain of the processor. + @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range + specified by BaseAddress and Length was allocated + in a prior call to AllocateMemorySpace(). + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ADD_MEMORY_SPACE)( + IN EFI_GCD_MEMORY_TYPE GcdMemoryType, + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN UINT64 Capabilities + ); + +/** + Allocates nonexistent memory, reserved memory, system memory, or memorymapped + I/O resources from the global coherency domain of the processor. + + @param GcdAllocateType The type of allocation to perform. + @param GcdMemoryType The type of memory resource being allocated. + @param Alignment The log base 2 of the boundary that BaseAddress must + be aligned on output. Align with 2^Alignment. + @param Length The size in bytes of the memory resource range that + is being allocated. + @param BaseAddress A pointer to a physical address to allocate. + @param Imagehandle The image handle of the agent that is allocating + the memory resource. + @param DeviceHandle The device handle for which the memory resource + is being allocated. + + @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid. + @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid. + @retval EFI_INVALID_PARAMETER Length is zero. + @retval EFI_INVALID_PARAMETER BaseAddress is NULL. + @retval EFI_INVALID_PARAMETER ImageHandle is NULL. + @retval EFI_NOT_FOUND The memory resource request could not be satisfied. + No descriptor contains the desired space. + @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the memory + resource from the global coherency domain of the processor. + @retval EFI_SUCCESS The memory resource was allocated from the global coherency + domain of the processor. + + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ALLOCATE_MEMORY_SPACE)( + IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, + IN EFI_GCD_MEMORY_TYPE GcdMemoryType, + IN UINTN Alignment, + IN UINT64 Length, + IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, + IN EFI_HANDLE ImageHandle, + IN EFI_HANDLE DeviceHandle OPTIONAL + ); + +/** + Frees nonexistent memory, reserved memory, system memory, or memory-mapped + I/O resources from the global coherency domain of the processor. + + @param BaseAddress The physical address that is the start address of the memory resource being freed. + @param Length The size in bytes of the memory resource range that is being freed. + + @retval EFI_SUCCESS The memory resource was freed from the global coherency domain of + the processor. + @retval EFI_INVALID_PARAMETER Length is zero. + @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory + resource range specified by BaseAddress and Length. + @retval EFI_NOT_FOUND The memory resource range specified by BaseAddress and + Length was not allocated with previous calls to AllocateMemorySpace(). + @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the memory resource + from the global coherency domain of the processor. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_FREE_MEMORY_SPACE)( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ); + +/** + Removes reserved memory, system memory, or memory-mapped I/O resources from + the global coherency domain of the processor. + + @param BaseAddress The physical address that is the start address of the memory resource being removed. + @param Length The size in bytes of the memory resource that is being removed. + + @retval EFI_SUCCESS The memory resource was removed from the global coherency + domain of the processor. + @retval EFI_INVALID_PARAMETER Length is zero. + @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory + resource range specified by BaseAddress and Length. + @retval EFI_NOT_FOUND One or more bytes of the memory resource range specified by + BaseAddress and Length was not added with previous calls to + AddMemorySpace(). + @retval EFI_ACCESS_DEFINED One or more bytes of the memory resource range specified by + BaseAddress and Length has been allocated with AllocateMemorySpace(). + @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the memory + resource from the global coherency domain of the processor. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_REMOVE_MEMORY_SPACE)( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ); + +/** + Retrieves the descriptor for a memory region containing a specified address. + + @param BaseAddress The physical address that is the start address of a memory region. + @param Descriptor A pointer to a caller allocated descriptor. + + @retval EFI_SUCCESS The descriptor for the memory resource region containing + BaseAddress was returned in Descriptor. + @retval EFI_INVALID_PARAMETER Descriptor is NULL. + @retval EFI_NOT_FOUND A memory resource range containing BaseAddress was not found. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_GET_MEMORY_SPACE_DESCRIPTOR)( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor + ); + +/** + Modifies the attributes for a memory region in the global coherency domain of the + processor. + + @param BaseAddress The physical address that is the start address of a memory region. + @param Length The size in bytes of the memory region. + @param Attributes The bit mask of attributes to set for the memory region. + + @retval EFI_SUCCESS The attributes were set for the memory region. + @retval EFI_INVALID_PARAMETER Length is zero. + @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory + resource range specified by BaseAddress and Length. + @retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource + range specified by BaseAddress and Length. + @retval EFI_ACCESS_DENIED The attributes for the memory resource range specified by + BaseAddress and Length cannot be modified. + @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of + the memory resource range. + @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol is + not available yet. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES)( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN UINT64 Attributes + ); + +/** + Modifies the capabilities for a memory region in the global coherency domain of the + processor. + + @param BaseAddress The physical address that is the start address of a memory region. + @param Length The size in bytes of the memory region. + @param Capabilities The bit mask of capabilities that the memory region supports. + + @retval EFI_SUCCESS The capabilities were set for the memory region. + @retval EFI_INVALID_PARAMETER Length is zero. + @retval EFI_UNSUPPORTED The capabilities specified by Capabilities do not include the + memory region attributes currently in use. + @retval EFI_ACCESS_DENIED The capabilities for the memory resource range specified by + BaseAddress and Length cannot be modified. + @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the capabilities + of the memory resource range. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SET_MEMORY_SPACE_CAPABILITIES) ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN UINT64 Capabilities + ); + +/** + Returns a map of the memory resources in the global coherency domain of the + processor. + + @param NumberOfDescriptors A pointer to number of descriptors returned in the MemorySpaceMap buffer. + @param MemorySpaceMap A pointer to the array of EFI_GCD_MEMORY_SPACE_DESCRIPTORs. + + @retval EFI_SUCCESS The memory space map was returned in the MemorySpaceMap + buffer, and the number of descriptors in MemorySpaceMap was + returned in NumberOfDescriptors. + @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL. + @retval EFI_INVALID_PARAMETER MemorySpaceMap is NULL. + @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate MemorySpaceMap. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_GET_MEMORY_SPACE_MAP)( + OUT UINTN *NumberOfDescriptors, + OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap + ); + +/** + Adds reserved I/O or I/O resources to the global coherency domain of the processor. + + @param GcdIoType The type of I/O resource being added. + @param BaseAddress The physical address that is the start address of the I/O resource being added. + @param Length The size in bytes of the I/O resource that is being added. + + @retval EFI_SUCCESS The I/O resource was added to the global coherency domain of + the processor. + @retval EFI_INVALID_PARAMETER GcdIoType is invalid. + @retval EFI_INVALID_PARAMETER Length is zero. + @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add the I/O resource to + the global coherency domain of the processor. + @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O + resource range specified by BaseAddress and Length. + @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by + BaseAddress and Length conflicts with an I/O resource + range that was previously added to the global coherency domain + of the processor. + @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by + BaseAddress and Length was allocated in a prior call to + AllocateIoSpace(). + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ADD_IO_SPACE)( + IN EFI_GCD_IO_TYPE GcdIoType, + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ); + +/** + Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency + domain of the processor. + + @param GcdAllocateType The type of allocation to perform. + @param GcdIoType The type of I/O resource being allocated. + @param Alignment The log base 2 of the boundary that BaseAddress must be aligned on output. + @param Length The size in bytes of the I/O resource range that is being allocated. + @param BaseAddress A pointer to a physical address. + @param Imagehandle The image handle of the agent that is allocating the I/O resource. + @param DeviceHandle The device handle for which the I/O resource is being allocated. + + @retval EFI_SUCCESS The I/O resource was allocated from the global coherency domain + of the processor. + @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid. + @retval EFI_INVALID_PARAMETER GcdIoType is invalid. + @retval EFI_INVALID_PARAMETER Length is zero. + @retval EFI_INVALID_PARAMETER BaseAddress is NULL. + @retval EFI_INVALID_PARAMETER ImageHandle is NULL. + @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the I/O + resource from the global coherency domain of the processor. + @retval EFI_NOT_FOUND The I/O resource request could not be satisfied. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_ALLOCATE_IO_SPACE)( + IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, + IN EFI_GCD_IO_TYPE GcdIoType, + IN UINTN Alignment, + IN UINT64 Length, + IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, + IN EFI_HANDLE ImageHandle, + IN EFI_HANDLE DeviceHandle OPTIONAL + ); + +/** + Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency + domain of the processor. + + @param BaseAddress The physical address that is the start address of the I/O resource being freed. + @param Length The size in bytes of the I/O resource range that is being freed. + + @retval EFI_SUCCESS The I/O resource was freed from the global coherency domain of the + processor. + @retval EFI_INVALID_PARAMETER Length is zero. + @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O resource + range specified by BaseAddress and Length. + @retval EFI_NOT_FOUND The I/O resource range specified by BaseAddress and Length + was not allocated with previous calls to AllocateIoSpace(). + @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the I/O resource from + the global coherency domain of the processor. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_FREE_IO_SPACE)( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ); + +/** + Removes reserved I/O or I/O resources from the global coherency domain of the + processor. + + @param BaseAddress A pointer to a physical address that is the start address of the I/O resource being + removed. + @param Length The size in bytes of the I/O resource that is being removed. + + @retval EFI_SUCCESS The I/O resource was removed from the global coherency domain + of the processor. + @retval EFI_INVALID_PARAMETER Length is zero. + @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O + resource range specified by BaseAddress and Length. + @retval EFI_NOT_FOUND One or more bytes of the I/O resource range specified by + BaseAddress and Length was not added with previous + calls to AddIoSpace(). + @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by + BaseAddress and Length has been allocated with + AllocateIoSpace(). + @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the I/O + resource from the global coherency domain of the processor. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_REMOVE_IO_SPACE)( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ); + +/** + Retrieves the descriptor for an I/O region containing a specified address. + + @param BaseAddress The physical address that is the start address of an I/O region. + @param Descriptor A pointer to a caller allocated descriptor. + + @retval EFI_SUCCESS The descriptor for the I/O resource region containing + BaseAddress was returned in Descriptor. + @retval EFI_INVALID_PARAMETER Descriptor is NULL. + @retval EFI_NOT_FOUND An I/O resource range containing BaseAddress was not found. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR)( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor + ); + +/** + Returns a map of the I/O resources in the global coherency domain of the processor. + + @param NumberOfDescriptors A pointer to number of descriptors returned in the IoSpaceMap buffer. + @param MemorySpaceMap A pointer to the array of EFI_GCD_IO_SPACE_DESCRIPTORs. + + @retval EFI_SUCCESS The I/O space map was returned in the IoSpaceMap buffer, and + the number of descriptors in IoSpaceMap was returned in + NumberOfDescriptors. + @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL. + @retval EFI_INVALID_PARAMETER IoSpaceMap is NULL. + @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate IoSpaceMap. + + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_GET_IO_SPACE_MAP)( + OUT UINTN *NumberOfDescriptors, + OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap + ); + + + +/** + Loads and executed DXE drivers from firmware volumes. + + The Dispatch() function searches for DXE drivers in firmware volumes that have been + installed since the last time the Dispatch() service was called. It then evaluates + the dependency expressions of all the DXE drivers and loads and executes those DXE + drivers whose dependency expression evaluate to TRUE. This service must interact with + the Security Architectural Protocol to authenticate DXE drivers before they are executed. + This process is continued until no more DXE drivers can be executed. + + @retval EFI_SUCCESS One or more DXE driver were dispatched. + @retval EFI_NOT_FOUND No DXE drivers were dispatched. + @retval EFI_ALREADY_STARTED An attempt is being made to start the DXE Dispatcher recursively. + Thus, no action was taken. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_DISPATCH)( + VOID + ); + +/** + Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume. + + @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName. + @param FileName A pointer to the name of the file in a firmware volume. + + @retval EFI_SUCCESS The DXE driver was found and its SOR bit was cleared. + @retval EFI_NOT_FOUND The DXE driver does not exist, or the DXE driver exists and its SOR + bit is not set. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SCHEDULE)( + IN EFI_HANDLE FirmwareVolumeHandle, + IN CONST EFI_GUID *FileName + ); + +/** + Promotes a file stored in a firmware volume from the untrusted to the trusted state. + + @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName. + @param DriverName A pointer to the name of the file in a firmware volume. + + @return Status of promoting FFS from untrusted to trusted + state. + @retval EFI_NOT_FOUND The file was not found in the untrusted state. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_TRUST)( + IN EFI_HANDLE FirmwareVolumeHandle, + IN CONST EFI_GUID *FileName + ); + +/** + Creates a firmware volume handle for a firmware volume that is present in system memory. + + @param FirmwareVolumeHeader A pointer to the header of the firmware volume. + @param Size The size, in bytes, of the firmware volume. + @param FirmwareVolumeHandle On output, a pointer to the created handle. + + @retval EFI_SUCCESS The EFI_FIRMWARE_VOLUME_PROTOCOL and + EFI_DEVICE_PATH_PROTOCOL were installed onto + FirmwareVolumeHandle for the firmware volume described + by FirmwareVolumeHeader and Size. + @retval EFI_VOLUME_CORRUPTED The firmware volume described by FirmwareVolumeHeader + and Size is corrupted. + @retval EFI_OUT_OF_RESOURCES There are not enough system resources available to produce the + EFI_FIRMWARE_VOLUME_PROTOCOL and EFI_DEVICE_PATH_PROTOCOL + for the firmware volume described by FirmwareVolumeHeader and Size. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME)( + IN CONST VOID *FirmwareVolumeHeader, + IN UINTN Size, + OUT EFI_HANDLE *FirmwareVolumeHandle + ); + +// +// DXE Services Table +// +#define DXE_SERVICES_SIGNATURE 0x565245535f455844ULL +#define DXE_SPECIFICATION_MAJOR_REVISION 1 +#define DXE_SPECIFICATION_MINOR_REVISION 70 +#define DXE_SERVICES_REVISION ((DXE_SPECIFICATION_MAJOR_REVISION<<16) | (DXE_SPECIFICATION_MINOR_REVISION)) + +typedef struct { + /// + /// The table header for the DXE Services Table. + /// This header contains the DXE_SERVICES_SIGNATURE and DXE_SERVICES_REVISION values. + /// + EFI_TABLE_HEADER Hdr; + + // + // Global Coherency Domain Services + // + EFI_ADD_MEMORY_SPACE AddMemorySpace; + EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace; + EFI_FREE_MEMORY_SPACE FreeMemorySpace; + EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace; + EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor; + EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes; + EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap; + EFI_ADD_IO_SPACE AddIoSpace; + EFI_ALLOCATE_IO_SPACE AllocateIoSpace; + EFI_FREE_IO_SPACE FreeIoSpace; + EFI_REMOVE_IO_SPACE RemoveIoSpace; + EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor; + EFI_GET_IO_SPACE_MAP GetIoSpaceMap; + + // + // Dispatcher Services + // + EFI_DISPATCH Dispatch; + EFI_SCHEDULE Schedule; + EFI_TRUST Trust; + // + // Service to process a single firmware volume found in a capsule + // + EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume; + // + // Extensions to Global Coherency Domain Services + // + EFI_SET_MEMORY_SPACE_CAPABILITIES SetMemorySpaceCapabilities; +} DXE_SERVICES; + +typedef DXE_SERVICES EFI_DXE_SERVICES; + +#endif diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiFirmwareFile.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiFirmwareFile.h new file mode 100644 index 0000000000..bfb8fe3695 --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiFirmwareFile.h @@ -0,0 +1,509 @@ +/** @file + The firmware file related definitions in PI. + +Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR> +SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + PI Version 1.6. + +**/ + + +#ifndef __PI_FIRMWARE_FILE_H__ +#define __PI_FIRMWARE_FILE_H__ + +#pragma pack(1) +/// +/// Used to verify the integrity of the file. +/// +typedef union { + struct { + /// + /// The IntegrityCheck.Checksum.Header field is an 8-bit checksum of the file + /// header. The State and IntegrityCheck.Checksum.File fields are assumed + /// to be zero and the checksum is calculated such that the entire header sums to zero. + /// + UINT8 Header; + /// + /// If the FFS_ATTRIB_CHECKSUM (see definition below) bit of the Attributes + /// field is set to one, the IntegrityCheck.Checksum.File field is an 8-bit + /// checksum of the file data. + /// If the FFS_ATTRIB_CHECKSUM bit of the Attributes field is cleared to zero, + /// the IntegrityCheck.Checksum.File field must be initialized with a value of + /// 0xAA. The IntegrityCheck.Checksum.File field is valid any time the + /// EFI_FILE_DATA_VALID bit is set in the State field. + /// + UINT8 File; + } Checksum; + /// + /// This is the full 16 bits of the IntegrityCheck field. + /// + UINT16 Checksum16; +} EFI_FFS_INTEGRITY_CHECK; + +/// +/// FFS_FIXED_CHECKSUM is the checksum value used when the +/// FFS_ATTRIB_CHECKSUM attribute bit is clear. +/// +#define FFS_FIXED_CHECKSUM 0xAA + +typedef UINT8 EFI_FV_FILETYPE; +typedef UINT8 EFI_FFS_FILE_ATTRIBUTES; +typedef UINT8 EFI_FFS_FILE_STATE; + +/// +/// File Types Definitions +/// +#define EFI_FV_FILETYPE_ALL 0x00 +#define EFI_FV_FILETYPE_RAW 0x01 +#define EFI_FV_FILETYPE_FREEFORM 0x02 +#define EFI_FV_FILETYPE_SECURITY_CORE 0x03 +#define EFI_FV_FILETYPE_PEI_CORE 0x04 +#define EFI_FV_FILETYPE_DXE_CORE 0x05 +#define EFI_FV_FILETYPE_PEIM 0x06 +#define EFI_FV_FILETYPE_DRIVER 0x07 +#define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08 +#define EFI_FV_FILETYPE_APPLICATION 0x09 +#define EFI_FV_FILETYPE_MM 0x0A +#define EFI_FV_FILETYPE_SMM EFI_FV_FILETYPE_MM +#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B +#define EFI_FV_FILETYPE_COMBINED_MM_DXE 0x0C +#define EFI_FV_FILETYPE_COMBINED_SMM_DXE EFI_FV_FILETYPE_COMBINED_MM_DXE +#define EFI_FV_FILETYPE_MM_CORE 0x0D +#define EFI_FV_FILETYPE_SMM_CORE EFI_FV_FILETYPE_MM_CORE +#define EFI_FV_FILETYPE_MM_STANDALONE 0x0E +#define EFI_FV_FILETYPE_MM_CORE_STANDALONE 0x0F +#define EFI_FV_FILETYPE_OEM_MIN 0xc0 +#define EFI_FV_FILETYPE_OEM_MAX 0xdf +#define EFI_FV_FILETYPE_DEBUG_MIN 0xe0 +#define EFI_FV_FILETYPE_DEBUG_MAX 0xef +#define EFI_FV_FILETYPE_FFS_MIN 0xf0 +#define EFI_FV_FILETYPE_FFS_MAX 0xff +#define EFI_FV_FILETYPE_FFS_PAD 0xf0 +/// +/// FFS File Attributes. +/// +#define FFS_ATTRIB_LARGE_FILE 0x01 +#define FFS_ATTRIB_DATA_ALIGNMENT_2 0x02 +#define FFS_ATTRIB_FIXED 0x04 +#define FFS_ATTRIB_DATA_ALIGNMENT 0x38 +#define FFS_ATTRIB_CHECKSUM 0x40 + +/// +/// FFS File State Bits. +/// +#define EFI_FILE_HEADER_CONSTRUCTION 0x01 +#define EFI_FILE_HEADER_VALID 0x02 +#define EFI_FILE_DATA_VALID 0x04 +#define EFI_FILE_MARKED_FOR_UPDATE 0x08 +#define EFI_FILE_DELETED 0x10 +#define EFI_FILE_HEADER_INVALID 0x20 + + +/// +/// Each file begins with the header that describe the +/// contents and state of the files. +/// +typedef struct { + /// + /// This GUID is the file name. It is used to uniquely identify the file. + /// + EFI_GUID Name; + /// + /// Used to verify the integrity of the file. + /// + EFI_FFS_INTEGRITY_CHECK IntegrityCheck; + /// + /// Identifies the type of file. + /// + EFI_FV_FILETYPE Type; + /// + /// Declares various file attribute bits. + /// + EFI_FFS_FILE_ATTRIBUTES Attributes; + /// + /// The length of the file in bytes, including the FFS header. + /// + UINT8 Size[3]; + /// + /// Used to track the state of the file throughout the life of the file from creation to deletion. + /// + EFI_FFS_FILE_STATE State; +} EFI_FFS_FILE_HEADER; + +typedef struct { + /// + /// This GUID is the file name. It is used to uniquely identify the file. There may be only + /// one instance of a file with the file name GUID of Name in any given firmware + /// volume, except if the file type is EFI_FV_FILETYPE_FFS_PAD. + /// + EFI_GUID Name; + + /// + /// Used to verify the integrity of the file. + /// + EFI_FFS_INTEGRITY_CHECK IntegrityCheck; + + /// + /// Identifies the type of file. + /// + EFI_FV_FILETYPE Type; + + /// + /// Declares various file attribute bits. + /// + EFI_FFS_FILE_ATTRIBUTES Attributes; + + /// + /// The length of the file in bytes, including the FFS header. + /// The length of the file data is either (Size - sizeof(EFI_FFS_FILE_HEADER)). This calculation means a + /// zero-length file has a Size of 24 bytes, which is sizeof(EFI_FFS_FILE_HEADER). + /// Size is not required to be a multiple of 8 bytes. Given a file F, the next file header is + /// located at the next 8-byte aligned firmware volume offset following the last byte of the file F. + /// + UINT8 Size[3]; + + /// + /// Used to track the state of the file throughout the life of the file from creation to deletion. + /// + EFI_FFS_FILE_STATE State; + + /// + /// If FFS_ATTRIB_LARGE_FILE is set in Attributes, then ExtendedSize exists and Size must be set to zero. + /// If FFS_ATTRIB_LARGE_FILE is not set then EFI_FFS_FILE_HEADER is used. + /// + UINT64 ExtendedSize; +} EFI_FFS_FILE_HEADER2; + +#define IS_FFS_FILE2(FfsFileHeaderPtr) \ + (((((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Attributes) & FFS_ATTRIB_LARGE_FILE) == FFS_ATTRIB_LARGE_FILE) + +/// +/// The argument passed as the FfsFileHeaderPtr parameter to the +/// FFS_FILE_SIZE() function-like macro below must not have side effects: +/// FfsFileHeaderPtr is evaluated multiple times. +/// +#define FFS_FILE_SIZE(FfsFileHeaderPtr) ((UINT32) ( \ + (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[0] ) | \ + (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[1] << 8) | \ + (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[2] << 16))) + +#define FFS_FILE2_SIZE(FfsFileHeaderPtr) \ + ((UINT32) (((EFI_FFS_FILE_HEADER2 *) (UINTN) FfsFileHeaderPtr)->ExtendedSize)) + +typedef UINT8 EFI_SECTION_TYPE; + +/// +/// Pseudo type. It is used as a wild card when retrieving sections. +/// The section type EFI_SECTION_ALL matches all section types. +/// +#define EFI_SECTION_ALL 0x00 + +/// +/// Encapsulation section Type values. +/// +#define EFI_SECTION_COMPRESSION 0x01 + +#define EFI_SECTION_GUID_DEFINED 0x02 + +#define EFI_SECTION_DISPOSABLE 0x03 + +/// +/// Leaf section Type values. +/// +#define EFI_SECTION_PE32 0x10 +#define EFI_SECTION_PIC 0x11 +#define EFI_SECTION_TE 0x12 +#define EFI_SECTION_DXE_DEPEX 0x13 +#define EFI_SECTION_VERSION 0x14 +#define EFI_SECTION_USER_INTERFACE 0x15 +#define EFI_SECTION_COMPATIBILITY16 0x16 +#define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17 +#define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18 +#define EFI_SECTION_RAW 0x19 +#define EFI_SECTION_PEI_DEPEX 0x1B +#define EFI_SECTION_MM_DEPEX 0x1C +#define EFI_SECTION_SMM_DEPEX EFI_SECTION_MM_DEPEX + +/// +/// Common section header. +/// +typedef struct { + /// + /// A 24-bit unsigned integer that contains the total size of the section in bytes, + /// including the EFI_COMMON_SECTION_HEADER. + /// + UINT8 Size[3]; + EFI_SECTION_TYPE Type; + /// + /// Declares the section type. + /// +} EFI_COMMON_SECTION_HEADER; + +typedef struct { + /// + /// A 24-bit unsigned integer that contains the total size of the section in bytes, + /// including the EFI_COMMON_SECTION_HEADER. + /// + UINT8 Size[3]; + + EFI_SECTION_TYPE Type; + + /// + /// If Size is 0xFFFFFF, then ExtendedSize contains the size of the section. If + /// Size is not equal to 0xFFFFFF, then this field does not exist. + /// + UINT32 ExtendedSize; +} EFI_COMMON_SECTION_HEADER2; + +/// +/// Leaf section type that contains an +/// IA-32 16-bit executable image. +/// +typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION; +typedef EFI_COMMON_SECTION_HEADER2 EFI_COMPATIBILITY16_SECTION2; + +/// +/// CompressionType of EFI_COMPRESSION_SECTION. +/// +#define EFI_NOT_COMPRESSED 0x00 +#define EFI_STANDARD_COMPRESSION 0x01 +/// +/// An encapsulation section type in which the +/// section data is compressed. +/// +typedef struct { + /// + /// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION. + /// + EFI_COMMON_SECTION_HEADER CommonHeader; + /// + /// The UINT32 that indicates the size of the section data after decompression. + /// + UINT32 UncompressedLength; + /// + /// Indicates which compression algorithm is used. + /// + UINT8 CompressionType; +} EFI_COMPRESSION_SECTION; + +typedef struct { + /// + /// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION. + /// + EFI_COMMON_SECTION_HEADER2 CommonHeader; + /// + /// UINT32 that indicates the size of the section data after decompression. + /// + UINT32 UncompressedLength; + /// + /// Indicates which compression algorithm is used. + /// + UINT8 CompressionType; +} EFI_COMPRESSION_SECTION2; + +/// +/// An encapsulation section type in which the section data is disposable. +/// A disposable section is an encapsulation section in which the section data may be disposed of during +/// the process of creating or updating a firmware image without significant impact on the usefulness of +/// the file. The Type field in the section header is set to EFI_SECTION_DISPOSABLE. This +/// allows optional or descriptive data to be included with the firmware file which can be removed in +/// order to conserve space. The contents of this section are implementation specific, but might contain +/// debug data or detailed integration instructions. +/// +typedef EFI_COMMON_SECTION_HEADER EFI_DISPOSABLE_SECTION; +typedef EFI_COMMON_SECTION_HEADER2 EFI_DISPOSABLE_SECTION2; + +/// +/// The leaf section which could be used to determine the dispatch order of DXEs. +/// +typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION; +typedef EFI_COMMON_SECTION_HEADER2 EFI_DXE_DEPEX_SECTION2; + +/// +/// The leaf section which contains a PI FV. +/// +typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION; +typedef EFI_COMMON_SECTION_HEADER2 EFI_FIRMWARE_VOLUME_IMAGE_SECTION2; + +/// +/// The leaf section which contains a single GUID. +/// +typedef struct { + /// + /// Common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID. + /// + EFI_COMMON_SECTION_HEADER CommonHeader; + /// + /// This GUID is defined by the creator of the file. It is a vendor-defined file type. + /// + EFI_GUID SubTypeGuid; +} EFI_FREEFORM_SUBTYPE_GUID_SECTION; + +typedef struct { + /// + /// The common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID. + /// + EFI_COMMON_SECTION_HEADER2 CommonHeader; + /// + /// This GUID is defined by the creator of the file. It is a vendor-defined file type. + /// + EFI_GUID SubTypeGuid; +} EFI_FREEFORM_SUBTYPE_GUID_SECTION2; + +/// +/// Attributes of EFI_GUID_DEFINED_SECTION. +/// +#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01 +#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02 +/// +/// The leaf section which is encapsulation defined by specific GUID. +/// +typedef struct { + /// + /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED. + /// + EFI_COMMON_SECTION_HEADER CommonHeader; + /// + /// The GUID that defines the format of the data that follows. It is a vendor-defined section type. + /// + EFI_GUID SectionDefinitionGuid; + /// + /// Contains the offset in bytes from the beginning of the common header to the first byte of the data. + /// + UINT16 DataOffset; + /// + /// The bit field that declares some specific characteristics of the section contents. + /// + UINT16 Attributes; +} EFI_GUID_DEFINED_SECTION; + +typedef struct { + /// + /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED. + /// + EFI_COMMON_SECTION_HEADER2 CommonHeader; + /// + /// The GUID that defines the format of the data that follows. It is a vendor-defined section type. + /// + EFI_GUID SectionDefinitionGuid; + /// + /// Contains the offset in bytes from the beginning of the common header to the first byte of the data. + /// + UINT16 DataOffset; + /// + /// The bit field that declares some specific characteristics of the section contents. + /// + UINT16 Attributes; +} EFI_GUID_DEFINED_SECTION2; + +/// +/// The leaf section which contains PE32+ image. +/// +typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION; +typedef EFI_COMMON_SECTION_HEADER2 EFI_PE32_SECTION2; + +/// +/// The leaf section used to determine the dispatch order of PEIMs. +/// +typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION; +typedef EFI_COMMON_SECTION_HEADER2 EFI_PEI_DEPEX_SECTION2; + +/// +/// A leaf section type that contains a position-independent-code (PIC) image. +/// A PIC image section is a leaf section that contains a position-independent-code (PIC) image. +/// In addition to normal PE32+ images that contain relocation information, PEIM executables may be +/// PIC and are referred to as PIC images. A PIC image is the same as a PE32+ image except that all +/// relocation information has been stripped from the image and the image can be moved and will +/// execute correctly without performing any relocation or other fix-ups. EFI_PIC_SECTION2 must +/// be used if the section is 16MB or larger. +/// +typedef EFI_COMMON_SECTION_HEADER EFI_PIC_SECTION; +typedef EFI_COMMON_SECTION_HEADER2 EFI_PIC_SECTION2; + +/// +/// The leaf section which constains the position-independent-code image. +/// +typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION; +typedef EFI_COMMON_SECTION_HEADER2 EFI_TE_SECTION2; + +/// +/// The leaf section which contains an array of zero or more bytes. +/// +typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION; +typedef EFI_COMMON_SECTION_HEADER2 EFI_RAW_SECTION2; + +/// +/// The SMM dependency expression section is a leaf section that contains a dependency expression that +/// is used to determine the dispatch order for SMM drivers. Before the SMRAM invocation of the +/// SMM driver's entry point, this dependency expression must evaluate to TRUE. See the Platform +/// Initialization Specification, Volume 2, for details regarding the format of the dependency expression. +/// The dependency expression may refer to protocols installed in either the UEFI or the SMM protocol +/// database. EFI_SMM_DEPEX_SECTION2 must be used if the section is 16MB or larger. +/// +typedef EFI_COMMON_SECTION_HEADER EFI_SMM_DEPEX_SECTION; +typedef EFI_COMMON_SECTION_HEADER2 EFI_SMM_DEPEX_SECTION2; + +/// +/// The leaf section which contains a unicode string that +/// is human readable file name. +/// +typedef struct { + EFI_COMMON_SECTION_HEADER CommonHeader; + + /// + /// Array of unicode string. + /// + CHAR16 FileNameString[1]; +} EFI_USER_INTERFACE_SECTION; + +typedef struct { + EFI_COMMON_SECTION_HEADER2 CommonHeader; + CHAR16 FileNameString[1]; +} EFI_USER_INTERFACE_SECTION2; + +/// +/// The leaf section which contains a numeric build number and +/// an optional unicode string that represents the file revision. +/// +typedef struct { + EFI_COMMON_SECTION_HEADER CommonHeader; + UINT16 BuildNumber; + + /// + /// Array of unicode string. + /// + CHAR16 VersionString[1]; +} EFI_VERSION_SECTION; + +typedef struct { + EFI_COMMON_SECTION_HEADER2 CommonHeader; + /// + /// A UINT16 that represents a particular build. Subsequent builds have monotonically + /// increasing build numbers relative to earlier builds. + /// + UINT16 BuildNumber; + CHAR16 VersionString[1]; +} EFI_VERSION_SECTION2; + +/// +/// The argument passed as the SectionHeaderPtr parameter to the SECTION_SIZE() +/// and IS_SECTION2() function-like macros below must not have side effects: +/// SectionHeaderPtr is evaluated multiple times. +/// +#define SECTION_SIZE(SectionHeaderPtr) ((UINT32) ( \ + (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[0] ) | \ + (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[1] << 8) | \ + (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[2] << 16))) + +#define IS_SECTION2(SectionHeaderPtr) \ + (SECTION_SIZE (SectionHeaderPtr) == 0x00ffffff) + +#define SECTION2_SIZE(SectionHeaderPtr) \ + (((EFI_COMMON_SECTION_HEADER2 *) (UINTN) SectionHeaderPtr)->ExtendedSize) + +#pragma pack() + +#endif + diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiFirmwareVolume.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiFirmwareVolume.h new file mode 100644 index 0000000000..ca13075b77 --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiFirmwareVolume.h @@ -0,0 +1,247 @@ +/** @file + The firmware volume related definitions in PI. + + Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + PI Version 1.6 + +**/ + +#ifndef __PI_FIRMWAREVOLUME_H__ +#define __PI_FIRMWAREVOLUME_H__ + +/// +/// EFI_FV_FILE_ATTRIBUTES +/// +typedef UINT32 EFI_FV_FILE_ATTRIBUTES; + +// +// Value of EFI_FV_FILE_ATTRIBUTES. +// +#define EFI_FV_FILE_ATTRIB_ALIGNMENT 0x0000001F +#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100 +#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200 + +/// +/// type of EFI FVB attribute +/// +typedef UINT32 EFI_FVB_ATTRIBUTES_2; + +// +// Attributes bit definitions +// +#define EFI_FVB2_READ_DISABLED_CAP 0x00000001 +#define EFI_FVB2_READ_ENABLED_CAP 0x00000002 +#define EFI_FVB2_READ_STATUS 0x00000004 +#define EFI_FVB2_WRITE_DISABLED_CAP 0x00000008 +#define EFI_FVB2_WRITE_ENABLED_CAP 0x00000010 +#define EFI_FVB2_WRITE_STATUS 0x00000020 +#define EFI_FVB2_LOCK_CAP 0x00000040 +#define EFI_FVB2_LOCK_STATUS 0x00000080 +#define EFI_FVB2_STICKY_WRITE 0x00000200 +#define EFI_FVB2_MEMORY_MAPPED 0x00000400 +#define EFI_FVB2_ERASE_POLARITY 0x00000800 +#define EFI_FVB2_READ_LOCK_CAP 0x00001000 +#define EFI_FVB2_READ_LOCK_STATUS 0x00002000 +#define EFI_FVB2_WRITE_LOCK_CAP 0x00004000 +#define EFI_FVB2_WRITE_LOCK_STATUS 0x00008000 +#define EFI_FVB2_ALIGNMENT 0x001F0000 +#define EFI_FVB2_ALIGNMENT_1 0x00000000 +#define EFI_FVB2_ALIGNMENT_2 0x00010000 +#define EFI_FVB2_ALIGNMENT_4 0x00020000 +#define EFI_FVB2_ALIGNMENT_8 0x00030000 +#define EFI_FVB2_ALIGNMENT_16 0x00040000 +#define EFI_FVB2_ALIGNMENT_32 0x00050000 +#define EFI_FVB2_ALIGNMENT_64 0x00060000 +#define EFI_FVB2_ALIGNMENT_128 0x00070000 +#define EFI_FVB2_ALIGNMENT_256 0x00080000 +#define EFI_FVB2_ALIGNMENT_512 0x00090000 +#define EFI_FVB2_ALIGNMENT_1K 0x000A0000 +#define EFI_FVB2_ALIGNMENT_2K 0x000B0000 +#define EFI_FVB2_ALIGNMENT_4K 0x000C0000 +#define EFI_FVB2_ALIGNMENT_8K 0x000D0000 +#define EFI_FVB2_ALIGNMENT_16K 0x000E0000 +#define EFI_FVB2_ALIGNMENT_32K 0x000F0000 +#define EFI_FVB2_ALIGNMENT_64K 0x00100000 +#define EFI_FVB2_ALIGNMENT_128K 0x00110000 +#define EFI_FVB2_ALIGNMENT_256K 0x00120000 +#define EFI_FVB2_ALIGNMENT_512K 0x00130000 +#define EFI_FVB2_ALIGNMENT_1M 0x00140000 +#define EFI_FVB2_ALIGNMENT_2M 0x00150000 +#define EFI_FVB2_ALIGNMENT_4M 0x00160000 +#define EFI_FVB2_ALIGNMENT_8M 0x00170000 +#define EFI_FVB2_ALIGNMENT_16M 0x00180000 +#define EFI_FVB2_ALIGNMENT_32M 0x00190000 +#define EFI_FVB2_ALIGNMENT_64M 0x001A0000 +#define EFI_FVB2_ALIGNMENT_128M 0x001B0000 +#define EFI_FVB2_ALIGNMENT_256M 0x001C0000 +#define EFI_FVB2_ALIGNMENT_512M 0x001D0000 +#define EFI_FVB2_ALIGNMENT_1G 0x001E0000 +#define EFI_FVB2_ALIGNMENT_2G 0x001F0000 +#define EFI_FVB2_WEAK_ALIGNMENT 0x80000000 + +typedef struct { + /// + /// The number of sequential blocks which are of the same size. + /// + UINT32 NumBlocks; + /// + /// The size of the blocks. + /// + UINT32 Length; +} EFI_FV_BLOCK_MAP_ENTRY; + +/// +/// Describes the features and layout of the firmware volume. +/// +typedef struct { + /// + /// The first 16 bytes are reserved to allow for the reset vector of + /// processors whose reset vector is at address 0. + /// + UINT8 ZeroVector[16]; + /// + /// Declares the file system with which the firmware volume is formatted. + /// + EFI_GUID FileSystemGuid; + /// + /// Length in bytes of the complete firmware volume, including the header. + /// + UINT64 FvLength; + /// + /// Set to EFI_FVH_SIGNATURE + /// + UINT32 Signature; + /// + /// Declares capabilities and power-on defaults for the firmware volume. + /// + EFI_FVB_ATTRIBUTES_2 Attributes; + /// + /// Length in bytes of the complete firmware volume header. + /// + UINT16 HeaderLength; + /// + /// A 16-bit checksum of the firmware volume header. A valid header sums to zero. + /// + UINT16 Checksum; + /// + /// Offset, relative to the start of the header, of the extended header + /// (EFI_FIRMWARE_VOLUME_EXT_HEADER) or zero if there is no extended header. + /// + UINT16 ExtHeaderOffset; + /// + /// This field must always be set to zero. + /// + UINT8 Reserved[1]; + /// + /// Set to 2. Future versions of this specification may define new header fields and will + /// increment the Revision field accordingly. + /// + UINT8 Revision; + /// + /// An array of run-length encoded FvBlockMapEntry structures. The array is + /// terminated with an entry of {0,0}. + /// + EFI_FV_BLOCK_MAP_ENTRY BlockMap[1]; +} EFI_FIRMWARE_VOLUME_HEADER; + +#define EFI_FVH_SIGNATURE SIGNATURE_32 ('_', 'F', 'V', 'H') + +/// +/// Firmware Volume Header Revision definition +/// +#define EFI_FVH_REVISION 0x02 + +/// +/// Extension header pointed by ExtHeaderOffset of volume header. +/// +typedef struct { + /// + /// Firmware volume name. + /// + EFI_GUID FvName; + /// + /// Size of the rest of the extension header, including this structure. + /// + UINT32 ExtHeaderSize; +} EFI_FIRMWARE_VOLUME_EXT_HEADER; + +/// +/// Entry struture for describing FV extension header +/// +typedef struct { + /// + /// Size of this header extension. + /// + UINT16 ExtEntrySize; + /// + /// Type of the header. + /// + UINT16 ExtEntryType; +} EFI_FIRMWARE_VOLUME_EXT_ENTRY; + +#define EFI_FV_EXT_TYPE_OEM_TYPE 0x01 +/// +/// This extension header provides a mapping between a GUID and an OEM file type. +/// +typedef struct { + /// + /// Standard extension entry, with the type EFI_FV_EXT_TYPE_OEM_TYPE. + /// + EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr; + /// + /// A bit mask, one bit for each file type between 0xC0 (bit 0) and 0xDF (bit 31). If a bit + /// is '1', then the GUID entry exists in Types. If a bit is '0' then no GUID entry exists in Types. + /// + UINT32 TypeMask; + /// + /// An array of GUIDs, each GUID representing an OEM file type. + /// + /// EFI_GUID Types[1]; + /// +} EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE; + +#define EFI_FV_EXT_TYPE_GUID_TYPE 0x0002 + +/// +/// This extension header EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE provides a vendor specific +/// GUID FormatType type which includes a length and a successive series of data bytes. +/// +typedef struct { + /// + /// Standard extension entry, with the type EFI_FV_EXT_TYPE_OEM_TYPE. + /// + EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr; + /// + /// Vendor-specific GUID. + /// + EFI_GUID FormatType; + /// + /// An arry of bytes of length Length. + /// + /// UINT8 Data[1]; + /// +} EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE; + +#define EFI_FV_EXT_TYPE_USED_SIZE_TYPE 0x03 + +/// +/// The EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_SIZE_TYPE can be used to find +/// out how many EFI_FVB2_ERASE_POLARITY bytes are at the end of the FV. +/// +typedef struct { + /// + /// Standard extension entry, with the type EFI_FV_EXT_TYPE_USED_SIZE_TYPE. + /// + EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr; + /// + /// The number of bytes of the FV that are in uses. The remaining + /// EFI_FIRMWARE_VOLUME_HEADER FvLength minus UsedSize bytes in + /// the FV must contain the value implied by EFI_FVB2_ERASE_POLARITY. + /// + UINT32 UsedSize; +} EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_SIZE_TYPE; + +#endif diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiHob.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiHob.h new file mode 100644 index 0000000000..b38b15aee6 --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiHob.h @@ -0,0 +1,512 @@ +/** @file + HOB related definitions in PI. + +Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR> +SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + PI Version 1.6 + +**/ + +#ifndef __PI_HOB_H__ +#define __PI_HOB_H__ + +// +// HobType of EFI_HOB_GENERIC_HEADER. +// +#define EFI_HOB_TYPE_HANDOFF 0x0001 +#define EFI_HOB_TYPE_MEMORY_ALLOCATION 0x0002 +#define EFI_HOB_TYPE_RESOURCE_DESCRIPTOR 0x0003 +#define EFI_HOB_TYPE_GUID_EXTENSION 0x0004 +#define EFI_HOB_TYPE_FV 0x0005 +#define EFI_HOB_TYPE_CPU 0x0006 +#define EFI_HOB_TYPE_MEMORY_POOL 0x0007 +#define EFI_HOB_TYPE_FV2 0x0009 +#define EFI_HOB_TYPE_LOAD_PEIM_UNUSED 0x000A +#define EFI_HOB_TYPE_UEFI_CAPSULE 0x000B +#define EFI_HOB_TYPE_FV3 0x000C +#define EFI_HOB_TYPE_UNUSED 0xFFFE +#define EFI_HOB_TYPE_END_OF_HOB_LIST 0xFFFF + +/// +/// Describes the format and size of the data inside the HOB. +/// All HOBs must contain this generic HOB header. +/// +typedef struct { + /// + /// Identifies the HOB data structure type. + /// + UINT16 HobType; + /// + /// The length in bytes of the HOB. + /// + UINT16 HobLength; + /// + /// This field must always be set to zero. + /// + UINT32 Reserved; +} EFI_HOB_GENERIC_HEADER; + + +/// +/// Value of version in EFI_HOB_HANDOFF_INFO_TABLE. +/// +#define EFI_HOB_HANDOFF_TABLE_VERSION 0x0009 + +/// +/// Contains general state information used by the HOB producer phase. +/// This HOB must be the first one in the HOB list. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_HANDOFF. + /// + EFI_HOB_GENERIC_HEADER Header; + /// + /// The version number pertaining to the PHIT HOB definition. + /// This value is four bytes in length to provide an 8-byte aligned entry + /// when it is combined with the 4-byte BootMode. + /// + UINT32 Version; + /// + /// The system boot mode as determined during the HOB producer phase. + /// + EFI_BOOT_MODE BootMode; + /// + /// The highest address location of memory that is allocated for use by the HOB producer + /// phase. This address must be 4-KB aligned to meet page restrictions of UEFI. + /// + EFI_PHYSICAL_ADDRESS EfiMemoryTop; + /// + /// The lowest address location of memory that is allocated for use by the HOB producer phase. + /// + EFI_PHYSICAL_ADDRESS EfiMemoryBottom; + /// + /// The highest address location of free memory that is currently available + /// for use by the HOB producer phase. + /// + EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop; + /// + /// The lowest address location of free memory that is available for use by the HOB producer phase. + /// + EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom; + /// + /// The end of the HOB list. + /// + EFI_PHYSICAL_ADDRESS EfiEndOfHobList; +} EFI_HOB_HANDOFF_INFO_TABLE; + +/// +/// EFI_HOB_MEMORY_ALLOCATION_HEADER describes the +/// various attributes of the logical memory allocation. The type field will be used for +/// subsequent inclusion in the UEFI memory map. +/// +typedef struct { + /// + /// A GUID that defines the memory allocation region's type and purpose, as well as + /// other fields within the memory allocation HOB. This GUID is used to define the + /// additional data within the HOB that may be present for the memory allocation HOB. + /// Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0 + /// specification. + /// + EFI_GUID Name; + + /// + /// The base address of memory allocated by this HOB. Type + /// EFI_PHYSICAL_ADDRESS is defined in AllocatePages() in the UEFI 2.0 + /// specification. + /// + EFI_PHYSICAL_ADDRESS MemoryBaseAddress; + + /// + /// The length in bytes of memory allocated by this HOB. + /// + UINT64 MemoryLength; + + /// + /// Defines the type of memory allocated by this HOB. The memory type definition + /// follows the EFI_MEMORY_TYPE definition. Type EFI_MEMORY_TYPE is defined + /// in AllocatePages() in the UEFI 2.0 specification. + /// + EFI_MEMORY_TYPE MemoryType; + + /// + /// Padding for Itanium processor family + /// + UINT8 Reserved[4]; +} EFI_HOB_MEMORY_ALLOCATION_HEADER; + +/// +/// Describes all memory ranges used during the HOB producer +/// phase that exist outside the HOB list. This HOB type +/// describes how memory is used, not the physical attributes of memory. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION. + /// + EFI_HOB_GENERIC_HEADER Header; + /// + /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the + /// various attributes of the logical memory allocation. + /// + EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor; + // + // Additional data pertaining to the "Name" Guid memory + // may go here. + // +} EFI_HOB_MEMORY_ALLOCATION; + + +/// +/// Describes the memory stack that is produced by the HOB producer +/// phase and upon which all post-memory-installed executable +/// content in the HOB producer phase is executing. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION. + /// + EFI_HOB_GENERIC_HEADER Header; + /// + /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the + /// various attributes of the logical memory allocation. + /// + EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor; +} EFI_HOB_MEMORY_ALLOCATION_STACK; + +/// +/// Defines the location of the boot-strap +/// processor (BSP) BSPStore ("Backing Store Pointer Store"). +/// This HOB is valid for the Itanium processor family only +/// register overflow store. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION. + /// + EFI_HOB_GENERIC_HEADER Header; + /// + /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the + /// various attributes of the logical memory allocation. + /// + EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor; +} EFI_HOB_MEMORY_ALLOCATION_BSP_STORE; + +/// +/// Defines the location and entry point of the HOB consumer phase. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION. + /// + EFI_HOB_GENERIC_HEADER Header; + /// + /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the + /// various attributes of the logical memory allocation. + /// + EFI_HOB_MEMORY_ALLOCATION_HEADER MemoryAllocationHeader; + /// + /// The GUID specifying the values of the firmware file system name + /// that contains the HOB consumer phase component. + /// + EFI_GUID ModuleName; + /// + /// The address of the memory-mapped firmware volume + /// that contains the HOB consumer phase firmware file. + /// + EFI_PHYSICAL_ADDRESS EntryPoint; +} EFI_HOB_MEMORY_ALLOCATION_MODULE; + +/// +/// The resource type. +/// +typedef UINT32 EFI_RESOURCE_TYPE; + +// +// Value of ResourceType in EFI_HOB_RESOURCE_DESCRIPTOR. +// +#define EFI_RESOURCE_SYSTEM_MEMORY 0x00000000 +#define EFI_RESOURCE_MEMORY_MAPPED_IO 0x00000001 +#define EFI_RESOURCE_IO 0x00000002 +#define EFI_RESOURCE_FIRMWARE_DEVICE 0x00000003 +#define EFI_RESOURCE_MEMORY_MAPPED_IO_PORT 0x00000004 +#define EFI_RESOURCE_MEMORY_RESERVED 0x00000005 +#define EFI_RESOURCE_IO_RESERVED 0x00000006 +#define EFI_RESOURCE_MAX_MEMORY_TYPE 0x00000007 + +/// +/// A type of recount attribute type. +/// +typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE; + +// +// These types can be ORed together as needed. +// +// The following attributes are used to describe settings +// +#define EFI_RESOURCE_ATTRIBUTE_PRESENT 0x00000001 +#define EFI_RESOURCE_ATTRIBUTE_INITIALIZED 0x00000002 +#define EFI_RESOURCE_ATTRIBUTE_TESTED 0x00000004 +#define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED 0x00000080 +// +// This is typically used as memory cacheability attribute today. +// NOTE: Since PI spec 1.4, please use EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTED +// as Physical write protected attribute, and EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED +// means Memory cacheability attribute: The memory supports being programmed with +// a writeprotected cacheable attribute. +// +#define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED 0x00000100 +#define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED 0x00000200 +#define EFI_RESOURCE_ATTRIBUTE_PERSISTENT 0x00800000 +// +// The rest of the attributes are used to describe capabilities +// +#define EFI_RESOURCE_ATTRIBUTE_SINGLE_BIT_ECC 0x00000008 +#define EFI_RESOURCE_ATTRIBUTE_MULTIPLE_BIT_ECC 0x00000010 +#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_1 0x00000020 +#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_2 0x00000040 +#define EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE 0x00000400 +#define EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE 0x00000800 +#define EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE 0x00001000 +#define EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE 0x00002000 +#define EFI_RESOURCE_ATTRIBUTE_16_BIT_IO 0x00004000 +#define EFI_RESOURCE_ATTRIBUTE_32_BIT_IO 0x00008000 +#define EFI_RESOURCE_ATTRIBUTE_64_BIT_IO 0x00010000 +#define EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED 0x00020000 +#define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTABLE 0x00100000 +// +// This is typically used as memory cacheability attribute today. +// NOTE: Since PI spec 1.4, please use EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTABLE +// as Memory capability attribute: The memory supports being protected from processor +// writes, and EFI_RESOURCE_ATTRIBUTE_WRITE_PROTEC TABLE means Memory cacheability attribute: +// The memory supports being programmed with a writeprotected cacheable attribute. +// +#define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTABLE 0x00200000 +#define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTABLE 0x00400000 +#define EFI_RESOURCE_ATTRIBUTE_PERSISTABLE 0x01000000 + +#define EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTED 0x00040000 +#define EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTABLE 0x00080000 + +// +// Physical memory relative reliability attribute. This +// memory provides higher reliability relative to other +// memory in the system. If all memory has the same +// reliability, then this bit is not used. +// +#define EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE 0x02000000 + +/// +/// Describes the resource properties of all fixed, +/// nonrelocatable resource ranges found on the processor +/// host bus during the HOB producer phase. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_RESOURCE_DESCRIPTOR. + /// + EFI_HOB_GENERIC_HEADER Header; + /// + /// A GUID representing the owner of the resource. This GUID is used by HOB + /// consumer phase components to correlate device ownership of a resource. + /// + EFI_GUID Owner; + /// + /// The resource type enumeration as defined by EFI_RESOURCE_TYPE. + /// + EFI_RESOURCE_TYPE ResourceType; + /// + /// Resource attributes as defined by EFI_RESOURCE_ATTRIBUTE_TYPE. + /// + EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute; + /// + /// The physical start address of the resource region. + /// + EFI_PHYSICAL_ADDRESS PhysicalStart; + /// + /// The number of bytes of the resource region. + /// + UINT64 ResourceLength; +} EFI_HOB_RESOURCE_DESCRIPTOR; + +/// +/// Allows writers of executable content in the HOB producer phase to +/// maintain and manage HOBs with specific GUID. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_GUID_EXTENSION. + /// + EFI_HOB_GENERIC_HEADER Header; + /// + /// A GUID that defines the contents of this HOB. + /// + EFI_GUID Name; + // + // Guid specific data goes here + // +} EFI_HOB_GUID_TYPE; + +/// +/// Details the location of firmware volumes that contain firmware files. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_FV. + /// + EFI_HOB_GENERIC_HEADER Header; + /// + /// The physical memory-mapped base address of the firmware volume. + /// + EFI_PHYSICAL_ADDRESS BaseAddress; + /// + /// The length in bytes of the firmware volume. + /// + UINT64 Length; +} EFI_HOB_FIRMWARE_VOLUME; + +/// +/// Details the location of a firmware volume that was extracted +/// from a file within another firmware volume. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_FV2. + /// + EFI_HOB_GENERIC_HEADER Header; + /// + /// The physical memory-mapped base address of the firmware volume. + /// + EFI_PHYSICAL_ADDRESS BaseAddress; + /// + /// The length in bytes of the firmware volume. + /// + UINT64 Length; + /// + /// The name of the firmware volume. + /// + EFI_GUID FvName; + /// + /// The name of the firmware file that contained this firmware volume. + /// + EFI_GUID FileName; +} EFI_HOB_FIRMWARE_VOLUME2; + +/// +/// Details the location of a firmware volume that was extracted +/// from a file within another firmware volume. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_FV3. + /// + EFI_HOB_GENERIC_HEADER Header; + /// + /// The physical memory-mapped base address of the firmware volume. + /// + EFI_PHYSICAL_ADDRESS BaseAddress; + /// + /// The length in bytes of the firmware volume. + /// + UINT64 Length; + /// + /// The authentication status. + /// + UINT32 AuthenticationStatus; + /// + /// TRUE if the FV was extracted as a file within another firmware volume. + /// FALSE otherwise. + /// + BOOLEAN ExtractedFv; + /// + /// The name of the firmware volume. + /// Valid only if IsExtractedFv is TRUE. + /// + EFI_GUID FvName; + /// + /// The name of the firmware file that contained this firmware volume. + /// Valid only if IsExtractedFv is TRUE. + /// + EFI_GUID FileName; +} EFI_HOB_FIRMWARE_VOLUME3; + +/// +/// Describes processor information, such as address space and I/O space capabilities. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_CPU. + /// + EFI_HOB_GENERIC_HEADER Header; + /// + /// Identifies the maximum physical memory addressability of the processor. + /// + UINT8 SizeOfMemorySpace; + /// + /// Identifies the maximum physical I/O addressability of the processor. + /// + UINT8 SizeOfIoSpace; + /// + /// This field will always be set to zero. + /// + UINT8 Reserved[6]; +} EFI_HOB_CPU; + + +/// +/// Describes pool memory allocations. +/// +typedef struct { + /// + /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_POOL. + /// + EFI_HOB_GENERIC_HEADER Header; +} EFI_HOB_MEMORY_POOL; + +/// +/// Each UEFI capsule HOB details the location of a UEFI capsule. It includes a base address and length +/// which is based upon memory blocks with a EFI_CAPSULE_HEADER and the associated +/// CapsuleImageSize-based payloads. These HOB's shall be created by the PEI PI firmware +/// sometime after the UEFI UpdateCapsule service invocation with the +/// CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE flag set in the EFI_CAPSULE_HEADER. +/// +typedef struct { + /// + /// The HOB generic header where Header.HobType = EFI_HOB_TYPE_UEFI_CAPSULE. + /// + EFI_HOB_GENERIC_HEADER Header; + + /// + /// The physical memory-mapped base address of an UEFI capsule. This value is set to + /// point to the base of the contiguous memory of the UEFI capsule. + /// The length of the contiguous memory in bytes. + /// + EFI_PHYSICAL_ADDRESS BaseAddress; + UINT64 Length; +} EFI_HOB_UEFI_CAPSULE; + +/// +/// Union of all the possible HOB Types. +/// +typedef union { + EFI_HOB_GENERIC_HEADER *Header; + EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable; + EFI_HOB_MEMORY_ALLOCATION *MemoryAllocation; + EFI_HOB_MEMORY_ALLOCATION_BSP_STORE *MemoryAllocationBspStore; + EFI_HOB_MEMORY_ALLOCATION_STACK *MemoryAllocationStack; + EFI_HOB_MEMORY_ALLOCATION_MODULE *MemoryAllocationModule; + EFI_HOB_RESOURCE_DESCRIPTOR *ResourceDescriptor; + EFI_HOB_GUID_TYPE *Guid; + EFI_HOB_FIRMWARE_VOLUME *FirmwareVolume; + EFI_HOB_FIRMWARE_VOLUME2 *FirmwareVolume2; + EFI_HOB_FIRMWARE_VOLUME3 *FirmwareVolume3; + EFI_HOB_CPU *Cpu; + EFI_HOB_MEMORY_POOL *Pool; + EFI_HOB_UEFI_CAPSULE *Capsule; + UINT8 *Raw; +} EFI_PEI_HOB_POINTERS; + + +#endif diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiI2c.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiI2c.h new file mode 100644 index 0000000000..45f0917aee --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiI2c.h @@ -0,0 +1,301 @@ +/** @file + Include file matches things in PI. + +Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR> +SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + PI Version 1.3 + +**/ + +#ifndef __PI_I2C_H__ +#define __PI_I2C_H__ + +/// +/// A 10-bit slave address is or'ed with the following value enabling the +/// I2C protocol stack to address the duplicated address space between 0 +// and 127 in 10-bit mode. +/// +#define I2C_ADDRESSING_10_BIT 0x80000000 + +/// +/// I2C controller capabilities +/// +/// The EFI_I2C_CONTROLLER_CAPABILITIES specifies the capabilities of the +/// I2C host controller. The StructureSizeInBytes enables variations of +/// this structure to be identified if there is need to extend this +/// structure in the future. +/// +typedef struct { + /// + /// Length of this data structure in bytes + /// + UINT32 StructureSizeInBytes; + + /// + /// The maximum number of bytes the I2C host controller is able to + /// receive from the I2C bus. + /// + UINT32 MaximumReceiveBytes; + + /// + /// The maximum number of bytes the I2C host controller is able to send + /// on the I2C bus. + /// + UINT32 MaximumTransmitBytes; + + /// + /// The maximum number of bytes in the I2C bus transaction. + /// + UINT32 MaximumTotalBytes; +} EFI_I2C_CONTROLLER_CAPABILITIES; + +/// +/// I2C device description +/// +/// The EFI_I2C_ENUMERATE_PROTOCOL uses the EFI_I2C_DEVICE to describe +/// the platform specific details associated with an I2C device. This +/// description is passed to the I2C bus driver during enumeration where +/// it is made available to the third party I2C device driver via the +/// EFI_I2C_IO_PROTOCOL. +/// +typedef struct { + /// + /// Unique value assigned by the silicon manufacture or the third + /// party I2C driver writer for the I2C part. This value logically + /// combines both the manufacture name and the I2C part number into + /// a single value specified as a GUID. + /// + CONST EFI_GUID *DeviceGuid; + + /// + /// Unique ID of the I2C part within the system + /// + UINT32 DeviceIndex; + + /// + /// Hardware revision - ACPI _HRV value. See the Advanced + /// Configuration and Power Interface Specification, Revision 5.0 + /// for the field format and the Plug and play support for I2C + /// web-page for restriction on values. + /// + /// http://www.acpi.info/spec.htm + /// http://msdn.microsoft.com/en-us/library/windows/hardware/jj131711(v=vs.85).aspx + /// + UINT32 HardwareRevision; + + /// + /// I2C bus configuration for the I2C device + /// + UINT32 I2cBusConfiguration; + + /// + /// Number of slave addresses for the I2C device. + /// + UINT32 SlaveAddressCount; + + /// + /// Pointer to the array of slave addresses for the I2C device. + /// + CONST UINT32 *SlaveAddressArray; +} EFI_I2C_DEVICE; + +/// +/// Define the I2C flags +/// +/// I2C read operation when set +#define I2C_FLAG_READ 0x00000001 + +/// +/// Define the flags for SMBus operation +/// +/// The following flags are also present in only the first I2C operation +/// and are ignored when present in other operations. These flags +/// describe a particular SMB transaction as shown in the following table. +/// + +/// SMBus operation +#define I2C_FLAG_SMBUS_OPERATION 0x00010000 + +/// SMBus block operation +/// The flag I2C_FLAG_SMBUS_BLOCK causes the I2C master protocol to update +/// the LengthInBytes field of the operation in the request packet with +/// the actual number of bytes read or written. These values are only +/// valid when the entire I2C transaction is successful. +/// This flag also changes the LengthInBytes meaning to be: A maximum +/// of LengthInBytes is to be read from the device. The first byte +/// read contains the number of bytes remaining to be read, plus an +/// optional PEC value. +#define I2C_FLAG_SMBUS_BLOCK 0x00020000 + +/// SMBus process call operation +#define I2C_FLAG_SMBUS_PROCESS_CALL 0x00040000 + +/// SMBus use packet error code (PEC) +/// Note that the I2C master protocol may clear the I2C_FLAG_SMBUS_PEC bit +/// to indicate that the PEC value was checked by the hardware and is +/// not appended to the returned read data. +/// +#define I2C_FLAG_SMBUS_PEC 0x00080000 + +//---------------------------------------------------------------------- +/// +/// QuickRead: OperationCount=1, +/// LengthInBytes=0, Flags=I2C_FLAG_READ +/// QuickWrite: OperationCount=1, +/// LengthInBytes=0, Flags=0 +/// +/// +/// ReceiveByte: OperationCount=1, +/// LengthInBytes=1, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_READ +/// ReceiveByte+PEC: OperationCount=1, +/// LengthInBytes=2, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_READ +/// | I2C_FLAG_SMBUS_PEC +/// +/// +/// SendByte: OperationCount=1, +/// LengthInBytes=1, Flags=I2C_FLAG_SMBUS_OPERATION +/// SendByte+PEC: OperationCount=1, +/// LengthInBytes=2, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_PEC +/// +/// +/// ReadDataByte: OperationCount=2, +/// LengthInBytes=1, Flags=I2C_FLAG_SMBUS_OPERATION +/// LengthInBytes=1, Flags=I2C_FLAG_READ +/// ReadDataByte+PEC: OperationCount=2, +/// LengthInBytes=1, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_PEC +/// LengthInBytes=2, Flags=I2C_FLAG_READ +/// +/// +/// WriteDataByte: OperationCount=1, +/// LengthInBytes=2, Flags=I2C_FLAG_SMBUS_OPERATION +/// WriteDataByte+PEC: OperationCount=1, +/// LengthInBytes=3, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_PEC +/// +/// +/// ReadDataWord: OperationCount=2, +/// LengthInBytes=1, Flags=I2C_FLAG_SMBUS_OPERATION +/// LengthInBytes=2, Flags=I2C_FLAG_READ +/// ReadDataWord+PEC: OperationCount=2, +/// LengthInBytes=1, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_PEC +/// LengthInBytes=3, Flags=I2C_FLAG_READ +/// +/// +/// WriteDataWord: OperationCount=1, +/// LengthInBytes=3, Flags=I2C_FLAG_SMBUS_OPERATION +/// WriteDataWord+PEC: OperationCount=1, +/// LengthInBytes=4, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_PEC +/// +/// +/// ReadBlock: OperationCount=2, +/// LengthInBytes=1, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_BLOCK +/// LengthInBytes=33, Flags=I2C_FLAG_READ +/// ReadBlock+PEC: OperationCount=2, +/// LengthInBytes=1, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_BLOCK +/// | I2C_FLAG_SMBUS_PEC +/// LengthInBytes=34, Flags=I2C_FLAG_READ +/// +/// +/// WriteBlock: OperationCount=1, +/// LengthInBytes=N+2, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_BLOCK +/// WriteBlock+PEC: OperationCount=1, +/// LengthInBytes=N+3, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_BLOCK +/// | I2C_FLAG_SMBUS_PEC +/// +/// +/// ProcessCall: OperationCount=2, +/// LengthInBytes=3, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_PROCESS_CALL +/// LengthInBytes=2, Flags=I2C_FLAG_READ +/// ProcessCall+PEC: OperationCount=2, +/// LengthInBytes=3, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_PROCESS_CALL +/// | I2C_FLAG_SMBUS_PEC +/// LengthInBytes=3, Flags=I2C_FLAG_READ +/// +/// +/// BlkProcessCall: OperationCount=2, +/// LengthInBytes=N+2, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_PROCESS_CALL +/// | I2C_FLAG_SMBUS_BLOCK +/// LengthInBytes=33, Flags=I2C_FLAG_READ +/// BlkProcessCall+PEC: OperationCount=2, +/// LengthInBytes=N+2, Flags=I2C_FLAG_SMBUS_OPERATION +/// | I2C_FLAG_SMBUS_PROCESS_CALL +/// | I2C_FLAG_SMBUS_BLOCK +/// | I2C_FLAG_SMBUS_PEC +/// LengthInBytes=34, Flags=I2C_FLAG_READ +/// +//---------------------------------------------------------------------- + +/// +/// I2C device operation +/// +/// The EFI_I2C_OPERATION describes a subset of an I2C transaction in which +/// the I2C controller is either sending or receiving bytes from the bus. +/// Some transactions will consist of a single operation while others will +/// be two or more. +/// +/// Note: Some I2C controllers do not support read or write ping (address +/// only) operation and will return EFI_UNSUPPORTED status when these +/// operations are requested. +/// +/// Note: I2C controllers which do not support complex transactions requiring +/// multiple repeated start bits return EFI_UNSUPPORTED without processing +/// any of the transaction. +/// +typedef struct { + /// + /// Flags to qualify the I2C operation. + /// + UINT32 Flags; + + /// + /// Number of bytes to send to or receive from the I2C device. A ping + /// (address only byte/bytes) is indicated by setting the LengthInBytes + /// to zero. + /// + UINT32 LengthInBytes; + + /// + /// Pointer to a buffer containing the data to send or to receive from + /// the I2C device. The Buffer must be at least LengthInBytes in size. + /// + UINT8 *Buffer; +} EFI_I2C_OPERATION; + +/// +/// I2C device request +/// +/// The EFI_I2C_REQUEST_PACKET describes a single I2C transaction. The +/// transaction starts with a start bit followed by the first operation +/// in the operation array. Subsequent operations are separated with +/// repeated start bits and the last operation is followed by a stop bit +/// which concludes the transaction. Each operation is described by one +/// of the elements in the Operation array. +/// +typedef struct { + /// + /// Number of elements in the operation array + /// + UINTN OperationCount; + + /// + /// Description of the I2C operation + /// + EFI_I2C_OPERATION Operation [1]; +} EFI_I2C_REQUEST_PACKET; + +#endif // __PI_I2C_H__ diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiMmCis.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiMmCis.h new file mode 100644 index 0000000000..a802ad076a --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiMmCis.h @@ -0,0 +1,345 @@ +/** @file + Common definitions in the Platform Initialization Specification version 1.5 + VOLUME 4 Management Mode Core Interface version. + + Copyright (c) 2017, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _PI_MMCIS_H_ +#define _PI_MMCIS_H_ + +#include <Pi/PiMultiPhase.h> +#include <Protocol/MmCpuIo.h> + +typedef struct _EFI_MM_SYSTEM_TABLE EFI_MM_SYSTEM_TABLE; + +/// +/// The Management Mode System Table (MMST) signature +/// +#define MM_MMST_SIGNATURE SIGNATURE_32 ('S', 'M', 'S', 'T') +/// +/// The Management Mode System Table (MMST) revision is 1.6 +/// +#define MM_SPECIFICATION_MAJOR_REVISION 1 +#define MM_SPECIFICATION_MINOR_REVISION 60 +#define EFI_MM_SYSTEM_TABLE_REVISION ((MM_SPECIFICATION_MAJOR_REVISION<<16) | (MM_SPECIFICATION_MINOR_REVISION)) + +/** + Adds, updates, or removes a configuration table entry from the Management Mode System Table. + + The MmInstallConfigurationTable() function is used to maintain the list + of configuration tables that are stored in the Management Mode System + Table. The list is stored as an array of (GUID, Pointer) pairs. The list + must be allocated from pool memory with PoolType set to EfiRuntimeServicesData. + + @param[in] SystemTable A pointer to the MM System Table (MMST). + @param[in] Guid A pointer to the GUID for the entry to add, update, or remove. + @param[in] Table A pointer to the buffer of the table to add. + @param[in] TableSize The size of the table to install. + + @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed. + @retval EFI_INVALID_PARAMETER Guid is not valid. + @retval EFI_NOT_FOUND An attempt was made to delete a non-existent entry. + @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_MM_INSTALL_CONFIGURATION_TABLE)( + IN CONST EFI_MM_SYSTEM_TABLE *SystemTable, + IN CONST EFI_GUID *Guid, + IN VOID *Table, + IN UINTN TableSize + ); + +/** + This service lets the caller to get one distinct application processor (AP) to execute + a caller-provided code stream while in MM. + + @param[in] Procedure A pointer to the code stream to be run on the designated + AP of the system. + @param[in] CpuNumber The zero-based index of the processor number of the AP + on which the code stream is supposed to run. + @param[in,out] ProcArguments Allows the caller to pass a list of parameters to the code + that is run by the AP. + + @retval EFI_SUCCESS The call was successful and the return parameters are valid. + @retval EFI_INVALID_PARAMETER The input arguments are out of range. + @retval EFI_INVALID_PARAMETER The CPU requested is not available on this SMI invocation. + @retval EFI_INVALID_PARAMETER The CPU cannot support an additional service invocation. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_MM_STARTUP_THIS_AP)( + IN EFI_AP_PROCEDURE Procedure, + IN UINTN CpuNumber, + IN OUT VOID *ProcArguments OPTIONAL + ); + +/** + Function prototype for protocol install notification. + + @param[in] Protocol Points to the protocol's unique identifier. + @param[in] Interface Points to the interface instance. + @param[in] Handle The handle on which the interface was installed. + + @return Status Code +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_MM_NOTIFY_FN)( + IN CONST EFI_GUID *Protocol, + IN VOID *Interface, + IN EFI_HANDLE Handle + ); + +/** + Register a callback function be called when a particular protocol interface is installed. + + The MmRegisterProtocolNotify() function creates a registration Function that is to be + called whenever a protocol interface is installed for Protocol by + MmInstallProtocolInterface(). + If Function == NULL and Registration is an existing registration, then the callback is unhooked. + + @param[in] Protocol The unique ID of the protocol for which the event is to be registered. + @param[in] Function Points to the notification function. + @param[out] Registration A pointer to a memory location to receive the registration value. + + @retval EFI_SUCCESS Successfully returned the registration record + that has been added or unhooked. + @retval EFI_INVALID_PARAMETER Protocol is NULL or Registration is NULL. + @retval EFI_OUT_OF_RESOURCES Not enough memory resource to finish the request. + @retval EFI_NOT_FOUND If the registration is not found when Function == NULL. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_MM_REGISTER_PROTOCOL_NOTIFY)( + IN CONST EFI_GUID *Protocol, + IN EFI_MM_NOTIFY_FN Function, + OUT VOID **Registration + ); + +/** + Manage MMI of a particular type. + + @param[in] HandlerType Points to the handler type or NULL for root MMI handlers. + @param[in] Context Points to an optional context buffer. + @param[in,out] CommBuffer Points to the optional communication buffer. + @param[in,out] CommBufferSize Points to the size of the optional communication buffer. + + @retval EFI_WARN_INTERRUPT_SOURCE_PENDING Interrupt source was processed successfully but not quiesced. + @retval EFI_INTERRUPT_PENDING One or more SMI sources could not be quiesced. + @retval EFI_NOT_FOUND Interrupt source was not handled or quiesced. + @retval EFI_SUCCESS Interrupt source was handled and quiesced. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_MM_INTERRUPT_MANAGE)( + IN CONST EFI_GUID *HandlerType, + IN CONST VOID *Context OPTIONAL, + IN OUT VOID *CommBuffer OPTIONAL, + IN OUT UINTN *CommBufferSize OPTIONAL + ); + +/** + Main entry point for an MM handler dispatch or communicate-based callback. + + @param[in] DispatchHandle The unique handle assigned to this handler by MmiHandlerRegister(). + @param[in] Context Points to an optional handler context which was specified when the + handler was registered. + @param[in,out] CommBuffer A pointer to a collection of data in memory that will + be conveyed from a non-MM environment into an MM environment. + @param[in,out] CommBufferSize The size of the CommBuffer. + + @retval EFI_SUCCESS The interrupt was handled and quiesced. No other handlers + should still be called. + @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED The interrupt has been quiesced but other handlers should + still be called. + @retval EFI_WARN_INTERRUPT_SOURCE_PENDING The interrupt is still pending and other handlers should still + be called. + @retval EFI_INTERRUPT_PENDING The interrupt could not be quiesced. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_MM_HANDLER_ENTRY_POINT)( + IN EFI_HANDLE DispatchHandle, + IN CONST VOID *Context OPTIONAL, + IN OUT VOID *CommBuffer OPTIONAL, + IN OUT UINTN *CommBufferSize OPTIONAL + ); + +/** + Registers a handler to execute within MM. + + @param[in] Handler Handler service function pointer. + @param[in] HandlerType Points to the handler type or NULL for root MMI handlers. + @param[out] DispatchHandle On return, contains a unique handle which can be used to later + unregister the handler function. + + @retval EFI_SUCCESS MMI handler added successfully. + @retval EFI_INVALID_PARAMETER Handler is NULL or DispatchHandle is NULL. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_MM_INTERRUPT_REGISTER)( + IN EFI_MM_HANDLER_ENTRY_POINT Handler, + IN CONST EFI_GUID *HandlerType OPTIONAL, + OUT EFI_HANDLE *DispatchHandle + ); + +/** + Unregister a handler in MM. + + @param[in] DispatchHandle The handle that was specified when the handler was registered. + + @retval EFI_SUCCESS Handler function was successfully unregistered. + @retval EFI_INVALID_PARAMETER DispatchHandle does not refer to a valid handle. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_MM_INTERRUPT_UNREGISTER)( + IN EFI_HANDLE DispatchHandle + ); + +/// +/// Processor information and functionality needed by MM Foundation. +/// +typedef struct _EFI_MM_ENTRY_CONTEXT { + EFI_MM_STARTUP_THIS_AP MmStartupThisAp; + /// + /// A number between zero and the NumberOfCpus field. This field designates which + /// processor is executing the MM Foundation. + /// + UINTN CurrentlyExecutingCpu; + /// + /// The number of possible processors in the platform. This is a 1 based + /// counter. This does not indicate the number of processors that entered MM. + /// + UINTN NumberOfCpus; + /// + /// Points to an array, where each element describes the number of bytes in the + /// corresponding save state specified by CpuSaveState. There are always + /// NumberOfCpus entries in the array. + /// + UINTN *CpuSaveStateSize; + /// + /// Points to an array, where each element is a pointer to a CPU save state. The + /// corresponding element in CpuSaveStateSize specifies the number of bytes in the + /// save state area. There are always NumberOfCpus entries in the array. + /// + VOID **CpuSaveState; +} EFI_MM_ENTRY_CONTEXT; + +/** + This function is the main entry point to the MM Foundation. + + @param[in] MmEntryContext Processor information and functionality needed by MM Foundation. +**/ +typedef +VOID +(EFIAPI *EFI_MM_ENTRY_POINT)( + IN CONST EFI_MM_ENTRY_CONTEXT *MmEntryContext + ); + +/// +/// Management Mode System Table (MMST) +/// +/// The Management Mode System Table (MMST) is a table that contains a collection of common +/// services for managing MMRAM allocation and providing basic I/O services. These services are +/// intended for both preboot and runtime usage. +/// +struct _EFI_MM_SYSTEM_TABLE { + /// + /// The table header for the SMST. + /// + EFI_TABLE_HEADER Hdr; + /// + /// A pointer to a NULL-terminated Unicode string containing the vendor name. + /// It is permissible for this pointer to be NULL. + /// + CHAR16 *MmFirmwareVendor; + /// + /// The particular revision of the firmware. + /// + UINT32 MmFirmwareRevision; + + EFI_MM_INSTALL_CONFIGURATION_TABLE MmInstallConfigurationTable; + + /// + /// I/O Service + /// + EFI_MM_CPU_IO_PROTOCOL MmIo; + + /// + /// Runtime memory services + /// + EFI_ALLOCATE_POOL MmAllocatePool; + EFI_FREE_POOL MmFreePool; + EFI_ALLOCATE_PAGES MmAllocatePages; + EFI_FREE_PAGES MmFreePages; + + /// + /// MP service + /// + EFI_MM_STARTUP_THIS_AP MmStartupThisAp; + + /// + /// CPU information records + /// + + /// + /// A number between zero and and the NumberOfCpus field. This field designates + /// which processor is executing the MM infrastructure. + /// + UINTN CurrentlyExecutingCpu; + /// + /// The number of possible processors in the platform. This is a 1 based counter. + /// + UINTN NumberOfCpus; + /// + /// Points to an array, where each element describes the number of bytes in the + /// corresponding save state specified by CpuSaveState. There are always + /// NumberOfCpus entries in the array. + /// + UINTN *CpuSaveStateSize; + /// + /// Points to an array, where each element is a pointer to a CPU save state. The + /// corresponding element in CpuSaveStateSize specifies the number of bytes in the + /// save state area. There are always NumberOfCpus entries in the array. + /// + VOID **CpuSaveState; + + /// + /// Extensibility table + /// + + /// + /// The number of UEFI Configuration Tables in the buffer MmConfigurationTable. + /// + UINTN NumberOfTableEntries; + /// + /// A pointer to the UEFI Configuration Tables. The number of entries in the table is + /// NumberOfTableEntries. + /// + EFI_CONFIGURATION_TABLE *MmConfigurationTable; + + /// + /// Protocol services + /// + EFI_INSTALL_PROTOCOL_INTERFACE MmInstallProtocolInterface; + EFI_UNINSTALL_PROTOCOL_INTERFACE MmUninstallProtocolInterface; + EFI_HANDLE_PROTOCOL MmHandleProtocol; + EFI_MM_REGISTER_PROTOCOL_NOTIFY MmRegisterProtocolNotify; + EFI_LOCATE_HANDLE MmLocateHandle; + EFI_LOCATE_PROTOCOL MmLocateProtocol; + + /// + /// MMI Management functions + /// + EFI_MM_INTERRUPT_MANAGE MmiManage; + EFI_MM_INTERRUPT_REGISTER MmiHandlerRegister; + EFI_MM_INTERRUPT_UNREGISTER MmiHandlerUnRegister; +}; + +#endif diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiMultiPhase.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiMultiPhase.h new file mode 100644 index 0000000000..e4f2f00c27 --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiMultiPhase.h @@ -0,0 +1,195 @@ +/** @file + Include file matches things in PI for multiple module types. + +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> +SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + These elements are defined in UEFI Platform Initialization Specification 1.2. + +**/ + +#ifndef __PI_MULTIPHASE_H__ +#define __PI_MULTIPHASE_H__ + +#include <Pi/PiFirmwareVolume.h> +#include <Pi/PiFirmwareFile.h> +#include <Pi/PiBootMode.h> +#include <Pi/PiHob.h> +#include <Pi/PiDependency.h> +#include <Pi/PiStatusCode.h> +#include <Pi/PiS3BootScript.h> + +/** + Produces an error code in the range reserved for use by the Platform Initialization + Architecture Specification. + + The supported 32-bit range is 0xA0000000-0xBFFFFFFF + The supported 64-bit range is 0xA000000000000000-0xBFFFFFFFFFFFFFFF + + @param StatusCode The status code value to convert into a warning code. + StatusCode must be in the range 0x00000000..0x1FFFFFFF. + + @return The value specified by StatusCode in the PI reserved range. + +**/ +#define DXE_ERROR(StatusCode) (MAX_BIT | (MAX_BIT >> 2) | StatusCode) + +/// +/// If this value is returned by an EFI image, then the image should be unloaded. +/// +#define EFI_REQUEST_UNLOAD_IMAGE DXE_ERROR (1) + +/// +/// If this value is returned by an API, it means the capability is not yet +/// installed/available/ready to use. +/// +#define EFI_NOT_AVAILABLE_YET DXE_ERROR (2) + +/// +/// Success and warning codes reserved for use by PI. +/// Supported 32-bit range is 0x20000000-0x3fffffff. +/// Supported 64-bit range is 0x2000000000000000-0x3fffffffffffffff. +/// +#define PI_ENCODE_WARNING(a) ((MAX_BIT >> 2) | (a)) + +/// +/// Error codes reserved for use by PI. +/// Supported 32-bit range is 0xa0000000-0xbfffffff. +/// Supported 64-bit range is 0xa000000000000000-0xbfffffffffffffff. +/// +#define PI_ENCODE_ERROR(a) (MAX_BIT | (MAX_BIT >> 2) | (a)) + +/// +/// Return status codes defined in SMM CIS. +/// +#define EFI_INTERRUPT_PENDING PI_ENCODE_ERROR (0) + +#define EFI_WARN_INTERRUPT_SOURCE_PENDING PI_ENCODE_WARNING (0) +#define EFI_WARN_INTERRUPT_SOURCE_QUIESCED PI_ENCODE_WARNING (1) + +/// +/// Bitmask of values for Authentication Status. +/// Authentication Status is returned from EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL +/// and the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI +/// +/// xx00 Image was not signed. +/// xxx1 Platform security policy override. Assumes the same meaning as 0010 (the image was signed, the +/// signature was tested, and the signature passed authentication test). +/// 0010 Image was signed, the signature was tested, and the signature passed authentication test. +/// 0110 Image was signed and the signature was not tested. +/// 1010 Image was signed, the signature was tested, and the signature failed the authentication test. +/// +///@{ +#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 +#define EFI_AUTH_STATUS_ALL 0x0f +///@} + +/// +/// MMRAM states and capabilities +/// +#define EFI_MMRAM_OPEN 0x00000001 +#define EFI_MMRAM_CLOSED 0x00000002 +#define EFI_MMRAM_LOCKED 0x00000004 +#define EFI_CACHEABLE 0x00000008 +#define EFI_ALLOCATED 0x00000010 +#define EFI_NEEDS_TESTING 0x00000020 +#define EFI_NEEDS_ECC_INITIALIZATION 0x00000040 + +#define EFI_SMRAM_OPEN EFI_MMRAM_OPEN +#define EFI_SMRAM_CLOSED EFI_MMRAM_CLOSED +#define EFI_SMRAM_LOCKED EFI_MMRAM_LOCKED + +/// +/// Structure describing a MMRAM region and its accessibility attributes. +/// +typedef struct { + /// + /// Designates the physical address of the MMRAM in memory. This view of memory is + /// the same as seen by I/O-based agents, for example, but it may not be the address seen + /// by the processors. + /// + EFI_PHYSICAL_ADDRESS PhysicalStart; + /// + /// Designates the address of the MMRAM, as seen by software executing on the + /// processors. This address may or may not match PhysicalStart. + /// + EFI_PHYSICAL_ADDRESS CpuStart; + /// + /// Describes the number of bytes in the MMRAM region. + /// + UINT64 PhysicalSize; + /// + /// Describes the accessibility attributes of the MMRAM. These attributes include the + /// hardware state (e.g., Open/Closed/Locked), capability (e.g., cacheable), logical + /// allocation (e.g., allocated), and pre-use initialization (e.g., needs testing/ECC + /// initialization). + /// + UINT64 RegionState; +} EFI_MMRAM_DESCRIPTOR; + +typedef EFI_MMRAM_DESCRIPTOR EFI_SMRAM_DESCRIPTOR; + +typedef enum { + EFI_PCD_TYPE_8, + EFI_PCD_TYPE_16, + EFI_PCD_TYPE_32, + EFI_PCD_TYPE_64, + EFI_PCD_TYPE_BOOL, + EFI_PCD_TYPE_PTR +} EFI_PCD_TYPE; + +typedef struct { + /// + /// The returned information associated with the requested TokenNumber. If + /// TokenNumber is 0, then PcdType is set to EFI_PCD_TYPE_8. + /// + EFI_PCD_TYPE PcdType; + /// + /// The size of the data in bytes associated with the TokenNumber specified. If + /// TokenNumber is 0, then PcdSize is set 0. + /// + UINTN PcdSize; + /// + /// The null-terminated ASCII string associated with a given token. If the + /// TokenNumber specified was 0, then this field corresponds to the null-terminated + /// ASCII string associated with the token's namespace Guid. If NULL, there is no + /// name associated with this request. + /// + CHAR8 *PcdName; +} EFI_PCD_INFO; + +/** + The function prototype for invoking a function on an Application Processor. + + This definition is used by the UEFI MP Serices Protocol, and the + PI SMM System Table. + + @param[in,out] Buffer The pointer to private data buffer. +**/ +typedef +VOID +(EFIAPI *EFI_AP_PROCEDURE)( + IN OUT VOID *Buffer + ); + +/** + The function prototype for invoking a function on an Application Processor. + + This definition is used by the UEFI MM MP Serices Protocol. + + @param[in] ProcedureArgument The pointer to private data buffer. + + @retval EFI_SUCCESS Excutive the procedure successfully + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_AP_PROCEDURE2)( + IN VOID *ProcedureArgument +); + +#endif diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiPeiCis.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiPeiCis.h new file mode 100644 index 0000000000..3f25f58c95 --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiPeiCis.h @@ -0,0 +1,1061 @@ +/** @file + PI PEI master include file. This file should match the PI spec. + +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR> +SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + PI Version 1.7. + +**/ + +#ifndef __PI_PEICIS_H__ +#define __PI_PEICIS_H__ + +#include <Uefi/UefiMultiPhase.h> +#include <Pi/PiMultiPhase.h> + +/// +/// The handles of EFI FV. +/// +typedef VOID *EFI_PEI_FV_HANDLE; + +/// +/// The handles of EFI FFS. +/// +typedef VOID *EFI_PEI_FILE_HANDLE; + +/// +/// Declare the forward reference data structure for EFI_PEI_SERVICE. +/// +typedef struct _EFI_PEI_SERVICES EFI_PEI_SERVICES; + +/// +/// Declare the forward reference data structure for EFI_PEI_NOTIFY_DESCRIPTOR. +/// +typedef struct _EFI_PEI_NOTIFY_DESCRIPTOR EFI_PEI_NOTIFY_DESCRIPTOR; + + +#include <Ppi/CpuIo.h> +#include <Ppi/PciCfg2.h> + + +/** + The PEI Dispatcher will invoke each PEIM one time. During this pass, the PEI + Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header. + + @param FileHandle Pointer to the FFS file header. + @param PeiServices Describes the list of possible PEI Services. + + @retval EFI_SUCCESS The PEI completed successfully. + @retval !EFI_SUCCESS There is error in PEIM. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEIM_ENTRY_POINT2)( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ); + +/** + Entry point of the notification callback function itself within the PEIM. + + @param PeiServices Indirect reference to the PEI Services Table. + @param NotifyDescriptor Address of the notification descriptor data structure. + @param Ppi Address of the PPI that was installed. + + @return Status of the notification. + The status code returned from this function is ignored. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEIM_NOTIFY_ENTRY_POINT)( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, + IN VOID *Ppi + ); + +// +// PEI Ppi Services List Descriptors +// +#define EFI_PEI_PPI_DESCRIPTOR_PIC 0x00000001 +#define EFI_PEI_PPI_DESCRIPTOR_PPI 0x00000010 +#define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK 0x00000020 +#define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH 0x00000040 +#define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES 0x00000060 +#define EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST 0x80000000 + +/// +/// The data structure through which a PEIM describes available services to the PEI Foundation. +/// +typedef struct { + /// + /// This field is a set of flags describing the characteristics of this imported table entry. + /// All flags are defined as EFI_PEI_PPI_DESCRIPTOR_***, which can also be combined into one. + /// + UINTN Flags; + /// + /// The address of the EFI_GUID that names the interface. + /// + EFI_GUID *Guid; + /// + /// A pointer to the PPI. It contains the information necessary to install a service. + /// + VOID *Ppi; +} EFI_PEI_PPI_DESCRIPTOR; + +/// +/// The data structure in a given PEIM that tells the PEI +/// Foundation where to invoke the notification service. +/// +struct _EFI_PEI_NOTIFY_DESCRIPTOR { + /// + /// Details if the type of notification are callback or dispatch. + /// + UINTN Flags; + /// + /// The address of the EFI_GUID that names the interface. + /// + EFI_GUID *Guid; + /// + /// Address of the notification callback function itself within the PEIM. + /// + EFI_PEIM_NOTIFY_ENTRY_POINT Notify; +}; + +/// +/// This data structure is the means by which callable services are installed and +/// notifications are registered in the PEI phase. +/// +typedef union { + /// + /// The typedef structure of the notification descriptor. + /// + EFI_PEI_NOTIFY_DESCRIPTOR Notify; + /// + /// The typedef structure of the PPI descriptor. + /// + EFI_PEI_PPI_DESCRIPTOR Ppi; +} EFI_PEI_DESCRIPTOR; + +/** + This service is the first one provided by the PEI Foundation. This function + installs an interface in the PEI PPI database by GUID. The purpose of the + service is to publish an interface that other parties can use to call + additional PEIMs. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table + published by the PEI Foundation. + @param PpiList A pointer to the list of interfaces that the caller shall install. + + @retval EFI_SUCCESS The interface was successfully installed. + @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI + descriptors in the list do not have the + EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field. + @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_INSTALL_PPI)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList + ); + +/** + This function reinstalls an interface in the PEI PPI database by GUID. + The purpose of the service is to publish an interface that other parties + can use to replace a same-named interface in the protocol database + with a different interface. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table + published by the PEI Foundation. + @param OldPpi A pointer to the former PPI in the database. + @param NewPpi A pointer to the new interfaces that the caller shall install. + + @retval EFI_SUCCESS The interface was successfully installed. + @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI descriptors in the + list do not have the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field. + @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database. + @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been installed. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_REINSTALL_PPI)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi, + IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi + ); + +/** + This function locates an interface in the PEI PPI database by GUID. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES published by the PEI Foundation. + @param Guid A pointer to the GUID whose corresponding interface needs to be found. + @param Instance The N-th instance of the interface that is required. + @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR. + @param Ppi A pointer to the instance of the interface. + + @retval EFI_SUCCESS The interface was successfully returned. + @retval EFI_NOT_FOUND The PPI descriptor is not found in the database. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_LOCATE_PPI)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_GUID *Guid, + IN UINTN Instance, + IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor OPTIONAL, + IN OUT VOID **Ppi + ); + +/** + This function installs a notification service to be called back when a + given interface is installed or reinstalled. The purpose of the service + is to publish an interface that other parties can use to call additional PPIs + that may materialize later. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation + @param NotifyList A pointer to the list of notification interfaces that the caller shall install. + + @retval EFI_SUCCESS The interface was successfully installed. + @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL, or any of the PEI PPI descriptors in the + list do not have the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field. + @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_NOTIFY_PPI)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList + ); + +/** + This function returns the present value of the boot mode. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param BootMode A pointer to contain the value of the boot mode. + + @retval EFI_SUCCESS The boot mode returned successfully. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_GET_BOOT_MODE)( + IN CONST EFI_PEI_SERVICES **PeiServices, + OUT EFI_BOOT_MODE *BootMode + ); + +/** + This function sets the value of the boot mode. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation + @param BootMode The value of the boot mode to set. + + @retval EFI_SUCCESS The boot mode returned successfully. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_SET_BOOT_MODE)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_BOOT_MODE BootMode + ); + +/** + This function returns the pointer to the list of Hand-Off Blocks (HOBs) in memory. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation + @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize + + @retval EFI_SUCCESS The list was successfully returned. + @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_GET_HOB_LIST)( + IN CONST EFI_PEI_SERVICES **PeiServices, + OUT VOID **HobList + ); + +/** + This service, published by the PEI Foundation, abstracts the creation of a Hand-Off Block's (HOB's) headers. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param Type The type of HOB to be installed. + @param Length The length of the HOB to be added. + @param Hob The address of a pointer that will contain the HOB header. + + @retval EFI_SUCCESS The HOB was successfully created. + @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_CREATE_HOB)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN UINT16 Type, + IN UINT16 Length, + IN OUT VOID **Hob + ); + +/** + The purpose of the service is to abstract the capability of the PEI + Foundation to discover instances of firmware volumes in the system. + + This service enables PEIMs to discover additional firmware volumes. The PEI Foundation uses this + service to abstract the locations and formats of various firmware volumes. These volumes include + the Boot Firmware Volume and any other volumes exposed by EFI_PEI_FV_PPI. The service + returns a volume handle of type EFI_PEI_FV_HANDLE, which must be unique within the system. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param Instance This instance of the firmware volume to find. + The value 0 is the Boot Firmware Volume (BFV). + @param VolumeHandle On exit, points to the next volumn handle or NULL if it does not exist. + + @retval EFI_SUCCESS The volume was found. + @retval EFI_NOT_FOUND The volume was not found. + @retval EFI_INVALID_PARAMETER VolumeHandle is NULL. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME2)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN UINTN Instance, + OUT EFI_PEI_FV_HANDLE *VolumeHandle + ); + +/** + Searches for the next matching file in the firmware volume. + + This service enables PEIMs to discover firmware files within a specified volume. + To find the first instance of a firmware file, pass a FileHandle value of NULL into the service. + The service returns a file handle of type EFI_PEI_FILE_HANDLE, which must be unique within + the system. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param SearchType A filter to find files only of this type. + @param FvHandle Handle of firmware volume in which to search. + @param FileHandle On entry, points to the current handle from which to begin searching + or NULL to start at the beginning of the firmware volume. + On exit, points the file handle of the next file in the volume or NULL + if there are no more files. + + @retval EFI_SUCCESS The file was found. + @retval EFI_NOT_FOUND The file was not found. + @retval EFI_NOT_FOUND The header checksum was not zero. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE2)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_FV_FILETYPE SearchType, + IN CONST EFI_PEI_FV_HANDLE FvHandle, + IN OUT EFI_PEI_FILE_HANDLE *FileHandle + ); + +/** + Searches for the next matching section within the specified file. + + This service enables PEI modules to discover the first section of a given type within a valid file. + This service will search within encapsulation sections (compression and GUIDed) as well. It will + search inside of a GUIDed section or a compressed section, but may not, for example, search a + GUIDed section inside a GUIDes section. + This service will not search within compression sections or GUIDed sections that require + extraction if memory is not present. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param SectionType The value of the section type to find. + @param FileHandle Handle of the firmware file to search. + @param SectionData A pointer to the discovered section, if successful. + + @retval EFI_SUCCESS The section was found. + @retval EFI_NOT_FOUND The section was not found. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA2)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_SECTION_TYPE SectionType, + IN EFI_PEI_FILE_HANDLE FileHandle, + OUT VOID **SectionData + ); + +/** + Searches for the next matching section within the specified file. + + This service enables PEI modules to discover the section of a given type within a valid file. + This service will search within encapsulation sections (compression and GUIDed) as well. It will + search inside of a GUIDed section or a compressed section, but may not, for example, search a + GUIDed section inside a GUIDes section. + This service will not search within compression sections or GUIDed sections that require + extraction if memory is not present. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param SectionType The value of the section type to find. + @param SectionInstance Section instance to find. + @param FileHandle Handle of the firmware file to search. + @param SectionData A pointer to the discovered section, if successful. + @param AuthenticationStatus A pointer to the authentication status for this section. + + @retval EFI_SUCCESS The section was found. + @retval EFI_NOT_FOUND The section was not found. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA3)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_SECTION_TYPE SectionType, + IN UINTN SectionInstance, + IN EFI_PEI_FILE_HANDLE FileHandle, + OUT VOID **SectionData, + OUT UINT32 *AuthenticationStatus + ); + +/** + This function registers the found memory configuration with the PEI Foundation. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param MemoryBegin The value of a region of installed memory. + @param MemoryLength The corresponding length of a region of installed memory. + + @retval EFI_SUCCESS The region was successfully installed in a HOB. + @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system. + @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_INSTALL_PEI_MEMORY)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_PHYSICAL_ADDRESS MemoryBegin, + IN UINT64 MemoryLength + ); + +/** + The purpose of the service is to publish an interface that allows + PEIMs to allocate memory ranges that are managed by the PEI Foundation. + + Prior to InstallPeiMemory() being called, PEI will allocate pages from the heap. + After InstallPeiMemory() is called, PEI will allocate pages within the region + of memory provided by InstallPeiMemory() service in a best-effort fashion. + Location-specific allocations are not managed by the PEI foundation code. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param MemoryType The type of memory to allocate. + @param Pages The number of contiguous 4 KB pages to allocate. + @param Memory A pointer to a physical address. On output, the address is set to the base + of the page range that was allocated. + + @retval EFI_SUCCESS The memory range was successfully allocated. + @retval EFI_OUT_OF_RESOURCES The pages could not be allocated. + @retval EFI_INVALID_PARAMETER The type is not equal to EfiLoaderCode, EfiLoaderData, EfiRuntimeServicesCode, + EfiRuntimeServicesData, EfiBootServicesCode, EfiBootServicesData, + EfiACPIReclaimMemory, EfiReservedMemoryType, or EfiACPIMemoryNVS. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_ALLOCATE_PAGES)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN Pages, + OUT EFI_PHYSICAL_ADDRESS *Memory + ); + +/** + Frees memory pages. + + @param[in] PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param[in] Memory The base physical address of the pages to be freed. + @param[in] Pages The number of contiguous 4 KB pages to free. + + @retval EFI_SUCCESS The requested pages were freed. + @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid. + @retval EFI_NOT_FOUND The requested memory pages were not allocated with + AllocatePages(). + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FREE_PAGES) ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_PHYSICAL_ADDRESS Memory, + IN UINTN Pages + ); + +/** + The purpose of this service is to publish an interface that + allows PEIMs to allocate memory ranges that are managed by the PEI Foundation. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param Size The number of bytes to allocate from the pool. + @param Buffer If the call succeeds, a pointer to a pointer to the allocated buffer; undefined otherwise. + + @retval EFI_SUCCESS The allocation was successful. + @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_ALLOCATE_POOL)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN UINTN Size, + OUT VOID **Buffer + ); + +/** + This service copies the contents of one buffer to another buffer. + + @param Destination The pointer to the destination buffer of the memory copy. + @param Source The pointer to the source buffer of the memory copy. + @param Length The number of bytes to copy from Source to Destination. + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_COPY_MEM)( + IN VOID *Destination, + IN VOID *Source, + IN UINTN Length + ); + +/** + The service fills a buffer with a specified value. + + @param Buffer The pointer to the buffer to fill. + @param Size The number of bytes in Buffer to fill. + @param Value The value to fill Buffer with. + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_SET_MEM)( + IN VOID *Buffer, + IN UINTN Size, + IN UINT8 Value + ); + +/** + This service publishes an interface that allows PEIMs to report status codes. + + ReportStatusCode() is called by PEIMs that wish to report status information on their + progress. The principal use model is for a PEIM to emit one of the standard 32-bit error codes. This + will allow a platform owner to ascertain the state of the system, especially under conditions where + the full consoles might not have been installed. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param Type Indicates the type of status code being reported. + @param Value Describes the current status of a hardware or + software entity. This includes information about the class and + subclass that is used to classify the entity as well as an operation. + For progress codes, the operation is the current activity. + For error codes, it is the exception.For debug codes,it is not defined at this time. + @param Instance The enumeration of a hardware or software entity within + the system. A system may contain multiple entities that match a class/subclass + pairing. The instance differentiates between them. An instance of 0 indicates + that instance information is unavailable, not meaningful, or not relevant. + Valid instance numbers start with 1. + @param CallerId This optional parameter may be used to identify the caller. + This parameter allows the status code driver to apply different rules to + different callers. + @param Data This optional parameter may be used to pass additional data. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_NOT_AVAILABLE_YET No progress code provider has installed an interface in the system. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_REPORT_STATUS_CODE)( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_STATUS_CODE_TYPE Type, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN CONST EFI_GUID *CallerId OPTIONAL, + IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL + ); + +/** + Resets the entire platform. + + This service resets the entire platform, including all processors + and devices, and reboots the system. + This service will never return EFI_SUCCESS. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES + table published by the PEI Foundation. + + @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_RESET_SYSTEM)( + IN CONST EFI_PEI_SERVICES **PeiServices + ); + +/** + Resets the entire platform. + + @param[in] ResetType The type of reset to perform. + @param[in] ResetStatus The status code for the reset. + @param[in] DataSize The size, in bytes, of ResetData. + @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown + the data buffer starts with a Null-terminated string, optionally + followed by additional binary data. The string is a description + that the caller may use to further indicate the reason for the + system reset. + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_RESET2_SYSTEM) ( + IN EFI_RESET_TYPE ResetType, + IN EFI_STATUS ResetStatus, + IN UINTN DataSize, + IN VOID *ResetData OPTIONAL + ); + +/** + Find a file within a volume by its name. + + This service searches for files with a specific name, within + either the specified firmware volume or all firmware volumes. + The service returns a file handle of type EFI_PEI_FILE_HANDLE, + which must be unique within the system. + + @param FileName A pointer to the name of the file to + find within the firmware volume. + @param VolumeHandle The firmware volume to search. + @param FileHandle Upon exit, points to the found file's + handle or NULL if it could not be found. + + @retval EFI_SUCCESS The file was found. + @retval EFI_NOT_FOUND The file was not found. + @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or + FileName was NULL. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FFS_FIND_BY_NAME)( + IN CONST EFI_GUID *FileName, + IN EFI_PEI_FV_HANDLE VolumeHandle, + OUT EFI_PEI_FILE_HANDLE *FileHandle + ); + +/// +/// The information of the FV file. +/// +typedef struct { + /// + /// Name of the file. + /// + EFI_GUID FileName; + /// + /// File type. + /// + EFI_FV_FILETYPE FileType; + /// + /// Attributes of the file. + /// + EFI_FV_FILE_ATTRIBUTES FileAttributes; + /// + /// Points to the file's data (not the header). + /// Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED + /// is zero. + /// + VOID *Buffer; + /// + /// Size of the file's data. + /// + UINT32 BufferSize; +} EFI_FV_FILE_INFO; + +/// +/// The information with authentication status of the FV file. +/// +typedef struct { + /// + /// Name of the file. + /// + EFI_GUID FileName; + /// + /// File type. + /// + EFI_FV_FILETYPE FileType; + /// + /// Attributes of the file. + /// + EFI_FV_FILE_ATTRIBUTES FileAttributes; + /// + /// Points to the file's data (not the header). + /// Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED + /// is zero. + /// + VOID *Buffer; + /// + /// Size of the file's data. + /// + UINT32 BufferSize; + /// + /// Authentication status for this file. + /// + UINT32 AuthenticationStatus; +} EFI_FV_FILE_INFO2; + +/** + Returns information about a specific file. + + This function returns information about a specific file, + including its file name, type, attributes, starting address and + size. If the firmware volume is not memory mapped, then the + Buffer member will be NULL. + + @param FileHandle The handle of the file. + @param FileInfo Upon exit, points to the file's + information. + + @retval EFI_SUCCESS File information was returned. + @retval EFI_INVALID_PARAMETER FileHandle does not + represent a valid file. + @retval EFI_INVALID_PARAMETER FileInfo is NULL. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FFS_GET_FILE_INFO)( + IN EFI_PEI_FILE_HANDLE FileHandle, + OUT EFI_FV_FILE_INFO *FileInfo + ); + +/** + Returns information about a specific file. + + This function returns information about a specific file, + including its file name, type, attributes, starting address, size and authentication status. + If the firmware volume is not memory mapped, then the Buffer member will be NULL. + + @param FileHandle The handle of the file. + @param FileInfo Upon exit, points to the file's + information. + + @retval EFI_SUCCESS File information was returned. + @retval EFI_INVALID_PARAMETER FileHandle does not + represent a valid file. + @retval EFI_INVALID_PARAMETER FileInfo is NULL. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FFS_GET_FILE_INFO2)( + IN EFI_PEI_FILE_HANDLE FileHandle, + OUT EFI_FV_FILE_INFO2 *FileInfo + ); + +/// +/// The information of the FV volume. +/// +typedef struct { + /// + /// Attributes of the firmware volume. + /// + EFI_FVB_ATTRIBUTES_2 FvAttributes; + /// + /// Format of the firmware volume. + /// + EFI_GUID FvFormat; + /// + /// Name of the firmware volume. + /// + EFI_GUID FvName; + /// + /// Points to the first byte of the firmware + /// volume, if bit EFI_FVB_MEMORY_MAPPED is + /// set in FvAttributes. + /// + VOID *FvStart; + /// + /// Size of the firmware volume. + /// + UINT64 FvSize; +} EFI_FV_INFO; + +/** + Returns information about the specified volume. + + This function returns information about a specific firmware + volume, including its name, type, attributes, starting address + and size. + + @param VolumeHandle Handle of the volume. + @param VolumeInfo Upon exit, points to the volume's information. + + @retval EFI_SUCCESS The volume information returned. + @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume. + @retval EFI_INVALID_PARAMETER If VolumeHandle is NULL. + @retval EFI_SUCCESS Information was successfully returned. + @retval EFI_INVALID_PARAMETER The volume designated by the VolumeHandle is not available. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FFS_GET_VOLUME_INFO)( + IN EFI_PEI_FV_HANDLE VolumeHandle, + OUT EFI_FV_INFO *VolumeInfo + ); + +/** + Register a PEIM so that it will be shadowed and called again. + + This service registers a file handle so that after memory is + available, the PEIM will be re-loaded into permanent memory and + re-initialized. The PEIM registered this way will always be + initialized twice. The first time, this function call will + return EFI_SUCCESS. The second time, this function call will + return EFI_ALREADY_STARTED. Depending on the order in which + PEIMs are dispatched, the PEIM making this call may be + initialized after permanent memory is installed, even the first + time. + + @param FileHandle PEIM's file handle. Must be the currently + executing PEIM. + + @retval EFI_SUCCESS The PEIM was successfully registered for + shadowing. + @retval EFI_ALREADY_STARTED The PEIM was previously + registered for shadowing. + @retval EFI_NOT_FOUND The FileHandle does not refer to a + valid file handle. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_REGISTER_FOR_SHADOW)( + IN EFI_PEI_FILE_HANDLE FileHandle + ); + + +// +// PEI Specification Revision information +// +#define PEI_SPECIFICATION_MAJOR_REVISION 1 +#define PEI_SPECIFICATION_MINOR_REVISION 70 +/// +/// Specification inconsistency here: +/// In the PI1.0 spec, PEI_SERVICES_SIGNATURE is defined as 0x5652455320494550. But +/// to pass a multiple tool chain, it appends an ULL. +/// +// +// PEI Services Table +// +#define PEI_SERVICES_SIGNATURE 0x5652455320494550ULL +/// +/// Specification inconsistency here: +/// In the PI1.0 specification, there is a typo error in PEI_SERVICES_REVISION. In the specification the defintion is +/// #define ((PEI_SPECIFICATION_MAJOR_REVISION<<16) |(PEI_SPECIFICATION_MINOR_REVISION)) +/// and it should be as follows: +/// +#define PEI_SERVICES_REVISION ((PEI_SPECIFICATION_MAJOR_REVISION<<16) | (PEI_SPECIFICATION_MINOR_REVISION)) + +/// +/// EFI_PEI_SERVICES is a collection of functions whose implementation is provided by the PEI +/// Foundation. These services fall into various classes, including the following: +/// - Managing the boot mode +/// - Allocating both early and permanent memory +/// - Supporting the Firmware File System (FFS) +/// - Abstracting the PPI database abstraction +/// - Creating Hand-Off Blocks (HOBs). +/// +struct _EFI_PEI_SERVICES { + /// + /// The table header for the PEI Services Table. + /// + EFI_TABLE_HEADER Hdr; + + // + // PPI Functions + // + EFI_PEI_INSTALL_PPI InstallPpi; + EFI_PEI_REINSTALL_PPI ReInstallPpi; + EFI_PEI_LOCATE_PPI LocatePpi; + EFI_PEI_NOTIFY_PPI NotifyPpi; + + // + // Boot Mode Functions + // + EFI_PEI_GET_BOOT_MODE GetBootMode; + EFI_PEI_SET_BOOT_MODE SetBootMode; + + // + // HOB Functions + // + EFI_PEI_GET_HOB_LIST GetHobList; + EFI_PEI_CREATE_HOB CreateHob; + + // + // Firmware Volume Functions + // + EFI_PEI_FFS_FIND_NEXT_VOLUME2 FfsFindNextVolume; + EFI_PEI_FFS_FIND_NEXT_FILE2 FfsFindNextFile; + EFI_PEI_FFS_FIND_SECTION_DATA2 FfsFindSectionData; + + // + // PEI Memory Functions + // + EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory; + EFI_PEI_ALLOCATE_PAGES AllocatePages; + EFI_PEI_ALLOCATE_POOL AllocatePool; + EFI_PEI_COPY_MEM CopyMem; + EFI_PEI_SET_MEM SetMem; + + // + // Status Code + // + EFI_PEI_REPORT_STATUS_CODE ReportStatusCode; + + // + // Reset + // + EFI_PEI_RESET_SYSTEM ResetSystem; + + // + // (the following interfaces are installed by publishing PEIM) + // I/O Abstractions + // + EFI_PEI_CPU_IO_PPI *CpuIo; + EFI_PEI_PCI_CFG2_PPI *PciCfg; + + // + // Future Installed Services + // + EFI_PEI_FFS_FIND_BY_NAME FfsFindFileByName; + EFI_PEI_FFS_GET_FILE_INFO FfsGetFileInfo; + EFI_PEI_FFS_GET_VOLUME_INFO FfsGetVolumeInfo; + EFI_PEI_REGISTER_FOR_SHADOW RegisterForShadow; + EFI_PEI_FFS_FIND_SECTION_DATA3 FindSectionData3; + EFI_PEI_FFS_GET_FILE_INFO2 FfsGetFileInfo2; + EFI_PEI_RESET2_SYSTEM ResetSystem2; + EFI_PEI_FREE_PAGES FreePages; +}; + + +/// +/// EFI_SEC_PEI_HAND_OFF structure holds information about +/// PEI core's operating environment, such as the size of location of +/// temporary RAM, the stack location and BFV location. +/// +typedef struct _EFI_SEC_PEI_HAND_OFF { + /// + /// Size of the data structure. + /// + UINT16 DataSize; + + /// + /// Points to the first byte of the boot firmware volume, + /// which the PEI Dispatcher should search for + /// PEI modules. + /// + VOID *BootFirmwareVolumeBase; + + /// + /// Size of the boot firmware volume, in bytes. + /// + UINTN BootFirmwareVolumeSize; + + /// + /// Points to the first byte of the temporary RAM. + /// + VOID *TemporaryRamBase; + + /// + /// Size of the temporary RAM, in bytes. + /// + UINTN TemporaryRamSize; + + /// + /// Points to the first byte of the temporary RAM + /// available for use by the PEI Foundation. The area + /// described by PeiTemporaryRamBase and PeiTemporaryRamSize + /// must not extend outside beyond the area described by + /// TemporaryRamBase & TemporaryRamSize. This area should not + /// overlap with the area reported by StackBase and + /// StackSize. + /// + VOID *PeiTemporaryRamBase; + + /// + /// The size of the available temporary RAM available for + /// use by the PEI Foundation, in bytes. + /// + UINTN PeiTemporaryRamSize; + + /// + /// Points to the first byte of the stack. + /// This are may be part of the memory described by + /// TemporaryRamBase and TemporaryRamSize + /// or may be an entirely separate area. + /// + VOID *StackBase; + + /// + /// Size of the stack, in bytes. + /// + UINTN StackSize; +} EFI_SEC_PEI_HAND_OFF; + + +/** + The entry point of PEI Foundation. + + This function is the entry point for the PEI Foundation, which + allows the SEC phase to pass information about the stack, + temporary RAM and the Boot Firmware Volume. In addition, it also + allows the SEC phase to pass services and data forward for use + during the PEI phase in the form of one or more PPIs. These PPI's + will be installed and/or immediately signaled if they are + notification type. There is no limit to the number of additional + PPIs that can be passed from SEC into the PEI Foundation. As part + of its initialization phase, the PEI Foundation will add these + SEC-hosted PPIs to its PPI database such that both the PEI + Foundation and any modules can leverage the associated service + calls and/or code in these early PPIs. + + @param SecCoreData Points to a data structure containing + information about the PEI core's + operating environment, such as the size + and location of temporary RAM, the stack + location and the BFV location. + + @param PpiList Points to a list of one or more PPI + descriptors to be installed initially by + the PEI core. An empty PPI list consists + of a single descriptor with the end-tag + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. + As part of its initialization phase, the + PEI Foundation will add these SEC-hosted + PPIs to its PPI database such that both + the PEI Foundation and any modules can + leverage the associated service calls + and/or code in these early PPIs. + + +**/ +typedef +VOID +(EFIAPI *EFI_PEI_CORE_ENTRY_POINT)( + IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, + IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList +); + +#endif diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiS3BootScript.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiS3BootScript.h new file mode 100644 index 0000000000..b1c4de2859 --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiS3BootScript.h @@ -0,0 +1,53 @@ +/** @file + This file contains the boot script defintions that are shared between the + Boot Script Executor PPI and the Boot Script Save Protocol. + + Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _PI_S3_BOOT_SCRIPT_H_ +#define _PI_S3_BOOT_SCRIPT_H_ + +//******************************************* +// EFI Boot Script Opcode definitions +//******************************************* +#define EFI_BOOT_SCRIPT_IO_WRITE_OPCODE 0x00 +#define EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE 0x01 +#define EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE 0x02 +#define EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE 0x03 +#define EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE 0x04 +#define EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE 0x05 +#define EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE 0x06 +#define EFI_BOOT_SCRIPT_STALL_OPCODE 0x07 +#define EFI_BOOT_SCRIPT_DISPATCH_OPCODE 0x08 +#define EFI_BOOT_SCRIPT_DISPATCH_2_OPCODE 0x09 +#define EFI_BOOT_SCRIPT_INFORMATION_OPCODE 0x0A +#define EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE 0x0B +#define EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE 0x0C +#define EFI_BOOT_SCRIPT_IO_POLL_OPCODE 0x0D +#define EFI_BOOT_SCRIPT_MEM_POLL_OPCODE 0x0E +#define EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE 0x0F +#define EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE 0x10 + +//******************************************* +// EFI_BOOT_SCRIPT_WIDTH +//******************************************* +typedef enum { + EfiBootScriptWidthUint8, + EfiBootScriptWidthUint16, + EfiBootScriptWidthUint32, + EfiBootScriptWidthUint64, + EfiBootScriptWidthFifoUint8, + EfiBootScriptWidthFifoUint16, + EfiBootScriptWidthFifoUint32, + EfiBootScriptWidthFifoUint64, + EfiBootScriptWidthFillUint8, + EfiBootScriptWidthFillUint16, + EfiBootScriptWidthFillUint32, + EfiBootScriptWidthFillUint64, + EfiBootScriptWidthMaximum +} EFI_BOOT_SCRIPT_WIDTH; + +#endif diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiSmmCis.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiSmmCis.h new file mode 100644 index 0000000000..f081dc2aaf --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiSmmCis.h @@ -0,0 +1,200 @@ +/** @file + Common definitions in the Platform Initialization Specification version 1.4a + VOLUME 4 System Management Mode Core Interface version. + + Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _PI_SMMCIS_H_ +#define _PI_SMMCIS_H_ + +#include <Pi/PiMmCis.h> +#include <Protocol/SmmCpuIo2.h> + +typedef struct _EFI_SMM_SYSTEM_TABLE2 EFI_SMM_SYSTEM_TABLE2; +// +// Define new MM related definition introduced by PI 1.5. +// +#define SMM_SMST_SIGNATURE MM_MMST_SIGNATURE +#define SMM_SPECIFICATION_MAJOR_REVISION MM_SPECIFICATION_MAJOR_REVISION +#define SMM_SPECIFICATION_MINOR_REVISION MM_SPECIFICATION_MINOR_REVISION +#define EFI_SMM_SYSTEM_TABLE2_REVISION EFI_MM_SYSTEM_TABLE_REVISION + +/** + Adds, updates, or removes a configuration table entry from the System Management System Table. + + The SmmInstallConfigurationTable() function is used to maintain the list + of configuration tables that are stored in the System Management System + Table. The list is stored as an array of (GUID, Pointer) pairs. The list + must be allocated from pool memory with PoolType set to EfiRuntimeServicesData. + + @param[in] SystemTable A pointer to the SMM System Table (SMST). + @param[in] Guid A pointer to the GUID for the entry to add, update, or remove. + @param[in] Table A pointer to the buffer of the table to add. + @param[in] TableSize The size of the table to install. + + @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed. + @retval EFI_INVALID_PARAMETER Guid is not valid. + @retval EFI_NOT_FOUND An attempt was made to delete a non-existent entry. + @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE2)( + IN CONST EFI_SMM_SYSTEM_TABLE2 *SystemTable, + IN CONST EFI_GUID *Guid, + IN VOID *Table, + IN UINTN TableSize + ); + +typedef EFI_MM_STARTUP_THIS_AP EFI_SMM_STARTUP_THIS_AP; +typedef EFI_MM_NOTIFY_FN EFI_SMM_NOTIFY_FN; +typedef EFI_MM_REGISTER_PROTOCOL_NOTIFY EFI_SMM_REGISTER_PROTOCOL_NOTIFY; +typedef EFI_MM_INTERRUPT_MANAGE EFI_SMM_INTERRUPT_MANAGE; +typedef EFI_MM_HANDLER_ENTRY_POINT EFI_SMM_HANDLER_ENTRY_POINT2; +typedef EFI_MM_INTERRUPT_REGISTER EFI_SMM_INTERRUPT_REGISTER; +typedef EFI_MM_INTERRUPT_UNREGISTER EFI_SMM_INTERRUPT_UNREGISTER; + +/// +/// Processor information and functionality needed by SMM Foundation. +/// +typedef struct _EFI_SMM_ENTRY_CONTEXT { + EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp; + /// + /// A number between zero and the NumberOfCpus field. This field designates which + /// processor is executing the SMM Foundation. + /// + UINTN CurrentlyExecutingCpu; + /// + /// The number of possible processors in the platform. This is a 1 based + /// counter. This does not indicate the number of processors that entered SMM. + /// + UINTN NumberOfCpus; + /// + /// Points to an array, where each element describes the number of bytes in the + /// corresponding save state specified by CpuSaveState. There are always + /// NumberOfCpus entries in the array. + /// + UINTN *CpuSaveStateSize; + /// + /// Points to an array, where each element is a pointer to a CPU save state. The + /// corresponding element in CpuSaveStateSize specifies the number of bytes in the + /// save state area. There are always NumberOfCpus entries in the array. + /// + VOID **CpuSaveState; +} EFI_SMM_ENTRY_CONTEXT; + +/** + This function is the main entry point to the SMM Foundation. + + @param[in] SmmEntryContext Processor information and functionality needed by SMM Foundation. +**/ +typedef +VOID +(EFIAPI *EFI_SMM_ENTRY_POINT)( + IN CONST EFI_SMM_ENTRY_CONTEXT *SmmEntryContext + ); + +/// +/// System Management System Table (SMST) +/// +/// The System Management System Table (SMST) is a table that contains a collection of common +/// services for managing SMRAM allocation and providing basic I/O services. These services are +/// intended for both preboot and runtime usage. +/// +struct _EFI_SMM_SYSTEM_TABLE2 { + /// + /// The table header for the SMST. + /// + EFI_TABLE_HEADER Hdr; + /// + /// A pointer to a NULL-terminated Unicode string containing the vendor name. + /// It is permissible for this pointer to be NULL. + /// + CHAR16 *SmmFirmwareVendor; + /// + /// The particular revision of the firmware. + /// + UINT32 SmmFirmwareRevision; + + EFI_SMM_INSTALL_CONFIGURATION_TABLE2 SmmInstallConfigurationTable; + + /// + /// I/O Service + /// + EFI_SMM_CPU_IO2_PROTOCOL SmmIo; + + /// + /// Runtime memory services + /// + EFI_ALLOCATE_POOL SmmAllocatePool; + EFI_FREE_POOL SmmFreePool; + EFI_ALLOCATE_PAGES SmmAllocatePages; + EFI_FREE_PAGES SmmFreePages; + + /// + /// MP service + /// + EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp; + + /// + /// CPU information records + /// + + /// + /// A number between zero and and the NumberOfCpus field. This field designates + /// which processor is executing the SMM infrastructure. + /// + UINTN CurrentlyExecutingCpu; + /// + /// The number of possible processors in the platform. This is a 1 based counter. + /// + UINTN NumberOfCpus; + /// + /// Points to an array, where each element describes the number of bytes in the + /// corresponding save state specified by CpuSaveState. There are always + /// NumberOfCpus entries in the array. + /// + UINTN *CpuSaveStateSize; + /// + /// Points to an array, where each element is a pointer to a CPU save state. The + /// corresponding element in CpuSaveStateSize specifies the number of bytes in the + /// save state area. There are always NumberOfCpus entries in the array. + /// + VOID **CpuSaveState; + + /// + /// Extensibility table + /// + + /// + /// The number of UEFI Configuration Tables in the buffer SmmConfigurationTable. + /// + UINTN NumberOfTableEntries; + /// + /// A pointer to the UEFI Configuration Tables. The number of entries in the table is + /// NumberOfTableEntries. + /// + EFI_CONFIGURATION_TABLE *SmmConfigurationTable; + + /// + /// Protocol services + /// + EFI_INSTALL_PROTOCOL_INTERFACE SmmInstallProtocolInterface; + EFI_UNINSTALL_PROTOCOL_INTERFACE SmmUninstallProtocolInterface; + EFI_HANDLE_PROTOCOL SmmHandleProtocol; + EFI_SMM_REGISTER_PROTOCOL_NOTIFY SmmRegisterProtocolNotify; + EFI_LOCATE_HANDLE SmmLocateHandle; + EFI_LOCATE_PROTOCOL SmmLocateProtocol; + + /// + /// SMI Management functions + /// + EFI_SMM_INTERRUPT_MANAGE SmiManage; + EFI_SMM_INTERRUPT_REGISTER SmiHandlerRegister; + EFI_SMM_INTERRUPT_UNREGISTER SmiHandlerUnRegister; +}; + +#endif diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiStatusCode.h b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiStatusCode.h new file mode 100644 index 0000000000..e484f2027f --- /dev/null +++ b/src/vendorcode/intel/edk2/edk2-stable202005/MdePkg/Include/Pi/PiStatusCode.h @@ -0,0 +1,1207 @@ +/** @file + StatusCode related definitions in PI. + +Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR> +SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + These status codes are defined in UEFI Platform Initialization Specification 1.2, + Volume 3: Shared Architectural Elements. + +**/ + +#ifndef __PI_STATUS_CODE_H__ +#define __PI_STATUS_CODE_H__ + +// +// Required for IA32, X64, IPF, ARM and EBC defines for CPU exception types +// +#include <Protocol/DebugSupport.h> + +/// +/// Status Code Type Definition. +/// +typedef UINT32 EFI_STATUS_CODE_TYPE; + +/// +/// A Status Code Type is made up of the code type and severity. +/// All values masked by EFI_STATUS_CODE_RESERVED_MASK are +/// reserved for use by this specification. +/// +///@{ +#define EFI_STATUS_CODE_TYPE_MASK 0x000000FF +#define EFI_STATUS_CODE_SEVERITY_MASK 0xFF000000 +#define EFI_STATUS_CODE_RESERVED_MASK 0x00FFFF00 +///@} + +/// +/// Definition of code types. All other values masked by +/// EFI_STATUS_CODE_TYPE_MASK are reserved for use by +/// this specification. +/// +///@{ +#define EFI_PROGRESS_CODE 0x00000001 +#define EFI_ERROR_CODE 0x00000002 +#define EFI_DEBUG_CODE 0x00000003 +///@} + +/// +/// Definitions of severities, all other values masked by +/// EFI_STATUS_CODE_SEVERITY_MASK are reserved for use by +/// this specification. +/// Uncontained errors are major errors that could not contained +/// to the specific component that is reporting the error. +/// For example, if a memory error was not detected early enough, +/// the bad data could be consumed by other drivers. +/// +///@{ +#define EFI_ERROR_MINOR 0x40000000 +#define EFI_ERROR_MAJOR 0x80000000 +#define EFI_ERROR_UNRECOVERED 0x90000000 +#define EFI_ERROR_UNCONTAINED 0xa0000000 +///@} + +/// +/// Status Code Value Definition. +/// +typedef UINT32 EFI_STATUS_CODE_VALUE; + +/// +/// A Status Code Value is made up of the class, subclass, and +/// an operation. +/// +///@{ +#define EFI_STATUS_CODE_CLASS_MASK 0xFF000000 +#define EFI_STATUS_CODE_SUBCLASS_MASK 0x00FF0000 +#define EFI_STATUS_CODE_OPERATION_MASK 0x0000FFFF +///@} + +/// +/// Definition of Status Code extended data header. +/// The data will follow HeaderSize bytes from the beginning of +/// the structure and is Size bytes long. +/// +typedef struct { + /// + /// The size of the structure. This is specified to enable future expansion. + /// + UINT16 HeaderSize; + /// + /// The size of the data in bytes. This does not include the size of the header structure. + /// + UINT16 Size; + /// + /// The GUID defining the type of the data. + /// + EFI_GUID Type; +} EFI_STATUS_CODE_DATA; + +/// +/// General partitioning scheme for Progress and Error Codes are: +/// - 0x0000-0x0FFF Shared by all sub-classes in a given class. +/// - 0x1000-0x7FFF Subclass Specific. +/// - 0x8000-0xFFFF OEM specific. +///@{ +#define EFI_SUBCLASS_SPECIFIC 0x1000 +#define EFI_OEM_SPECIFIC 0x8000 +///@} + +/// +/// Debug Code definitions for all classes and subclass. +/// Only one debug code is defined at this point and should +/// be used for anything that is sent to the debug stream. +/// +///@{ +#define EFI_DC_UNSPECIFIED 0x0 +///@} + +/// +/// Class definitions. +/// Values of 4-127 are reserved for future use by this specification. +/// Values in the range 127-255 are reserved for OEM use. +/// +///@{ +#define EFI_COMPUTING_UNIT 0x00000000 +#define EFI_PERIPHERAL 0x01000000 +#define EFI_IO_BUS 0x02000000 +#define EFI_SOFTWARE 0x03000000 +///@} + +/// +/// Computing Unit Subclass definitions. +/// Values of 8-127 are reserved for future use by this specification. +/// Values of 128-255 are reserved for OEM use. +/// +///@{ +#define EFI_COMPUTING_UNIT_UNSPECIFIED (EFI_COMPUTING_UNIT | 0x00000000) +#define EFI_COMPUTING_UNIT_HOST_PROCESSOR (EFI_COMPUTING_UNIT | 0x00010000) +#define EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR (EFI_COMPUTING_UNIT | 0x00020000) +#define EFI_COMPUTING_UNIT_IO_PROCESSOR (EFI_COMPUTING_UNIT | 0x00030000) +#define EFI_COMPUTING_UNIT_CACHE (EFI_COMPUTING_UNIT | 0x00040000) +#define EFI_COMPUTING_UNIT_MEMORY (EFI_COMPUTING_UNIT | 0x00050000) +#define EFI_COMPUTING_UNIT_CHIPSET (EFI_COMPUTING_UNIT | 0x00060000) +///@} + +/// +/// Computing Unit Class Progress Code definitions. +/// These are shared by all subclasses. +/// +///@{ +#define EFI_CU_PC_INIT_BEGIN 0x00000000 +#define EFI_CU_PC_INIT_END 0x00000001 +///@} + +// +// Computing Unit Unspecified Subclass Progress Code definitions. +// + +/// +/// Computing Unit Host Processor Subclass Progress Code definitions. +///@{ +#define EFI_CU_HP_PC_POWER_ON_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_CU_HP_PC_CACHE_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_CU_HP_PC_RAM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_CU_HP_PC_MEMORY_CONTROLLER_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_CU_HP_PC_IO_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_CU_HP_PC_BSP_SELECT (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_CU_HP_PC_BSP_RESELECT (EFI_SUBCLASS_SPECIFIC | 0x00000006) +#define EFI_CU_HP_PC_AP_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000007) +#define EFI_CU_HP_PC_SMM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000008) +///@} + +// +// Computing Unit Firmware Processor Subclass Progress Code definitions. +// + +// +// Computing Unit IO Processor Subclass Progress Code definitions. +// + +/// +/// Computing Unit Cache Subclass Progress Code definitions. +/// +///@{ +#define EFI_CU_CACHE_PC_PRESENCE_DETECT (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_CU_CACHE_PC_CONFIGURATION (EFI_SUBCLASS_SPECIFIC | 0x00000001) +///@} + +/// +/// Computing Unit Memory Subclass Progress Code definitions. +/// +///@{ +#define EFI_CU_MEMORY_PC_SPD_READ (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_CU_MEMORY_PC_PRESENCE_DETECT (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_CU_MEMORY_PC_TIMING (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_CU_MEMORY_PC_CONFIGURING (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_CU_MEMORY_PC_OPTIMIZING (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_CU_MEMORY_PC_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_CU_MEMORY_PC_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000006) +///@} + +// +// Computing Unit Chipset Subclass Progress Code definitions. +// + +/// +/// South Bridge initialization prior to memory detection. +/// +#define EFI_CHIPSET_PC_PEI_CAR_SB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000000) + +/// +/// North Bridge initialization prior to memory detection. +/// +#define EFI_CHIPSET_PC_PEI_CAR_NB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000001) + +/// +/// South Bridge initialization after memory detection. +/// +#define EFI_CHIPSET_PC_PEI_MEM_SB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000002) + +/// +/// North Bridge initialization after memory detection. +/// +#define EFI_CHIPSET_PC_PEI_MEM_NB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000003) + +/// +/// PCI Host Bridge DXE initialization. +/// +#define EFI_CHIPSET_PC_DXE_HB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000004) + +/// +/// North Bridge DXE initialization. +/// +#define EFI_CHIPSET_PC_DXE_NB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000005) + +/// +/// North Bridge specific SMM initialization in DXE. +/// +#define EFI_CHIPSET_PC_DXE_NB_SMM_INIT (EFI_SUBCLASS_SPECIFIC|0x00000006) + +/// +/// Initialization of the South Bridge specific UEFI Runtime Services. +/// +#define EFI_CHIPSET_PC_DXE_SB_RT_INIT (EFI_SUBCLASS_SPECIFIC|0x00000007) + +/// +/// South Bridge DXE initialization +/// +#define EFI_CHIPSET_PC_DXE_SB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000008) + +/// +/// South Bridge specific SMM initialization in DXE. +/// +#define EFI_CHIPSET_PC_DXE_SB_SMM_INIT (EFI_SUBCLASS_SPECIFIC|0x00000009) + +/// +/// Initialization of the South Bridge devices. +/// +#define EFI_CHIPSET_PC_DXE_SB_DEVICES_INIT (EFI_SUBCLASS_SPECIFIC|0x0000000a) + +/// +/// Computing Unit Class Error Code definitions. +/// These are shared by all subclasses. +/// +///@{ +#define EFI_CU_EC_NON_SPECIFIC 0x00000000 +#define EFI_CU_EC_DISABLED 0x00000001 +#define EFI_CU_EC_NOT_SUPPORTED 0x00000002 +#define EFI_CU_EC_NOT_DETECTED 0x00000003 +#define EFI_CU_EC_NOT_CONFIGURED 0x00000004 +///@} + +// +// Computing Unit Unspecified Subclass Error Code definitions. +// + +/// +/// Computing Unit Host Processor Subclass Error Code definitions. +/// +///@{ +#define EFI_CU_HP_EC_INVALID_TYPE (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_CU_HP_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_CU_HP_EC_MISMATCH (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_CU_HP_EC_TIMER_EXPIRED (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_CU_HP_EC_SELF_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_CU_HP_EC_INTERNAL (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_CU_HP_EC_THERMAL (EFI_SUBCLASS_SPECIFIC | 0x00000006) +#define EFI_CU_HP_EC_LOW_VOLTAGE (EFI_SUBCLASS_SPECIFIC | 0x00000007) +#define EFI_CU_HP_EC_HIGH_VOLTAGE (EFI_SUBCLASS_SPECIFIC | 0x00000008) +#define EFI_CU_HP_EC_CACHE (EFI_SUBCLASS_SPECIFIC | 0x00000009) +#define EFI_CU_HP_EC_MICROCODE_UPDATE (EFI_SUBCLASS_SPECIFIC | 0x0000000A) +#define EFI_CU_HP_EC_CORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x0000000B) +#define EFI_CU_HP_EC_UNCORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x0000000C) +#define EFI_CU_HP_EC_NO_MICROCODE_UPDATE (EFI_SUBCLASS_SPECIFIC | 0x0000000D) +///@} + +/// +/// Computing Unit Firmware Processor Subclass Error Code definitions. +/// +///@{ +#define EFI_CU_FP_EC_HARD_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_CU_FP_EC_SOFT_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_CU_FP_EC_COMM_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002) +///@} + +// +// Computing Unit IO Processor Subclass Error Code definitions. +// + +/// +/// Computing Unit Cache Subclass Error Code definitions. +/// +///@{ +#define EFI_CU_CACHE_EC_INVALID_TYPE (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_CU_CACHE_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_CU_CACHE_EC_INVALID_SIZE (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_CU_CACHE_EC_MISMATCH (EFI_SUBCLASS_SPECIFIC | 0x00000003) +///@} + +/// +/// Computing Unit Memory Subclass Error Code definitions. +/// +///@{ +#define EFI_CU_MEMORY_EC_INVALID_TYPE (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_CU_MEMORY_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_CU_MEMORY_EC_CORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_CU_MEMORY_EC_UNCORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_CU_MEMORY_EC_SPD_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_CU_MEMORY_EC_INVALID_SIZE (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_CU_MEMORY_EC_MISMATCH (EFI_SUBCLASS_SPECIFIC | 0x00000006) +#define EFI_CU_MEMORY_EC_S3_RESUME_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000007) +#define EFI_CU_MEMORY_EC_UPDATE_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000008) +#define EFI_CU_MEMORY_EC_NONE_DETECTED (EFI_SUBCLASS_SPECIFIC | 0x00000009) +#define EFI_CU_MEMORY_EC_NONE_USEFUL (EFI_SUBCLASS_SPECIFIC | 0x0000000A) +///@} + +/// +/// Computing Unit Chipset Subclass Error Code definitions. +/// +///@{ +#define EFI_CHIPSET_EC_BAD_BATTERY (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_CHIPSET_EC_DXE_NB_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_CHIPSET_EC_DXE_SB_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_CHIPSET_EC_INTRUDER_DETECT (EFI_SUBCLASS_SPECIFIC | 0x00000003) +///@} + +/// +/// Peripheral Subclass definitions. +/// Values of 12-127 are reserved for future use by this specification. +/// Values of 128-255 are reserved for OEM use. +/// +///@{ +#define EFI_PERIPHERAL_UNSPECIFIED (EFI_PERIPHERAL | 0x00000000) +#define EFI_PERIPHERAL_KEYBOARD (EFI_PERIPHERAL | 0x00010000) +#define EFI_PERIPHERAL_MOUSE (EFI_PERIPHERAL | 0x00020000) +#define EFI_PERIPHERAL_LOCAL_CONSOLE (EFI_PERIPHERAL | 0x00030000) +#define EFI_PERIPHERAL_REMOTE_CONSOLE (EFI_PERIPHERAL | 0x00040000) +#define EFI_PERIPHERAL_SERIAL_PORT (EFI_PERIPHERAL | 0x00050000) +#define EFI_PERIPHERAL_PARALLEL_PORT (EFI_PERIPHERAL | 0x00060000) +#define EFI_PERIPHERAL_FIXED_MEDIA (EFI_PERIPHERAL | 0x00070000) +#define EFI_PERIPHERAL_REMOVABLE_MEDIA (EFI_PERIPHERAL | 0x00080000) +#define EFI_PERIPHERAL_AUDIO_INPUT (EFI_PERIPHERAL | 0x00090000) +#define EFI_PERIPHERAL_AUDIO_OUTPUT (EFI_PERIPHERAL | 0x000A0000) +#define EFI_PERIPHERAL_LCD_DEVICE (EFI_PERIPHERAL | 0x000B0000) +#define EFI_PERIPHERAL_NETWORK (EFI_PERIPHERAL | 0x000C0000) +#define EFI_PERIPHERAL_DOCKING (EFI_PERIPHERAL | 0x000D0000) +///@} + +/// +/// Peripheral Class Progress Code definitions. +/// These are shared by all subclasses. +/// +///@{ +#define EFI_P_PC_INIT 0x00000000 +#define EFI_P_PC_RESET 0x00000001 +#define EFI_P_PC_DISABLE 0x00000002 +#define EFI_P_PC_PRESENCE_DETECT 0x00000003 +#define EFI_P_PC_ENABLE 0x00000004 +#define EFI_P_PC_RECONFIG 0x00000005 +#define EFI_P_PC_DETECTED 0x00000006 +#define EFI_P_PC_REMOVED 0x00000007 +///@} + +// +// Peripheral Class Unspecified Subclass Progress Code definitions. +// + +/// +/// Peripheral Class Keyboard Subclass Progress Code definitions. +/// +///@{ +#define EFI_P_KEYBOARD_PC_CLEAR_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_P_KEYBOARD_PC_SELF_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000001) +///@} + +/// +/// Peripheral Class Mouse Subclass Progress Code definitions. +/// +///@{ +#define EFI_P_MOUSE_PC_SELF_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000000) +///@} + +// +// Peripheral Class Local Console Subclass Progress Code definitions. +// + +// +// Peripheral Class Remote Console Subclass Progress Code definitions. +// + +/// +/// Peripheral Class Serial Port Subclass Progress Code definitions. +/// +///@{ +#define EFI_P_SERIAL_PORT_PC_CLEAR_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000000) +///@} + +// +// Peripheral Class Parallel Port Subclass Progress Code definitions. +// + +// +// Peripheral Class Fixed Media Subclass Progress Code definitions. +// + +// +// Peripheral Class Removable Media Subclass Progress Code definitions. +// + +// +// Peripheral Class Audio Input Subclass Progress Code definitions. +// + +// +// Peripheral Class Audio Output Subclass Progress Code definitions. +// + +// +// Peripheral Class LCD Device Subclass Progress Code definitions. +// + +// +// Peripheral Class Network Subclass Progress Code definitions. +// + +/// +/// Peripheral Class Error Code definitions. +/// These are shared by all subclasses. +/// +///@{ +#define EFI_P_EC_NON_SPECIFIC 0x00000000 +#define EFI_P_EC_DISABLED 0x00000001 +#define EFI_P_EC_NOT_SUPPORTED 0x00000002 +#define EFI_P_EC_NOT_DETECTED 0x00000003 +#define EFI_P_EC_NOT_CONFIGURED 0x00000004 +#define EFI_P_EC_INTERFACE_ERROR 0x00000005 +#define EFI_P_EC_CONTROLLER_ERROR 0x00000006 +#define EFI_P_EC_INPUT_ERROR 0x00000007 +#define EFI_P_EC_OUTPUT_ERROR 0x00000008 +#define EFI_P_EC_RESOURCE_CONFLICT 0x00000009 +///@} + +// +// Peripheral Class Unspecified Subclass Error Code definitions. +// + +/// +/// Peripheral Class Keyboard Subclass Error Code definitions. +/// +///@{ +#define EFI_P_KEYBOARD_EC_LOCKED (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_P_KEYBOARD_EC_STUCK_KEY (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_P_KEYBOARD_EC_BUFFER_FULL (EFI_SUBCLASS_SPECIFIC | 0x00000002) +///@} + +/// +/// Peripheral Class Mouse Subclass Error Code definitions. +/// +///@{ +#define EFI_P_MOUSE_EC_LOCKED (EFI_SUBCLASS_SPECIFIC | 0x00000000) +///@} + +// +// Peripheral Class Local Console Subclass Error Code definitions. +// + +// +// Peripheral Class Remote Console Subclass Error Code definitions. +// + +// +// Peripheral Class Serial Port Subclass Error Code definitions. +// + +// +// Peripheral Class Parallel Port Subclass Error Code definitions. +// + +// +// Peripheral Class Fixed Media Subclass Error Code definitions. +// + +// +// Peripheral Class Removable Media Subclass Error Code definitions. +// + +// +// Peripheral Class Audio Input Subclass Error Code definitions. +// + +// +// Peripheral Class Audio Output Subclass Error Code definitions. +// + +// +// Peripheral Class LCD Device Subclass Error Code definitions. +// + +// +// Peripheral Class Network Subclass Error Code definitions. +// + +/// +/// IO Bus Subclass definitions. +/// Values of 14-127 are reserved for future use by this specification. +/// Values of 128-255 are reserved for OEM use. +/// +///@{ +#define EFI_IO_BUS_UNSPECIFIED (EFI_IO_BUS | 0x00000000) +#define EFI_IO_BUS_PCI (EFI_IO_BUS | 0x00010000) +#define EFI_IO_BUS_USB (EFI_IO_BUS | 0x00020000) +#define EFI_IO_BUS_IBA (EFI_IO_BUS | 0x00030000) +#define EFI_IO_BUS_AGP (EFI_IO_BUS | 0x00040000) +#define EFI_IO_BUS_PC_CARD (EFI_IO_BUS | 0x00050000) +#define EFI_IO_BUS_LPC (EFI_IO_BUS | 0x00060000) +#define EFI_IO_BUS_SCSI (EFI_IO_BUS | 0x00070000) +#define EFI_IO_BUS_ATA_ATAPI (EFI_IO_BUS | 0x00080000) +#define EFI_IO_BUS_FC (EFI_IO_BUS | 0x00090000) +#define EFI_IO_BUS_IP_NETWORK (EFI_IO_BUS | 0x000A0000) +#define EFI_IO_BUS_SMBUS (EFI_IO_BUS | 0x000B0000) +#define EFI_IO_BUS_I2C (EFI_IO_BUS | 0x000C0000) +///@} + +/// +/// IO Bus Class Progress Code definitions. +/// These are shared by all subclasses. +/// +///@{ +#define EFI_IOB_PC_INIT 0x00000000 +#define EFI_IOB_PC_RESET 0x00000001 +#define EFI_IOB_PC_DISABLE 0x00000002 +#define EFI_IOB_PC_DETECT 0x00000003 +#define EFI_IOB_PC_ENABLE 0x00000004 +#define EFI_IOB_PC_RECONFIG 0x00000005 +#define EFI_IOB_PC_HOTPLUG 0x00000006 +///@} + +// +// IO Bus Class Unspecified Subclass Progress Code definitions. +// + +/// +/// IO Bus Class PCI Subclass Progress Code definitions. +/// +///@{ +#define EFI_IOB_PCI_BUS_ENUM (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_IOB_PCI_RES_ALLOC (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_IOB_PCI_HPC_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000002) +///@} + +// +// IO Bus Class USB Subclass Progress Code definitions. +// + +// +// IO Bus Class IBA Subclass Progress Code definitions. +// + +// +// IO Bus Class AGP Subclass Progress Code definitions. +// + +// +// IO Bus Class PC Card Subclass Progress Code definitions. +// + +// +// IO Bus Class LPC Subclass Progress Code definitions. +// + +// +// IO Bus Class SCSI Subclass Progress Code definitions. +// + +// +// IO Bus Class ATA/ATAPI Subclass Progress Code definitions. +// +#define EFI_IOB_ATA_BUS_SMART_ENABLE (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_IOB_ATA_BUS_SMART_DISABLE (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_IOB_ATA_BUS_SMART_OVERTHRESHOLD (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_IOB_ATA_BUS_SMART_UNDERTHRESHOLD (EFI_SUBCLASS_SPECIFIC | 0x00000003) +// +// IO Bus Class FC Subclass Progress Code definitions. +// + +// +// IO Bus Class IP Network Subclass Progress Code definitions. +// + +// +// IO Bus Class SMBUS Subclass Progress Code definitions. +// + +// +// IO Bus Class I2C Subclass Progress Code definitions. +// + +/// +/// IO Bus Class Error Code definitions. +/// These are shared by all subclasses. +/// +///@{ +#define EFI_IOB_EC_NON_SPECIFIC 0x00000000 +#define EFI_IOB_EC_DISABLED 0x00000001 +#define EFI_IOB_EC_NOT_SUPPORTED 0x00000002 +#define EFI_IOB_EC_NOT_DETECTED 0x00000003 +#define EFI_IOB_EC_NOT_CONFIGURED 0x00000004 +#define EFI_IOB_EC_INTERFACE_ERROR 0x00000005 +#define EFI_IOB_EC_CONTROLLER_ERROR 0x00000006 +#define EFI_IOB_EC_READ_ERROR 0x00000007 +#define EFI_IOB_EC_WRITE_ERROR 0x00000008 +#define EFI_IOB_EC_RESOURCE_CONFLICT 0x00000009 +///@} + +// +// IO Bus Class Unspecified Subclass Error Code definitions. +// + +/// +/// IO Bus Class PCI Subclass Error Code definitions. +/// +///@{ +#define EFI_IOB_PCI_EC_PERR (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_IOB_PCI_EC_SERR (EFI_SUBCLASS_SPECIFIC | 0x00000001) +///@} + +// +// IO Bus Class USB Subclass Error Code definitions. +// + +// +// IO Bus Class IBA Subclass Error Code definitions. +// + +// +// IO Bus Class AGP Subclass Error Code definitions. +// + +// +// IO Bus Class PC Card Subclass Error Code definitions. +// + +// +// IO Bus Class LPC Subclass Error Code definitions. +// + +// +// IO Bus Class SCSI Subclass Error Code definitions. +// + +// +// IO Bus Class ATA/ATAPI Subclass Error Code definitions. +// +#define EFI_IOB_ATA_BUS_SMART_NOTSUPPORTED (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_IOB_ATA_BUS_SMART_DISABLED (EFI_SUBCLASS_SPECIFIC | 0x00000001) + +// +// IO Bus Class FC Subclass Error Code definitions. +// + +// +// IO Bus Class IP Network Subclass Error Code definitions. +// + +// +// IO Bus Class SMBUS Subclass Error Code definitions. +// + +// +// IO Bus Class I2C Subclass Error Code definitions. +// + +/// +/// Software Subclass definitions. +/// Values of 14-127 are reserved for future use by this specification. +/// Values of 128-255 are reserved for OEM use. +/// +///@{ +#define EFI_SOFTWARE_UNSPECIFIED (EFI_SOFTWARE | 0x00000000) +#define EFI_SOFTWARE_SEC (EFI_SOFTWARE | 0x00010000) +#define EFI_SOFTWARE_PEI_CORE (EFI_SOFTWARE | 0x00020000) +#define EFI_SOFTWARE_PEI_MODULE (EFI_SOFTWARE | 0x00030000) +#define EFI_SOFTWARE_DXE_CORE (EFI_SOFTWARE | 0x00040000) +#define EFI_SOFTWARE_DXE_BS_DRIVER (EFI_SOFTWARE | 0x00050000) +#define EFI_SOFTWARE_DXE_RT_DRIVER (EFI_SOFTWARE | 0x00060000) +#define EFI_SOFTWARE_SMM_DRIVER (EFI_SOFTWARE | 0x00070000) +#define EFI_SOFTWARE_EFI_APPLICATION (EFI_SOFTWARE | 0x00080000) +#define EFI_SOFTWARE_EFI_OS_LOADER (EFI_SOFTWARE | 0x00090000) +#define EFI_SOFTWARE_RT (EFI_SOFTWARE | 0x000A0000) +#define EFI_SOFTWARE_AL (EFI_SOFTWARE | 0x000B0000) +#define EFI_SOFTWARE_EBC_EXCEPTION (EFI_SOFTWARE | 0x000C0000) +#define EFI_SOFTWARE_IA32_EXCEPTION (EFI_SOFTWARE | 0x000D0000) +#define EFI_SOFTWARE_IPF_EXCEPTION (EFI_SOFTWARE | 0x000E0000) +#define EFI_SOFTWARE_PEI_SERVICE (EFI_SOFTWARE | 0x000F0000) +#define EFI_SOFTWARE_EFI_BOOT_SERVICE (EFI_SOFTWARE | 0x00100000) +#define EFI_SOFTWARE_EFI_RUNTIME_SERVICE (EFI_SOFTWARE | 0x00110000) +#define EFI_SOFTWARE_EFI_DXE_SERVICE (EFI_SOFTWARE | 0x00120000) +#define EFI_SOFTWARE_X64_EXCEPTION (EFI_SOFTWARE | 0x00130000) +#define EFI_SOFTWARE_ARM_EXCEPTION (EFI_SOFTWARE | 0x00140000) + +///@} + +/// +/// Software Class Progress Code definitions. +/// These are shared by all subclasses. +/// +///@{ +#define EFI_SW_PC_INIT 0x00000000 +#define EFI_SW_PC_LOAD 0x00000001 +#define EFI_SW_PC_INIT_BEGIN 0x00000002 +#define EFI_SW_PC_INIT_END 0x00000003 +#define EFI_SW_PC_AUTHENTICATE_BEGIN 0x00000004 +#define EFI_SW_PC_AUTHENTICATE_END 0x00000005 +#define EFI_SW_PC_INPUT_WAIT 0x00000006 +#define EFI_SW_PC_USER_SETUP 0x00000007 +///@} + +// +// Software Class Unspecified Subclass Progress Code definitions. +// + +/// +/// Software Class SEC Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_SEC_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_SEC_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001) +///@} + +/// +/// Software Class PEI Core Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_PEI_CORE_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_PEI_CORE_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000002) +///@} + +/// +/// Software Class PEI Module Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_PEI_PC_RECOVERY_BEGIN (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_PEI_PC_CAPSULE_LOAD (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_PEI_PC_CAPSULE_START (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_SW_PEI_PC_RECOVERY_USER (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_SW_PEI_PC_RECOVERY_AUTO (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_SW_PEI_PC_S3_BOOT_SCRIPT (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_SW_PEI_PC_OS_WAKE (EFI_SUBCLASS_SPECIFIC | 0x00000006) +#define EFI_SW_PEI_PC_S3_STARTED (EFI_SUBCLASS_SPECIFIC | 0x00000007) +///@} + +/// +/// Software Class DXE Core Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_DXE_CORE_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_DXE_CORE_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_SW_DXE_CORE_PC_START_DRIVER (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_SW_DXE_CORE_PC_ARCH_READY (EFI_SUBCLASS_SPECIFIC | 0x00000004) +///@} + +/// +/// Software Class DXE BS Driver Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_DXE_BS_PC_LEGACY_OPROM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_SW_DXE_BS_PC_EXIT_BOOT_SERVICES_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_SW_DXE_BS_PC_VIRTUAL_ADDRESS_CHANGE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_SW_DXE_BS_PC_VARIABLE_SERVICES_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_SW_DXE_BS_PC_VARIABLE_RECLAIM (EFI_SUBCLASS_SPECIFIC | 0x00000006) +#define EFI_SW_DXE_BS_PC_ATTEMPT_BOOT_ORDER_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000007) +#define EFI_SW_DXE_BS_PC_CONFIG_RESET (EFI_SUBCLASS_SPECIFIC | 0x00000008) +#define EFI_SW_DXE_BS_PC_CSM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000009) +///@} + +// +// Software Class SMM Driver Subclass Progress Code definitions. +// + +// +// Software Class EFI Application Subclass Progress Code definitions. +// + +// +// Software Class EFI OS Loader Subclass Progress Code definitions. +// + +/// +/// Software Class EFI RT Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_RT_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_RT_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_RT_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000002) +///@} + +// +// Software Class X64 Exception Subclass Progress Code definitions. +// + +// +// Software Class ARM Exception Subclass Progress Code definitions. +// + +// +// Software Class EBC Exception Subclass Progress Code definitions. +// + +// +// Software Class IA32 Exception Subclass Progress Code definitions. +// + +// +// Software Class X64 Exception Subclass Progress Code definitions. +// + +// +// Software Class IPF Exception Subclass Progress Code definitions. +// + +/// +/// Software Class PEI Services Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_PS_PC_INSTALL_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_PS_PC_REINSTALL_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_PS_PC_LOCATE_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_SW_PS_PC_NOTIFY_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_SW_PS_PC_GET_BOOT_MODE (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_SW_PS_PC_SET_BOOT_MODE (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_SW_PS_PC_GET_HOB_LIST (EFI_SUBCLASS_SPECIFIC | 0x00000006) +#define EFI_SW_PS_PC_CREATE_HOB (EFI_SUBCLASS_SPECIFIC | 0x00000007) +#define EFI_SW_PS_PC_FFS_FIND_NEXT_VOLUME (EFI_SUBCLASS_SPECIFIC | 0x00000008) +#define EFI_SW_PS_PC_FFS_FIND_NEXT_FILE (EFI_SUBCLASS_SPECIFIC | 0x00000009) +#define EFI_SW_PS_PC_FFS_FIND_SECTION_DATA (EFI_SUBCLASS_SPECIFIC | 0x0000000A) +#define EFI_SW_PS_PC_INSTALL_PEI_MEMORY (EFI_SUBCLASS_SPECIFIC | 0x0000000B) +#define EFI_SW_PS_PC_ALLOCATE_PAGES (EFI_SUBCLASS_SPECIFIC | 0x0000000C) +#define EFI_SW_PS_PC_ALLOCATE_POOL (EFI_SUBCLASS_SPECIFIC | 0x0000000D) +#define EFI_SW_PS_PC_COPY_MEM (EFI_SUBCLASS_SPECIFIC | 0x0000000E) +#define EFI_SW_PS_PC_SET_MEM (EFI_SUBCLASS_SPECIFIC | 0x0000000F) +#define EFI_SW_PS_PC_RESET_SYSTEM (EFI_SUBCLASS_SPECIFIC | 0x00000010) +#define EFI_SW_PS_PC_FFS_FIND_FILE_BY_NAME (EFI_SUBCLASS_SPECIFIC | 0x00000013) +#define EFI_SW_PS_PC_FFS_GET_FILE_INFO (EFI_SUBCLASS_SPECIFIC | 0x00000014) +#define EFI_SW_PS_PC_FFS_GET_VOLUME_INFO (EFI_SUBCLASS_SPECIFIC | 0x00000015) +#define EFI_SW_PS_PC_FFS_REGISTER_FOR_SHADOW (EFI_SUBCLASS_SPECIFIC | 0x00000016) +///@} + +/// +/// Software Class EFI Boot Services Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_BS_PC_RAISE_TPL (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_BS_PC_RESTORE_TPL (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_BS_PC_ALLOCATE_PAGES (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_SW_BS_PC_FREE_PAGES (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_SW_BS_PC_GET_MEMORY_MAP (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_SW_BS_PC_ALLOCATE_POOL (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_SW_BS_PC_FREE_POOL (EFI_SUBCLASS_SPECIFIC | 0x00000006) +#define EFI_SW_BS_PC_CREATE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000007) +#define EFI_SW_BS_PC_SET_TIMER (EFI_SUBCLASS_SPECIFIC | 0x00000008) +#define EFI_SW_BS_PC_WAIT_FOR_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000009) +#define EFI_SW_BS_PC_SIGNAL_EVENT (EFI_SUBCLASS_SPECIFIC | 0x0000000A) +#define EFI_SW_BS_PC_CLOSE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x0000000B) +#define EFI_SW_BS_PC_CHECK_EVENT (EFI_SUBCLASS_SPECIFIC | 0x0000000C) +#define EFI_SW_BS_PC_INSTALL_PROTOCOL_INTERFACE (EFI_SUBCLASS_SPECIFIC | 0x0000000D) +#define EFI_SW_BS_PC_REINSTALL_PROTOCOL_INTERFACE (EFI_SUBCLASS_SPECIFIC | 0x0000000E) +#define EFI_SW_BS_PC_UNINSTALL_PROTOCOL_INTERFACE (EFI_SUBCLASS_SPECIFIC | 0x0000000F) +#define EFI_SW_BS_PC_HANDLE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000010) +#define EFI_SW_BS_PC_PC_HANDLE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000011) +#define EFI_SW_BS_PC_REGISTER_PROTOCOL_NOTIFY (EFI_SUBCLASS_SPECIFIC | 0x00000012) +#define EFI_SW_BS_PC_LOCATE_HANDLE (EFI_SUBCLASS_SPECIFIC | 0x00000013) +#define EFI_SW_BS_PC_INSTALL_CONFIGURATION_TABLE (EFI_SUBCLASS_SPECIFIC | 0x00000014) +#define EFI_SW_BS_PC_LOAD_IMAGE (EFI_SUBCLASS_SPECIFIC | 0x00000015) +#define EFI_SW_BS_PC_START_IMAGE (EFI_SUBCLASS_SPECIFIC | 0x00000016) +#define EFI_SW_BS_PC_EXIT (EFI_SUBCLASS_SPECIFIC | 0x00000017) +#define EFI_SW_BS_PC_UNLOAD_IMAGE (EFI_SUBCLASS_SPECIFIC | 0x00000018) +#define EFI_SW_BS_PC_EXIT_BOOT_SERVICES (EFI_SUBCLASS_SPECIFIC | 0x00000019) +#define EFI_SW_BS_PC_GET_NEXT_MONOTONIC_COUNT (EFI_SUBCLASS_SPECIFIC | 0x0000001A) +#define EFI_SW_BS_PC_STALL (EFI_SUBCLASS_SPECIFIC | 0x0000001B) +#define EFI_SW_BS_PC_SET_WATCHDOG_TIMER (EFI_SUBCLASS_SPECIFIC | 0x0000001C) +#define EFI_SW_BS_PC_CONNECT_CONTROLLER (EFI_SUBCLASS_SPECIFIC | 0x0000001D) +#define EFI_SW_BS_PC_DISCONNECT_CONTROLLER (EFI_SUBCLASS_SPECIFIC | 0x0000001E) +#define EFI_SW_BS_PC_OPEN_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x0000001F) +#define EFI_SW_BS_PC_CLOSE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000020) +#define EFI_SW_BS_PC_OPEN_PROTOCOL_INFORMATION (EFI_SUBCLASS_SPECIFIC | 0x00000021) +#define EFI_SW_BS_PC_PROTOCOLS_PER_HANDLE (EFI_SUBCLASS_SPECIFIC | 0x00000022) +#define EFI_SW_BS_PC_LOCATE_HANDLE_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000023) +#define EFI_SW_BS_PC_LOCATE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000024) +#define EFI_SW_BS_PC_INSTALL_MULTIPLE_INTERFACES (EFI_SUBCLASS_SPECIFIC | 0x00000025) +#define EFI_SW_BS_PC_UNINSTALL_MULTIPLE_INTERFACES (EFI_SUBCLASS_SPECIFIC | 0x00000026) +#define EFI_SW_BS_PC_CALCULATE_CRC_32 (EFI_SUBCLASS_SPECIFIC | 0x00000027) +#define EFI_SW_BS_PC_COPY_MEM (EFI_SUBCLASS_SPECIFIC | 0x00000028) +#define EFI_SW_BS_PC_SET_MEM (EFI_SUBCLASS_SPECIFIC | 0x00000029) +#define EFI_SW_BS_PC_CREATE_EVENT_EX (EFI_SUBCLASS_SPECIFIC | 0x0000002A) +///@} + +/// +/// Software Class EFI Runtime Services Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_RS_PC_GET_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_RS_PC_SET_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_RS_PC_GET_WAKEUP_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_SW_RS_PC_SET_WAKEUP_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_SW_RS_PC_CONVERT_POINTER (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_SW_RS_PC_GET_VARIABLE (EFI_SUBCLASS_SPECIFIC | 0x00000006) +#define EFI_SW_RS_PC_GET_NEXT_VARIABLE_NAME (EFI_SUBCLASS_SPECIFIC | 0x00000007) +#define EFI_SW_RS_PC_SET_VARIABLE (EFI_SUBCLASS_SPECIFIC | 0x00000008) +#define EFI_SW_RS_PC_GET_NEXT_HIGH_MONOTONIC_COUNT (EFI_SUBCLASS_SPECIFIC | 0x00000009) +#define EFI_SW_RS_PC_RESET_SYSTEM (EFI_SUBCLASS_SPECIFIC | 0x0000000A) +#define EFI_SW_RS_PC_UPDATE_CAPSULE (EFI_SUBCLASS_SPECIFIC | 0x0000000B) +#define EFI_SW_RS_PC_QUERY_CAPSULE_CAPABILITIES (EFI_SUBCLASS_SPECIFIC | 0x0000000C) +#define EFI_SW_RS_PC_QUERY_VARIABLE_INFO (EFI_SUBCLASS_SPECIFIC | 0x0000000D) +///@} + +/// +/// Software Class EFI DXE Services Subclass Progress Code definitions +/// +///@{ +#define EFI_SW_DS_PC_ADD_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_DS_PC_ALLOCATE_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_DS_PC_FREE_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_SW_DS_PC_REMOVE_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_SW_DS_PC_GET_MEMORY_SPACE_DESCRIPTOR (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_SW_DS_PC_SET_MEMORY_SPACE_ATTRIBUTES (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_SW_DS_PC_GET_MEMORY_SPACE_MAP (EFI_SUBCLASS_SPECIFIC | 0x00000006) +#define EFI_SW_DS_PC_ADD_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000007) +#define EFI_SW_DS_PC_ALLOCATE_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000008) +#define EFI_SW_DS_PC_FREE_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000009) +#define EFI_SW_DS_PC_REMOVE_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x0000000A) +#define EFI_SW_DS_PC_GET_IO_SPACE_DESCRIPTOR (EFI_SUBCLASS_SPECIFIC | 0x0000000B) +#define EFI_SW_DS_PC_GET_IO_SPACE_MAP (EFI_SUBCLASS_SPECIFIC | 0x0000000C) +#define EFI_SW_DS_PC_DISPATCH (EFI_SUBCLASS_SPECIFIC | 0x0000000D) +#define EFI_SW_DS_PC_SCHEDULE (EFI_SUBCLASS_SPECIFIC | 0x0000000E) +#define EFI_SW_DS_PC_TRUST (EFI_SUBCLASS_SPECIFIC | 0x0000000F) +#define EFI_SW_DS_PC_PROCESS_FIRMWARE_VOLUME (EFI_SUBCLASS_SPECIFIC | 0x00000010) +///@} + +/// +/// Software Class Error Code definitions. +/// These are shared by all subclasses. +/// +///@{ +#define EFI_SW_EC_NON_SPECIFIC 0x00000000 +#define EFI_SW_EC_LOAD_ERROR 0x00000001 +#define EFI_SW_EC_INVALID_PARAMETER 0x00000002 +#define EFI_SW_EC_UNSUPPORTED 0x00000003 +#define EFI_SW_EC_INVALID_BUFFER 0x00000004 +#define EFI_SW_EC_OUT_OF_RESOURCES 0x00000005 +#define EFI_SW_EC_ABORTED 0x00000006 +#define EFI_SW_EC_ILLEGAL_SOFTWARE_STATE 0x00000007 +#define EFI_SW_EC_ILLEGAL_HARDWARE_STATE 0x00000008 +#define EFI_SW_EC_START_ERROR 0x00000009 +#define EFI_SW_EC_BAD_DATE_TIME 0x0000000A +#define EFI_SW_EC_CFG_INVALID 0x0000000B +#define EFI_SW_EC_CFG_CLR_REQUEST 0x0000000C +#define EFI_SW_EC_CFG_DEFAULT 0x0000000D +#define EFI_SW_EC_PWD_INVALID 0x0000000E +#define EFI_SW_EC_PWD_CLR_REQUEST 0x0000000F +#define EFI_SW_EC_PWD_CLEARED 0x00000010 +#define EFI_SW_EC_EVENT_LOG_FULL 0x00000011 +#define EFI_SW_EC_WRITE_PROTECTED 0x00000012 +#define EFI_SW_EC_FV_CORRUPTED 0x00000013 +///@} + +// +// Software Class Unspecified Subclass Error Code definitions. +// + +// +// Software Class SEC Subclass Error Code definitions. +// + +/// +/// Software Class PEI Core Subclass Error Code definitions. +/// +///@{ +#define EFI_SW_PEI_CORE_EC_DXE_CORRUPT (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_PEI_CORE_EC_DXEIPL_NOT_FOUND (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_PEI_CORE_EC_MEMORY_NOT_INSTALLED (EFI_SUBCLASS_SPECIFIC | 0x00000002) +///@} + +/// +/// Software Class PEI Module Subclass Error Code definitions. +/// +///@{ +#define EFI_SW_PEI_EC_NO_RECOVERY_CAPSULE (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_PEI_EC_INVALID_CAPSULE_DESCRIPTOR (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_PEI_EC_S3_RESUME_PPI_NOT_FOUND (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_SW_PEI_EC_S3_BOOT_SCRIPT_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_SW_PEI_EC_S3_OS_WAKE_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_SW_PEI_EC_S3_RESUME_FAILED (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_SW_PEI_EC_RECOVERY_PPI_NOT_FOUND (EFI_SUBCLASS_SPECIFIC | 0x00000006) +#define EFI_SW_PEI_EC_RECOVERY_FAILED (EFI_SUBCLASS_SPECIFIC | 0x00000007) +#define EFI_SW_PEI_EC_S3_RESUME_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000008) +#define EFI_SW_PEI_EC_INVALID_CAPSULE (EFI_SUBCLASS_SPECIFIC | 0x00000009) +///@} + +/// +/// Software Class DXE Foundation Subclass Error Code definitions. +/// +///@{ +#define EFI_SW_DXE_CORE_EC_NO_ARCH (EFI_SUBCLASS_SPECIFIC | 0x00000000) +///@} + + +/// +/// Software Class DXE Boot Service Driver Subclass Error Code definitions. +/// +///@{ +#define EFI_SW_DXE_BS_EC_LEGACY_OPROM_NO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_DXE_BS_EC_INVALID_PASSWORD (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_SW_DXE_BS_EC_INVALID_IDE_PASSWORD (EFI_SUBCLASS_SPECIFIC | 0x00000004) +///@} + +// +// Software Class DXE Runtime Service Driver Subclass Error Code definitions. +// + +// +// Software Class SMM Driver Subclass Error Code definitions. +// + +// +// Software Class EFI Application Subclass Error Code definitions. +// + +// +// Software Class EFI OS Loader Subclass Error Code definitions. +// + +// +// Software Class EFI RT Subclass Error Code definitions. +// + +// +// Software Class EFI AL Subclass Error Code definitions. +// + +/// +/// Software Class EBC Exception Subclass Error Code definitions. +/// These exceptions are derived from the debug protocol definitions in the EFI +/// specification. +/// +///@{ +#define EFI_SW_EC_EBC_UNDEFINED 0x00000000 +#define EFI_SW_EC_EBC_DIVIDE_ERROR EXCEPT_EBC_DIVIDE_ERROR +#define EFI_SW_EC_EBC_DEBUG EXCEPT_EBC_DEBUG +#define EFI_SW_EC_EBC_BREAKPOINT EXCEPT_EBC_BREAKPOINT +#define EFI_SW_EC_EBC_OVERFLOW EXCEPT_EBC_OVERFLOW +#define EFI_SW_EC_EBC_INVALID_OPCODE EXCEPT_EBC_INVALID_OPCODE +#define EFI_SW_EC_EBC_STACK_FAULT EXCEPT_EBC_STACK_FAULT +#define EFI_SW_EC_EBC_ALIGNMENT_CHECK EXCEPT_EBC_ALIGNMENT_CHECK +#define EFI_SW_EC_EBC_INSTRUCTION_ENCODING EXCEPT_EBC_INSTRUCTION_ENCODING +#define EFI_SW_EC_EBC_BAD_BREAK EXCEPT_EBC_BAD_BREAK +#define EFI_SW_EC_EBC_STEP EXCEPT_EBC_STEP +///@} + +/// +/// Software Class IA32 Exception Subclass Error Code definitions. +/// These exceptions are derived from the debug protocol definitions in the EFI +/// specification. +/// +///@{ +#define EFI_SW_EC_IA32_DIVIDE_ERROR EXCEPT_IA32_DIVIDE_ERROR +#define EFI_SW_EC_IA32_DEBUG EXCEPT_IA32_DEBUG +#define EFI_SW_EC_IA32_NMI EXCEPT_IA32_NMI +#define EFI_SW_EC_IA32_BREAKPOINT EXCEPT_IA32_BREAKPOINT +#define EFI_SW_EC_IA32_OVERFLOW EXCEPT_IA32_OVERFLOW +#define EFI_SW_EC_IA32_BOUND EXCEPT_IA32_BOUND +#define EFI_SW_EC_IA32_INVALID_OPCODE EXCEPT_IA32_INVALID_OPCODE +#define EFI_SW_EC_IA32_DOUBLE_FAULT EXCEPT_IA32_DOUBLE_FAULT +#define EFI_SW_EC_IA32_INVALID_TSS EXCEPT_IA32_INVALID_TSS +#define EFI_SW_EC_IA32_SEG_NOT_PRESENT EXCEPT_IA32_SEG_NOT_PRESENT +#define EFI_SW_EC_IA32_STACK_FAULT EXCEPT_IA32_STACK_FAULT +#define EFI_SW_EC_IA32_GP_FAULT EXCEPT_IA32_GP_FAULT +#define EFI_SW_EC_IA32_PAGE_FAULT EXCEPT_IA32_PAGE_FAULT +#define EFI_SW_EC_IA32_FP_ERROR EXCEPT_IA32_FP_ERROR +#define EFI_SW_EC_IA32_ALIGNMENT_CHECK EXCEPT_IA32_ALIGNMENT_CHECK +#define EFI_SW_EC_IA32_MACHINE_CHECK EXCEPT_IA32_MACHINE_CHECK +#define EFI_SW_EC_IA32_SIMD EXCEPT_IA32_SIMD +///@} + +/// +/// Software Class IPF Exception Subclass Error Code definitions. +/// These exceptions are derived from the debug protocol definitions in the EFI +/// specification. +/// +///@{ +#define EFI_SW_EC_IPF_ALT_DTLB EXCEPT_IPF_ALT_DTLB +#define EFI_SW_EC_IPF_DNESTED_TLB EXCEPT_IPF_DNESTED_TLB +#define EFI_SW_EC_IPF_BREAKPOINT EXCEPT_IPF_BREAKPOINT +#define EFI_SW_EC_IPF_EXTERNAL_INTERRUPT EXCEPT_IPF_EXTERNAL_INTERRUPT +#define EFI_SW_EC_IPF_GEN_EXCEPT EXCEPT_IPF_GEN_EXCEPT +#define EFI_SW_EC_IPF_NAT_CONSUMPTION EXCEPT_IPF_NAT_CONSUMPTION +#define EFI_SW_EC_IPF_DEBUG_EXCEPT EXCEPT_IPF_DEBUG_EXCEPT +#define EFI_SW_EC_IPF_UNALIGNED_ACCESS EXCEPT_IPF_UNALIGNED_ACCESS +#define EFI_SW_EC_IPF_FP_FAULT EXCEPT_IPF_FP_FAULT +#define EFI_SW_EC_IPF_FP_TRAP EXCEPT_IPF_FP_TRAP +#define EFI_SW_EC_IPF_TAKEN_BRANCH EXCEPT_IPF_TAKEN_BRANCH +#define EFI_SW_EC_IPF_SINGLE_STEP EXCEPT_IPF_SINGLE_STEP +///@} + +/// +/// Software Class PEI Service Subclass Error Code definitions. +/// +///@{ +#define EFI_SW_PS_EC_RESET_NOT_AVAILABLE (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_PS_EC_MEMORY_INSTALLED_TWICE (EFI_SUBCLASS_SPECIFIC | 0x00000001) +///@} + +// +// Software Class EFI Boot Service Subclass Error Code definitions. +// + +// +// Software Class EFI Runtime Service Subclass Error Code definitions. +// + +/// +/// Software Class EFI DXE Service Subclass Error Code definitions. +/// +///@{ +#define EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_SW_DXE_BS_PC_VERIFYING_PASSWORD (EFI_SUBCLASS_SPECIFIC | 0x00000006) +///@} + +/// +/// Software Class DXE RT Driver Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_DXE_RT_PC_S0 (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_DXE_RT_PC_S1 (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_DXE_RT_PC_S2 (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_SW_DXE_RT_PC_S3 (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_SW_DXE_RT_PC_S4 (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_SW_DXE_RT_PC_S5 (EFI_SUBCLASS_SPECIFIC | 0x00000005) +///@} + +/// +/// Software Class X64 Exception Subclass Error Code definitions. +/// These exceptions are derived from the debug protocol +/// definitions in the EFI specification. +/// +///@{ +#define EFI_SW_EC_X64_DIVIDE_ERROR EXCEPT_X64_DIVIDE_ERROR +#define EFI_SW_EC_X64_DEBUG EXCEPT_X64_DEBUG +#define EFI_SW_EC_X64_NMI EXCEPT_X64_NMI +#define EFI_SW_EC_X64_BREAKPOINT EXCEPT_X64_BREAKPOINT +#define EFI_SW_EC_X64_OVERFLOW EXCEPT_X64_OVERFLOW +#define EFI_SW_EC_X64_BOUND EXCEPT_X64_BOUND +#define EFI_SW_EC_X64_INVALID_OPCODE EXCEPT_X64_INVALID_OPCODE +#define EFI_SW_EC_X64_DOUBLE_FAULT EXCEPT_X64_DOUBLE_FAULT +#define EFI_SW_EC_X64_INVALID_TSS EXCEPT_X64_INVALID_TSS +#define EFI_SW_EC_X64_SEG_NOT_PRESENT EXCEPT_X64_SEG_NOT_PRESENT +#define EFI_SW_EC_X64_STACK_FAULT EXCEPT_X64_STACK_FAULT +#define EFI_SW_EC_X64_GP_FAULT EXCEPT_X64_GP_FAULT +#define EFI_SW_EC_X64_PAGE_FAULT EXCEPT_X64_PAGE_FAULT +#define EFI_SW_EC_X64_FP_ERROR EXCEPT_X64_FP_ERROR +#define EFI_SW_EC_X64_ALIGNMENT_CHECK EXCEPT_X64_ALIGNMENT_CHECK +#define EFI_SW_EC_X64_MACHINE_CHECK EXCEPT_X64_MACHINE_CHECK +#define EFI_SW_EC_X64_SIMD EXCEPT_X64_SIMD +///@} + +/// +/// Software Class ARM Exception Subclass Error Code definitions. +/// These exceptions are derived from the debug protocol +/// definitions in the EFI specification. +/// +///@{ +#define EFI_SW_EC_ARM_RESET EXCEPT_ARM_RESET +#define EFI_SW_EC_ARM_UNDEFINED_INSTRUCTION EXCEPT_ARM_UNDEFINED_INSTRUCTION +#define EFI_SW_EC_ARM_SOFTWARE_INTERRUPT EXCEPT_ARM_SOFTWARE_INTERRUPT +#define EFI_SW_EC_ARM_PREFETCH_ABORT EXCEPT_ARM_PREFETCH_ABORT +#define EFI_SW_EC_ARM_DATA_ABORT EXCEPT_ARM_DATA_ABORT +#define EFI_SW_EC_ARM_RESERVED EXCEPT_ARM_RESERVED +#define EFI_SW_EC_ARM_IRQ EXCEPT_ARM_IRQ +#define EFI_SW_EC_ARM_FIQ EXCEPT_ARM_FIQ +///@} + +#endif |