2 This file defines the data structures that are architecturally defined for file
3 images loaded via the FirmwareVolume protocol. The Firmware Volume specification
4 is the basis for these definitions.
6 Copyright (c) 2006, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 Module Name: FimrwareVolumeImageFormat.h
17 @par Revision Reference:
18 These definitions are from Firmware Volume Spec 0.9.
22 #ifndef __FIRMWARE_VOLUME_IMAGE_FORMAT_H__
23 #define __FIRMWARE_VOLUME_IMAGE_FORMAT_H__
26 // pack all data structures since this is actually a binary format and we cannot
27 // allow internal padding in the data structures because of some compilerism..
31 // ////////////////////////////////////////////////////////////////////////////
33 // Architectural file types
35 typedef UINT8 EFI_FV_FILETYPE
;
37 #define EFI_FV_FILETYPE_ALL 0x00
38 #define EFI_FV_FILETYPE_RAW 0x01
39 #define EFI_FV_FILETYPE_FREEFORM 0x02
40 #define EFI_FV_FILETYPE_SECURITY_CORE 0x03
41 #define EFI_FV_FILETYPE_PEI_CORE 0x04
42 #define EFI_FV_FILETYPE_DXE_CORE 0x05
43 #define EFI_FV_FILETYPE_PEIM 0x06
44 #define EFI_FV_FILETYPE_DRIVER 0x07
45 #define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08
46 #define EFI_FV_FILETYPE_APPLICATION 0x09
48 // File type 0x0A is reserved and should not be used
50 #define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
53 // ////////////////////////////////////////////////////////////////////////////
57 typedef UINT8 EFI_SECTION_TYPE
;
60 // ************************************************************
61 // The section type EFI_SECTION_ALL is a psuedo type. It is
62 // used as a wildcard when retrieving sections. The section
63 // type EFI_SECTION_ALL matches all section types.
64 // ************************************************************
66 #define EFI_SECTION_ALL 0x00
69 // ************************************************************
70 // Encapsulation section Type values
71 // ************************************************************
73 #define EFI_SECTION_COMPRESSION 0x01
74 #define EFI_SECTION_GUID_DEFINED 0x02
77 // ************************************************************
78 // Leaf section Type values
79 // ************************************************************
81 #define EFI_SECTION_FIRST_LEAF_SECTION_TYPE 0x10
83 #define EFI_SECTION_PE32 0x10
84 #define EFI_SECTION_PIC 0x11
85 #define EFI_SECTION_TE 0x12
86 #define EFI_SECTION_DXE_DEPEX 0x13
87 #define EFI_SECTION_VERSION 0x14
88 #define EFI_SECTION_USER_INTERFACE 0x15
89 #define EFI_SECTION_COMPATIBILITY16 0x16
90 #define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17
91 #define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18
92 #define EFI_SECTION_RAW 0x19
93 #define EFI_SECTION_PEI_DEPEX 0x1B
95 #define EFI_SECTION_LAST_LEAF_SECTION_TYPE 0x1B
96 #define EFI_SECTION_LAST_SECTION_TYPE 0x1B
99 // ////////////////////////////////////////////////////////////////////////////
101 // Common section header
106 } EFI_COMMON_SECTION_HEADER
;
108 #define SECTION_SIZE(SectionHeaderPtr) \
109 ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))
112 // ////////////////////////////////////////////////////////////////////////////
114 // Compression section
117 // CompressionType values
119 #define EFI_NOT_COMPRESSED 0x00
120 #define EFI_STANDARD_COMPRESSION 0x01
121 #define EFI_CUSTOMIZED_COMPRESSION 0x02
124 EFI_COMMON_SECTION_HEADER CommonHeader
;
125 UINT32 UncompressedLength
;
126 UINT8 CompressionType
;
127 } EFI_COMPRESSION_SECTION
;
130 // ////////////////////////////////////////////////////////////////////////////
132 // GUID defined section
135 EFI_COMMON_SECTION_HEADER CommonHeader
;
136 EFI_GUID SectionDefinitionGuid
;
139 } EFI_GUID_DEFINED_SECTION
;
142 // Bit values for Attributes
144 #define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01
145 #define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02
148 // Bit values for AuthenticationStatus
150 #define EFI_AGGREGATE_AUTH_STATUS_PLATFORM_OVERRIDE 0x000001
151 #define EFI_AGGREGATE_AUTH_STATUS_IMAGE_SIGNED 0x000002
152 #define EFI_AGGREGATE_AUTH_STATUS_NOT_TESTED 0x000004
153 #define EFI_AGGREGATE_AUTH_STATUS_TEST_FAILED 0x000008
154 #define EFI_AGGREGATE_AUTH_STATUS_ALL 0x00000f
156 #define EFI_LOCAL_AUTH_STATUS_PLATFORM_OVERRIDE 0x010000
157 #define EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED 0x020000
158 #define EFI_LOCAL_AUTH_STATUS_NOT_TESTED 0x040000
159 #define EFI_LOCAL_AUTH_STATUS_TEST_FAILED 0x080000
160 #define EFI_LOCAL_AUTH_STATUS_ALL 0x0f0000
163 // ////////////////////////////////////////////////////////////////////////////
168 EFI_COMMON_SECTION_HEADER CommonHeader
;
172 // ////////////////////////////////////////////////////////////////////////////
177 EFI_COMMON_SECTION_HEADER CommonHeader
;
181 // ////////////////////////////////////////////////////////////////////////////
183 // PEIM header section
186 EFI_COMMON_SECTION_HEADER CommonHeader
;
187 } EFI_PEIM_HEADER_SECTION
;
190 // ////////////////////////////////////////////////////////////////////////////
195 EFI_COMMON_SECTION_HEADER CommonHeader
;
199 // ////////////////////////////////////////////////////////////////////////////
204 EFI_COMMON_SECTION_HEADER CommonHeader
;
206 INT16 VersionString
[1];
207 } EFI_VERSION_SECTION
;
210 // ////////////////////////////////////////////////////////////////////////////
212 // User interface section
215 EFI_COMMON_SECTION_HEADER CommonHeader
;
216 INT16 FileNameString
[1];
217 } EFI_USER_INTERFACE_SECTION
;
220 // ////////////////////////////////////////////////////////////////////////////
225 EFI_COMMON_SECTION_HEADER CommonHeader
;
226 } EFI_CODE16_SECTION
;
229 // ////////////////////////////////////////////////////////////////////////////
231 // Firmware Volume Image section
234 EFI_COMMON_SECTION_HEADER CommonHeader
;
235 } EFI_FIRMWARE_VOLUME_IMAGE_SECTION
;
238 // ////////////////////////////////////////////////////////////////////////////
240 // Freeform subtype GUID section
243 EFI_COMMON_SECTION_HEADER CommonHeader
;
244 EFI_GUID SubTypeGuid
;
245 } EFI_FREEFORM_SUBTYPE_GUID_SECTION
;
248 // ////////////////////////////////////////////////////////////////////////////
253 EFI_COMMON_SECTION_HEADER CommonHeader
;
257 // undo the pragma from the beginning...
262 EFI_COMMON_SECTION_HEADER
*CommonHeader
;
263 EFI_COMPRESSION_SECTION
*CompressionSection
;
264 EFI_GUID_DEFINED_SECTION
*GuidDefinedSection
;
265 EFI_PE32_SECTION
*Pe32Section
;
266 EFI_PIC_SECTION
*PicSection
;
267 EFI_PEIM_HEADER_SECTION
*PeimHeaderSection
;
268 EFI_DEPEX_SECTION
*DependencySection
;
269 EFI_VERSION_SECTION
*VersionSection
;
270 EFI_USER_INTERFACE_SECTION
*UISection
;
271 EFI_CODE16_SECTION
*Code16Section
;
272 EFI_FIRMWARE_VOLUME_IMAGE_SECTION
*FVImageSection
;
273 EFI_FREEFORM_SUBTYPE_GUID_SECTION
*FreeformSubtypeSection
;
274 EFI_RAW_SECTION
*RawSection
;
275 } EFI_FILE_SECTION_POINTER
;