12#ifndef __PI_FIRMWARE_FILE_H__
13#define __PI_FIRMWARE_FILE_H__
48#define FFS_FIXED_CHECKSUM 0xAA
50typedef UINT8 EFI_FV_FILETYPE;
51typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;
52typedef UINT8 EFI_FFS_FILE_STATE;
57#define EFI_FV_FILETYPE_ALL 0x00
58#define EFI_FV_FILETYPE_RAW 0x01
59#define EFI_FV_FILETYPE_FREEFORM 0x02
60#define EFI_FV_FILETYPE_SECURITY_CORE 0x03
61#define EFI_FV_FILETYPE_PEI_CORE 0x04
62#define EFI_FV_FILETYPE_DXE_CORE 0x05
63#define EFI_FV_FILETYPE_PEIM 0x06
64#define EFI_FV_FILETYPE_DRIVER 0x07
65#define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08
66#define EFI_FV_FILETYPE_APPLICATION 0x09
67#define EFI_FV_FILETYPE_MM 0x0A
68#define EFI_FV_FILETYPE_SMM EFI_FV_FILETYPE_MM
69#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
70#define EFI_FV_FILETYPE_COMBINED_MM_DXE 0x0C
71#define EFI_FV_FILETYPE_COMBINED_SMM_DXE EFI_FV_FILETYPE_COMBINED_MM_DXE
72#define EFI_FV_FILETYPE_MM_CORE 0x0D
73#define EFI_FV_FILETYPE_SMM_CORE EFI_FV_FILETYPE_MM_CORE
74#define EFI_FV_FILETYPE_MM_STANDALONE 0x0E
75#define EFI_FV_FILETYPE_MM_CORE_STANDALONE 0x0F
76#define EFI_FV_FILETYPE_OEM_MIN 0xc0
77#define EFI_FV_FILETYPE_OEM_MAX 0xdf
78#define EFI_FV_FILETYPE_DEBUG_MIN 0xe0
79#define EFI_FV_FILETYPE_DEBUG_MAX 0xef
80#define EFI_FV_FILETYPE_FFS_MIN 0xf0
81#define EFI_FV_FILETYPE_FFS_MAX 0xff
82#define EFI_FV_FILETYPE_FFS_PAD 0xf0
86#define FFS_ATTRIB_LARGE_FILE 0x01
87#define FFS_ATTRIB_DATA_ALIGNMENT_2 0x02
88#define FFS_ATTRIB_FIXED 0x04
89#define FFS_ATTRIB_DATA_ALIGNMENT 0x38
90#define FFS_ATTRIB_CHECKSUM 0x40
95#define EFI_FILE_HEADER_CONSTRUCTION 0x01
96#define EFI_FILE_HEADER_VALID 0x02
97#define EFI_FILE_DATA_VALID 0x04
98#define EFI_FILE_MARKED_FOR_UPDATE 0x08
99#define EFI_FILE_DELETED 0x10
100#define EFI_FILE_HEADER_INVALID 0x20
177#define IS_FFS_FILE2(FfsFileHeaderPtr) \
178 (((((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Attributes) & FFS_ATTRIB_LARGE_FILE) == FFS_ATTRIB_LARGE_FILE)
185#define FFS_FILE_SIZE(FfsFileHeaderPtr) ((UINT32) (\
186 (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[0] ) | \
187 (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[1] << 8) | \
188 (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[2] << 16)))
190#define FFS_FILE2_SIZE(FfsFileHeaderPtr) \
191 ((UINT32) (((EFI_FFS_FILE_HEADER2 *) (UINTN) FfsFileHeaderPtr)->ExtendedSize))
193typedef UINT8 EFI_SECTION_TYPE;
199#define EFI_SECTION_ALL 0x00
204#define EFI_SECTION_COMPRESSION 0x01
206#define EFI_SECTION_GUID_DEFINED 0x02
208#define EFI_SECTION_DISPOSABLE 0x03
213#define EFI_SECTION_PE32 0x10
214#define EFI_SECTION_PIC 0x11
215#define EFI_SECTION_TE 0x12
216#define EFI_SECTION_DXE_DEPEX 0x13
217#define EFI_SECTION_VERSION 0x14
218#define EFI_SECTION_USER_INTERFACE 0x15
219#define EFI_SECTION_COMPATIBILITY16 0x16
220#define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17
221#define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18
222#define EFI_SECTION_RAW 0x19
223#define EFI_SECTION_PEI_DEPEX 0x1B
224#define EFI_SECTION_MM_DEPEX 0x1C
225#define EFI_SECTION_SMM_DEPEX EFI_SECTION_MM_DEPEX
236 EFI_SECTION_TYPE Type;
249 EFI_SECTION_TYPE Type;
268#define EFI_NOT_COMPRESSED 0x00
269#define EFI_STANDARD_COMPRESSION 0x01
356#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01
357#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02
456 CHAR16 FileNameString[1];
461 CHAR16 FileNameString[1];
475 CHAR16 VersionString[1];
485 CHAR16 VersionString[1];
493#define SECTION_SIZE(SectionHeaderPtr) ((UINT32) (\
494 (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[0] ) | \
495 (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[1] << 8) | \
496 (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[2] << 16)))
498#define IS_SECTION2(SectionHeaderPtr) \
499 (SECTION_SIZE (SectionHeaderPtr) == 0x00ffffff)
501#define SECTION2_SIZE(SectionHeaderPtr) \
502 (((EFI_COMMON_SECTION_HEADER2 *) (UINTN) SectionHeaderPtr)->ExtendedSize)
EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION
EFI_COMMON_SECTION_HEADER EFI_SMM_DEPEX_SECTION
EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION
EFI_COMMON_SECTION_HEADER EFI_PIC_SECTION
EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION
EFI_COMMON_SECTION_HEADER EFI_DISPOSABLE_SECTION
EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION
EFI_COMMON_SECTION_HEADER EFI_TE_SECTION
EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION
EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION
UINT32 UncompressedLength
EFI_COMMON_SECTION_HEADER2 CommonHeader
EFI_COMMON_SECTION_HEADER CommonHeader
UINT32 UncompressedLength
EFI_FFS_INTEGRITY_CHECK IntegrityCheck
EFI_FFS_FILE_ATTRIBUTES Attributes
EFI_FFS_INTEGRITY_CHECK IntegrityCheck
EFI_FFS_FILE_ATTRIBUTES Attributes
EFI_COMMON_SECTION_HEADER2 CommonHeader
EFI_COMMON_SECTION_HEADER CommonHeader
EFI_GUID SectionDefinitionGuid
EFI_COMMON_SECTION_HEADER2 CommonHeader
EFI_COMMON_SECTION_HEADER CommonHeader
EFI_GUID SectionDefinitionGuid