]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Pi/PiFirmwareVolume.h
Removed tabs and fixed some minor coding style issues. Also fixed typo in EFI_PEI_ENT...
[mirror_edk2.git] / MdePkg / Include / Pi / PiFirmwareVolume.h
1 /** @file
2 The firmware volume 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: PiFirmwareVolume.h
14
15 @par Revision Reference:
16 Version 1.0.
17
18 **/
19
20 #ifndef __PI_FIRMWAREVOLUME_H__
21 #define __PI_FIRMWAREVOLUME_H__
22
23 //
24 // EFI_FV_FILE_ATTRIBUTES
25 //
26 typedef UINT32 EFI_FV_FILE_ATTRIBUTES;
27
28 //
29 // Value of EFI_FV_FILE_ATTRIBUTES.
30 //
31 #define EFI_FV_FILE_ATTRIB_ALIGNMENT 0x0000001F
32 #define EFI_FV_FILE_ATTRIB_FIXED 0x00000100
33 #define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200
34
35 typedef UINT32 EFI_FVB_ATTRIBUTES;
36
37 //
38 // Attributes bit definitions
39 //
40 #define EFI_FVB2_READ_DISABLED_CAP 0x00000001
41 #define EFI_FVB2_READ_ENABLED_CAP 0x00000002
42 #define EFI_FVB2_READ_STATUS 0x00000004
43 #define EFI_FVB2_WRITE_DISABLED_CAP 0x00000008
44 #define EFI_FVB2_WRITE_ENABLED_CAP 0x00000010
45 #define EFI_FVB2_WRITE_STATUS 0x00000020
46 #define EFI_FVB2_LOCK_CAP 0x00000040
47 #define EFI_FVB2_LOCK_STATUS 0x00000080
48 #define EFI_FVB2_STICKY_WRITE 0x00000200
49 #define EFI_FVB2_MEMORY_MAPPED 0x00000400
50 #define EFI_FVB2_ERASE_POLARITY 0x00000800
51 #define EFI_FVB2_READ_LOCK_CAP 0x00001000
52 #define EFI_FVB2_READ_LOCK_STATUS 0x00002000
53 #define EFI_FVB2_WRITE_LOCK_CAP 0x00004000
54 #define EFI_FVB2_WRITE_LOCK_STATUS 0x00008000
55 #define EFI_FVB2_ALIGNMENT 0x001F0000
56 #define EFI_FVB2_ALIGNMENT_1 0x00000000
57 #define EFI_FVB2_ALIGNMENT_2 0x00010000
58 #define EFI_FVB2_ALIGNMENT_4 0x00020000
59 #define EFI_FVB2_ALIGNMENT_8 0x00030000
60 #define EFI_FVB2_ALIGNMENT_16 0x00040000
61 #define EFI_FVB2_ALIGNMENT_32 0x00050000
62 #define EFI_FVB2_ALIGNMENT_64 0x00060000
63 #define EFI_FVB2_ALIGNMENT_128 0x00070000
64 #define EFI_FVB2_ALIGNMENT_256 0x00080000
65 #define EFI_FVB2_ALIGNMENT_512 0x00090000
66 #define EFI_FVB2_ALIGNMENT_1K 0x000A0000
67 #define EFI_FVB2_ALIGNMENT_2K 0x000B0000
68 #define EFI_FVB2_ALIGNMENT_4K 0x000C0000
69 #define EFI_FVB2_ALIGNMENT_8K 0x000D0000
70 #define EFI_FVB2_ALIGNMENT_16K 0x000E0000
71 #define EFI_FVB2_ALIGNMENT_32K 0x000F0000
72 #define EFI_FVB2_ALIGNMENT_64K 0x00100000
73 #define EFI_FVB2_ALIGNMENT_128K 0x00110000
74 #define EFI_FVB2_ALIGNMENT_256K 0x00120000
75 #define EFI_FVB2_ALIGNMNET_512K 0x00130000
76 #define EFI_FVB2_ALIGNMENT_1M 0x00140000
77 #define EFI_FVB2_ALIGNMENT_2M 0x00150000
78 #define EFI_FVB2_ALIGNMENT_4M 0x00160000
79 #define EFI_FVB2_ALIGNMENT_8M 0x00170000
80 #define EFI_FVB2_ALIGNMENT_16M 0x00180000
81 #define EFI_FVB2_ALIGNMENT_32M 0x00190000
82 #define EFI_FVB2_ALIGNMENT_64M 0x001A0000
83 #define EFI_FVB2_ALIGNMENT_128M 0x001B0000
84 #define EFI_FVB2_ALIGNMENT_256M 0x001C0000
85 #define EFI_FVB2_ALIGNMENT_512M 0x001D0000
86 #define EFI_FVB2_ALIGNMENT_1G 0x001E0000
87 #define EFI_FVB2_ALIGNMENT_2G 0x001F0000
88
89
90 typedef struct {
91 UINT32 NumBlocks;
92 UINT32 Length;
93 } EFI_FV_BLOCK_MAP_ENTRY;
94
95 //
96 // Describes the features and layout of the firmware volume.
97 //
98 typedef struct {
99 UINT8 ZeroVector[16];
100 EFI_GUID FileSystemGuid;
101 UINT64 FvLength;
102 UINT32 Signature;
103 EFI_FVB_ATTRIBUTES Attributes;
104 UINT16 HeaderLength;
105 UINT16 Checksum;
106 UINT16 ExtHeaderOffset;
107 UINT8 Reserved[1];
108 UINT8 Revision;
109 EFI_FV_BLOCK_MAP_ENTRY BlockMap[1];
110 } EFI_FIRMWARE_VOLUME_HEADER;
111
112
113
114 //
115 // Extension header pointed by ExtHeaderOffset of volume header.
116 //
117 typedef struct {
118 EFI_GUID FvName;
119 UINT32 ExtHeaderSize;
120 } EFI_FIRMWARE_VOLUME_EXT_HEADER;
121
122 typedef struct {
123 UINT16 ExtEntrySize;
124 UINT16 ExtEntryType;
125 } EFI_FIRMWARE_VOLUME_EXT_ENTRY;
126
127 #define EFI_FV_EXT_TYPE_OEM_TYPE 0x01
128 typedef struct {
129 EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;
130 UINT32 TypeMask;
131
132 //
133 // Array of GUIDs.
134 // Each GUID represents an OEM file type.
135 //
136 EFI_GUID Types[1];
137 } EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE;
138
139
140 #endif