12 #ifndef __PI_FIRMWARE_FILE_H__ 13 #define __PI_FIRMWARE_FILE_H__ 50 #define FFS_FIXED_CHECKSUM 0xAA 59 #define EFI_FV_FILETYPE_ALL 0x00 60 #define EFI_FV_FILETYPE_RAW 0x01 61 #define EFI_FV_FILETYPE_FREEFORM 0x02 62 #define EFI_FV_FILETYPE_SECURITY_CORE 0x03 63 #define EFI_FV_FILETYPE_PEI_CORE 0x04 64 #define EFI_FV_FILETYPE_DXE_CORE 0x05 65 #define EFI_FV_FILETYPE_PEIM 0x06 66 #define EFI_FV_FILETYPE_DRIVER 0x07 67 #define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08 68 #define EFI_FV_FILETYPE_APPLICATION 0x09 69 #define EFI_FV_FILETYPE_MM 0x0A 70 #define EFI_FV_FILETYPE_SMM EFI_FV_FILETYPE_MM 71 #define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B 72 #define EFI_FV_FILETYPE_COMBINED_MM_DXE 0x0C 73 #define EFI_FV_FILETYPE_COMBINED_SMM_DXE EFI_FV_FILETYPE_COMBINED_MM_DXE 74 #define EFI_FV_FILETYPE_MM_CORE 0x0D 75 #define EFI_FV_FILETYPE_SMM_CORE EFI_FV_FILETYPE_MM_CORE 76 #define EFI_FV_FILETYPE_MM_STANDALONE 0x0E 77 #define EFI_FV_FILETYPE_MM_CORE_STANDALONE 0x0F 78 #define EFI_FV_FILETYPE_OEM_MIN 0xc0 79 #define EFI_FV_FILETYPE_OEM_MAX 0xdf 80 #define EFI_FV_FILETYPE_DEBUG_MIN 0xe0 81 #define EFI_FV_FILETYPE_DEBUG_MAX 0xef 82 #define EFI_FV_FILETYPE_FFS_MIN 0xf0 83 #define EFI_FV_FILETYPE_FFS_MAX 0xff 84 #define EFI_FV_FILETYPE_FFS_PAD 0xf0 88 #define FFS_ATTRIB_LARGE_FILE 0x01 89 #define FFS_ATTRIB_DATA_ALIGNMENT_2 0x02 90 #define FFS_ATTRIB_FIXED 0x04 91 #define FFS_ATTRIB_DATA_ALIGNMENT 0x38 92 #define FFS_ATTRIB_CHECKSUM 0x40 97 #define EFI_FILE_HEADER_CONSTRUCTION 0x01 98 #define EFI_FILE_HEADER_VALID 0x02 99 #define EFI_FILE_DATA_VALID 0x04 100 #define EFI_FILE_MARKED_FOR_UPDATE 0x08 101 #define EFI_FILE_DELETED 0x10 102 #define EFI_FILE_HEADER_INVALID 0x20 179 #define IS_FFS_FILE2(FfsFileHeaderPtr) \ 180 (((((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Attributes) & FFS_ATTRIB_LARGE_FILE) == FFS_ATTRIB_LARGE_FILE) 187 #define FFS_FILE_SIZE(FfsFileHeaderPtr) ((UINT32) (\ 188 (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[0] ) | \ 189 (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[1] << 8) | \ 190 (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[2] << 16))) 192 #define FFS_FILE2_SIZE(FfsFileHeaderPtr) \ 193 ((UINT32) (((EFI_FFS_FILE_HEADER2 *) (UINTN) FfsFileHeaderPtr)->ExtendedSize)) 201 #define EFI_SECTION_ALL 0x00 206 #define EFI_SECTION_COMPRESSION 0x01 208 #define EFI_SECTION_GUID_DEFINED 0x02 210 #define EFI_SECTION_DISPOSABLE 0x03 215 #define EFI_SECTION_PE32 0x10 216 #define EFI_SECTION_PIC 0x11 217 #define EFI_SECTION_TE 0x12 218 #define EFI_SECTION_DXE_DEPEX 0x13 219 #define EFI_SECTION_VERSION 0x14 220 #define EFI_SECTION_USER_INTERFACE 0x15 221 #define EFI_SECTION_COMPATIBILITY16 0x16 222 #define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17 223 #define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18 224 #define EFI_SECTION_RAW 0x19 225 #define EFI_SECTION_PEI_DEPEX 0x1B 226 #define EFI_SECTION_MM_DEPEX 0x1C 227 #define EFI_SECTION_SMM_DEPEX EFI_SECTION_MM_DEPEX 270 #define EFI_NOT_COMPRESSED 0x00 271 #define EFI_STANDARD_COMPRESSION 0x01 358 #define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01 359 #define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02 495 #define SECTION_SIZE(SectionHeaderPtr) ((UINT32) (\ 496 (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[0] ) | \ 497 (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[1] << 8) | \ 498 (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[2] << 16))) 500 #define IS_SECTION2(SectionHeaderPtr) \ 501 (SECTION_SIZE (SectionHeaderPtr) == 0x00ffffff) 503 #define SECTION2_SIZE(SectionHeaderPtr) \ 504 (((EFI_COMMON_SECTION_HEADER2 *) (UINTN) SectionHeaderPtr)->ExtendedSize) The leaf section which contains a unicode string that is human readable file name.
UINT32 UncompressedLength
UINT32 that indicates the size of the section data after decompression.
EFI_GUID SectionDefinitionGuid
The GUID that defines the format of the data that follows.
EFI_COMMON_SECTION_HEADER2 CommonHeader
The common section header.
128 bit buffer containing a unique identifier value.
UINT16 DataOffset
Contains the offset in bytes from the beginning of the common header to the first byte of the data.
EFI_COMMON_SECTION_HEADER2 EFI_TE_SECTION2
UINT16 Checksum16
This is the full 16 bits of the IntegrityCheck field.
EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION
The leaf section which could be used to determine the dispatch order of DXEs.
UINT32 UncompressedLength
The UINT32 that indicates the size of the section data after decompression.
UINT8_t Checksum
Checksum.
EFI_COMMON_SECTION_HEADER2 CommonHeader
Used to verify the integrity of the file.
UINT16_t Size
Size of structure.
UINT8 CompressionType
Indicates which compression algorithm is used.
UINT8 Header
The IntegrityCheck.Checksum.Header field is an 8-bit checksum of the file header.
EFI_GUID SectionDefinitionGuid
The GUID that defines the format of the data that follows.
EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION
The leaf section which contains a PI FV.
EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION
The leaf section which contains an array of zero or more bytes.
EFI_COMMON_SECTION_HEADER2 CommonHeader
Usual common section header.
UINT8 EFI_FFS_FILE_ATTRIBUTES
EFI_COMMON_SECTION_HEADER CommonHeader
EFI_COMMON_SECTION_HEADER2 EFI_PIC_SECTION2
EFI_COMMON_SECTION_HEADER CommonHeader
EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION
The leaf section which contains PE32+ image.
UINT16 Attributes
The bit field that declares some specific characteristics of the section contents.
UINT16 DataOffset
Contains the offset in bytes from the beginning of the common header to the first byte of the data.
FILE_LICENCE(BSD2_PATENT)
An encapsulation section type in which the section data is compressed.
EFI_COMMON_SECTION_HEADER2 CommonHeader
UINT16 BuildNumber
A UINT16 that represents a particular build.
EFI_COMMON_SECTION_HEADER2 EFI_FIRMWARE_VOLUME_IMAGE_SECTION2
EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION
Leaf section type that contains an IA-32 16-bit executable image.
unsigned long long UINT64
EFI_COMMON_SECTION_HEADER2 EFI_COMPATIBILITY16_SECTION2
EFI_COMMON_SECTION_HEADER2 EFI_DXE_DEPEX_SECTION2
The leaf section which contains a numeric build number and an optional unicode string that represents...
The leaf section which is encapsulation defined by specific GUID.
UINT16 Attributes
The bit field that declares some specific characteristics of the section contents.
EFI_COMMON_SECTION_HEADER EFI_DISPOSABLE_SECTION
An encapsulation section type in which the section data is disposable.
EFI_COMMON_SECTION_HEADER CommonHeader
Usual common section header.
EFI_COMMON_SECTION_HEADER2 EFI_PEI_DEPEX_SECTION2
UINT8 File
If the FFS_ATTRIB_CHECKSUM (see definition below) bit of the Attributes field is set to one,...
EFI_COMMON_SECTION_HEADER EFI_SMM_DEPEX_SECTION
The SMM dependency expression section is a leaf section that contains a dependency expression that is...
EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION
The leaf section used to determine the dispatch order of PEIMs.
EFI_COMMON_SECTION_HEADER EFI_PIC_SECTION
A leaf section type that contains a position-independent-code (PIC) image.
EFI_COMMON_SECTION_HEADER2 EFI_PE32_SECTION2
EFI_COMMON_SECTION_HEADER2 EFI_DISPOSABLE_SECTION2
UINT8 CompressionType
Indicates which compression algorithm is used.
EFI_COMMON_SECTION_HEADER CommonHeader
The common section header.
EFI_COMMON_SECTION_HEADER2 EFI_SMM_DEPEX_SECTION2
EFI_COMMON_SECTION_HEADER EFI_TE_SECTION
The leaf section which constains the position-independent-code image.
EFI_COMMON_SECTION_HEADER2 EFI_RAW_SECTION2