BaseTools: Clear build versions to sync with buildtools/BaseTools
[mirror_edk2.git] / BaseTools / Source / C / Include / Common / PiFirmwareVolume.h
CommitLineData
30fdf114
LG
1/** @file\r
2 The firmware volume related definitions in PI.\r
3\r
e8a47801 4 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
30fdf114
LG
5\r
6 This program and the accompanying materials are licensed and made available\r
7 under the terms and conditions of the BSD License which accompanies this\r
8 distribution. The full text of the license may be found at:\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14 File Name: PiFirmwareVolume.h\r
15\r
16 @par Revision Reference:\r
2bcc713e 17 Version 1.2C\r
30fdf114
LG
18\r
19**/\r
20\r
21#ifndef __PI_FIRMWAREVOLUME_H__\r
22#define __PI_FIRMWAREVOLUME_H__\r
23\r
24//\r
25// EFI_FV_FILE_ATTRIBUTES\r
26//\r
27typedef UINT32 EFI_FV_FILE_ATTRIBUTES;\r
28\r
29//\r
30// Value of EFI_FV_FILE_ATTRIBUTES.\r
31// \r
32#define EFI_FV_FILE_ATTRIB_ALIGNMENT 0x0000001F\r
33#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100\r
34#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200\r
35\r
2bcc713e 36typedef UINT32 EFI_FVB_ATTRIBUTES_2;\r
30fdf114
LG
37\r
38// \r
39// Attributes bit definitions\r
40// \r
41#define EFI_FVB2_READ_DISABLED_CAP 0x00000001\r
42#define EFI_FVB2_READ_ENABLED_CAP 0x00000002\r
43#define EFI_FVB2_READ_STATUS 0x00000004\r
44#define EFI_FVB2_WRITE_DISABLED_CAP 0x00000008\r
45#define EFI_FVB2_WRITE_ENABLED_CAP 0x00000010\r
46#define EFI_FVB2_WRITE_STATUS 0x00000020\r
47#define EFI_FVB2_LOCK_CAP 0x00000040\r
48#define EFI_FVB2_LOCK_STATUS 0x00000080\r
49#define EFI_FVB2_STICKY_WRITE 0x00000200\r
50#define EFI_FVB2_MEMORY_MAPPED 0x00000400\r
51#define EFI_FVB2_ERASE_POLARITY 0x00000800\r
52#define EFI_FVB2_READ_LOCK_CAP 0x00001000\r
53#define EFI_FVB2_READ_LOCK_STATUS 0x00002000\r
54#define EFI_FVB2_WRITE_LOCK_CAP 0x00004000\r
55#define EFI_FVB2_WRITE_LOCK_STATUS 0x00008000\r
56#define EFI_FVB2_ALIGNMENT 0x001F0000\r
e8a47801 57#define EFI_FVB2_WEAK_ALIGNMENT 0x80000000\r
30fdf114
LG
58#define EFI_FVB2_ALIGNMENT_1 0x00000000\r
59#define EFI_FVB2_ALIGNMENT_2 0x00010000\r
60#define EFI_FVB2_ALIGNMENT_4 0x00020000\r
61#define EFI_FVB2_ALIGNMENT_8 0x00030000\r
62#define EFI_FVB2_ALIGNMENT_16 0x00040000\r
63#define EFI_FVB2_ALIGNMENT_32 0x00050000\r
64#define EFI_FVB2_ALIGNMENT_64 0x00060000\r
65#define EFI_FVB2_ALIGNMENT_128 0x00070000\r
66#define EFI_FVB2_ALIGNMENT_256 0x00080000\r
67#define EFI_FVB2_ALIGNMENT_512 0x00090000\r
68#define EFI_FVB2_ALIGNMENT_1K 0x000A0000\r
69#define EFI_FVB2_ALIGNMENT_2K 0x000B0000\r
70#define EFI_FVB2_ALIGNMENT_4K 0x000C0000\r
71#define EFI_FVB2_ALIGNMENT_8K 0x000D0000\r
72#define EFI_FVB2_ALIGNMENT_16K 0x000E0000\r
73#define EFI_FVB2_ALIGNMENT_32K 0x000F0000\r
74#define EFI_FVB2_ALIGNMENT_64K 0x00100000\r
75#define EFI_FVB2_ALIGNMENT_128K 0x00110000\r
76#define EFI_FVB2_ALIGNMENT_256K 0x00120000\r
2bcc713e 77#define EFI_FVB2_ALIGNMENT_512K 0x00130000\r
30fdf114
LG
78#define EFI_FVB2_ALIGNMENT_1M 0x00140000\r
79#define EFI_FVB2_ALIGNMENT_2M 0x00150000\r
80#define EFI_FVB2_ALIGNMENT_4M 0x00160000\r
81#define EFI_FVB2_ALIGNMENT_8M 0x00170000\r
82#define EFI_FVB2_ALIGNMENT_16M 0x00180000\r
83#define EFI_FVB2_ALIGNMENT_32M 0x00190000\r
84#define EFI_FVB2_ALIGNMENT_64M 0x001A0000\r
85#define EFI_FVB2_ALIGNMENT_128M 0x001B0000\r
86#define EFI_FVB2_ALIGNMENT_256M 0x001C0000\r
87#define EFI_FVB2_ALIGNMENT_512M 0x001D0000\r
88#define EFI_FVB2_ALIGNMENT_1G 0x001E0000\r
89#define EFI_FVB2_ALIGNMENT_2G 0x001F0000\r
90\r
91\r
92typedef struct {\r
93 UINT32 NumBlocks;\r
94 UINT32 Length;\r
95} EFI_FV_BLOCK_MAP_ENTRY;\r
96\r
97//\r
98// Describes the features and layout of the firmware volume.\r
99//\r
100typedef struct {\r
101 UINT8 ZeroVector[16];\r
102 EFI_GUID FileSystemGuid;\r
103 UINT64 FvLength;\r
104 UINT32 Signature;\r
2bcc713e 105 EFI_FVB_ATTRIBUTES_2 Attributes;\r
30fdf114
LG
106 UINT16 HeaderLength;\r
107 UINT16 Checksum;\r
108 UINT16 ExtHeaderOffset;\r
109 UINT8 Reserved[1];\r
110 UINT8 Revision;\r
111 EFI_FV_BLOCK_MAP_ENTRY BlockMap[1];\r
112} EFI_FIRMWARE_VOLUME_HEADER;\r
113\r
2bc3256c 114#define EFI_FVH_SIGNATURE SIGNATURE_32 ('_', 'F', 'V', 'H')\r
30fdf114
LG
115\r
116///\r
117/// Firmware Volume Header Revision definition\r
118///\r
119#define EFI_FVH_REVISION 0x02\r
120\r
121//\r
122// Extension header pointed by ExtHeaderOffset of volume header.\r
123// \r
124typedef struct {\r
125 EFI_GUID FvName;\r
126 UINT32 ExtHeaderSize;\r
127} EFI_FIRMWARE_VOLUME_EXT_HEADER;\r
128\r
129typedef struct {\r
130 UINT16 ExtEntrySize;\r
131 UINT16 ExtEntryType;\r
132} EFI_FIRMWARE_VOLUME_EXT_ENTRY;\r
133\r
134#define EFI_FV_EXT_TYPE_OEM_TYPE 0x01\r
135typedef struct {\r
136 EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;\r
137 UINT32 TypeMask;\r
138\r
139 //\r
140 // Array of GUIDs. \r
141 // Each GUID represents an OEM file type.\r
142 // \r
2bcc713e
LG
143 // EFI_GUID Types[1];\r
144 //\r
30fdf114
LG
145} EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE;\r
146\r
2bcc713e
LG
147#define EFI_FV_EXT_TYPE_GUID_TYPE 0x0002\r
148typedef struct {\r
149 EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;\r
150 EFI_GUID FormatType;\r
151\r
152 //\r
153 // An arry of bytes of length Length.\r
154 //\r
155 // UINT8 Data[1];\r
156 //\r
157} EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE;\r
30fdf114
LG
158\r
159#endif\r