2007-06-08 13:31:52 +02:00
|
|
|
/** @file
|
|
|
|
The firmware file related definitions in PI.
|
|
|
|
|
2015-08-24 03:43:20 +02:00
|
|
|
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
2014-10-22 05:03:18 +02:00
|
|
|
This program and the accompanying materials are licensed and made available under
|
|
|
|
the terms and conditions of the BSD License that accompanies this distribution.
|
2010-03-12 23:19:12 +01:00
|
|
|
The full text of the license may be found at
|
2014-10-22 05:03:18 +02:00
|
|
|
http://opensource.org/licenses/bsd-license.php.
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2014-10-22 05:03:18 +02:00
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-06-08 13:31:52 +02:00
|
|
|
|
|
|
|
@par Revision Reference:
|
2015-08-24 03:43:20 +02:00
|
|
|
PI Version 1.4.
|
2007-06-08 13:31:52 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
2008-04-21 08:56:45 +02:00
|
|
|
|
2007-06-08 13:31:52 +02:00
|
|
|
#ifndef __PI_FIRMWARE_FILE_H__
|
|
|
|
#define __PI_FIRMWARE_FILE_H__
|
|
|
|
|
2007-07-06 04:53:00 +02:00
|
|
|
#pragma pack(1)
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Used to verify the integrity of the file.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef union {
|
|
|
|
struct {
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// 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.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
UINT8 Header;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// 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
|
2011-05-17 10:56:03 +02:00
|
|
|
/// checksum of the file data.
|
2008-12-10 09:22:03 +01:00
|
|
|
/// 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
|
2010-03-01 00:53:41 +01:00
|
|
|
/// 0xAA. The IntegrityCheck.Checksum.File field is valid any time the
|
2008-12-10 09:22:03 +01:00
|
|
|
/// EFI_FILE_DATA_VALID bit is set in the State field.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
UINT8 File;
|
|
|
|
} Checksum;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// This is the full 16 bits of the IntegrityCheck field.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
UINT16 Checksum16;
|
|
|
|
} EFI_FFS_INTEGRITY_CHECK;
|
|
|
|
|
2010-03-01 00:53:41 +01:00
|
|
|
///
|
|
|
|
/// FFS_FIXED_CHECKSUM is the checksum value used when the
|
2010-03-12 23:19:12 +01:00
|
|
|
/// FFS_ATTRIB_CHECKSUM attribute bit is clear.
|
2010-03-01 00:53:41 +01:00
|
|
|
///
|
|
|
|
#define FFS_FIXED_CHECKSUM 0xAA
|
|
|
|
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef UINT8 EFI_FV_FILETYPE;
|
|
|
|
typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;
|
|
|
|
typedef UINT8 EFI_FFS_FILE_STATE;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// File Types Definitions
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-07-26 01:51:08 +02:00
|
|
|
#define EFI_FV_FILETYPE_ALL 0x00
|
2007-07-03 09:59:59 +02:00
|
|
|
#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
|
2009-08-21 07:13:43 +02:00
|
|
|
#define EFI_FV_FILETYPE_SMM 0x0A
|
2007-07-03 09:59:59 +02:00
|
|
|
#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
|
2009-08-21 07:13:43 +02:00
|
|
|
#define EFI_FV_FILETYPE_COMBINED_SMM_DXE 0x0C
|
|
|
|
#define EFI_FV_FILETYPE_SMM_CORE 0x0D
|
2007-07-03 09:59:59 +02:00
|
|
|
#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
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2008-06-24 06:37:24 +02:00
|
|
|
/// FFS File Attributes.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
#define FFS_ATTRIB_LARGE_FILE 0x01
|
2007-06-08 13:31:52 +02:00
|
|
|
#define FFS_ATTRIB_FIXED 0x04
|
|
|
|
#define FFS_ATTRIB_DATA_ALIGNMENT 0x38
|
|
|
|
#define FFS_ATTRIB_CHECKSUM 0x40
|
|
|
|
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2008-06-24 06:37:24 +02:00
|
|
|
/// FFS File State Bits.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
#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
|
|
|
|
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// Each file begins with the header that describe the
|
2008-06-24 06:37:24 +02:00
|
|
|
/// contents and state of the files.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// This GUID is the file name. It is used to uniquely identify the file.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
EFI_GUID Name;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Used to verify the integrity of the file.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
EFI_FFS_INTEGRITY_CHECK IntegrityCheck;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Identifies the type of file.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
EFI_FV_FILETYPE Type;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Declares various file attribute bits.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
EFI_FFS_FILE_ATTRIBUTES Attributes;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// The length of the file in bytes, including the FFS header.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
UINT8 Size[3];
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Used to track the state of the file throughout the life of the file from creation to deletion.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
EFI_FFS_FILE_STATE State;
|
|
|
|
} EFI_FFS_FILE_HEADER;
|
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
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;
|
2014-10-22 05:03:18 +02:00
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
///
|
|
|
|
/// Used to verify the integrity of the file.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
EFI_FFS_INTEGRITY_CHECK IntegrityCheck;
|
2014-10-22 05:03:18 +02:00
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
///
|
|
|
|
/// Identifies the type of file.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
EFI_FV_FILETYPE Type;
|
2014-10-22 05:03:18 +02:00
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
///
|
|
|
|
/// Declares various file attribute bits.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
EFI_FFS_FILE_ATTRIBUTES Attributes;
|
2014-10-22 05:03:18 +02:00
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
///
|
|
|
|
/// 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];
|
2014-10-22 05:03:18 +02:00
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
///
|
|
|
|
/// Used to track the state of the file throughout the life of the file from creation to deletion.
|
|
|
|
///
|
|
|
|
EFI_FFS_FILE_STATE State;
|
2014-10-22 05:03:18 +02:00
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// If FFS_ATTRIB_LARGE_FILE is set in Attributes, then ExtendedSize exists and Size must be set to zero.
|
2009-08-20 09:24:36 +02:00
|
|
|
/// If FFS_ATTRIB_LARGE_FILE is not set then EFI_FFS_FILE_HEADER is used.
|
|
|
|
///
|
2015-08-24 03:43:20 +02:00
|
|
|
UINT64 ExtendedSize;
|
2009-08-20 09:24:36 +02:00
|
|
|
} EFI_FFS_FILE_HEADER2;
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2011-10-27 10:45:50 +02:00
|
|
|
#define IS_FFS_FILE2(FfsFileHeaderPtr) \
|
|
|
|
(((((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Attributes) & FFS_ATTRIB_LARGE_FILE) == FFS_ATTRIB_LARGE_FILE)
|
|
|
|
|
|
|
|
#define FFS_FILE_SIZE(FfsFileHeaderPtr) \
|
|
|
|
((UINT32) (*((UINT32 *) ((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Size) & 0x00ffffff))
|
|
|
|
|
|
|
|
#define FFS_FILE2_SIZE(FfsFileHeaderPtr) \
|
2015-08-24 03:43:20 +02:00
|
|
|
((UINT32) (((EFI_FFS_FILE_HEADER2 *) (UINTN) FfsFileHeaderPtr)->ExtendedSize))
|
2011-10-27 10:45:50 +02:00
|
|
|
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef UINT8 EFI_SECTION_TYPE;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// Pseudo type. It is used as a wild card when retrieving sections.
|
|
|
|
/// The section type EFI_SECTION_ALL matches all section types.
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
#define EFI_SECTION_ALL 0x00
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// Encapsulation section Type values.
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
#define EFI_SECTION_COMPRESSION 0x01
|
|
|
|
|
|
|
|
#define EFI_SECTION_GUID_DEFINED 0x02
|
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
#define EFI_SECTION_DISPOSABLE 0x03
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// Leaf section Type values.
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
#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
|
2009-08-20 09:24:36 +02:00
|
|
|
#define EFI_SECTION_SMM_DEPEX 0x1C
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// Common section header.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// A 24-bit unsigned integer that contains the total size of the section in bytes,
|
2008-12-10 09:22:03 +01:00
|
|
|
/// including the EFI_COMMON_SECTION_HEADER.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
UINT8 Size[3];
|
|
|
|
EFI_SECTION_TYPE Type;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Declares the section type.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_COMMON_SECTION_HEADER;
|
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef struct {
|
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// A 24-bit unsigned integer that contains the total size of the section in bytes,
|
2009-08-20 09:24:36 +02:00
|
|
|
/// including the EFI_COMMON_SECTION_HEADER.
|
|
|
|
///
|
|
|
|
UINT8 Size[3];
|
2014-10-22 05:03:18 +02:00
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
EFI_SECTION_TYPE Type;
|
2014-10-22 05:03:18 +02:00
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// If Size is 0xFFFFFF, then ExtendedSize contains the size of the section. If
|
2014-10-22 05:03:18 +02:00
|
|
|
/// Size is not equal to 0xFFFFFF, then this field does not exist.
|
2009-08-20 09:24:36 +02:00
|
|
|
///
|
|
|
|
UINT32 ExtendedSize;
|
|
|
|
} EFI_COMMON_SECTION_HEADER2;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// Leaf section type that contains an
|
2008-06-24 06:37:24 +02:00
|
|
|
/// IA-32 16-bit executable image.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;
|
|
|
|
typedef EFI_COMMON_SECTION_HEADER2 EFI_COMPATIBILITY16_SECTION2;
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// CompressionType of EFI_COMPRESSION_SECTION.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
#define EFI_NOT_COMPRESSED 0x00
|
|
|
|
#define EFI_STANDARD_COMPRESSION 0x01
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// An encapsulation section type in which the
|
2008-06-24 06:37:24 +02:00
|
|
|
/// section data is compressed.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EFI_COMMON_SECTION_HEADER CommonHeader;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The UINT32 that indicates the size of the section data after decompression.
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
UINT32 UncompressedLength;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Indicates which compression algorithm is used.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
UINT8 CompressionType;
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_COMPRESSION_SECTION;
|
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
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;
|
|
|
|
|
2009-08-19 08:04:05 +02:00
|
|
|
///
|
|
|
|
/// 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.
|
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_DISPOSABLE_SECTION;
|
|
|
|
typedef EFI_COMMON_SECTION_HEADER2 EFI_DISPOSABLE_SECTION2;
|
2009-08-19 08:04:05 +02:00
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The leaf section which could be used to determine the dispatch order of DXEs.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;
|
|
|
|
typedef EFI_COMMON_SECTION_HEADER2 EFI_DXE_DEPEX_SECTION2;
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The leaf section which contains a PI FV.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;
|
|
|
|
typedef EFI_COMMON_SECTION_HEADER2 EFI_FIRMWARE_VOLUME_IMAGE_SECTION2;
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The leaf section which contains a single GUID.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EFI_COMMON_SECTION_HEADER CommonHeader;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// This GUID is defined by the creator of the file. It is a vendor-defined file type.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EFI_GUID SubTypeGuid;
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_FREEFORM_SUBTYPE_GUID_SECTION;
|
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef struct {
|
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID.
|
2009-08-20 09:24:36 +02:00
|
|
|
///
|
|
|
|
EFI_COMMON_SECTION_HEADER2 CommonHeader;
|
|
|
|
///
|
|
|
|
/// This GUID is defined by the creator of the file. It is a vendor-defined file type.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
EFI_GUID SubTypeGuid;
|
|
|
|
} EFI_FREEFORM_SUBTYPE_GUID_SECTION2;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// Attributes of EFI_GUID_DEFINED_SECTION.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01
|
|
|
|
#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The leaf section which is encapsulation defined by specific GUID.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EFI_COMMON_SECTION_HEADER CommonHeader;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The GUID that defines the format of the data that follows. It is a vendor-defined section type.
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
EFI_GUID SectionDefinitionGuid;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
|
|
|
/// Contains the offset in bytes from the beginning of the common header to the first byte of the data.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
UINT16 DataOffset;
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The bit field that declares some specific characteristics of the section contents.
|
2008-12-10 09:22:03 +01:00
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
UINT16 Attributes;
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_GUID_DEFINED_SECTION;
|
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef struct {
|
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.
|
2009-08-20 09:24:36 +02:00
|
|
|
///
|
|
|
|
EFI_COMMON_SECTION_HEADER2 CommonHeader;
|
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The GUID that defines the format of the data that follows. It is a vendor-defined section type.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
EFI_GUID SectionDefinitionGuid;
|
|
|
|
///
|
|
|
|
/// Contains the offset in bytes from the beginning of the common header to the first byte of the data.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
UINT16 DataOffset;
|
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The bit field that declares some specific characteristics of the section contents.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
UINT16 Attributes;
|
|
|
|
} EFI_GUID_DEFINED_SECTION2;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The leaf section which contains PE32+ image.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;
|
|
|
|
typedef EFI_COMMON_SECTION_HEADER2 EFI_PE32_SECTION2;
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The leaf section used to determine the dispatch order of PEIMs.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
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;
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The leaf section which constains the position-independent-code image.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;
|
|
|
|
typedef EFI_COMMON_SECTION_HEADER2 EFI_TE_SECTION2;
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The leaf section which contains an array of zero or more bytes.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;
|
|
|
|
typedef EFI_COMMON_SECTION_HEADER2 EFI_RAW_SECTION2;
|
|
|
|
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
/// 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
|
2010-03-12 23:19:12 +01:00
|
|
|
/// Initialization Specification, Volume 2, for details regarding the format of the dependency expression.
|
2009-08-20 09:24:36 +02:00
|
|
|
/// 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.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_SMM_DEPEX_SECTION;
|
|
|
|
typedef EFI_COMMON_SECTION_HEADER2 EFI_SMM_DEPEX_SECTION2;
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2014-10-22 05:03:18 +02:00
|
|
|
/// The leaf section which contains a unicode string that
|
2008-06-24 06:37:24 +02:00
|
|
|
/// is human readable file name.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2007-06-18 22:28:02 +02:00
|
|
|
EFI_COMMON_SECTION_HEADER CommonHeader;
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Array of unicode string.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
CHAR16 FileNameString[1];
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_USER_INTERFACE_SECTION;
|
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
typedef struct {
|
|
|
|
EFI_COMMON_SECTION_HEADER2 CommonHeader;
|
|
|
|
CHAR16 FileNameString[1];
|
|
|
|
} EFI_USER_INTERFACE_SECTION2;
|
2007-06-08 13:31:52 +02:00
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
2010-03-12 23:19:12 +01:00
|
|
|
/// The leaf section which contains a numeric build number and
|
2014-10-22 05:03:18 +02:00
|
|
|
/// an optional unicode string that represents the file revision.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2007-06-18 22:28:02 +02:00
|
|
|
EFI_COMMON_SECTION_HEADER CommonHeader;
|
|
|
|
UINT16 BuildNumber;
|
2008-09-04 08:16:14 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// Array of unicode string.
|
2014-10-22 05:03:18 +02:00
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
CHAR16 VersionString[1];
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_VERSION_SECTION;
|
|
|
|
|
2009-08-20 09:24:36 +02:00
|
|
|
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;
|
2007-07-04 10:23:26 +02:00
|
|
|
|
2011-10-27 10:45:50 +02:00
|
|
|
#define IS_SECTION2(SectionHeaderPtr) \
|
|
|
|
((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff) == 0x00ffffff)
|
|
|
|
|
2007-07-04 10:23:26 +02:00
|
|
|
#define SECTION_SIZE(SectionHeaderPtr) \
|
2011-10-27 10:45:50 +02:00
|
|
|
((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff))
|
|
|
|
|
|
|
|
#define SECTION2_SIZE(SectionHeaderPtr) \
|
|
|
|
(((EFI_COMMON_SECTION_HEADER2 *) (UINTN) SectionHeaderPtr)->ExtendedSize)
|
2007-07-04 10:23:26 +02:00
|
|
|
|
2007-07-06 04:53:00 +02:00
|
|
|
#pragma pack()
|
2007-07-04 10:23:26 +02:00
|
|
|
|
2007-06-08 13:31:52 +02:00
|
|
|
#endif
|
|
|
|
|