]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Framework/Include/EfiFirmwareVolumeHeader.h
EFI_FVB2_ALIGNMNET_512K should be EFI_FVB2_ALIGNMENT_512K.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Framework / Include / EfiFirmwareVolumeHeader.h
CommitLineData
3eb9473e 1/*++\r
2\r
5d9f5dc1 3Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
f57387d5 4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 EfiFirmwareVolumeHeader.h\r
15\r
16Abstract:\r
17\r
18 Defines data structure that is the volume header found at the beginning of\r
19 all firmware volumes that are either memory mapped, or have an\r
20 associated FirmwareVolumeBlock protocol.\r
21\r
22--*/\r
23\r
24#ifndef _EFI_FIRMWARE_VOLUME_HEADER_H_\r
25#define _EFI_FIRMWARE_VOLUME_HEADER_H_\r
26\r
27\r
28//\r
29// Firmware Volume Block Attributes bit definitions\r
30// They are the shared between Framework and PI1.0.\r
31//\r
32typedef UINT32 EFI_FVB_ATTRIBUTES;\r
33\r
34#define EFI_FVB_READ_DISABLED_CAP 0x00000001\r
35#define EFI_FVB_READ_ENABLED_CAP 0x00000002\r
36#define EFI_FVB_READ_STATUS 0x00000004\r
37\r
38#define EFI_FVB_WRITE_DISABLED_CAP 0x00000008\r
39#define EFI_FVB_WRITE_ENABLED_CAP 0x00000010\r
40#define EFI_FVB_WRITE_STATUS 0x00000020\r
41\r
42#define EFI_FVB_LOCK_CAP 0x00000040\r
43#define EFI_FVB_LOCK_STATUS 0x00000080\r
44\r
45#define EFI_FVB_STICKY_WRITE 0x00000200\r
46#define EFI_FVB_MEMORY_MAPPED 0x00000400\r
47#define EFI_FVB_ERASE_POLARITY 0x00000800\r
48\r
49\r
50#if (PI_SPECIFICATION_VERSION < 0x00010000)\r
51\r
52#define EFI_FVB_ALIGNMENT_CAP 0x00008000\r
53#define EFI_FVB_ALIGNMENT_2 0x00010000\r
54#define EFI_FVB_ALIGNMENT_4 0x00020000\r
55#define EFI_FVB_ALIGNMENT_8 0x00040000\r
56#define EFI_FVB_ALIGNMENT_16 0x00080000\r
57#define EFI_FVB_ALIGNMENT_32 0x00100000\r
58#define EFI_FVB_ALIGNMENT_64 0x00200000\r
59#define EFI_FVB_ALIGNMENT_128 0x00400000\r
60#define EFI_FVB_ALIGNMENT_256 0x00800000\r
61#define EFI_FVB_ALIGNMENT_512 0x01000000\r
62#define EFI_FVB_ALIGNMENT_1K 0x02000000\r
63#define EFI_FVB_ALIGNMENT_2K 0x04000000\r
64#define EFI_FVB_ALIGNMENT_4K 0x08000000\r
65#define EFI_FVB_ALIGNMENT_8K 0x10000000\r
66#define EFI_FVB_ALIGNMENT_16K 0x20000000\r
67#define EFI_FVB_ALIGNMENT_32K 0x40000000\r
68#define EFI_FVB_ALIGNMENT_64K 0x80000000\r
69\r
70#define EFI_FVB_CAPABILITIES (EFI_FVB_READ_DISABLED_CAP | \\r
71 EFI_FVB_READ_ENABLED_CAP | \\r
72 EFI_FVB_WRITE_DISABLED_CAP | \\r
73 EFI_FVB_WRITE_ENABLED_CAP | \\r
74 EFI_FVB_LOCK_CAP \\r
75 )\r
76\r
77#define EFI_FVB_STATUS (EFI_FVB_READ_STATUS | EFI_FVB_WRITE_STATUS | EFI_FVB_LOCK_STATUS)\r
78\r
79\r
80\r
81#else\r
82\r
83#define EFI_FVB2_READ_LOCK_CAP 0x00001000\r
84#define EFI_FVB2_READ_LOCK_STATUS 0x00002000\r
85\r
86#define EFI_FVB2_WRITE_LOCK_CAP 0x00004000\r
87#define EFI_FVB2_WRITE_LOCK_STATUS 0x00008000\r
88\r
89#define EFI_FVB2_ALIGNMENT 0x001F0000\r
90#define EFI_FVB2_ALIGNMENT_1 0x00000000\r
91#define EFI_FVB2_ALIGNMENT_2 0x00010000\r
92#define EFI_FVB2_ALIGNMENT_4 0x00020000\r
93#define EFI_FVB2_ALIGNMENT_8 0x00030000\r
94#define EFI_FVB2_ALIGNMENT_16 0x00040000\r
95#define EFI_FVB2_ALIGNMENT_32 0x00050000\r
96#define EFI_FVB2_ALIGNMENT_64 0x00060000\r
97#define EFI_FVB2_ALIGNMENT_128 0x00070000\r
98#define EFI_FVB2_ALIGNMENT_256 0x00080000\r
99#define EFI_FVB2_ALIGNMENT_512 0x00090000\r
100#define EFI_FVB2_ALIGNMENT_1K 0x000A0000\r
101#define EFI_FVB2_ALIGNMENT_2K 0x000B0000\r
102#define EFI_FVB2_ALIGNMENT_4K 0x000C0000\r
103#define EFI_FVB2_ALIGNMENT_8K 0x000D0000\r
104#define EFI_FVB2_ALIGNMENT_16K 0x000E0000\r
105#define EFI_FVB2_ALIGNMENT_32K 0x000F0000\r
106#define EFI_FVB2_ALIGNMENT_64K 0x00100000\r
107#define EFI_FVB2_ALIGNMENT_128K 0x00110000\r
108#define EFI_FVB2_ALIGNMENT_256K 0x00120000\r
5d9f5dc1 109#define EFI_FVB2_ALIGNMENT_512K 0x00130000\r
3eb9473e 110#define EFI_FVB2_ALIGNMENT_1M 0x00140000\r
111#define EFI_FVB2_ALIGNMENT_2M 0x00150000\r
112#define EFI_FVB2_ALIGNMENT_4M 0x00160000\r
113#define EFI_FVB2_ALIGNMENT_8M 0x00170000\r
114#define EFI_FVB2_ALIGNMENT_16M 0x00180000\r
115#define EFI_FVB2_ALIGNMENT_32M 0x00190000\r
116#define EFI_FVB2_ALIGNMENT_64M 0x001A0000\r
117#define EFI_FVB2_ALIGNMENT_128M 0x001B0000\r
118#define EFI_FVB2_ALIGNMENT_256M 0x001C0000\r
119#define EFI_FVB2_ALIGNMENT_512M 0x001D0000\r
120#define EFI_FVB2_ALIGNMENT_1G 0x001E0000\r
121#define EFI_FVB2_ALIGNMENT_2G 0x001F0000\r
122\r
123#define EFI_FVB_CAPABILITIES (EFI_FVB_READ_DISABLED_CAP | \\r
124 EFI_FVB_READ_ENABLED_CAP | \\r
125 EFI_FVB_WRITE_DISABLED_CAP | \\r
126 EFI_FVB_WRITE_ENABLED_CAP | \\r
127 EFI_FVB_LOCK_CAP | \\r
128 EFI_FVB2_READ_LOCK_CAP | \\r
129 EFI_FVB2_WRITE_LOCK_CAP )\r
130\r
131#define EFI_FVB_STATUS (EFI_FVB_READ_STATUS | EFI_FVB_WRITE_STATUS | \\r
132 EFI_FVB_LOCK_STATUS | EFI_FVB2_READ_LOCK_STATUS | \\r
133 EFI_FVB2_WRITE_LOCK_STATUS )\r
134\r
135\r
136\r
137//\r
138// Extended Header Header. Located via ExtHeaderOffset.\r
139// The extended headers follow each other in memory and are \r
140// terminated by ExtHeaderType EFI_FV_EXT_TYPE_END\r
141//\r
142#define EFI_FV_EXT_TYPE_END 0x00\r
143typedef struct {\r
144 UINT16 ExtEntrySize;\r
145 UINT16 ExtEntryType;\r
146} EFI_FIRMWARE_VOLUME_EXT_ENTRY;\r
147\r
148//\r
149// GUID that maps OEM file types to GUIDs\r
150//\r
151#define EFI_FV_EXT_TYPE_OEM_TYPE 0x01\r
152typedef struct {\r
153 EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;\r
154 UINT32 TypeMask;\r
155 EFI_GUID Types[1];\r
156} EFI_FIRMWARE_VOLUME_EXT_HEADER_OEM_TYPE;\r
157\r
158//\r
159// Unique name of the FV\r
160//\r
161typedef struct {\r
162 EFI_GUID FvName;\r
163 UINT32 ExtHeaderSize;\r
164} EFI_FIRMWARE_VOLUME_EXT_HEADER;\r
165\r
166\r
167#endif\r
168\r
169\r
170//\r
171// Firmware Volume Header Revision definition\r
172//\r
173#define EFI_FVH_REVISION 0x01\r
174//\r
175// PI1.0 define Firmware Volume Header Revision to 2\r
176//\r
177#define EFI_FVH_PI_REVISION 0x02\r
178\r
179//\r
180// Firmware Volume Header Signature definition\r
181//\r
182#define EFI_FVH_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', 'H')\r
183\r
184//\r
185// Firmware Volume Header Block Map Entry definition\r
186//\r
187typedef struct {\r
188 UINT32 NumBlocks;\r
189 UINT32 BlockLength;\r
190} EFI_FV_BLOCK_MAP_ENTRY;\r
191\r
192//\r
193// Firmware Volume Header definition\r
194//\r
195typedef struct {\r
196 UINT8 ZeroVector[16];\r
197 EFI_GUID FileSystemGuid;\r
198 UINT64 FvLength;\r
199 UINT32 Signature;\r
200 EFI_FVB_ATTRIBUTES Attributes;\r
201 UINT16 HeaderLength;\r
202 UINT16 Checksum;\r
203#if (PI_SPECIFICATION_VERSION < 0x00010000)\r
204 UINT8 Reserved[3];\r
205#else\r
206 UINT16 ExtHeaderOffset;\r
207 UINT8 Reserved[1];\r
208#endif\r
209 UINT8 Revision;\r
210 EFI_FV_BLOCK_MAP_ENTRY FvBlockMap[1];\r
211} EFI_FIRMWARE_VOLUME_HEADER;\r
212\r
213#endif\r