]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Pi/PiFirmwareFile.h
Make some vfr buidable.
[mirror_edk2.git] / MdePkg / Include / Pi / PiFirmwareFile.h
CommitLineData
959ccb23 1/** @file\r
2 The firmware file related definitions in PI.\r
3\r
4 Copyright (c) 2006 - 2007, Intel Corporation \r
5 All rights reserved. This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. 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
959ccb23 13 @par Revision Reference:\r
14 Version 1.0.\r
15\r
16**/\r
17\r
18#ifndef __PI_FIRMWARE_FILE_H__\r
19#define __PI_FIRMWARE_FILE_H__\r
20\r
21//\r
22// Used to verify the integrity of the file.\r
23// \r
24typedef union {\r
25 struct {\r
26 UINT8 Header;\r
27 UINT8 File;\r
28 } Checksum;\r
29 UINT16 Checksum16;\r
30} EFI_FFS_INTEGRITY_CHECK;\r
31\r
32typedef UINT8 EFI_FV_FILETYPE;\r
33typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;\r
34typedef UINT8 EFI_FFS_FILE_STATE;\r
35\r
36// \r
37// FFS File Attributes.\r
38// \r
39#define FFS_ATTRIB_FIXED 0x04\r
40#define FFS_ATTRIB_DATA_ALIGNMENT 0x38\r
41#define FFS_ATTRIB_CHECKSUM 0x40\r
42\r
43// \r
44// FFS File State Bits.\r
45// \r
46#define EFI_FILE_HEADER_CONSTRUCTION 0x01\r
47#define EFI_FILE_HEADER_VALID 0x02\r
48#define EFI_FILE_DATA_VALID 0x04\r
49#define EFI_FILE_MARKED_FOR_UPDATE 0x08\r
50#define EFI_FILE_DELETED 0x10\r
51#define EFI_FILE_HEADER_INVALID 0x20\r
52\r
53\r
54//\r
55// Each file begins with the header that describe the \r
56// contents and state of the files.\r
57// \r
58typedef struct {\r
59 EFI_GUID Name;\r
60 EFI_FFS_INTEGRITY_CHECK IntegrityCheck;\r
61 EFI_FV_FILETYPE Type;\r
62 EFI_FFS_FILE_ATTRIBUTES Attributes;\r
63 UINT8 Size[3];\r
64 EFI_FFS_FILE_STATE State;\r
65} EFI_FFS_FILE_HEADER;\r
66\r
67\r
68typedef UINT8 EFI_SECTION_TYPE;\r
69\r
70//\r
71// Pseudo type. It is\r
72// used as a wild card when retrieving sections. The section\r
73// type EFI_SECTION_ALL matches all section types.\r
74//\r
75#define EFI_SECTION_ALL 0x00\r
76\r
77//\r
78// Encapsulation section Type values\r
79//\r
80#define EFI_SECTION_COMPRESSION 0x01\r
81\r
82#define EFI_SECTION_GUID_DEFINED 0x02\r
83\r
84//\r
85// Leaf section Type values\r
86//\r
87#define EFI_SECTION_PE32 0x10\r
88#define EFI_SECTION_PIC 0x11\r
89#define EFI_SECTION_TE 0x12\r
90#define EFI_SECTION_DXE_DEPEX 0x13\r
91#define EFI_SECTION_VERSION 0x14\r
92#define EFI_SECTION_USER_INTERFACE 0x15\r
93#define EFI_SECTION_COMPATIBILITY16 0x16\r
94#define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17\r
95#define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18\r
96#define EFI_SECTION_RAW 0x19\r
97#define EFI_SECTION_PEI_DEPEX 0x1B\r
98\r
99typedef struct {\r
100 UINT8 Size[3];\r
101 EFI_SECTION_TYPE Type;\r
102} EFI_COMMON_SECTION_HEADER;\r
103\r
104//\r
105// Leaf section type that contains an \r
106// IA-32 16-bit executable image.\r
107// \r
108typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;\r
109\r
110//\r
111// CompressionType of EFI_COMPRESSION_SECTION.\r
112// \r
113#define EFI_NOT_COMPRESSED 0x00\r
114#define EFI_STANDARD_COMPRESSION 0x01\r
115//\r
116// An encapsulation section type in which the \r
117// section data is compressed.\r
118// \r
119typedef struct {\r
00edb218
A
120 EFI_COMMON_SECTION_HEADER CommonHeader;\r
121 UINT32 UncompressedLength;\r
122 UINT8 CompressionType;\r
959ccb23 123} EFI_COMPRESSION_SECTION;\r
124\r
125//\r
126// Leaf section which could be used to determine the dispatch order of DXEs.\r
127// \r
128typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;\r
129\r
130//\r
131// Leaf section witch contains a PI FV.\r
132// \r
133typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;\r
134\r
135//\r
136// Leaf section which contains a single GUID.\r
137// \r
138typedef struct {\r
00edb218
A
139 EFI_COMMON_SECTION_HEADER CommonHeader;\r
140 EFI_GUID SubTypeGuid;\r
959ccb23 141} EFI_FREEFORM_SUBTYPE_GUID_SECTION;\r
142\r
143//\r
144// Attributes of EFI_GUID_DEFINED_SECTION\r
145// \r
146#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01\r
147#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02\r
148//\r
149// Leaf section which is encapsulation defined by specific GUID\r
150// \r
151typedef struct {\r
00edb218
A
152 EFI_COMMON_SECTION_HEADER CommonHeader;\r
153 EFI_GUID SectionDefinitionGuid;\r
154 UINT16 DataOffset;\r
155 UINT16 Attributes;\r
959ccb23 156} EFI_GUID_DEFINED_SECTION;\r
157\r
158//\r
159// Leaf section which contains PE32+ image.\r
160// \r
161typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;\r
162\r
163\r
164//\r
165// Leaf section which used to determine the dispatch order of PEIMs.\r
166// \r
167typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION;\r
168\r
169//\r
170// Leaf section which constains the position-independent-code image.\r
171// \r
172typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;\r
173\r
174//\r
175// Leaf section which contains an array of zero or more bytes.\r
176// \r
177typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;\r
178\r
179//\r
180// Leaf section which contains a unicode string that \r
181// is human readable file name.\r
182// \r
183typedef struct {\r
00edb218 184 EFI_COMMON_SECTION_HEADER CommonHeader;\r
959ccb23 185\r
186 //\r
187 // Array of unicode string.\r
188 // \r
00edb218 189 CHAR16 FileNameString[1];\r
959ccb23 190} EFI_USER_INTERFACE_SECTION;\r
191\r
192\r
193//\r
194// Leaf section which contains a numeric build number and\r
195// an optional unicode string that represent the file revision. \r
196// \r
197typedef struct {\r
00edb218
A
198 EFI_COMMON_SECTION_HEADER CommonHeader;\r
199 UINT16 BuildNumber;\r
200 CHAR16 VersionString[1];\r
959ccb23 201} EFI_VERSION_SECTION;\r
202\r
203#endif\r
204\r