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