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