]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
f57387d5 HT |
3 | Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
3eb9473e | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | FirmwareVolumeBlock.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Firmware Volume Block protocol as defined in the Tiano Firmware Volume\r | |
19 | specification.\r | |
20 | \r | |
21 | Low level firmware device access routines to abstract firmware device\r | |
22 | hardware.\r | |
23 | \r | |
24 | --*/\r | |
25 | \r | |
26 | #ifndef _FW_VOL_BLOCK_H_\r | |
27 | #define _FW_VOL_BLOCK_H_\r | |
28 | \r | |
29 | #include "EfiFirmwareVolumeHeader.h"\r | |
30 | \r | |
4c913fe6 | 31 | //\r |
32 | // The following GUID value has been changed to EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL_GUID in\r | |
33 | // PI 1.2 spec on purpose. This will force all platforms built with EdkCompatibilityPkg\r | |
34 | // produce FVB 2 protocol.\r | |
35 | //\r | |
3eb9473e | 36 | #define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \\r |
37 | { \\r | |
4c913fe6 | 38 | 0x8f644fa9, 0xe850, 0x4db1, {0x9c, 0xe2, 0xb, 0x44, 0x69, 0x8e, 0x8d, 0xa4 } \\r |
3eb9473e | 39 | }\r |
40 | \r | |
41 | EFI_FORWARD_DECLARATION (EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL);\r | |
42 | \r | |
43 | typedef\r | |
44 | EFI_STATUS\r | |
45 | (EFIAPI *EFI_FVB_GET_ATTRIBUTES) (\r | |
46 | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r | |
47 | OUT EFI_FVB_ATTRIBUTES * Attributes\r | |
48 | )\r | |
49 | /*++\r | |
50 | \r | |
51 | Routine Description:\r | |
52 | Retrieves Volume attributes. No polarity translations are done.\r | |
53 | \r | |
54 | Arguments:\r | |
55 | This - Calling context\r | |
56 | Attributes - output buffer which contains attributes\r | |
57 | \r | |
58 | Returns:\r | |
59 | EFI_INVALID_PARAMETER\r | |
60 | EFI_SUCCESS\r | |
61 | \r | |
62 | --*/\r | |
63 | ;\r | |
64 | \r | |
65 | typedef\r | |
66 | EFI_STATUS\r | |
67 | (EFIAPI *EFI_FVB_SET_ATTRIBUTES) (\r | |
68 | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r | |
69 | IN OUT EFI_FVB_ATTRIBUTES * Attributes\r | |
70 | )\r | |
71 | /*++\r | |
72 | \r | |
73 | Routine Description:\r | |
74 | Sets Volume attributes. No polarity translations are done.\r | |
75 | \r | |
76 | Arguments:\r | |
77 | This - Calling context\r | |
78 | Attributes - On input: contains new attributes\r | |
79 | On output: contains current attributes of FV\r | |
80 | \r | |
81 | Returns:\r | |
82 | EFI_INVALID_PARAMETER\r | |
83 | EFI_SUCCESS\r | |
84 | \r | |
85 | --*/\r | |
86 | ;\r | |
87 | \r | |
88 | typedef\r | |
89 | EFI_STATUS\r | |
90 | (EFIAPI *EFI_FVB_GET_PHYSICAL_ADDRESS) (\r | |
91 | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r | |
92 | OUT EFI_PHYSICAL_ADDRESS * Address\r | |
93 | )\r | |
94 | /*++\r | |
95 | \r | |
96 | Routine Description:\r | |
97 | Retrieves the physical address of a memory mapped FV.\r | |
98 | \r | |
99 | Arguments:\r | |
100 | This - Calling context\r | |
101 | Attributes - Address is a pointer to a caller allocated EFI_PHYSICAL_ADDRESS\r | |
102 | that on successful return from GetPhysicalAddress() contains the\r | |
103 | base address of the firmware volume. \r | |
104 | \r | |
105 | Returns:\r | |
106 | EFI_UNSUPPORTED\r | |
107 | EFI_SUCCESS\r | |
108 | \r | |
109 | --*/\r | |
110 | ;\r | |
111 | \r | |
112 | typedef\r | |
113 | EFI_STATUS\r | |
114 | (EFIAPI *EFI_FVB_GET_BLOCK_SIZE) (\r | |
115 | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r | |
116 | IN EFI_LBA Lba,\r | |
117 | OUT UINTN *BlockSize,\r | |
118 | OUT UINTN *NumberOfBlocks\r | |
119 | )\r | |
120 | /*++\r | |
121 | \r | |
122 | Routine Description:\r | |
123 | Retrieves the size in bytes of a specific block within an FV.\r | |
124 | \r | |
125 | Arguments:\r | |
126 | This - Calling context.\r | |
127 | Lba - Indicates which block to return the size for.\r | |
128 | BlockSize - BlockSize is a pointer to a caller allocated \r | |
129 | UINTN in which the size of the block is returned.\r | |
130 | NumberOfBlocks - NumberOfBlocks is a pointer to a caller allocated\r | |
131 | UINTN in which the number of consecutive blocks\r | |
132 | starting with Lba is returned. All blocks in this\r | |
133 | range have a size of BlockSize.\r | |
134 | \r | |
135 | Returns:\r | |
136 | EFI_INVALID_PARAMETER\r | |
137 | EFI_SUCCESS\r | |
138 | \r | |
139 | --*/\r | |
140 | ;\r | |
141 | \r | |
142 | typedef\r | |
143 | EFI_STATUS\r | |
144 | (EFIAPI *EFI_FVB_READ) (\r | |
145 | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r | |
146 | IN EFI_LBA Lba,\r | |
147 | IN UINTN Offset,\r | |
148 | IN OUT UINTN *NumBytes,\r | |
149 | OUT UINT8 *Buffer\r | |
150 | )\r | |
151 | /*++\r | |
152 | \r | |
153 | Routine Description:\r | |
154 | Reads data beginning at Lba:Offset from FV and places the data in Buffer.\r | |
155 | The read terminates either when *NumBytes of data have been read, or when\r | |
156 | a block boundary is reached. *NumBytes is updated to reflect the actual\r | |
157 | number of bytes read.\r | |
158 | \r | |
159 | Arguments:\r | |
160 | This - Calling context\r | |
161 | Lba - Block in which to begin read\r | |
162 | Offset - Offset in the block at which to begin read\r | |
163 | NumBytes - At input, indicates the requested read size. At output, indicates\r | |
164 | the actual number of bytes read.\r | |
165 | Buffer - Data buffer in which to place data read.\r | |
166 | \r | |
167 | Returns:\r | |
168 | EFI_INVALID_PARAMETER\r | |
169 | EFI_NOT_FOUND\r | |
170 | EFI_DEVICE_ERROR\r | |
171 | EFI_SUCCESS\r | |
172 | \r | |
173 | --*/\r | |
174 | ;\r | |
175 | \r | |
176 | typedef\r | |
177 | EFI_STATUS\r | |
178 | (EFIAPI *EFI_FVB_WRITE) (\r | |
179 | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r | |
180 | IN EFI_LBA Lba,\r | |
181 | IN UINTN Offset,\r | |
182 | IN OUT UINTN *NumBytes,\r | |
183 | IN UINT8 *Buffer\r | |
184 | )\r | |
185 | /*++\r | |
186 | \r | |
187 | Routine Description:\r | |
188 | \r | |
189 | Writes data beginning at Lba:Offset from FV. The write terminates either\r | |
190 | when *NumBytes of data have been written, or when a block boundary is\r | |
191 | reached. *NumBytes is updated to reflect the actual number of bytes\r | |
192 | written.\r | |
193 | \r | |
194 | Arguments:\r | |
195 | This - Calling context\r | |
196 | Lba - Block in which to begin write\r | |
197 | Offset - Offset in the block at which to begin write\r | |
198 | NumBytes - At input, indicates the requested write size. At output, indicates\r | |
199 | the actual number of bytes written.\r | |
200 | Buffer - Buffer containing source data for the write.\r | |
201 | \r | |
202 | Returns:\r | |
203 | EFI_INVALID_PARAMETER\r | |
204 | EFI_NOT_FOUND\r | |
205 | EFI_DEVICE_ERROR\r | |
206 | EFI_SUCCESS\r | |
207 | \r | |
208 | --*/\r | |
209 | ;\r | |
210 | \r | |
211 | #define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFF\r | |
212 | \r | |
213 | typedef\r | |
214 | EFI_STATUS\r | |
215 | (EFIAPI *EFI_FVB_ERASE_BLOCKS) (\r | |
216 | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r | |
217 | ...\r | |
218 | )\r | |
219 | /*++\r | |
220 | \r | |
221 | Routine Description:\r | |
222 | The EraseBlock() function erases one or more blocks as denoted by the \r | |
223 | variable argument list. The entire parameter list of blocks must be verified\r | |
224 | prior to erasing any blocks. If a block is requested that does not exist \r | |
225 | within the associated firmware volume (it has a larger index than the last \r | |
226 | block of the firmware volume), the EraseBlock() function must return\r | |
227 | EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.\r | |
228 | \r | |
229 | Arguments:\r | |
230 | This - Calling context\r | |
231 | ... - Starting LBA followed by Number of Lba to erase. a -1 to terminate\r | |
232 | the list.\r | |
233 | \r | |
234 | Returns:\r | |
235 | EFI_INVALID_PARAMETER\r | |
236 | EFI_DEVICE_ERROR\r | |
237 | EFI_SUCCESS\r | |
238 | EFI_ACCESS_DENIED\r | |
239 | \r | |
240 | --*/\r | |
241 | ;\r | |
242 | \r | |
5d46191d | 243 | struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL {\r |
3eb9473e | 244 | EFI_FVB_GET_ATTRIBUTES GetVolumeAttributes;\r |
245 | EFI_FVB_SET_ATTRIBUTES SetVolumeAttributes;\r | |
246 | EFI_FVB_GET_PHYSICAL_ADDRESS GetPhysicalAddress;\r | |
247 | EFI_FVB_GET_BLOCK_SIZE GetBlockSize;\r | |
248 | EFI_FVB_READ Read;\r | |
249 | EFI_FVB_WRITE Write;\r | |
250 | EFI_FVB_ERASE_BLOCKS EraseBlocks;\r | |
251 | EFI_HANDLE ParentHandle;\r | |
5d46191d | 252 | };\r |
3eb9473e | 253 | \r |
254 | extern EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid;\r | |
255 | \r | |
256 | #endif\r |