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