1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
FirmwareVolume2.h
Abstract:
PI 1.0 spec definition.
--*/
#ifndef __FIRMWARE_VOLUME2_H__
#define __FIRMWARE_VOLUME2_H__
#include "EfiImageFormat.h"
#include "EfiFirmwareVolume.h"
//
// Firmware Volume Protocol GUID definition
//
#define EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID \
{ 0x220e73b6, 0x6bdb, 0x4413, {0x84, 0x5, 0xb9, 0x74, 0xb1, 0x8, 0x61, 0x9a} }
EFI_FORWARD_DECLARATION (EFI_FIRMWARE_VOLUME2_PROTOCOL);
//
// ************************************************************
// EFI_FV2_ATTRIBUTES bit definitions
// ************************************************************
//
#define EFI_FV2_READ_DISABLE_CAP 0x0000000000000001
#define EFI_FV2_READ_ENABLE_CAP 0x0000000000000002
#define EFI_FV2_READ_STATUS 0x0000000000000004
#define EFI_FV2_WRITE_DISABLE_CAP 0x0000000000000008
#define EFI_FV2_WRITE_ENABLE_CAP 0x0000000000000010
#define EFI_FV2_WRITE_STATUS 0x0000000000000020
#define EFI_FV2_LOCK_CAP 0x0000000000000040
#define EFI_FV2_LOCK_STATUS 0x0000000000000080
#define EFI_FV2_WRITE_POLICY_RELIABLE 0x0000000000000100
#define EFI_FV2_READ_LOCK_CAP 0x0000000000001000
#define EFI_FV2_READ_LOCK_STATUS 0x0000000000002000
#define EFI_FV2_WRITE_LOCK_CAP 0x0000000000004000
#define EFI_FV2_WRITE_LOCK_STATUS 0x0000000000008000
#define EFI_FV2_ALIGNMENT 0x00000000001F0000
#define EFI_FV2_ALIGNMENT_1 0x0000000000000000
#define EFI_FV2_ALIGNMENT_2 0x0000000000010000
#define EFI_FV2_ALIGNMENT_4 0x0000000000020000
#define EFI_FV2_ALIGNMENT_8 0x0000000000030000
#define EFI_FV2_ALIGNMENT_16 0x0000000000040000
#define EFI_FV2_ALIGNMENT_32 0x0000000000050000
#define EFI_FV2_ALIGNMENT_64 0x0000000000060000
#define EFI_FV2_ALIGNMENT_128 0x0000000000070000
#define EFI_FV2_ALIGNMENT_256 0x0000000000080000
#define EFI_FV2_ALIGNMENT_512 0x0000000000090000
#define EFI_FV2_ALIGNMENT_1K 0x00000000000A0000
#define EFI_FV2_ALIGNMENT_2K 0x00000000000B0000
#define EFI_FV2_ALIGNMENT_4K 0x00000000000C0000
#define EFI_FV2_ALIGNMENT_8K 0x00000000000D0000
#define EFI_FV2_ALIGNMENT_16K 0x00000000000E0000
#define EFI_FV2_ALIGNMENT_32K 0x00000000000F0000
#define EFI_FV2_ALIGNMENT_64K 0x0000000000100000
#define EFI_FV2_ALIGNMENT_128K 0x0000000000110000
#define EFI_FV2_ALIGNMENT_256K 0x0000000000120000
#define EFI_FV2_ALIGNMENT_512K 0x0000000000130000
#define EFI_FV2_ALIGNMENT_1M 0x0000000000140000
#define EFI_FV2_ALIGNMENT_2M 0x0000000000150000
#define EFI_FV2_ALIGNMENT_4M 0x0000000000160000
#define EFI_FV2_ALIGNMENT_8M 0x0000000000170000
#define EFI_FV2_ALIGNMENT_16M 0x0000000000180000
#define EFI_FV2_ALIGNMENT_32M 0x0000000000190000
#define EFI_FV2_ALIGNMENT_64M 0x00000000001A0000
#define EFI_FV2_ALIGNMENT_128M 0x00000000001B0000
#define EFI_FV2_ALIGNMENT_256M 0x00000000001C0000
#define EFI_FV2_ALIGNMENT_512M 0x00000000001D0000
#define EFI_FV2_ALIGNMENT_1G 0x00000000001E0000
#define EFI_FV2_ALIGNMENT_2G 0x00000000001F0000
#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100
#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200
//
// Protocol API definitions
//
typedef
EFI_STATUS
(EFIAPI *EFI_FV_GET_ATTRIBUTES) (
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
OUT EFI_FV_ATTRIBUTES *Attributes
);
typedef
EFI_STATUS
(EFIAPI *EFI_FV_SET_ATTRIBUTES) (
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
IN OUT EFI_FV_ATTRIBUTES *Attributes
);
typedef
EFI_STATUS
(EFIAPI *EFI_FV_READ_FILE) (
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
IN CONST EFI_GUID *NameGuid,
IN OUT VOID **Buffer,
IN OUT UINTN *BufferSize,
OUT EFI_FV_FILETYPE *FoundType,
OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,
OUT UINT32 *AuthenticationStatus
);
typedef
EFI_STATUS
(EFIAPI *EFI_FV_READ_SECTION) (
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
IN CONST EFI_GUID *NameGuid,
IN EFI_SECTION_TYPE SectionType,
IN UINTN SectionInstance,
IN OUT VOID **Buffer,
IN OUT UINTN *BufferSize,
OUT UINT32 *AuthenticationStatus
);
typedef
EFI_STATUS
(EFIAPI *EFI_FV_WRITE_FILE) (
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
IN UINT32 NumberOfFiles,
IN EFI_FV_WRITE_POLICY WritePolicy,
IN EFI_FV_WRITE_FILE_DATA *FileData
);
typedef
EFI_STATUS
(EFIAPI *EFI_FV_GET_NEXT_FILE) (
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
IN OUT VOID *Key,
IN OUT EFI_FV_FILETYPE *FileType,
OUT EFI_GUID *NameGuid,
OUT EFI_FV_FILE_ATTRIBUTES *Attributes,
OUT UINTN *Size
);
typedef
EFI_STATUS
(EFIAPI *EFI_FV_GET_INFO) (
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
IN CONST EFI_GUID *InformationType,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
);
typedef
EFI_STATUS
(EFIAPI *EFI_FV_SET_INFO) (
IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
IN CONST EFI_GUID *InformationType,
IN UINTN BufferSize,
IN CONST VOID *Buffer
);
struct _EFI_FIRMWARE_VOLUME2_PROTOCOL {
EFI_FV_GET_ATTRIBUTES GetVolumeAttributes;
EFI_FV_SET_ATTRIBUTES SetVolumeAttributes;
EFI_FV_READ_FILE ReadFile;
EFI_FV_READ_SECTION ReadSection;
EFI_FV_WRITE_FILE WriteFile;
EFI_FV_GET_NEXT_FILE GetNextFile;
UINT32 KeySize;
EFI_HANDLE ParentHandle;
EFI_FV_GET_INFO GetInfo;
EFI_FV_SET_INFO SetInfo;
};
extern EFI_GUID gEfiFirmwareVolume2ProtocolGuid;
#endif
|