]>
Commit | Line | Data |
---|---|---|
959ccb23 | 1 | /** @file\r |
2 | The firmware file related definitions in PI.\r | |
3 | \r | |
28fc9f47 | 4 | Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r |
fbb393ab LL |
5 | This program and the accompanying materials are licensed and made available under\r |
6 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
af2dc6a7 | 7 | The full text of the license may be found at\r |
fbb393ab | 8 | http://opensource.org/licenses/bsd-license.php.\r |
959ccb23 | 9 | \r |
fbb393ab LL |
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 | |
959ccb23 | 12 | \r |
959ccb23 | 13 | @par Revision Reference:\r |
28fc9f47 | 14 | PI Version 1.4.\r |
959ccb23 | 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 | |
62d1e08b | 22 | #pragma pack(1)\r |
dc53faa3 | 23 | ///\r |
24 | /// Used to verify the integrity of the file.\r | |
fbb393ab | 25 | ///\r |
959ccb23 | 26 | typedef union {\r |
27 | struct {\r | |
1bf79370 LG |
28 | ///\r |
29 | /// The IntegrityCheck.Checksum.Header field is an 8-bit checksum of the file\r | |
30 | /// header. The State and IntegrityCheck.Checksum.File fields are assumed\r | |
31 | /// to be zero and the checksum is calculated such that the entire header sums to zero.\r | |
32 | ///\r | |
959ccb23 | 33 | UINT8 Header;\r |
1bf79370 LG |
34 | ///\r |
35 | /// If the FFS_ATTRIB_CHECKSUM (see definition below) bit of the Attributes\r | |
36 | /// field is set to one, the IntegrityCheck.Checksum.File field is an 8-bit\r | |
bf099261 | 37 | /// checksum of the file data.\r |
1bf79370 LG |
38 | /// If the FFS_ATTRIB_CHECKSUM bit of the Attributes field is cleared to zero,\r |
39 | /// the IntegrityCheck.Checksum.File field must be initialized with a value of\r | |
2bf0d835 | 40 | /// 0xAA. The IntegrityCheck.Checksum.File field is valid any time the\r |
1bf79370 LG |
41 | /// EFI_FILE_DATA_VALID bit is set in the State field.\r |
42 | ///\r | |
959ccb23 | 43 | UINT8 File;\r |
44 | } Checksum;\r | |
1bf79370 LG |
45 | ///\r |
46 | /// This is the full 16 bits of the IntegrityCheck field.\r | |
47 | ///\r | |
959ccb23 | 48 | UINT16 Checksum16;\r |
49 | } EFI_FFS_INTEGRITY_CHECK;\r | |
50 | \r | |
2bf0d835 LG |
51 | ///\r |
52 | /// FFS_FIXED_CHECKSUM is the checksum value used when the\r | |
af2dc6a7 | 53 | /// FFS_ATTRIB_CHECKSUM attribute bit is clear.\r |
2bf0d835 LG |
54 | ///\r |
55 | #define FFS_FIXED_CHECKSUM 0xAA\r | |
56 | \r | |
959ccb23 | 57 | typedef UINT8 EFI_FV_FILETYPE;\r |
58 | typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;\r | |
59 | typedef UINT8 EFI_FFS_FILE_STATE;\r | |
60 | \r | |
dc53faa3 | 61 | ///\r |
62 | /// File Types Definitions\r | |
fbb393ab | 63 | ///\r |
d44d2087 | 64 | #define EFI_FV_FILETYPE_ALL 0x00\r |
8fb30482 | 65 | #define EFI_FV_FILETYPE_RAW 0x01\r |
66 | #define EFI_FV_FILETYPE_FREEFORM 0x02\r | |
67 | #define EFI_FV_FILETYPE_SECURITY_CORE 0x03\r | |
68 | #define EFI_FV_FILETYPE_PEI_CORE 0x04\r | |
69 | #define EFI_FV_FILETYPE_DXE_CORE 0x05\r | |
70 | #define EFI_FV_FILETYPE_PEIM 0x06\r | |
71 | #define EFI_FV_FILETYPE_DRIVER 0x07\r | |
72 | #define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08\r | |
73 | #define EFI_FV_FILETYPE_APPLICATION 0x09\r | |
95ba3c41 | 74 | #define EFI_FV_FILETYPE_SMM 0x0A\r |
8fb30482 | 75 | #define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B\r |
95ba3c41 | 76 | #define EFI_FV_FILETYPE_COMBINED_SMM_DXE 0x0C\r |
77 | #define EFI_FV_FILETYPE_SMM_CORE 0x0D\r | |
8fb30482 | 78 | #define EFI_FV_FILETYPE_OEM_MIN 0xc0\r |
79 | #define EFI_FV_FILETYPE_OEM_MAX 0xdf\r | |
80 | #define EFI_FV_FILETYPE_DEBUG_MIN 0xe0\r | |
81 | #define EFI_FV_FILETYPE_DEBUG_MAX 0xef\r | |
82 | #define EFI_FV_FILETYPE_FFS_MIN 0xf0\r | |
83 | #define EFI_FV_FILETYPE_FFS_MAX 0xff\r | |
84 | #define EFI_FV_FILETYPE_FFS_PAD 0xf0\r | |
fbb393ab | 85 | ///\r |
dc53faa3 | 86 | /// FFS File Attributes.\r |
fbb393ab | 87 | ///\r |
3d4d4cfa | 88 | #define FFS_ATTRIB_LARGE_FILE 0x01\r |
959ccb23 | 89 | #define FFS_ATTRIB_FIXED 0x04\r |
90 | #define FFS_ATTRIB_DATA_ALIGNMENT 0x38\r | |
91 | #define FFS_ATTRIB_CHECKSUM 0x40\r | |
92 | \r | |
fbb393ab | 93 | ///\r |
dc53faa3 | 94 | /// FFS File State Bits.\r |
fbb393ab | 95 | ///\r |
959ccb23 | 96 | #define EFI_FILE_HEADER_CONSTRUCTION 0x01\r |
97 | #define EFI_FILE_HEADER_VALID 0x02\r | |
98 | #define EFI_FILE_DATA_VALID 0x04\r | |
99 | #define EFI_FILE_MARKED_FOR_UPDATE 0x08\r | |
100 | #define EFI_FILE_DELETED 0x10\r | |
101 | #define EFI_FILE_HEADER_INVALID 0x20\r | |
102 | \r | |
103 | \r | |
dc53faa3 | 104 | ///\r |
fbb393ab | 105 | /// Each file begins with the header that describe the\r |
dc53faa3 | 106 | /// contents and state of the files.\r |
fbb393ab | 107 | ///\r |
959ccb23 | 108 | typedef struct {\r |
1bf79370 LG |
109 | ///\r |
110 | /// This GUID is the file name. It is used to uniquely identify the file.\r | |
111 | ///\r | |
959ccb23 | 112 | EFI_GUID Name;\r |
1bf79370 LG |
113 | ///\r |
114 | /// Used to verify the integrity of the file.\r | |
115 | ///\r | |
959ccb23 | 116 | EFI_FFS_INTEGRITY_CHECK IntegrityCheck;\r |
1bf79370 LG |
117 | ///\r |
118 | /// Identifies the type of file.\r | |
119 | ///\r | |
959ccb23 | 120 | EFI_FV_FILETYPE Type;\r |
1bf79370 LG |
121 | ///\r |
122 | /// Declares various file attribute bits.\r | |
123 | ///\r | |
959ccb23 | 124 | EFI_FFS_FILE_ATTRIBUTES Attributes;\r |
1bf79370 LG |
125 | ///\r |
126 | /// The length of the file in bytes, including the FFS header.\r | |
127 | ///\r | |
959ccb23 | 128 | UINT8 Size[3];\r |
1bf79370 LG |
129 | ///\r |
130 | /// Used to track the state of the file throughout the life of the file from creation to deletion.\r | |
131 | ///\r | |
959ccb23 | 132 | EFI_FFS_FILE_STATE State;\r |
133 | } EFI_FFS_FILE_HEADER;\r | |
134 | \r | |
3d4d4cfa | 135 | typedef struct {\r |
136 | ///\r | |
137 | /// This GUID is the file name. It is used to uniquely identify the file. There may be only\r | |
138 | /// one instance of a file with the file name GUID of Name in any given firmware\r | |
139 | /// volume, except if the file type is EFI_FV_FILETYPE_FFS_PAD.\r | |
140 | ///\r | |
141 | EFI_GUID Name;\r | |
fbb393ab | 142 | \r |
3d4d4cfa | 143 | ///\r |
144 | /// Used to verify the integrity of the file.\r | |
fbb393ab | 145 | ///\r |
3d4d4cfa | 146 | EFI_FFS_INTEGRITY_CHECK IntegrityCheck;\r |
fbb393ab | 147 | \r |
3d4d4cfa | 148 | ///\r |
149 | /// Identifies the type of file.\r | |
fbb393ab | 150 | ///\r |
3d4d4cfa | 151 | EFI_FV_FILETYPE Type;\r |
fbb393ab | 152 | \r |
3d4d4cfa | 153 | ///\r |
154 | /// Declares various file attribute bits.\r | |
fbb393ab | 155 | ///\r |
3d4d4cfa | 156 | EFI_FFS_FILE_ATTRIBUTES Attributes;\r |
fbb393ab | 157 | \r |
3d4d4cfa | 158 | ///\r |
159 | /// The length of the file in bytes, including the FFS header.\r | |
160 | /// The length of the file data is either (Size - sizeof(EFI_FFS_FILE_HEADER)). This calculation means a\r | |
161 | /// zero-length file has a Size of 24 bytes, which is sizeof(EFI_FFS_FILE_HEADER).\r | |
162 | /// Size is not required to be a multiple of 8 bytes. Given a file F, the next file header is\r | |
163 | /// located at the next 8-byte aligned firmware volume offset following the last byte of the file F.\r | |
164 | ///\r | |
165 | UINT8 Size[3];\r | |
fbb393ab | 166 | \r |
3d4d4cfa | 167 | ///\r |
168 | /// Used to track the state of the file throughout the life of the file from creation to deletion.\r | |
169 | ///\r | |
170 | EFI_FFS_FILE_STATE State;\r | |
fbb393ab | 171 | \r |
3d4d4cfa | 172 | ///\r |
af2dc6a7 | 173 | /// If FFS_ATTRIB_LARGE_FILE is set in Attributes, then ExtendedSize exists and Size must be set to zero.\r |
3d4d4cfa | 174 | /// If FFS_ATTRIB_LARGE_FILE is not set then EFI_FFS_FILE_HEADER is used.\r |
175 | ///\r | |
28fc9f47 | 176 | UINT64 ExtendedSize;\r |
3d4d4cfa | 177 | } EFI_FFS_FILE_HEADER2;\r |
959ccb23 | 178 | \r |
30f001ca SZ |
179 | #define IS_FFS_FILE2(FfsFileHeaderPtr) \\r |
180 | (((((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Attributes) & FFS_ATTRIB_LARGE_FILE) == FFS_ATTRIB_LARGE_FILE)\r | |
181 | \r | |
182 | #define FFS_FILE_SIZE(FfsFileHeaderPtr) \\r | |
183 | ((UINT32) (*((UINT32 *) ((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Size) & 0x00ffffff))\r | |
184 | \r | |
185 | #define FFS_FILE2_SIZE(FfsFileHeaderPtr) \\r | |
28fc9f47 | 186 | ((UINT32) (((EFI_FFS_FILE_HEADER2 *) (UINTN) FfsFileHeaderPtr)->ExtendedSize))\r |
30f001ca | 187 | \r |
959ccb23 | 188 | typedef UINT8 EFI_SECTION_TYPE;\r |
189 | \r | |
dc53faa3 | 190 | ///\r |
af2dc6a7 | 191 | /// Pseudo type. It is used as a wild card when retrieving sections.\r |
192 | /// The section type EFI_SECTION_ALL matches all section types.\r | |
dc53faa3 | 193 | ///\r |
959ccb23 | 194 | #define EFI_SECTION_ALL 0x00\r |
195 | \r | |
dc53faa3 | 196 | ///\r |
af2dc6a7 | 197 | /// Encapsulation section Type values.\r |
dc53faa3 | 198 | ///\r |
959ccb23 | 199 | #define EFI_SECTION_COMPRESSION 0x01\r |
200 | \r | |
201 | #define EFI_SECTION_GUID_DEFINED 0x02\r | |
202 | \r | |
3d4d4cfa | 203 | #define EFI_SECTION_DISPOSABLE 0x03\r |
204 | \r | |
dc53faa3 | 205 | ///\r |
af2dc6a7 | 206 | /// Leaf section Type values.\r |
dc53faa3 | 207 | ///\r |
959ccb23 | 208 | #define EFI_SECTION_PE32 0x10\r |
209 | #define EFI_SECTION_PIC 0x11\r | |
210 | #define EFI_SECTION_TE 0x12\r | |
211 | #define EFI_SECTION_DXE_DEPEX 0x13\r | |
212 | #define EFI_SECTION_VERSION 0x14\r | |
213 | #define EFI_SECTION_USER_INTERFACE 0x15\r | |
214 | #define EFI_SECTION_COMPATIBILITY16 0x16\r | |
215 | #define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17\r | |
216 | #define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18\r | |
217 | #define EFI_SECTION_RAW 0x19\r | |
218 | #define EFI_SECTION_PEI_DEPEX 0x1B\r | |
3d4d4cfa | 219 | #define EFI_SECTION_SMM_DEPEX 0x1C\r |
959ccb23 | 220 | \r |
dc53faa3 | 221 | ///\r |
af2dc6a7 | 222 | /// Common section header.\r |
fbb393ab | 223 | ///\r |
959ccb23 | 224 | typedef struct {\r |
1bf79370 | 225 | ///\r |
fbb393ab | 226 | /// A 24-bit unsigned integer that contains the total size of the section in bytes,\r |
1bf79370 LG |
227 | /// including the EFI_COMMON_SECTION_HEADER.\r |
228 | ///\r | |
959ccb23 | 229 | UINT8 Size[3];\r |
230 | EFI_SECTION_TYPE Type;\r | |
1bf79370 LG |
231 | ///\r |
232 | /// Declares the section type.\r | |
233 | ///\r | |
959ccb23 | 234 | } EFI_COMMON_SECTION_HEADER;\r |
235 | \r | |
3d4d4cfa | 236 | typedef struct {\r |
237 | ///\r | |
fbb393ab | 238 | /// A 24-bit unsigned integer that contains the total size of the section in bytes,\r |
3d4d4cfa | 239 | /// including the EFI_COMMON_SECTION_HEADER.\r |
240 | ///\r | |
241 | UINT8 Size[3];\r | |
fbb393ab | 242 | \r |
3d4d4cfa | 243 | EFI_SECTION_TYPE Type;\r |
fbb393ab | 244 | \r |
3d4d4cfa | 245 | ///\r |
af2dc6a7 | 246 | /// If Size is 0xFFFFFF, then ExtendedSize contains the size of the section. If\r |
fbb393ab | 247 | /// Size is not equal to 0xFFFFFF, then this field does not exist.\r |
3d4d4cfa | 248 | ///\r |
249 | UINT32 ExtendedSize;\r | |
250 | } EFI_COMMON_SECTION_HEADER2;\r | |
251 | \r | |
dc53faa3 | 252 | ///\r |
fbb393ab | 253 | /// Leaf section type that contains an\r |
dc53faa3 | 254 | /// IA-32 16-bit executable image.\r |
fbb393ab | 255 | ///\r |
3d4d4cfa | 256 | typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;\r |
257 | typedef EFI_COMMON_SECTION_HEADER2 EFI_COMPATIBILITY16_SECTION2;\r | |
959ccb23 | 258 | \r |
dc53faa3 | 259 | ///\r |
260 | /// CompressionType of EFI_COMPRESSION_SECTION.\r | |
fbb393ab | 261 | ///\r |
959ccb23 | 262 | #define EFI_NOT_COMPRESSED 0x00\r |
263 | #define EFI_STANDARD_COMPRESSION 0x01\r | |
dc53faa3 | 264 | ///\r |
fbb393ab | 265 | /// An encapsulation section type in which the\r |
dc53faa3 | 266 | /// section data is compressed.\r |
fbb393ab | 267 | ///\r |
959ccb23 | 268 | typedef struct {\r |
1bf79370 LG |
269 | ///\r |
270 | /// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION.\r | |
271 | ///\r | |
00edb218 | 272 | EFI_COMMON_SECTION_HEADER CommonHeader;\r |
1bf79370 | 273 | ///\r |
af2dc6a7 | 274 | /// The UINT32 that indicates the size of the section data after decompression.\r |
1bf79370 | 275 | ///\r |
00edb218 | 276 | UINT32 UncompressedLength;\r |
1bf79370 LG |
277 | ///\r |
278 | /// Indicates which compression algorithm is used.\r | |
279 | ///\r | |
00edb218 | 280 | UINT8 CompressionType;\r |
959ccb23 | 281 | } EFI_COMPRESSION_SECTION;\r |
282 | \r | |
3d4d4cfa | 283 | typedef struct {\r |
284 | ///\r | |
285 | /// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION.\r | |
286 | ///\r | |
287 | EFI_COMMON_SECTION_HEADER2 CommonHeader;\r | |
288 | ///\r | |
289 | /// UINT32 that indicates the size of the section data after decompression.\r | |
290 | ///\r | |
291 | UINT32 UncompressedLength;\r | |
292 | ///\r | |
293 | /// Indicates which compression algorithm is used.\r | |
294 | ///\r | |
295 | UINT8 CompressionType;\r | |
296 | } EFI_COMPRESSION_SECTION2;\r | |
297 | \r | |
73d622ed | 298 | ///\r |
299 | /// An encapsulation section type in which the section data is disposable.\r | |
300 | /// A disposable section is an encapsulation section in which the section data may be disposed of during\r | |
301 | /// the process of creating or updating a firmware image without significant impact on the usefulness of\r | |
302 | /// the file. The Type field in the section header is set to EFI_SECTION_DISPOSABLE. This\r | |
303 | /// allows optional or descriptive data to be included with the firmware file which can be removed in\r | |
304 | /// order to conserve space. The contents of this section are implementation specific, but might contain\r | |
305 | /// debug data or detailed integration instructions.\r | |
306 | ///\r | |
3d4d4cfa | 307 | typedef EFI_COMMON_SECTION_HEADER EFI_DISPOSABLE_SECTION;\r |
308 | typedef EFI_COMMON_SECTION_HEADER2 EFI_DISPOSABLE_SECTION2;\r | |
73d622ed | 309 | \r |
dc53faa3 | 310 | ///\r |
af2dc6a7 | 311 | /// The leaf section which could be used to determine the dispatch order of DXEs.\r |
fbb393ab | 312 | ///\r |
3d4d4cfa | 313 | typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;\r |
314 | typedef EFI_COMMON_SECTION_HEADER2 EFI_DXE_DEPEX_SECTION2;\r | |
959ccb23 | 315 | \r |
dc53faa3 | 316 | ///\r |
af2dc6a7 | 317 | /// The leaf section which contains a PI FV.\r |
fbb393ab | 318 | ///\r |
3d4d4cfa | 319 | typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;\r |
320 | typedef EFI_COMMON_SECTION_HEADER2 EFI_FIRMWARE_VOLUME_IMAGE_SECTION2;\r | |
959ccb23 | 321 | \r |
dc53faa3 | 322 | ///\r |
af2dc6a7 | 323 | /// The leaf section which contains a single GUID.\r |
fbb393ab | 324 | ///\r |
959ccb23 | 325 | typedef struct {\r |
1bf79370 LG |
326 | ///\r |
327 | /// Common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID.\r | |
328 | ///\r | |
00edb218 | 329 | EFI_COMMON_SECTION_HEADER CommonHeader;\r |
1bf79370 LG |
330 | ///\r |
331 | /// This GUID is defined by the creator of the file. It is a vendor-defined file type.\r | |
332 | ///\r | |
00edb218 | 333 | EFI_GUID SubTypeGuid;\r |
959ccb23 | 334 | } EFI_FREEFORM_SUBTYPE_GUID_SECTION;\r |
335 | \r | |
3d4d4cfa | 336 | typedef struct {\r |
337 | ///\r | |
af2dc6a7 | 338 | /// The common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID.\r |
3d4d4cfa | 339 | ///\r |
340 | EFI_COMMON_SECTION_HEADER2 CommonHeader;\r | |
341 | ///\r | |
342 | /// This GUID is defined by the creator of the file. It is a vendor-defined file type.\r | |
fbb393ab | 343 | ///\r |
3d4d4cfa | 344 | EFI_GUID SubTypeGuid;\r |
345 | } EFI_FREEFORM_SUBTYPE_GUID_SECTION2;\r | |
346 | \r | |
dc53faa3 | 347 | ///\r |
af2dc6a7 | 348 | /// Attributes of EFI_GUID_DEFINED_SECTION.\r |
fbb393ab | 349 | ///\r |
959ccb23 | 350 | #define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01\r |
351 | #define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02\r | |
dc53faa3 | 352 | ///\r |
af2dc6a7 | 353 | /// The leaf section which is encapsulation defined by specific GUID.\r |
fbb393ab | 354 | ///\r |
959ccb23 | 355 | typedef struct {\r |
1bf79370 | 356 | ///\r |
af2dc6a7 | 357 | /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.\r |
1bf79370 | 358 | ///\r |
00edb218 | 359 | EFI_COMMON_SECTION_HEADER CommonHeader;\r |
1bf79370 | 360 | ///\r |
af2dc6a7 | 361 | /// The GUID that defines the format of the data that follows. It is a vendor-defined section type.\r |
1bf79370 | 362 | ///\r |
00edb218 | 363 | EFI_GUID SectionDefinitionGuid;\r |
1bf79370 LG |
364 | ///\r |
365 | /// Contains the offset in bytes from the beginning of the common header to the first byte of the data.\r | |
366 | ///\r | |
00edb218 | 367 | UINT16 DataOffset;\r |
1bf79370 | 368 | ///\r |
af2dc6a7 | 369 | /// The bit field that declares some specific characteristics of the section contents.\r |
1bf79370 | 370 | ///\r |
00edb218 | 371 | UINT16 Attributes;\r |
959ccb23 | 372 | } EFI_GUID_DEFINED_SECTION;\r |
373 | \r | |
3d4d4cfa | 374 | typedef struct {\r |
375 | ///\r | |
af2dc6a7 | 376 | /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.\r |
3d4d4cfa | 377 | ///\r |
378 | EFI_COMMON_SECTION_HEADER2 CommonHeader;\r | |
379 | ///\r | |
af2dc6a7 | 380 | /// The GUID that defines the format of the data that follows. It is a vendor-defined section type.\r |
fbb393ab | 381 | ///\r |
3d4d4cfa | 382 | EFI_GUID SectionDefinitionGuid;\r |
383 | ///\r | |
384 | /// Contains the offset in bytes from the beginning of the common header to the first byte of the data.\r | |
fbb393ab | 385 | ///\r |
3d4d4cfa | 386 | UINT16 DataOffset;\r |
387 | ///\r | |
af2dc6a7 | 388 | /// The bit field that declares some specific characteristics of the section contents.\r |
fbb393ab | 389 | ///\r |
3d4d4cfa | 390 | UINT16 Attributes;\r |
391 | } EFI_GUID_DEFINED_SECTION2;\r | |
392 | \r | |
dc53faa3 | 393 | ///\r |
af2dc6a7 | 394 | /// The leaf section which contains PE32+ image.\r |
fbb393ab | 395 | ///\r |
3d4d4cfa | 396 | typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;\r |
397 | typedef EFI_COMMON_SECTION_HEADER2 EFI_PE32_SECTION2;\r | |
959ccb23 | 398 | \r |
dc53faa3 | 399 | ///\r |
af2dc6a7 | 400 | /// The leaf section used to determine the dispatch order of PEIMs.\r |
fbb393ab | 401 | ///\r |
3d4d4cfa | 402 | typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION;\r |
403 | typedef EFI_COMMON_SECTION_HEADER2 EFI_PEI_DEPEX_SECTION2;\r | |
404 | \r | |
405 | ///\r | |
406 | /// A leaf section type that contains a position-independent-code (PIC) image.\r | |
407 | /// A PIC image section is a leaf section that contains a position-independent-code (PIC) image.\r | |
408 | /// In addition to normal PE32+ images that contain relocation information, PEIM executables may be\r | |
409 | /// PIC and are referred to as PIC images. A PIC image is the same as a PE32+ image except that all\r | |
410 | /// relocation information has been stripped from the image and the image can be moved and will\r | |
411 | /// execute correctly without performing any relocation or other fix-ups. EFI_PIC_SECTION2 must\r | |
412 | /// be used if the section is 16MB or larger.\r | |
413 | ///\r | |
414 | typedef EFI_COMMON_SECTION_HEADER EFI_PIC_SECTION;\r | |
415 | typedef EFI_COMMON_SECTION_HEADER2 EFI_PIC_SECTION2;\r | |
959ccb23 | 416 | \r |
dc53faa3 | 417 | ///\r |
af2dc6a7 | 418 | /// The leaf section which constains the position-independent-code image.\r |
fbb393ab | 419 | ///\r |
3d4d4cfa | 420 | typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;\r |
421 | typedef EFI_COMMON_SECTION_HEADER2 EFI_TE_SECTION2;\r | |
959ccb23 | 422 | \r |
dc53faa3 | 423 | ///\r |
af2dc6a7 | 424 | /// The leaf section which contains an array of zero or more bytes.\r |
fbb393ab | 425 | ///\r |
3d4d4cfa | 426 | typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;\r |
427 | typedef EFI_COMMON_SECTION_HEADER2 EFI_RAW_SECTION2;\r | |
428 | \r | |
fbb393ab | 429 | ///\r |
3d4d4cfa | 430 | /// The SMM dependency expression section is a leaf section that contains a dependency expression that\r |
431 | /// is used to determine the dispatch order for SMM drivers. Before the SMRAM invocation of the\r | |
432 | /// SMM driver's entry point, this dependency expression must evaluate to TRUE. See the Platform\r | |
af2dc6a7 | 433 | /// Initialization Specification, Volume 2, for details regarding the format of the dependency expression.\r |
3d4d4cfa | 434 | /// The dependency expression may refer to protocols installed in either the UEFI or the SMM protocol\r |
435 | /// database. EFI_SMM_DEPEX_SECTION2 must be used if the section is 16MB or larger.\r | |
fbb393ab | 436 | ///\r |
3d4d4cfa | 437 | typedef EFI_COMMON_SECTION_HEADER EFI_SMM_DEPEX_SECTION;\r |
438 | typedef EFI_COMMON_SECTION_HEADER2 EFI_SMM_DEPEX_SECTION2;\r | |
959ccb23 | 439 | \r |
dc53faa3 | 440 | ///\r |
fbb393ab | 441 | /// The leaf section which contains a unicode string that\r |
dc53faa3 | 442 | /// is human readable file name.\r |
fbb393ab | 443 | ///\r |
959ccb23 | 444 | typedef struct {\r |
00edb218 | 445 | EFI_COMMON_SECTION_HEADER CommonHeader;\r |
959ccb23 | 446 | \r |
dc53faa3 | 447 | ///\r |
448 | /// Array of unicode string.\r | |
fbb393ab | 449 | ///\r |
00edb218 | 450 | CHAR16 FileNameString[1];\r |
959ccb23 | 451 | } EFI_USER_INTERFACE_SECTION;\r |
452 | \r | |
3d4d4cfa | 453 | typedef struct {\r |
454 | EFI_COMMON_SECTION_HEADER2 CommonHeader;\r | |
455 | CHAR16 FileNameString[1];\r | |
456 | } EFI_USER_INTERFACE_SECTION2;\r | |
959ccb23 | 457 | \r |
dc53faa3 | 458 | ///\r |
af2dc6a7 | 459 | /// The leaf section which contains a numeric build number and\r |
fbb393ab LL |
460 | /// an optional unicode string that represents the file revision.\r |
461 | ///\r | |
959ccb23 | 462 | typedef struct {\r |
00edb218 A |
463 | EFI_COMMON_SECTION_HEADER CommonHeader;\r |
464 | UINT16 BuildNumber;\r | |
7b1bf9f6 | 465 | \r |
466 | ///\r | |
467 | /// Array of unicode string.\r | |
fbb393ab | 468 | ///\r |
00edb218 | 469 | CHAR16 VersionString[1];\r |
959ccb23 | 470 | } EFI_VERSION_SECTION;\r |
471 | \r | |
3d4d4cfa | 472 | typedef struct {\r |
473 | EFI_COMMON_SECTION_HEADER2 CommonHeader;\r | |
474 | ///\r | |
475 | /// A UINT16 that represents a particular build. Subsequent builds have monotonically\r | |
476 | /// increasing build numbers relative to earlier builds.\r | |
477 | ///\r | |
478 | UINT16 BuildNumber;\r | |
479 | CHAR16 VersionString[1];\r | |
480 | } EFI_VERSION_SECTION2;\r | |
ddd3f471 | 481 | \r |
30f001ca SZ |
482 | #define IS_SECTION2(SectionHeaderPtr) \\r |
483 | ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff) == 0x00ffffff)\r | |
484 | \r | |
ddd3f471 | 485 | #define SECTION_SIZE(SectionHeaderPtr) \\r |
30f001ca SZ |
486 | ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff))\r |
487 | \r | |
488 | #define SECTION2_SIZE(SectionHeaderPtr) \\r | |
489 | (((EFI_COMMON_SECTION_HEADER2 *) (UINTN) SectionHeaderPtr)->ExtendedSize)\r | |
ddd3f471 | 490 | \r |
62d1e08b | 491 | #pragma pack()\r |
ddd3f471 | 492 | \r |
959ccb23 | 493 | #endif\r |
494 | \r |