3 Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Firmware Volume Block protocol as defined in the Tiano Firmware Volume
21 Low level firmware device access routines to abstract firmware device
26 #ifndef _FW_VOL_BLOCK_H_
27 #define _FW_VOL_BLOCK_H_
29 #include "EfiFirmwareVolumeHeader.h"
32 // The following GUID value has been changed to EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL_GUID in
33 // PI 1.2 spec on purpose. This will force all platforms built with EdkCompatibilityPkg
34 // produce FVB 2 protocol.
36 #define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \
38 0x8f644fa9, 0xe850, 0x4db1, {0x9c, 0xe2, 0xb, 0x44, 0x69, 0x8e, 0x8d, 0xa4 } \
41 EFI_FORWARD_DECLARATION (EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
);
43 typedef EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL
;
47 (EFIAPI
*EFI_FVB_GET_ATTRIBUTES
) (
48 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
49 OUT EFI_FVB_ATTRIBUTES
* Attributes
54 Retrieves Volume attributes. No polarity translations are done.
57 This - Calling context
58 Attributes - output buffer which contains attributes
69 (EFIAPI
*EFI_FVB_SET_ATTRIBUTES
) (
70 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
71 IN OUT EFI_FVB_ATTRIBUTES
* Attributes
76 Sets Volume attributes. No polarity translations are done.
79 This - Calling context
80 Attributes - On input: contains new attributes
81 On output: contains current attributes of FV
92 (EFIAPI
*EFI_FVB_GET_PHYSICAL_ADDRESS
) (
93 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
94 OUT EFI_PHYSICAL_ADDRESS
* Address
99 Retrieves the physical address of a memory mapped FV.
102 This - Calling context
103 Attributes - Address is a pointer to a caller allocated EFI_PHYSICAL_ADDRESS
104 that on successful return from GetPhysicalAddress() contains the
105 base address of the firmware volume.
116 (EFIAPI
*EFI_FVB_GET_BLOCK_SIZE
) (
117 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
119 OUT UINTN
*BlockSize
,
120 OUT UINTN
*NumberOfBlocks
125 Retrieves the size in bytes of a specific block within an FV.
128 This - Calling context.
129 Lba - Indicates which block to return the size for.
130 BlockSize - BlockSize is a pointer to a caller allocated
131 UINTN in which the size of the block is returned.
132 NumberOfBlocks - NumberOfBlocks is a pointer to a caller allocated
133 UINTN in which the number of consecutive blocks
134 starting with Lba is returned. All blocks in this
135 range have a size of BlockSize.
138 EFI_INVALID_PARAMETER
146 (EFIAPI
*EFI_FVB_READ
) (
147 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
150 IN OUT UINTN
*NumBytes
,
156 Reads data beginning at Lba:Offset from FV and places the data in Buffer.
157 The read terminates either when *NumBytes of data have been read, or when
158 a block boundary is reached. *NumBytes is updated to reflect the actual
159 number of bytes read.
162 This - Calling context
163 Lba - Block in which to begin read
164 Offset - Offset in the block at which to begin read
165 NumBytes - At input, indicates the requested read size. At output, indicates
166 the actual number of bytes read.
167 Buffer - Data buffer in which to place data read.
170 EFI_INVALID_PARAMETER
180 (EFIAPI
*EFI_FVB_WRITE
) (
181 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
184 IN OUT UINTN
*NumBytes
,
191 Writes data beginning at Lba:Offset from FV. The write terminates either
192 when *NumBytes of data have been written, or when a block boundary is
193 reached. *NumBytes is updated to reflect the actual number of bytes
197 This - Calling context
198 Lba - Block in which to begin write
199 Offset - Offset in the block at which to begin write
200 NumBytes - At input, indicates the requested write size. At output, indicates
201 the actual number of bytes written.
202 Buffer - Buffer containing source data for the write.
205 EFI_INVALID_PARAMETER
213 #define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFF
217 (EFIAPI
*EFI_FVB_ERASE_BLOCKS
) (
218 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
224 The EraseBlock() function erases one or more blocks as denoted by the
225 variable argument list. The entire parameter list of blocks must be verified
226 prior to erasing any blocks. If a block is requested that does not exist
227 within the associated firmware volume (it has a larger index than the last
228 block of the firmware volume), the EraseBlock() function must return
229 EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.
232 This - Calling context
233 ... - Starting LBA followed by Number of Lba to erase. a -1 to terminate
237 EFI_INVALID_PARAMETER
245 struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
{
246 EFI_FVB_GET_ATTRIBUTES GetVolumeAttributes
;
247 EFI_FVB_SET_ATTRIBUTES SetVolumeAttributes
;
248 EFI_FVB_GET_PHYSICAL_ADDRESS GetPhysicalAddress
;
249 EFI_FVB_GET_BLOCK_SIZE GetBlockSize
;
252 EFI_FVB_ERASE_BLOCKS EraseBlocks
;
253 EFI_HANDLE ParentHandle
;
256 extern EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid
;