]>
Commit | Line | Data |
---|---|---|
959ccb23 | 1 | /** @file\r |
2 | The firmware file related definitions in PI.\r | |
3 | \r | |
c8a9f069 | 4 | Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
959ccb23 | 6 | \r |
959ccb23 | 7 | @par Revision Reference:\r |
c8a9f069 | 8 | PI Version 1.6.\r |
959ccb23 | 9 | \r |
10 | **/\r | |
11 | \r | |
0b3cac32 | 12 | \r |
959ccb23 | 13 | #ifndef __PI_FIRMWARE_FILE_H__\r |
14 | #define __PI_FIRMWARE_FILE_H__\r | |
15 | \r | |
62d1e08b | 16 | #pragma pack(1)\r |
dc53faa3 | 17 | ///\r |
18 | /// Used to verify the integrity of the file.\r | |
fbb393ab | 19 | ///\r |
959ccb23 | 20 | typedef union {\r |
21 | struct {\r | |
1bf79370 LG |
22 | ///\r |
23 | /// The IntegrityCheck.Checksum.Header field is an 8-bit checksum of the file\r | |
24 | /// header. The State and IntegrityCheck.Checksum.File fields are assumed\r | |
25 | /// to be zero and the checksum is calculated such that the entire header sums to zero.\r | |
26 | ///\r | |
959ccb23 | 27 | UINT8 Header;\r |
1bf79370 LG |
28 | ///\r |
29 | /// If the FFS_ATTRIB_CHECKSUM (see definition below) bit of the Attributes\r | |
30 | /// field is set to one, the IntegrityCheck.Checksum.File field is an 8-bit\r | |
bf099261 | 31 | /// checksum of the file data.\r |
1bf79370 LG |
32 | /// If the FFS_ATTRIB_CHECKSUM bit of the Attributes field is cleared to zero,\r |
33 | /// the IntegrityCheck.Checksum.File field must be initialized with a value of\r | |
2bf0d835 | 34 | /// 0xAA. The IntegrityCheck.Checksum.File field is valid any time the\r |
1bf79370 LG |
35 | /// EFI_FILE_DATA_VALID bit is set in the State field.\r |
36 | ///\r | |
959ccb23 | 37 | UINT8 File;\r |
38 | } Checksum;\r | |
1bf79370 LG |
39 | ///\r |
40 | /// This is the full 16 bits of the IntegrityCheck field.\r | |
41 | ///\r | |
959ccb23 | 42 | UINT16 Checksum16;\r |
43 | } EFI_FFS_INTEGRITY_CHECK;\r | |
44 | \r | |
2bf0d835 LG |
45 | ///\r |
46 | /// FFS_FIXED_CHECKSUM is the checksum value used when the\r | |
af2dc6a7 | 47 | /// FFS_ATTRIB_CHECKSUM attribute bit is clear.\r |
2bf0d835 LG |
48 | ///\r |
49 | #define FFS_FIXED_CHECKSUM 0xAA\r | |
50 | \r | |
959ccb23 | 51 | typedef UINT8 EFI_FV_FILETYPE;\r |
52 | typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;\r | |
53 | typedef UINT8 EFI_FFS_FILE_STATE;\r | |
54 | \r | |
dc53faa3 | 55 | ///\r |
56 | /// File Types Definitions\r | |
fbb393ab | 57 | ///\r |
d44d2087 | 58 | #define EFI_FV_FILETYPE_ALL 0x00\r |
8fb30482 | 59 | #define EFI_FV_FILETYPE_RAW 0x01\r |
60 | #define EFI_FV_FILETYPE_FREEFORM 0x02\r | |
61 | #define EFI_FV_FILETYPE_SECURITY_CORE 0x03\r | |
62 | #define EFI_FV_FILETYPE_PEI_CORE 0x04\r | |
63 | #define EFI_FV_FILETYPE_DXE_CORE 0x05\r | |
64 | #define EFI_FV_FILETYPE_PEIM 0x06\r | |
65 | #define EFI_FV_FILETYPE_DRIVER 0x07\r | |
66 | #define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08\r | |
67 | #define EFI_FV_FILETYPE_APPLICATION 0x09\r | |
f412ecc3 SV |
68 | #define EFI_FV_FILETYPE_MM 0x0A\r |
69 | #define EFI_FV_FILETYPE_SMM EFI_FV_FILETYPE_MM\r | |
8fb30482 | 70 | #define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B\r |
f412ecc3 SV |
71 | #define EFI_FV_FILETYPE_COMBINED_MM_DXE 0x0C\r |
72 | #define EFI_FV_FILETYPE_COMBINED_SMM_DXE EFI_FV_FILETYPE_COMBINED_MM_DXE\r | |
73 | #define EFI_FV_FILETYPE_MM_CORE 0x0D\r | |
74 | #define EFI_FV_FILETYPE_SMM_CORE EFI_FV_FILETYPE_MM_CORE\r | |
75 | #define EFI_FV_FILETYPE_MM_STANDALONE 0x0E\r | |
76 | #define EFI_FV_FILETYPE_MM_CORE_STANDALONE 0x0F\r | |
8fb30482 | 77 | #define EFI_FV_FILETYPE_OEM_MIN 0xc0\r |
78 | #define EFI_FV_FILETYPE_OEM_MAX 0xdf\r | |
79 | #define EFI_FV_FILETYPE_DEBUG_MIN 0xe0\r | |
80 | #define EFI_FV_FILETYPE_DEBUG_MAX 0xef\r | |
81 | #define EFI_FV_FILETYPE_FFS_MIN 0xf0\r | |
82 | #define EFI_FV_FILETYPE_FFS_MAX 0xff\r | |
83 | #define EFI_FV_FILETYPE_FFS_PAD 0xf0\r | |
fbb393ab | 84 | ///\r |
dc53faa3 | 85 | /// FFS File Attributes.\r |
fbb393ab | 86 | ///\r |
3d4d4cfa | 87 | #define FFS_ATTRIB_LARGE_FILE 0x01\r |
c8a9f069 | 88 | #define FFS_ATTRIB_DATA_ALIGNMENT_2 0x02\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 | |
1fd227dd LE |
182 | ///\r |
183 | /// The argument passed as the FfsFileHeaderPtr parameter to the\r | |
184 | /// FFS_FILE_SIZE() function-like macro below must not have side effects:\r | |
185 | /// FfsFileHeaderPtr is evaluated multiple times.\r | |
186 | ///\r | |
187 | #define FFS_FILE_SIZE(FfsFileHeaderPtr) ((UINT32) ( \\r | |
188 | (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[0] ) | \\r | |
189 | (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[1] << 8) | \\r | |
190 | (((EFI_FFS_FILE_HEADER *) (UINTN) (FfsFileHeaderPtr))->Size[2] << 16)))\r | |
30f001ca SZ |
191 | \r |
192 | #define FFS_FILE2_SIZE(FfsFileHeaderPtr) \\r | |
28fc9f47 | 193 | ((UINT32) (((EFI_FFS_FILE_HEADER2 *) (UINTN) FfsFileHeaderPtr)->ExtendedSize))\r |
30f001ca | 194 | \r |
959ccb23 | 195 | typedef UINT8 EFI_SECTION_TYPE;\r |
196 | \r | |
dc53faa3 | 197 | ///\r |
af2dc6a7 | 198 | /// Pseudo type. It is used as a wild card when retrieving sections.\r |
199 | /// The section type EFI_SECTION_ALL matches all section types.\r | |
dc53faa3 | 200 | ///\r |
959ccb23 | 201 | #define EFI_SECTION_ALL 0x00\r |
202 | \r | |
dc53faa3 | 203 | ///\r |
af2dc6a7 | 204 | /// Encapsulation section Type values.\r |
dc53faa3 | 205 | ///\r |
959ccb23 | 206 | #define EFI_SECTION_COMPRESSION 0x01\r |
207 | \r | |
208 | #define EFI_SECTION_GUID_DEFINED 0x02\r | |
209 | \r | |
3d4d4cfa | 210 | #define EFI_SECTION_DISPOSABLE 0x03\r |
211 | \r | |
dc53faa3 | 212 | ///\r |
af2dc6a7 | 213 | /// Leaf section Type values.\r |
dc53faa3 | 214 | ///\r |
959ccb23 | 215 | #define EFI_SECTION_PE32 0x10\r |
216 | #define EFI_SECTION_PIC 0x11\r | |
217 | #define EFI_SECTION_TE 0x12\r | |
218 | #define EFI_SECTION_DXE_DEPEX 0x13\r | |
219 | #define EFI_SECTION_VERSION 0x14\r | |
220 | #define EFI_SECTION_USER_INTERFACE 0x15\r | |
221 | #define EFI_SECTION_COMPATIBILITY16 0x16\r | |
222 | #define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17\r | |
223 | #define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18\r | |
224 | #define EFI_SECTION_RAW 0x19\r | |
225 | #define EFI_SECTION_PEI_DEPEX 0x1B\r | |
f412ecc3 SV |
226 | #define EFI_SECTION_MM_DEPEX 0x1C\r |
227 | #define EFI_SECTION_SMM_DEPEX EFI_SECTION_MM_DEPEX\r | |
959ccb23 | 228 | \r |
dc53faa3 | 229 | ///\r |
af2dc6a7 | 230 | /// Common section header.\r |
fbb393ab | 231 | ///\r |
959ccb23 | 232 | typedef struct {\r |
1bf79370 | 233 | ///\r |
fbb393ab | 234 | /// A 24-bit unsigned integer that contains the total size of the section in bytes,\r |
1bf79370 LG |
235 | /// including the EFI_COMMON_SECTION_HEADER.\r |
236 | ///\r | |
959ccb23 | 237 | UINT8 Size[3];\r |
238 | EFI_SECTION_TYPE Type;\r | |
1bf79370 LG |
239 | ///\r |
240 | /// Declares the section type.\r | |
241 | ///\r | |
959ccb23 | 242 | } EFI_COMMON_SECTION_HEADER;\r |
243 | \r | |
3d4d4cfa | 244 | typedef struct {\r |
245 | ///\r | |
fbb393ab | 246 | /// A 24-bit unsigned integer that contains the total size of the section in bytes,\r |
3d4d4cfa | 247 | /// including the EFI_COMMON_SECTION_HEADER.\r |
248 | ///\r | |
249 | UINT8 Size[3];\r | |
fbb393ab | 250 | \r |
3d4d4cfa | 251 | EFI_SECTION_TYPE Type;\r |
fbb393ab | 252 | \r |
3d4d4cfa | 253 | ///\r |
af2dc6a7 | 254 | /// If Size is 0xFFFFFF, then ExtendedSize contains the size of the section. If\r |
fbb393ab | 255 | /// Size is not equal to 0xFFFFFF, then this field does not exist.\r |
3d4d4cfa | 256 | ///\r |
257 | UINT32 ExtendedSize;\r | |
258 | } EFI_COMMON_SECTION_HEADER2;\r | |
259 | \r | |
dc53faa3 | 260 | ///\r |
fbb393ab | 261 | /// Leaf section type that contains an\r |
dc53faa3 | 262 | /// IA-32 16-bit executable image.\r |
fbb393ab | 263 | ///\r |
3d4d4cfa | 264 | typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;\r |
265 | typedef EFI_COMMON_SECTION_HEADER2 EFI_COMPATIBILITY16_SECTION2;\r | |
959ccb23 | 266 | \r |
dc53faa3 | 267 | ///\r |
268 | /// CompressionType of EFI_COMPRESSION_SECTION.\r | |
fbb393ab | 269 | ///\r |
959ccb23 | 270 | #define EFI_NOT_COMPRESSED 0x00\r |
271 | #define EFI_STANDARD_COMPRESSION 0x01\r | |
dc53faa3 | 272 | ///\r |
fbb393ab | 273 | /// An encapsulation section type in which the\r |
dc53faa3 | 274 | /// section data is compressed.\r |
fbb393ab | 275 | ///\r |
959ccb23 | 276 | typedef struct {\r |
1bf79370 LG |
277 | ///\r |
278 | /// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION.\r | |
279 | ///\r | |
00edb218 | 280 | EFI_COMMON_SECTION_HEADER CommonHeader;\r |
1bf79370 | 281 | ///\r |
af2dc6a7 | 282 | /// The UINT32 that indicates the size of the section data after decompression.\r |
1bf79370 | 283 | ///\r |
00edb218 | 284 | UINT32 UncompressedLength;\r |
1bf79370 LG |
285 | ///\r |
286 | /// Indicates which compression algorithm is used.\r | |
287 | ///\r | |
00edb218 | 288 | UINT8 CompressionType;\r |
959ccb23 | 289 | } EFI_COMPRESSION_SECTION;\r |
290 | \r | |
3d4d4cfa | 291 | typedef struct {\r |
292 | ///\r | |
293 | /// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION.\r | |
294 | ///\r | |
295 | EFI_COMMON_SECTION_HEADER2 CommonHeader;\r | |
296 | ///\r | |
297 | /// UINT32 that indicates the size of the section data after decompression.\r | |
298 | ///\r | |
299 | UINT32 UncompressedLength;\r | |
300 | ///\r | |
301 | /// Indicates which compression algorithm is used.\r | |
302 | ///\r | |
303 | UINT8 CompressionType;\r | |
304 | } EFI_COMPRESSION_SECTION2;\r | |
305 | \r | |
73d622ed | 306 | ///\r |
307 | /// An encapsulation section type in which the section data is disposable.\r | |
308 | /// A disposable section is an encapsulation section in which the section data may be disposed of during\r | |
309 | /// the process of creating or updating a firmware image without significant impact on the usefulness of\r | |
310 | /// the file. The Type field in the section header is set to EFI_SECTION_DISPOSABLE. This\r | |
311 | /// allows optional or descriptive data to be included with the firmware file which can be removed in\r | |
312 | /// order to conserve space. The contents of this section are implementation specific, but might contain\r | |
313 | /// debug data or detailed integration instructions.\r | |
314 | ///\r | |
3d4d4cfa | 315 | typedef EFI_COMMON_SECTION_HEADER EFI_DISPOSABLE_SECTION;\r |
316 | typedef EFI_COMMON_SECTION_HEADER2 EFI_DISPOSABLE_SECTION2;\r | |
73d622ed | 317 | \r |
dc53faa3 | 318 | ///\r |
af2dc6a7 | 319 | /// The leaf section which could be used to determine the dispatch order of DXEs.\r |
fbb393ab | 320 | ///\r |
3d4d4cfa | 321 | typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;\r |
322 | typedef EFI_COMMON_SECTION_HEADER2 EFI_DXE_DEPEX_SECTION2;\r | |
959ccb23 | 323 | \r |
dc53faa3 | 324 | ///\r |
af2dc6a7 | 325 | /// The leaf section which contains a PI FV.\r |
fbb393ab | 326 | ///\r |
3d4d4cfa | 327 | typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;\r |
328 | typedef EFI_COMMON_SECTION_HEADER2 EFI_FIRMWARE_VOLUME_IMAGE_SECTION2;\r | |
959ccb23 | 329 | \r |
dc53faa3 | 330 | ///\r |
af2dc6a7 | 331 | /// The leaf section which contains a single GUID.\r |
fbb393ab | 332 | ///\r |
959ccb23 | 333 | typedef struct {\r |
1bf79370 LG |
334 | ///\r |
335 | /// Common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID.\r | |
336 | ///\r | |
00edb218 | 337 | EFI_COMMON_SECTION_HEADER CommonHeader;\r |
1bf79370 LG |
338 | ///\r |
339 | /// This GUID is defined by the creator of the file. It is a vendor-defined file type.\r | |
340 | ///\r | |
00edb218 | 341 | EFI_GUID SubTypeGuid;\r |
959ccb23 | 342 | } EFI_FREEFORM_SUBTYPE_GUID_SECTION;\r |
343 | \r | |
3d4d4cfa | 344 | typedef struct {\r |
345 | ///\r | |
af2dc6a7 | 346 | /// The common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID.\r |
3d4d4cfa | 347 | ///\r |
348 | EFI_COMMON_SECTION_HEADER2 CommonHeader;\r | |
349 | ///\r | |
350 | /// This GUID is defined by the creator of the file. It is a vendor-defined file type.\r | |
fbb393ab | 351 | ///\r |
3d4d4cfa | 352 | EFI_GUID SubTypeGuid;\r |
353 | } EFI_FREEFORM_SUBTYPE_GUID_SECTION2;\r | |
354 | \r | |
dc53faa3 | 355 | ///\r |
af2dc6a7 | 356 | /// Attributes of EFI_GUID_DEFINED_SECTION.\r |
fbb393ab | 357 | ///\r |
959ccb23 | 358 | #define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01\r |
359 | #define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02\r | |
dc53faa3 | 360 | ///\r |
af2dc6a7 | 361 | /// The leaf section which is encapsulation defined by specific GUID.\r |
fbb393ab | 362 | ///\r |
959ccb23 | 363 | typedef struct {\r |
1bf79370 | 364 | ///\r |
af2dc6a7 | 365 | /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.\r |
1bf79370 | 366 | ///\r |
00edb218 | 367 | EFI_COMMON_SECTION_HEADER CommonHeader;\r |
1bf79370 | 368 | ///\r |
af2dc6a7 | 369 | /// The GUID that defines the format of the data that follows. It is a vendor-defined section type.\r |
1bf79370 | 370 | ///\r |
00edb218 | 371 | EFI_GUID SectionDefinitionGuid;\r |
1bf79370 LG |
372 | ///\r |
373 | /// Contains the offset in bytes from the beginning of the common header to the first byte of the data.\r | |
374 | ///\r | |
00edb218 | 375 | UINT16 DataOffset;\r |
1bf79370 | 376 | ///\r |
af2dc6a7 | 377 | /// The bit field that declares some specific characteristics of the section contents.\r |
1bf79370 | 378 | ///\r |
00edb218 | 379 | UINT16 Attributes;\r |
959ccb23 | 380 | } EFI_GUID_DEFINED_SECTION;\r |
381 | \r | |
3d4d4cfa | 382 | typedef struct {\r |
383 | ///\r | |
af2dc6a7 | 384 | /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.\r |
3d4d4cfa | 385 | ///\r |
386 | EFI_COMMON_SECTION_HEADER2 CommonHeader;\r | |
387 | ///\r | |
af2dc6a7 | 388 | /// The GUID that defines the format of the data that follows. It is a vendor-defined section type.\r |
fbb393ab | 389 | ///\r |
3d4d4cfa | 390 | EFI_GUID SectionDefinitionGuid;\r |
391 | ///\r | |
392 | /// Contains the offset in bytes from the beginning of the common header to the first byte of the data.\r | |
fbb393ab | 393 | ///\r |
3d4d4cfa | 394 | UINT16 DataOffset;\r |
395 | ///\r | |
af2dc6a7 | 396 | /// The bit field that declares some specific characteristics of the section contents.\r |
fbb393ab | 397 | ///\r |
3d4d4cfa | 398 | UINT16 Attributes;\r |
399 | } EFI_GUID_DEFINED_SECTION2;\r | |
400 | \r | |
dc53faa3 | 401 | ///\r |
af2dc6a7 | 402 | /// The leaf section which contains PE32+ image.\r |
fbb393ab | 403 | ///\r |
3d4d4cfa | 404 | typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;\r |
405 | typedef EFI_COMMON_SECTION_HEADER2 EFI_PE32_SECTION2;\r | |
959ccb23 | 406 | \r |
dc53faa3 | 407 | ///\r |
af2dc6a7 | 408 | /// The leaf section used to determine the dispatch order of PEIMs.\r |
fbb393ab | 409 | ///\r |
3d4d4cfa | 410 | typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION;\r |
411 | typedef EFI_COMMON_SECTION_HEADER2 EFI_PEI_DEPEX_SECTION2;\r | |
412 | \r | |
413 | ///\r | |
414 | /// A leaf section type that contains a position-independent-code (PIC) image.\r | |
415 | /// A PIC image section is a leaf section that contains a position-independent-code (PIC) image.\r | |
416 | /// In addition to normal PE32+ images that contain relocation information, PEIM executables may be\r | |
417 | /// PIC and are referred to as PIC images. A PIC image is the same as a PE32+ image except that all\r | |
418 | /// relocation information has been stripped from the image and the image can be moved and will\r | |
419 | /// execute correctly without performing any relocation or other fix-ups. EFI_PIC_SECTION2 must\r | |
420 | /// be used if the section is 16MB or larger.\r | |
421 | ///\r | |
422 | typedef EFI_COMMON_SECTION_HEADER EFI_PIC_SECTION;\r | |
423 | typedef EFI_COMMON_SECTION_HEADER2 EFI_PIC_SECTION2;\r | |
959ccb23 | 424 | \r |
dc53faa3 | 425 | ///\r |
af2dc6a7 | 426 | /// The leaf section which constains the position-independent-code image.\r |
fbb393ab | 427 | ///\r |
3d4d4cfa | 428 | typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;\r |
429 | typedef EFI_COMMON_SECTION_HEADER2 EFI_TE_SECTION2;\r | |
959ccb23 | 430 | \r |
dc53faa3 | 431 | ///\r |
af2dc6a7 | 432 | /// The leaf section which contains an array of zero or more bytes.\r |
fbb393ab | 433 | ///\r |
3d4d4cfa | 434 | typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;\r |
435 | typedef EFI_COMMON_SECTION_HEADER2 EFI_RAW_SECTION2;\r | |
436 | \r | |
fbb393ab | 437 | ///\r |
3d4d4cfa | 438 | /// The SMM dependency expression section is a leaf section that contains a dependency expression that\r |
439 | /// is used to determine the dispatch order for SMM drivers. Before the SMRAM invocation of the\r | |
440 | /// SMM driver's entry point, this dependency expression must evaluate to TRUE. See the Platform\r | |
af2dc6a7 | 441 | /// Initialization Specification, Volume 2, for details regarding the format of the dependency expression.\r |
3d4d4cfa | 442 | /// The dependency expression may refer to protocols installed in either the UEFI or the SMM protocol\r |
443 | /// database. EFI_SMM_DEPEX_SECTION2 must be used if the section is 16MB or larger.\r | |
fbb393ab | 444 | ///\r |
3d4d4cfa | 445 | typedef EFI_COMMON_SECTION_HEADER EFI_SMM_DEPEX_SECTION;\r |
446 | typedef EFI_COMMON_SECTION_HEADER2 EFI_SMM_DEPEX_SECTION2;\r | |
959ccb23 | 447 | \r |
dc53faa3 | 448 | ///\r |
fbb393ab | 449 | /// The leaf section which contains a unicode string that\r |
dc53faa3 | 450 | /// is human readable file name.\r |
fbb393ab | 451 | ///\r |
959ccb23 | 452 | typedef struct {\r |
00edb218 | 453 | EFI_COMMON_SECTION_HEADER CommonHeader;\r |
959ccb23 | 454 | \r |
dc53faa3 | 455 | ///\r |
456 | /// Array of unicode string.\r | |
fbb393ab | 457 | ///\r |
00edb218 | 458 | CHAR16 FileNameString[1];\r |
959ccb23 | 459 | } EFI_USER_INTERFACE_SECTION;\r |
460 | \r | |
3d4d4cfa | 461 | typedef struct {\r |
462 | EFI_COMMON_SECTION_HEADER2 CommonHeader;\r | |
463 | CHAR16 FileNameString[1];\r | |
464 | } EFI_USER_INTERFACE_SECTION2;\r | |
959ccb23 | 465 | \r |
dc53faa3 | 466 | ///\r |
af2dc6a7 | 467 | /// The leaf section which contains a numeric build number and\r |
fbb393ab LL |
468 | /// an optional unicode string that represents the file revision.\r |
469 | ///\r | |
959ccb23 | 470 | typedef struct {\r |
00edb218 A |
471 | EFI_COMMON_SECTION_HEADER CommonHeader;\r |
472 | UINT16 BuildNumber;\r | |
7b1bf9f6 | 473 | \r |
474 | ///\r | |
475 | /// Array of unicode string.\r | |
fbb393ab | 476 | ///\r |
00edb218 | 477 | CHAR16 VersionString[1];\r |
959ccb23 | 478 | } EFI_VERSION_SECTION;\r |
479 | \r | |
3d4d4cfa | 480 | typedef struct {\r |
481 | EFI_COMMON_SECTION_HEADER2 CommonHeader;\r | |
482 | ///\r | |
483 | /// A UINT16 that represents a particular build. Subsequent builds have monotonically\r | |
484 | /// increasing build numbers relative to earlier builds.\r | |
485 | ///\r | |
486 | UINT16 BuildNumber;\r | |
487 | CHAR16 VersionString[1];\r | |
488 | } EFI_VERSION_SECTION2;\r | |
ddd3f471 | 489 | \r |
fc76bbd9 LE |
490 | ///\r |
491 | /// The argument passed as the SectionHeaderPtr parameter to the SECTION_SIZE()\r | |
492 | /// and IS_SECTION2() function-like macros below must not have side effects:\r | |
493 | /// SectionHeaderPtr is evaluated multiple times.\r | |
494 | ///\r | |
495 | #define SECTION_SIZE(SectionHeaderPtr) ((UINT32) ( \\r | |
496 | (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[0] ) | \\r | |
497 | (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[1] << 8) | \\r | |
498 | (((EFI_COMMON_SECTION_HEADER *) (UINTN) (SectionHeaderPtr))->Size[2] << 16)))\r | |
30f001ca | 499 | \r |
d976f09d LE |
500 | #define IS_SECTION2(SectionHeaderPtr) \\r |
501 | (SECTION_SIZE (SectionHeaderPtr) == 0x00ffffff)\r | |
502 | \r | |
30f001ca SZ |
503 | #define SECTION2_SIZE(SectionHeaderPtr) \\r |
504 | (((EFI_COMMON_SECTION_HEADER2 *) (UINTN) SectionHeaderPtr)->ExtendedSize)\r | |
ddd3f471 | 505 | \r |
62d1e08b | 506 | #pragma pack()\r |
ddd3f471 | 507 | \r |
959ccb23 | 508 | #endif\r |
509 | \r |