2007-06-08 13:31:52 +02:00
|
|
|
/** @file
|
|
|
|
The firmware file related definitions in PI.
|
|
|
|
|
|
|
|
Copyright (c) 2006 - 2007, Intel Corporation
|
|
|
|
All rights reserved. This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
@par Revision Reference:
|
|
|
|
Version 1.0.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
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__
|
|
|
|
|
2008-04-21 08:56:45 +02:00
|
|
|
#include <ProcessorBind.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.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef union {
|
|
|
|
struct {
|
|
|
|
UINT8 Header;
|
|
|
|
UINT8 File;
|
|
|
|
} Checksum;
|
|
|
|
UINT16 Checksum16;
|
|
|
|
} EFI_FFS_INTEGRITY_CHECK;
|
|
|
|
|
|
|
|
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
|
|
|
|
///
|
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
|
|
|
|
#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
|
|
|
|
#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
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// FFS File Attributes.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
#define FFS_ATTRIB_FIXED 0x04
|
|
|
|
#define FFS_ATTRIB_DATA_ALIGNMENT 0x38
|
|
|
|
#define FFS_ATTRIB_CHECKSUM 0x40
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// FFS File State Bits.
|
|
|
|
///
|
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
|
|
|
///
|
|
|
|
/// Each file begins with the header that describe the
|
|
|
|
/// contents and state of the files.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
|
|
|
EFI_GUID Name;
|
|
|
|
EFI_FFS_INTEGRITY_CHECK IntegrityCheck;
|
|
|
|
EFI_FV_FILETYPE Type;
|
|
|
|
EFI_FFS_FILE_ATTRIBUTES Attributes;
|
|
|
|
UINT8 Size[3];
|
|
|
|
EFI_FFS_FILE_STATE State;
|
|
|
|
} EFI_FFS_FILE_HEADER;
|
|
|
|
|
|
|
|
|
|
|
|
typedef UINT8 EFI_SECTION_TYPE;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Pseudo type. It is
|
|
|
|
/// used as a wild card when retrieving sections. The section
|
|
|
|
/// type EFI_SECTION_ALL matches all section types.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
#define EFI_SECTION_ALL 0x00
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Encapsulation section Type values
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
#define EFI_SECTION_COMPRESSION 0x01
|
|
|
|
|
|
|
|
#define EFI_SECTION_GUID_DEFINED 0x02
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Leaf section Type values
|
|
|
|
///
|
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
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Common section header
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
|
|
|
UINT8 Size[3];
|
|
|
|
EFI_SECTION_TYPE Type;
|
|
|
|
} EFI_COMMON_SECTION_HEADER;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Leaf section type that contains an
|
|
|
|
/// IA-32 16-bit executable image.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// CompressionType of EFI_COMPRESSION_SECTION.
|
|
|
|
///
|
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
|
|
|
///
|
|
|
|
/// An encapsulation section type in which the
|
|
|
|
/// section data is compressed.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2007-06-18 22:28:02 +02:00
|
|
|
EFI_COMMON_SECTION_HEADER CommonHeader;
|
|
|
|
UINT32 UncompressedLength;
|
|
|
|
UINT8 CompressionType;
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_COMPRESSION_SECTION;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Leaf section which could be used to determine the dispatch order of DXEs.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Leaf section witch contains a PI FV.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Leaf section which contains a single GUID.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2007-06-18 22:28:02 +02:00
|
|
|
EFI_COMMON_SECTION_HEADER CommonHeader;
|
|
|
|
EFI_GUID SubTypeGuid;
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_FREEFORM_SUBTYPE_GUID_SECTION;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Attributes of EFI_GUID_DEFINED_SECTION
|
|
|
|
///
|
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
|
|
|
///
|
|
|
|
/// Leaf section which is encapsulation defined by specific GUID
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef struct {
|
2007-06-18 22:28:02 +02:00
|
|
|
EFI_COMMON_SECTION_HEADER CommonHeader;
|
|
|
|
EFI_GUID SectionDefinitionGuid;
|
|
|
|
UINT16 DataOffset;
|
|
|
|
UINT16 Attributes;
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_GUID_DEFINED_SECTION;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Leaf section which contains PE32+ image.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;
|
|
|
|
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Leaf section which used to determine the dispatch order of PEIMs.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Leaf section which constains the position-independent-code image.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Leaf section which contains an array of zero or more bytes.
|
|
|
|
///
|
2007-06-08 13:31:52 +02:00
|
|
|
typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Leaf section which contains a unicode string that
|
|
|
|
/// is human readable file name.
|
|
|
|
///
|
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.
|
|
|
|
///
|
2007-06-18 22:28:02 +02:00
|
|
|
CHAR16 FileNameString[1];
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_USER_INTERFACE_SECTION;
|
|
|
|
|
|
|
|
|
2008-06-24 06:37:24 +02:00
|
|
|
///
|
|
|
|
/// Leaf section which contains a numeric build number and
|
|
|
|
/// an optional unicode string that represent 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;
|
|
|
|
CHAR16 VersionString[1];
|
2007-06-08 13:31:52 +02:00
|
|
|
} EFI_VERSION_SECTION;
|
|
|
|
|
2007-07-04 10:23:26 +02:00
|
|
|
|
|
|
|
#define SECTION_SIZE(SectionHeaderPtr) \
|
|
|
|
((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))
|
|
|
|
|
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
|
|
|
|
|