]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Pi/PiFirmwareVolume.h
Add comments for enumeration, structure data members those are referred by UefiServic...
[mirror_edk2.git] / MdePkg / Include / Pi / PiFirmwareVolume.h
CommitLineData
959ccb23 1/** @file\r
2 The firmware volume related definitions in PI.\r
3\r
0047820e 4 Copyright (c) 2006 - 2008, Intel Corporation \r
959ccb23 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
0047820e 14 PI Version 1.0\r
959ccb23 15\r
16**/\r
17\r
18#ifndef __PI_FIRMWAREVOLUME_H__\r
19#define __PI_FIRMWAREVOLUME_H__\r
20\r
0b3cac32 21#include <ProcessorBind.h>\r
22\r
dc53faa3 23///\r
24/// EFI_FV_FILE_ATTRIBUTES\r
25///\r
00edb218 26typedef UINT32 EFI_FV_FILE_ATTRIBUTES;\r
959ccb23 27\r
28//\r
29// Value of EFI_FV_FILE_ATTRIBUTES.\r
30// \r
00edb218
A
31#define EFI_FV_FILE_ATTRIB_ALIGNMENT 0x0000001F\r
32#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100\r
33#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200\r
959ccb23 34\r
dc53faa3 35///\r
36/// type of EFI FVB attribute\r
37/// \r
4ba967e7 38typedef UINT32 EFI_FVB_ATTRIBUTES_2;\r
959ccb23 39\r
40// \r
41// Attributes bit definitions\r
42// \r
43#define EFI_FVB2_READ_DISABLED_CAP 0x00000001\r
44#define EFI_FVB2_READ_ENABLED_CAP 0x00000002\r
45#define EFI_FVB2_READ_STATUS 0x00000004\r
46#define EFI_FVB2_WRITE_DISABLED_CAP 0x00000008\r
47#define EFI_FVB2_WRITE_ENABLED_CAP 0x00000010\r
48#define EFI_FVB2_WRITE_STATUS 0x00000020\r
49#define EFI_FVB2_LOCK_CAP 0x00000040\r
50#define EFI_FVB2_LOCK_STATUS 0x00000080\r
51#define EFI_FVB2_STICKY_WRITE 0x00000200\r
52#define EFI_FVB2_MEMORY_MAPPED 0x00000400\r
53#define EFI_FVB2_ERASE_POLARITY 0x00000800\r
54#define EFI_FVB2_READ_LOCK_CAP 0x00001000\r
55#define EFI_FVB2_READ_LOCK_STATUS 0x00002000\r
56#define EFI_FVB2_WRITE_LOCK_CAP 0x00004000\r
57#define EFI_FVB2_WRITE_LOCK_STATUS 0x00008000\r
58#define EFI_FVB2_ALIGNMENT 0x001F0000\r
59#define EFI_FVB2_ALIGNMENT_1 0x00000000\r
60#define EFI_FVB2_ALIGNMENT_2 0x00010000\r
61#define EFI_FVB2_ALIGNMENT_4 0x00020000\r
62#define EFI_FVB2_ALIGNMENT_8 0x00030000\r
63#define EFI_FVB2_ALIGNMENT_16 0x00040000\r
64#define EFI_FVB2_ALIGNMENT_32 0x00050000\r
65#define EFI_FVB2_ALIGNMENT_64 0x00060000\r
66#define EFI_FVB2_ALIGNMENT_128 0x00070000\r
67#define EFI_FVB2_ALIGNMENT_256 0x00080000\r
68#define EFI_FVB2_ALIGNMENT_512 0x00090000\r
69#define EFI_FVB2_ALIGNMENT_1K 0x000A0000\r
70#define EFI_FVB2_ALIGNMENT_2K 0x000B0000\r
71#define EFI_FVB2_ALIGNMENT_4K 0x000C0000\r
72#define EFI_FVB2_ALIGNMENT_8K 0x000D0000\r
73#define EFI_FVB2_ALIGNMENT_16K 0x000E0000\r
74#define EFI_FVB2_ALIGNMENT_32K 0x000F0000\r
75#define EFI_FVB2_ALIGNMENT_64K 0x00100000\r
76#define EFI_FVB2_ALIGNMENT_128K 0x00110000\r
77#define EFI_FVB2_ALIGNMENT_256K 0x00120000\r
78#define EFI_FVB2_ALIGNMNET_512K 0x00130000\r
79#define EFI_FVB2_ALIGNMENT_1M 0x00140000\r
80#define EFI_FVB2_ALIGNMENT_2M 0x00150000\r
81#define EFI_FVB2_ALIGNMENT_4M 0x00160000\r
82#define EFI_FVB2_ALIGNMENT_8M 0x00170000\r
83#define EFI_FVB2_ALIGNMENT_16M 0x00180000\r
84#define EFI_FVB2_ALIGNMENT_32M 0x00190000\r
85#define EFI_FVB2_ALIGNMENT_64M 0x001A0000\r
86#define EFI_FVB2_ALIGNMENT_128M 0x001B0000\r
87#define EFI_FVB2_ALIGNMENT_256M 0x001C0000\r
88#define EFI_FVB2_ALIGNMENT_512M 0x001D0000\r
89#define EFI_FVB2_ALIGNMENT_1G 0x001E0000\r
90#define EFI_FVB2_ALIGNMENT_2G 0x001F0000\r
91\r
92\r
93typedef struct {\r
1bf79370
LG
94 ///\r
95 /// The number of sequential blocks which are of the same size.\r
96 ///\r
959ccb23 97 UINT32 NumBlocks;\r
1bf79370
LG
98 ///\r
99 /// The size of the blocks.\r
100 ///\r
959ccb23 101 UINT32 Length;\r
102} EFI_FV_BLOCK_MAP_ENTRY;\r
103\r
0b3cac32 104///\r
105/// Describes the features and layout of the firmware volume.\r
106///\r
959ccb23 107typedef struct {\r
1bf79370
LG
108 ///\r
109 /// The first 16 bytes are reserved to allow for the reset vector of \r
110 /// processors whose reset vector is at address 0.\r
111 ///\r
00edb218 112 UINT8 ZeroVector[16];\r
1bf79370
LG
113 ///\r
114 /// Declares the file system with which the firmware volume is formatted.\r
115 ///\r
00edb218 116 EFI_GUID FileSystemGuid;\r
1bf79370
LG
117 ///\r
118 /// Length in bytes of the complete firmware volume, including the header.\r
119 ///\r
00edb218 120 UINT64 FvLength;\r
1bf79370
LG
121 ///\r
122 /// Set to EFI_FVH_SIGNATURE\r
123 ///\r
00edb218 124 UINT32 Signature;\r
1bf79370
LG
125 ///\r
126 /// Declares capabilities and power-on defaults for the firmware volume.\r
127 ///\r
4ba967e7 128 EFI_FVB_ATTRIBUTES_2 Attributes;\r
1bf79370
LG
129 ///\r
130 /// Length in bytes of the complete firmware volume header.\r
131 ///\r
00edb218 132 UINT16 HeaderLength;\r
1bf79370
LG
133 ///\r
134 /// A 16-bit checksum of the firmware volume header. A valid header sums to zero.\r
135 ///\r
00edb218 136 UINT16 Checksum;\r
1bf79370
LG
137 ///\r
138 /// Offset, relative to the start of the header, of the extended header\r
139 /// (EFI_FIRMWARE_VOLUME_EXT_HEADER) or zero if there is no extended header.\r
140 ///\r
00edb218 141 UINT16 ExtHeaderOffset;\r
1bf79370
LG
142 ///\r
143 /// This field must always be set to zero.\r
144 ///\r
00edb218 145 UINT8 Reserved[1];\r
1bf79370
LG
146 ///\r
147 /// Set to 2. Future versions of this specification may define new header fields and will\r
148 /// increment the Revision field accordingly.\r
149 ///\r
00edb218 150 UINT8 Revision;\r
1bf79370
LG
151 ///\r
152 /// An array of run-length encoded FvBlockMapEntry structures. The array is\r
153 /// terminated with an entry of {0,0}.\r
154 ///\r
959ccb23 155 EFI_FV_BLOCK_MAP_ENTRY BlockMap[1];\r
156} EFI_FIRMWARE_VOLUME_HEADER;\r
157\r
8a017eaf 158#define EFI_FVH_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', 'H')\r
959ccb23 159\r
8a017eaf 160///\r
161/// Firmware Volume Header Revision definition\r
162///\r
eda67610 163#define EFI_FVH_REVISION 0x02\r
959ccb23 164\r
dc53faa3 165///\r
166/// Extension header pointed by ExtHeaderOffset of volume header.\r
167/// \r
959ccb23 168typedef struct {\r
1bf79370
LG
169 ///\r
170 /// Firmware volume name.\r
171 ///\r
959ccb23 172 EFI_GUID FvName;\r
1bf79370
LG
173 ///\r
174 /// Size of the rest of the extension header, including this structure.\r
175 ///\r
959ccb23 176 UINT32 ExtHeaderSize;\r
177} EFI_FIRMWARE_VOLUME_EXT_HEADER;\r
178\r
dc53faa3 179///\r
180/// Entry struture for describing FV extension header\r
181/// \r
959ccb23 182typedef struct {\r
1bf79370
LG
183 ///\r
184 /// Size of this header extension.\r
185 ///\r
959ccb23 186 UINT16 ExtEntrySize;\r
1bf79370
LG
187 ///\r
188 /// Type of the header.\r
189 ///\r
959ccb23 190 UINT16 ExtEntryType;\r
191} EFI_FIRMWARE_VOLUME_EXT_ENTRY;\r
192\r
193#define EFI_FV_EXT_TYPE_OEM_TYPE 0x01\r
dc53faa3 194///\r
195/// This extension header provides a mapping between a GUID and an OEM file type.\r
196/// \r
959ccb23 197typedef struct {\r
1bf79370
LG
198 ///\r
199 /// Standard extension entry, with the type EFI_FV_EXT_TYPE_OEM_TYPE.\r
200 ///\r
959ccb23 201 EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;\r
1bf79370
LG
202 ///\r
203 /// A bit mask, one bit for each file type between 0xC0 (bit 0) and 0xDF (bit 31). If a bit\r
204 /// is '1', then the GUID entry exists in Types. If a bit is '0' then no GUID entry exists in Types.\r
205 ///\r
959ccb23 206 UINT32 TypeMask;\r
1bf79370
LG
207 ///\r
208 /// An array of GUIDs, each GUID representing an OEM file type.\r
209 /// \r
959ccb23 210 EFI_GUID Types[1];\r
211} EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE;\r
212\r
213\r
214#endif\r