]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Pi/PiFirmwareFile.h
Fix issue broken doxygen parsing. The issue is that when declaring a function pointer...
[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
0b3cac32 18\r
959ccb23 19#ifndef __PI_FIRMWARE_FILE_H__\r
20#define __PI_FIRMWARE_FILE_H__\r
21\r
0b3cac32 22#include <ProcessorBind.h>\r
23\r
62d1e08b 24#pragma pack(1)\r
959ccb23 25//\r
26// Used to verify the integrity of the file.\r
27// \r
28typedef union {\r
29 struct {\r
30 UINT8 Header;\r
31 UINT8 File;\r
32 } Checksum;\r
33 UINT16 Checksum16;\r
34} EFI_FFS_INTEGRITY_CHECK;\r
35\r
36typedef UINT8 EFI_FV_FILETYPE;\r
37typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;\r
38typedef UINT8 EFI_FFS_FILE_STATE;\r
39\r
8fb30482 40//\r
41// File Types Definitions\r
42// \r
d44d2087 43#define EFI_FV_FILETYPE_ALL 0x00\r
8fb30482 44#define EFI_FV_FILETYPE_RAW 0x01\r
45#define EFI_FV_FILETYPE_FREEFORM 0x02\r
46#define EFI_FV_FILETYPE_SECURITY_CORE 0x03\r
47#define EFI_FV_FILETYPE_PEI_CORE 0x04\r
48#define EFI_FV_FILETYPE_DXE_CORE 0x05\r
49#define EFI_FV_FILETYPE_PEIM 0x06\r
50#define EFI_FV_FILETYPE_DRIVER 0x07\r
51#define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08\r
52#define EFI_FV_FILETYPE_APPLICATION 0x09\r
53#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B\r
54#define EFI_FV_FILETYPE_OEM_MIN 0xc0\r
55#define EFI_FV_FILETYPE_OEM_MAX 0xdf\r
56#define EFI_FV_FILETYPE_DEBUG_MIN 0xe0\r
57#define EFI_FV_FILETYPE_DEBUG_MAX 0xef\r
58#define EFI_FV_FILETYPE_FFS_MIN 0xf0\r
59#define EFI_FV_FILETYPE_FFS_MAX 0xff\r
60#define EFI_FV_FILETYPE_FFS_PAD 0xf0\r
959ccb23 61// \r
62// FFS File Attributes.\r
63// \r
64#define FFS_ATTRIB_FIXED 0x04\r
65#define FFS_ATTRIB_DATA_ALIGNMENT 0x38\r
66#define FFS_ATTRIB_CHECKSUM 0x40\r
67\r
68// \r
69// FFS File State Bits.\r
70// \r
71#define EFI_FILE_HEADER_CONSTRUCTION 0x01\r
72#define EFI_FILE_HEADER_VALID 0x02\r
73#define EFI_FILE_DATA_VALID 0x04\r
74#define EFI_FILE_MARKED_FOR_UPDATE 0x08\r
75#define EFI_FILE_DELETED 0x10\r
76#define EFI_FILE_HEADER_INVALID 0x20\r
77\r
78\r
79//\r
80// Each file begins with the header that describe the \r
81// contents and state of the files.\r
82// \r
83typedef struct {\r
84 EFI_GUID Name;\r
85 EFI_FFS_INTEGRITY_CHECK IntegrityCheck;\r
86 EFI_FV_FILETYPE Type;\r
87 EFI_FFS_FILE_ATTRIBUTES Attributes;\r
88 UINT8 Size[3];\r
89 EFI_FFS_FILE_STATE State;\r
90} EFI_FFS_FILE_HEADER;\r
91\r
92\r
93typedef UINT8 EFI_SECTION_TYPE;\r
94\r
95//\r
96// Pseudo type. It is\r
97// used as a wild card when retrieving sections. The section\r
98// type EFI_SECTION_ALL matches all section types.\r
99//\r
100#define EFI_SECTION_ALL 0x00\r
101\r
102//\r
103// Encapsulation section Type values\r
104//\r
105#define EFI_SECTION_COMPRESSION 0x01\r
106\r
107#define EFI_SECTION_GUID_DEFINED 0x02\r
108\r
109//\r
110// Leaf section Type values\r
111//\r
112#define EFI_SECTION_PE32 0x10\r
113#define EFI_SECTION_PIC 0x11\r
114#define EFI_SECTION_TE 0x12\r
115#define EFI_SECTION_DXE_DEPEX 0x13\r
116#define EFI_SECTION_VERSION 0x14\r
117#define EFI_SECTION_USER_INTERFACE 0x15\r
118#define EFI_SECTION_COMPATIBILITY16 0x16\r
119#define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17\r
120#define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18\r
121#define EFI_SECTION_RAW 0x19\r
122#define EFI_SECTION_PEI_DEPEX 0x1B\r
123\r
124typedef struct {\r
125 UINT8 Size[3];\r
126 EFI_SECTION_TYPE Type;\r
127} EFI_COMMON_SECTION_HEADER;\r
128\r
129//\r
130// Leaf section type that contains an \r
131// IA-32 16-bit executable image.\r
132// \r
133typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;\r
134\r
135//\r
136// CompressionType of EFI_COMPRESSION_SECTION.\r
137// \r
138#define EFI_NOT_COMPRESSED 0x00\r
139#define EFI_STANDARD_COMPRESSION 0x01\r
140//\r
141// An encapsulation section type in which the \r
142// section data is compressed.\r
143// \r
144typedef struct {\r
00edb218
A
145 EFI_COMMON_SECTION_HEADER CommonHeader;\r
146 UINT32 UncompressedLength;\r
147 UINT8 CompressionType;\r
959ccb23 148} EFI_COMPRESSION_SECTION;\r
149\r
150//\r
151// Leaf section which could be used to determine the dispatch order of DXEs.\r
152// \r
153typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;\r
154\r
155//\r
156// Leaf section witch contains a PI FV.\r
157// \r
158typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;\r
159\r
160//\r
161// Leaf section which contains a single GUID.\r
162// \r
163typedef struct {\r
00edb218
A
164 EFI_COMMON_SECTION_HEADER CommonHeader;\r
165 EFI_GUID SubTypeGuid;\r
959ccb23 166} EFI_FREEFORM_SUBTYPE_GUID_SECTION;\r
167\r
168//\r
169// Attributes of EFI_GUID_DEFINED_SECTION\r
170// \r
171#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01\r
172#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02\r
173//\r
174// Leaf section which is encapsulation defined by specific GUID\r
175// \r
176typedef struct {\r
00edb218
A
177 EFI_COMMON_SECTION_HEADER CommonHeader;\r
178 EFI_GUID SectionDefinitionGuid;\r
179 UINT16 DataOffset;\r
180 UINT16 Attributes;\r
959ccb23 181} EFI_GUID_DEFINED_SECTION;\r
182\r
183//\r
184// Leaf section which contains PE32+ image.\r
185// \r
186typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;\r
187\r
188\r
189//\r
190// Leaf section which used to determine the dispatch order of PEIMs.\r
191// \r
192typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION;\r
193\r
194//\r
195// Leaf section which constains the position-independent-code image.\r
196// \r
197typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;\r
198\r
199//\r
200// Leaf section which contains an array of zero or more bytes.\r
201// \r
202typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;\r
203\r
204//\r
205// Leaf section which contains a unicode string that \r
206// is human readable file name.\r
207// \r
208typedef struct {\r
00edb218 209 EFI_COMMON_SECTION_HEADER CommonHeader;\r
959ccb23 210\r
211 //\r
212 // Array of unicode string.\r
213 // \r
00edb218 214 CHAR16 FileNameString[1];\r
959ccb23 215} EFI_USER_INTERFACE_SECTION;\r
216\r
217\r
218//\r
219// Leaf section which contains a numeric build number and\r
220// an optional unicode string that represent the file revision. \r
221// \r
222typedef struct {\r
00edb218
A
223 EFI_COMMON_SECTION_HEADER CommonHeader;\r
224 UINT16 BuildNumber;\r
225 CHAR16 VersionString[1];\r
959ccb23 226} EFI_VERSION_SECTION;\r
227\r
ddd3f471 228\r
229#define SECTION_SIZE(SectionHeaderPtr) \\r
230 ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))\r
231\r
62d1e08b 232#pragma pack()\r
ddd3f471 233\r
959ccb23 234#endif\r
235\r