]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.h
Update Guid Value format.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Framework / Protocol / FirmwareVolumeBlock / FirmwareVolumeBlock.h
CommitLineData
3eb9473e 1/*++\r
2\r
3Copyright (c) 2004, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 FirmwareVolumeBlock.h\r
15\r
16Abstract:\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
31#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \\r
32 { \\r
7ccf38a3 33 0xDE28BC59, 0x6228, 0x41BD, {0xBD, 0xF6, 0xA3, 0xB9, 0xAD, 0xB5, 0x8D, 0xA1} \\r
3eb9473e 34 }\r
35\r
36EFI_FORWARD_DECLARATION (EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL);\r
37\r
38typedef\r
39EFI_STATUS\r
40(EFIAPI *EFI_FVB_GET_ATTRIBUTES) (\r
41 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r
42 OUT EFI_FVB_ATTRIBUTES * Attributes\r
43 )\r
44/*++\r
45\r
46Routine Description:\r
47 Retrieves Volume attributes. No polarity translations are done.\r
48\r
49Arguments:\r
50 This - Calling context\r
51 Attributes - output buffer which contains attributes\r
52\r
53Returns:\r
54 EFI_INVALID_PARAMETER\r
55 EFI_SUCCESS\r
56\r
57--*/\r
58;\r
59\r
60typedef\r
61EFI_STATUS\r
62(EFIAPI *EFI_FVB_SET_ATTRIBUTES) (\r
63 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r
64 IN OUT EFI_FVB_ATTRIBUTES * Attributes\r
65 )\r
66/*++\r
67\r
68Routine Description:\r
69 Sets Volume attributes. No polarity translations are done.\r
70\r
71Arguments:\r
72 This - Calling context\r
73 Attributes - On input: contains new attributes\r
74 On output: contains current attributes of FV\r
75\r
76Returns:\r
77 EFI_INVALID_PARAMETER\r
78 EFI_SUCCESS\r
79\r
80--*/\r
81;\r
82\r
83typedef\r
84EFI_STATUS\r
85(EFIAPI *EFI_FVB_GET_PHYSICAL_ADDRESS) (\r
86 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r
87 OUT EFI_PHYSICAL_ADDRESS * Address\r
88 )\r
89/*++\r
90\r
91Routine Description:\r
92 Retrieves the physical address of a memory mapped FV.\r
93\r
94Arguments:\r
95 This - Calling context\r
96 Attributes - Address is a pointer to a caller allocated EFI_PHYSICAL_ADDRESS\r
97 that on successful return from GetPhysicalAddress() contains the\r
98 base address of the firmware volume. \r
99\r
100Returns:\r
101 EFI_UNSUPPORTED\r
102 EFI_SUCCESS\r
103\r
104--*/\r
105;\r
106\r
107typedef\r
108EFI_STATUS\r
109(EFIAPI *EFI_FVB_GET_BLOCK_SIZE) (\r
110 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r
111 IN EFI_LBA Lba,\r
112 OUT UINTN *BlockSize,\r
113 OUT UINTN *NumberOfBlocks\r
114 )\r
115/*++\r
116\r
117Routine Description:\r
118 Retrieves the size in bytes of a specific block within an FV.\r
119 \r
120Arguments:\r
121 This - Calling context.\r
122 Lba - Indicates which block to return the size for.\r
123 BlockSize - BlockSize is a pointer to a caller allocated \r
124 UINTN in which the size of the block is returned.\r
125 NumberOfBlocks - NumberOfBlocks is a pointer to a caller allocated\r
126 UINTN in which the number of consecutive blocks\r
127 starting with Lba is returned. All blocks in this\r
128 range have a size of BlockSize.\r
129\r
130Returns:\r
131 EFI_INVALID_PARAMETER\r
132 EFI_SUCCESS\r
133\r
134--*/\r
135;\r
136\r
137typedef\r
138EFI_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
148Routine Description:\r
149 Reads data beginning at Lba:Offset from FV and places the data in Buffer.\r
150 The read terminates either when *NumBytes of data have been read, or when\r
151 a block boundary is reached. *NumBytes is updated to reflect the actual\r
152 number of bytes read.\r
153\r
154Arguments:\r
155 This - Calling context\r
156 Lba - Block in which to begin read\r
157 Offset - Offset in the block at which to begin read\r
158 NumBytes - At input, indicates the requested read size. At output, indicates\r
159 the actual number of bytes read.\r
160 Buffer - Data buffer in which to place data read.\r
161\r
162Returns:\r
163 EFI_INVALID_PARAMETER\r
164 EFI_NOT_FOUND\r
165 EFI_DEVICE_ERROR\r
166 EFI_SUCCESS\r
167\r
168--*/\r
169;\r
170\r
171typedef\r
172EFI_STATUS\r
173(EFIAPI *EFI_FVB_WRITE) (\r
174 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r
175 IN EFI_LBA Lba,\r
176 IN UINTN Offset,\r
177 IN OUT UINTN *NumBytes,\r
178 IN UINT8 *Buffer\r
179 )\r
180/*++\r
181\r
182Routine Description:\r
183\r
184 Writes data beginning at Lba:Offset from FV. The write terminates either\r
185 when *NumBytes of data have been written, or when a block boundary is\r
186 reached. *NumBytes is updated to reflect the actual number of bytes\r
187 written.\r
188\r
189Arguments:\r
190 This - Calling context\r
191 Lba - Block in which to begin write\r
192 Offset - Offset in the block at which to begin write\r
193 NumBytes - At input, indicates the requested write size. At output, indicates\r
194 the actual number of bytes written.\r
195 Buffer - Buffer containing source data for the write.\r
196\r
197Returns:\r
198 EFI_INVALID_PARAMETER\r
199 EFI_NOT_FOUND\r
200 EFI_DEVICE_ERROR\r
201 EFI_SUCCESS\r
202\r
203--*/\r
204;\r
205\r
206#define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFF\r
207\r
208typedef\r
209EFI_STATUS\r
210(EFIAPI *EFI_FVB_ERASE_BLOCKS) (\r
211 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * This,\r
212 ...\r
213 )\r
214/*++\r
215\r
216Routine Description:\r
217 The EraseBlock() function erases one or more blocks as denoted by the \r
218variable argument list. The entire parameter list of blocks must be verified\r
219prior to erasing any blocks. If a block is requested that does not exist \r
220within the associated firmware volume (it has a larger index than the last \r
221block of the firmware volume), the EraseBlock() function must return\r
222EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.\r
223\r
224Arguments:\r
225 This - Calling context\r
226 ... - Starting LBA followed by Number of Lba to erase. a -1 to terminate\r
227 the list.\r
228 \r
229Returns:\r
230 EFI_INVALID_PARAMETER\r
231 EFI_DEVICE_ERROR\r
232 EFI_SUCCESS\r
233 EFI_ACCESS_DENIED\r
234 \r
235--*/\r
236;\r
237\r
5d46191d 238struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL {\r
3eb9473e 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
5d46191d 247};\r
3eb9473e 248\r
249extern EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid;\r
250\r
251#endif\r