3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 This file defines the data structures that are architecturally defined for file
19 images loaded via the FirmwareVolume protocol. The Firmware Volume specification
20 is the basis for these definitions.
24 #ifndef _EFI_IMAGE_FORMAT_H_
25 #define _EFI_IMAGE_FORMAT_H_
28 // pack all data structures since this is actually a binary format and we cannot
29 // allow internal padding in the data structures because of some compilerism..
33 // ////////////////////////////////////////////////////////////////////////////
35 // Architectural file types
37 typedef UINT8 EFI_FV_FILETYPE
;
39 #define EFI_FV_FILETYPE_ALL 0x00
40 #define EFI_FV_FILETYPE_RAW 0x01
41 #define EFI_FV_FILETYPE_FREEFORM 0x02
42 #define EFI_FV_FILETYPE_SECURITY_CORE 0x03
43 #define EFI_FV_FILETYPE_PEI_CORE 0x04
44 #define EFI_FV_FILETYPE_DXE_CORE 0x05
45 #define EFI_FV_FILETYPE_PEIM 0x06
46 #define EFI_FV_FILETYPE_DRIVER 0x07
47 #define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08
48 #define EFI_FV_FILETYPE_APPLICATION 0x09
50 // File type 0x0A is reserved and should not be used
52 #define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
55 // ////////////////////////////////////////////////////////////////////////////
59 typedef UINT8 EFI_SECTION_TYPE
;
62 // ************************************************************
63 // The section type EFI_SECTION_ALL is a psuedo type. It is
64 // used as a wildcard when retrieving sections. The section
65 // type EFI_SECTION_ALL matches all section types.
66 // ************************************************************
68 #define EFI_SECTION_ALL 0x00
71 // ************************************************************
72 // Encapsulation section Type values
73 // ************************************************************
75 #define EFI_SECTION_COMPRESSION 0x01
76 #define EFI_SECTION_GUID_DEFINED 0x02
79 // ************************************************************
80 // Leaf section Type values
81 // ************************************************************
83 #define EFI_SECTION_FIRST_LEAF_SECTION_TYPE 0x10
85 #define EFI_SECTION_PE32 0x10
86 #define EFI_SECTION_PIC 0x11
87 #define EFI_SECTION_TE 0x12
88 #define EFI_SECTION_DXE_DEPEX 0x13
89 #define EFI_SECTION_VERSION 0x14
90 #define EFI_SECTION_USER_INTERFACE 0x15
91 #define EFI_SECTION_COMPATIBILITY16 0x16
92 #define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17
93 #define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18
94 #define EFI_SECTION_RAW 0x19
95 #define EFI_SECTION_PEI_DEPEX 0x1B
97 #define EFI_SECTION_LAST_LEAF_SECTION_TYPE 0x1B
98 #define EFI_SECTION_LAST_SECTION_TYPE 0x1B
101 // ////////////////////////////////////////////////////////////////////////////
103 // Common section header
108 } EFI_COMMON_SECTION_HEADER
;
110 #define SECTION_SIZE(SectionHeaderPtr) \
111 ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))
114 // ////////////////////////////////////////////////////////////////////////////
116 // Compression section
119 // CompressionType values
121 #define EFI_NOT_COMPRESSED 0x00
122 #define EFI_STANDARD_COMPRESSION 0x01
123 #define EFI_CUSTOMIZED_COMPRESSION 0x02
126 EFI_COMMON_SECTION_HEADER CommonHeader
;
127 UINT32 UncompressedLength
;
128 UINT8 CompressionType
;
129 } EFI_COMPRESSION_SECTION
;
132 // ////////////////////////////////////////////////////////////////////////////
134 // GUID defined section
137 EFI_COMMON_SECTION_HEADER CommonHeader
;
138 EFI_GUID SectionDefinitionGuid
;
141 } EFI_GUID_DEFINED_SECTION
;
144 // Bit values for Attributes
146 #define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01
147 #define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02
150 // Bit values for AuthenticationStatus
152 #define EFI_AGGREGATE_AUTH_STATUS_PLATFORM_OVERRIDE 0x000001
153 #define EFI_AGGREGATE_AUTH_STATUS_IMAGE_SIGNED 0x000002
154 #define EFI_AGGREGATE_AUTH_STATUS_NOT_TESTED 0x000004
155 #define EFI_AGGREGATE_AUTH_STATUS_TEST_FAILED 0x000008
156 #define EFI_AGGREGATE_AUTH_STATUS_ALL 0x00000f
158 #define EFI_LOCAL_AUTH_STATUS_PLATFORM_OVERRIDE 0x010000
159 #define EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED 0x020000
160 #define EFI_LOCAL_AUTH_STATUS_NOT_TESTED 0x040000
161 #define EFI_LOCAL_AUTH_STATUS_TEST_FAILED 0x080000
162 #define EFI_LOCAL_AUTH_STATUS_ALL 0x0f0000
165 // ////////////////////////////////////////////////////////////////////////////
170 EFI_COMMON_SECTION_HEADER CommonHeader
;
174 // ////////////////////////////////////////////////////////////////////////////
179 EFI_COMMON_SECTION_HEADER CommonHeader
;
183 // ////////////////////////////////////////////////////////////////////////////
185 // PEIM header section
188 EFI_COMMON_SECTION_HEADER CommonHeader
;
189 } EFI_PEIM_HEADER_SECTION
;
192 // ////////////////////////////////////////////////////////////////////////////
197 EFI_COMMON_SECTION_HEADER CommonHeader
;
201 // ////////////////////////////////////////////////////////////////////////////
206 EFI_COMMON_SECTION_HEADER CommonHeader
;
208 INT16 VersionString
[1];
209 } EFI_VERSION_SECTION
;
212 // ////////////////////////////////////////////////////////////////////////////
214 // User interface section
217 EFI_COMMON_SECTION_HEADER CommonHeader
;
218 INT16 FileNameString
[1];
219 } EFI_USER_INTERFACE_SECTION
;
222 // ////////////////////////////////////////////////////////////////////////////
227 EFI_COMMON_SECTION_HEADER CommonHeader
;
228 } EFI_CODE16_SECTION
;
231 // ////////////////////////////////////////////////////////////////////////////
233 // Firmware Volume Image section
236 EFI_COMMON_SECTION_HEADER CommonHeader
;
237 } EFI_FIRMWARE_VOLUME_IMAGE_SECTION
;
240 // ////////////////////////////////////////////////////////////////////////////
242 // Freeform subtype GUID section
245 EFI_COMMON_SECTION_HEADER CommonHeader
;
246 EFI_GUID SubTypeGuid
;
247 } EFI_FREEFORM_SUBTYPE_GUID_SECTION
;
250 // ////////////////////////////////////////////////////////////////////////////
255 EFI_COMMON_SECTION_HEADER CommonHeader
;
259 // undo the pragma from the beginning...
264 EFI_COMMON_SECTION_HEADER
*CommonHeader
;
265 EFI_COMPRESSION_SECTION
*CompressionSection
;
266 EFI_GUID_DEFINED_SECTION
*GuidDefinedSection
;
267 EFI_PE32_SECTION
*Pe32Section
;
268 EFI_PIC_SECTION
*PicSection
;
269 EFI_PEIM_HEADER_SECTION
*PeimHeaderSection
;
270 EFI_DEPEX_SECTION
*DependencySection
;
271 EFI_VERSION_SECTION
*VersionSection
;
272 EFI_USER_INTERFACE_SECTION
*UISection
;
273 EFI_CODE16_SECTION
*Code16Section
;
274 EFI_FIRMWARE_VOLUME_IMAGE_SECTION
*FVImageSection
;
275 EFI_FREEFORM_SUBTYPE_GUID_SECTION
*FreeformSubtypeSection
;
276 EFI_RAW_SECTION
*RawSection
;
277 } EFI_FILE_SECTION_POINTER
;