3 Copyright (c) 2004 - 2009, 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
);
45 (EFIAPI
*EFI_FVB_GET_ATTRIBUTES
) (
46 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
47 OUT EFI_FVB_ATTRIBUTES
* Attributes
52 Retrieves Volume attributes. No polarity translations are done.
55 This - Calling context
56 Attributes - output buffer which contains attributes
67 (EFIAPI
*EFI_FVB_SET_ATTRIBUTES
) (
68 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
69 IN OUT EFI_FVB_ATTRIBUTES
* Attributes
74 Sets Volume attributes. No polarity translations are done.
77 This - Calling context
78 Attributes - On input: contains new attributes
79 On output: contains current attributes of FV
90 (EFIAPI
*EFI_FVB_GET_PHYSICAL_ADDRESS
) (
91 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
92 OUT EFI_PHYSICAL_ADDRESS
* Address
97 Retrieves the physical address of a memory mapped FV.
100 This - Calling context
101 Attributes - Address is a pointer to a caller allocated EFI_PHYSICAL_ADDRESS
102 that on successful return from GetPhysicalAddress() contains the
103 base address of the firmware volume.
114 (EFIAPI
*EFI_FVB_GET_BLOCK_SIZE
) (
115 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
117 OUT UINTN
*BlockSize
,
118 OUT UINTN
*NumberOfBlocks
123 Retrieves the size in bytes of a specific block within an FV.
126 This - Calling context.
127 Lba - Indicates which block to return the size for.
128 BlockSize - BlockSize is a pointer to a caller allocated
129 UINTN in which the size of the block is returned.
130 NumberOfBlocks - NumberOfBlocks is a pointer to a caller allocated
131 UINTN in which the number of consecutive blocks
132 starting with Lba is returned. All blocks in this
133 range have a size of BlockSize.
136 EFI_INVALID_PARAMETER
144 (EFIAPI
*EFI_FVB_READ
) (
145 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
148 IN OUT UINTN
*NumBytes
,
154 Reads data beginning at Lba:Offset from FV and places the data in Buffer.
155 The read terminates either when *NumBytes of data have been read, or when
156 a block boundary is reached. *NumBytes is updated to reflect the actual
157 number of bytes read.
160 This - Calling context
161 Lba - Block in which to begin read
162 Offset - Offset in the block at which to begin read
163 NumBytes - At input, indicates the requested read size. At output, indicates
164 the actual number of bytes read.
165 Buffer - Data buffer in which to place data read.
168 EFI_INVALID_PARAMETER
178 (EFIAPI
*EFI_FVB_WRITE
) (
179 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
182 IN OUT UINTN
*NumBytes
,
189 Writes data beginning at Lba:Offset from FV. The write terminates either
190 when *NumBytes of data have been written, or when a block boundary is
191 reached. *NumBytes is updated to reflect the actual number of bytes
195 This - Calling context
196 Lba - Block in which to begin write
197 Offset - Offset in the block at which to begin write
198 NumBytes - At input, indicates the requested write size. At output, indicates
199 the actual number of bytes written.
200 Buffer - Buffer containing source data for the write.
203 EFI_INVALID_PARAMETER
211 #define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFF
215 (EFIAPI
*EFI_FVB_ERASE_BLOCKS
) (
216 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
222 The EraseBlock() function erases one or more blocks as denoted by the
223 variable argument list. The entire parameter list of blocks must be verified
224 prior to erasing any blocks. If a block is requested that does not exist
225 within the associated firmware volume (it has a larger index than the last
226 block of the firmware volume), the EraseBlock() function must return
227 EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.
230 This - Calling context
231 ... - Starting LBA followed by Number of Lba to erase. a -1 to terminate
235 EFI_INVALID_PARAMETER
243 struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
{
244 EFI_FVB_GET_ATTRIBUTES GetVolumeAttributes
;
245 EFI_FVB_SET_ATTRIBUTES SetVolumeAttributes
;
246 EFI_FVB_GET_PHYSICAL_ADDRESS GetPhysicalAddress
;
247 EFI_FVB_GET_BLOCK_SIZE GetBlockSize
;
250 EFI_FVB_ERASE_BLOCKS EraseBlocks
;
251 EFI_HANDLE ParentHandle
;
254 extern EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid
;