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