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