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