]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Pi/PiFirmwareFile.h
Fix doxygen issue:
[mirror_edk2.git] / MdePkg / Include / Pi / PiFirmwareFile.h
CommitLineData
959ccb23 1/** @file\r
2 The firmware file related definitions in PI.\r
3\r
4 Copyright (c) 2006 - 2007, Intel Corporation \r
5 All rights reserved. This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. The full text of the license may be found at \r
8 http://opensource.org/licenses/bsd-license.php \r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
959ccb23 13 @par Revision Reference:\r
14 Version 1.0.\r
15\r
16**/\r
17\r
0b3cac32 18\r
959ccb23 19#ifndef __PI_FIRMWARE_FILE_H__\r
20#define __PI_FIRMWARE_FILE_H__\r
21\r
0b3cac32 22#include <ProcessorBind.h>\r
23\r
62d1e08b 24#pragma pack(1)\r
dc53faa3 25///\r
26/// Used to verify the integrity of the file.\r
27/// \r
959ccb23 28typedef union {\r
29 struct {\r
30 UINT8 Header;\r
31 UINT8 File;\r
32 } Checksum;\r
33 UINT16 Checksum16;\r
34} EFI_FFS_INTEGRITY_CHECK;\r
35\r
36typedef UINT8 EFI_FV_FILETYPE;\r
37typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;\r
38typedef UINT8 EFI_FFS_FILE_STATE;\r
39\r
dc53faa3 40///\r
41/// File Types Definitions\r
42/// \r
d44d2087 43#define EFI_FV_FILETYPE_ALL 0x00\r
8fb30482 44#define EFI_FV_FILETYPE_RAW 0x01\r
45#define EFI_FV_FILETYPE_FREEFORM 0x02\r
46#define EFI_FV_FILETYPE_SECURITY_CORE 0x03\r
47#define EFI_FV_FILETYPE_PEI_CORE 0x04\r
48#define EFI_FV_FILETYPE_DXE_CORE 0x05\r
49#define EFI_FV_FILETYPE_PEIM 0x06\r
50#define EFI_FV_FILETYPE_DRIVER 0x07\r
51#define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08\r
52#define EFI_FV_FILETYPE_APPLICATION 0x09\r
53#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B\r
54#define EFI_FV_FILETYPE_OEM_MIN 0xc0\r
55#define EFI_FV_FILETYPE_OEM_MAX 0xdf\r
56#define EFI_FV_FILETYPE_DEBUG_MIN 0xe0\r
57#define EFI_FV_FILETYPE_DEBUG_MAX 0xef\r
58#define EFI_FV_FILETYPE_FFS_MIN 0xf0\r
59#define EFI_FV_FILETYPE_FFS_MAX 0xff\r
60#define EFI_FV_FILETYPE_FFS_PAD 0xf0\r
dc53faa3 61/// \r
62/// FFS File Attributes.\r
63/// \r
959ccb23 64#define FFS_ATTRIB_FIXED 0x04\r
65#define FFS_ATTRIB_DATA_ALIGNMENT 0x38\r
66#define FFS_ATTRIB_CHECKSUM 0x40\r
67\r
dc53faa3 68/// \r
69/// FFS File State Bits.\r
70/// \r
959ccb23 71#define EFI_FILE_HEADER_CONSTRUCTION 0x01\r
72#define EFI_FILE_HEADER_VALID 0x02\r
73#define EFI_FILE_DATA_VALID 0x04\r
74#define EFI_FILE_MARKED_FOR_UPDATE 0x08\r
75#define EFI_FILE_DELETED 0x10\r
76#define EFI_FILE_HEADER_INVALID 0x20\r
77\r
78\r
dc53faa3 79///\r
80/// Each file begins with the header that describe the \r
81/// contents and state of the files.\r
82/// \r
959ccb23 83typedef struct {\r
84 EFI_GUID Name;\r
85 EFI_FFS_INTEGRITY_CHECK IntegrityCheck;\r
86 EFI_FV_FILETYPE Type;\r
87 EFI_FFS_FILE_ATTRIBUTES Attributes;\r
88 UINT8 Size[3];\r
89 EFI_FFS_FILE_STATE State;\r
90} EFI_FFS_FILE_HEADER;\r
91\r
92\r
93typedef UINT8 EFI_SECTION_TYPE;\r
94\r
dc53faa3 95///\r
96/// Pseudo type. It is\r
97/// used as a wild card when retrieving sections. The section\r
98/// type EFI_SECTION_ALL matches all section types.\r
99///\r
959ccb23 100#define EFI_SECTION_ALL 0x00\r
101\r
dc53faa3 102///\r
103/// Encapsulation section Type values\r
104///\r
959ccb23 105#define EFI_SECTION_COMPRESSION 0x01\r
106\r
107#define EFI_SECTION_GUID_DEFINED 0x02\r
108\r
dc53faa3 109///\r
110/// Leaf section Type values\r
111///\r
959ccb23 112#define EFI_SECTION_PE32 0x10\r
113#define EFI_SECTION_PIC 0x11\r
114#define EFI_SECTION_TE 0x12\r
115#define EFI_SECTION_DXE_DEPEX 0x13\r
116#define EFI_SECTION_VERSION 0x14\r
117#define EFI_SECTION_USER_INTERFACE 0x15\r
118#define EFI_SECTION_COMPATIBILITY16 0x16\r
119#define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17\r
120#define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18\r
121#define EFI_SECTION_RAW 0x19\r
122#define EFI_SECTION_PEI_DEPEX 0x1B\r
123\r
dc53faa3 124///\r
125/// Common section header\r
126/// \r
959ccb23 127typedef struct {\r
128 UINT8 Size[3];\r
129 EFI_SECTION_TYPE Type;\r
130} EFI_COMMON_SECTION_HEADER;\r
131\r
dc53faa3 132///\r
133/// Leaf section type that contains an \r
134/// IA-32 16-bit executable image.\r
135/// \r
959ccb23 136typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;\r
137\r
dc53faa3 138///\r
139/// CompressionType of EFI_COMPRESSION_SECTION.\r
140/// \r
959ccb23 141#define EFI_NOT_COMPRESSED 0x00\r
142#define EFI_STANDARD_COMPRESSION 0x01\r
dc53faa3 143///\r
144/// An encapsulation section type in which the \r
145/// section data is compressed.\r
146/// \r
959ccb23 147typedef struct {\r
00edb218
A
148 EFI_COMMON_SECTION_HEADER CommonHeader;\r
149 UINT32 UncompressedLength;\r
150 UINT8 CompressionType;\r
959ccb23 151} EFI_COMPRESSION_SECTION;\r
152\r
dc53faa3 153///\r
154/// Leaf section which could be used to determine the dispatch order of DXEs.\r
155/// \r
959ccb23 156typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;\r
157\r
dc53faa3 158///\r
159/// Leaf section witch contains a PI FV.\r
160/// \r
959ccb23 161typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;\r
162\r
dc53faa3 163///\r
164/// Leaf section which contains a single GUID.\r
165/// \r
959ccb23 166typedef struct {\r
00edb218
A
167 EFI_COMMON_SECTION_HEADER CommonHeader;\r
168 EFI_GUID SubTypeGuid;\r
959ccb23 169} EFI_FREEFORM_SUBTYPE_GUID_SECTION;\r
170\r
dc53faa3 171///\r
172/// Attributes of EFI_GUID_DEFINED_SECTION\r
173/// \r
959ccb23 174#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01\r
175#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02\r
dc53faa3 176///\r
177/// Leaf section which is encapsulation defined by specific GUID\r
178/// \r
959ccb23 179typedef struct {\r
00edb218
A
180 EFI_COMMON_SECTION_HEADER CommonHeader;\r
181 EFI_GUID SectionDefinitionGuid;\r
182 UINT16 DataOffset;\r
183 UINT16 Attributes;\r
959ccb23 184} EFI_GUID_DEFINED_SECTION;\r
185\r
dc53faa3 186///\r
187/// Leaf section which contains PE32+ image.\r
188/// \r
959ccb23 189typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;\r
190\r
191\r
dc53faa3 192///\r
193/// Leaf section which used to determine the dispatch order of PEIMs.\r
194/// \r
959ccb23 195typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION;\r
196\r
dc53faa3 197///\r
198/// Leaf section which constains the position-independent-code image.\r
199/// \r
959ccb23 200typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;\r
201\r
dc53faa3 202///\r
203/// Leaf section which contains an array of zero or more bytes.\r
204/// \r
959ccb23 205typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;\r
206\r
dc53faa3 207///\r
208/// Leaf section which contains a unicode string that \r
209/// is human readable file name.\r
210/// \r
959ccb23 211typedef struct {\r
00edb218 212 EFI_COMMON_SECTION_HEADER CommonHeader;\r
959ccb23 213\r
dc53faa3 214 ///\r
215 /// Array of unicode string.\r
216 /// \r
00edb218 217 CHAR16 FileNameString[1];\r
959ccb23 218} EFI_USER_INTERFACE_SECTION;\r
219\r
220\r
dc53faa3 221///\r
222/// Leaf section which contains a numeric build number and\r
223/// an optional unicode string that represent the file revision. \r
224/// \r
959ccb23 225typedef struct {\r
00edb218
A
226 EFI_COMMON_SECTION_HEADER CommonHeader;\r
227 UINT16 BuildNumber;\r
228 CHAR16 VersionString[1];\r
959ccb23 229} EFI_VERSION_SECTION;\r
230\r
ddd3f471 231\r
232#define SECTION_SIZE(SectionHeaderPtr) \\r
233 ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))\r
234\r
62d1e08b 235#pragma pack()\r
ddd3f471 236\r
959ccb23 237#endif\r
238\r