3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. 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"
31 #define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \
33 0xDE28BC59, 0x6228, 0x41BD, 0xBD, 0xF6, 0xA3, 0xB9, 0xAD, 0xB5, 0x8D, 0xA1 \
36 EFI_FORWARD_DECLARATION (EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
);
40 (EFIAPI
*EFI_FVB_GET_ATTRIBUTES
) (
41 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
42 OUT EFI_FVB_ATTRIBUTES
* Attributes
47 Retrieves Volume attributes. No polarity translations are done.
50 This - Calling context
51 Attributes - output buffer which contains attributes
62 (EFIAPI
*EFI_FVB_SET_ATTRIBUTES
) (
63 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
64 IN OUT EFI_FVB_ATTRIBUTES
* Attributes
69 Sets Volume attributes. No polarity translations are done.
72 This - Calling context
73 Attributes - On input: contains new attributes
74 On output: contains current attributes of FV
85 (EFIAPI
*EFI_FVB_GET_PHYSICAL_ADDRESS
) (
86 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
87 OUT EFI_PHYSICAL_ADDRESS
* Address
92 Retrieves the physical address of a memory mapped FV.
95 This - Calling context
96 Attributes - Address is a pointer to a caller allocated EFI_PHYSICAL_ADDRESS
97 that on successful return from GetPhysicalAddress() contains the
98 base address of the firmware volume.
109 (EFIAPI
*EFI_FVB_GET_BLOCK_SIZE
) (
110 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
112 OUT UINTN
*BlockSize
,
113 OUT UINTN
*NumberOfBlocks
118 Retrieves the size in bytes of a specific block within an FV.
121 This - Calling context.
122 Lba - Indicates which block to return the size for.
123 BlockSize - BlockSize is a pointer to a caller allocated
124 UINTN in which the size of the block is returned.
125 NumberOfBlocks - NumberOfBlocks is a pointer to a caller allocated
126 UINTN in which the number of consecutive blocks
127 starting with Lba is returned. All blocks in this
128 range have a size of BlockSize.
131 EFI_INVALID_PARAMETER
139 (EFIAPI
*EFI_FVB_READ
) (
140 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
143 IN OUT UINTN
*NumBytes
,
149 Reads data beginning at Lba:Offset from FV and places the data in Buffer.
150 The read terminates either when *NumBytes of data have been read, or when
151 a block boundary is reached. *NumBytes is updated to reflect the actual
152 number of bytes read.
155 This - Calling context
156 Lba - Block in which to begin read
157 Offset - Offset in the block at which to begin read
158 NumBytes - At input, indicates the requested read size. At output, indicates
159 the actual number of bytes read.
160 Buffer - Data buffer in which to place data read.
163 EFI_INVALID_PARAMETER
173 (EFIAPI
*EFI_FVB_WRITE
) (
174 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
177 IN OUT UINTN
*NumBytes
,
184 Writes data beginning at Lba:Offset from FV. The write terminates either
185 when *NumBytes of data have been written, or when a block boundary is
186 reached. *NumBytes is updated to reflect the actual number of bytes
190 This - Calling context
191 Lba - Block in which to begin write
192 Offset - Offset in the block at which to begin write
193 NumBytes - At input, indicates the requested write size. At output, indicates
194 the actual number of bytes written.
195 Buffer - Buffer containing source data for the write.
198 EFI_INVALID_PARAMETER
206 #define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFF
210 (EFIAPI
*EFI_FVB_ERASE_BLOCKS
) (
211 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
* This
,
217 The EraseBlock() function erases one or more blocks as denoted by the
218 variable argument list. The entire parameter list of blocks must be verified
219 prior to erasing any blocks. If a block is requested that does not exist
220 within the associated firmware volume (it has a larger index than the last
221 block of the firmware volume), the EraseBlock() function must return
222 EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.
225 This - Calling context
226 ... - Starting LBA followed by Number of Lba to erase. a -1 to terminate
230 EFI_INVALID_PARAMETER
238 typedef struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
{
239 EFI_FVB_GET_ATTRIBUTES GetVolumeAttributes
;
240 EFI_FVB_SET_ATTRIBUTES SetVolumeAttributes
;
241 EFI_FVB_GET_PHYSICAL_ADDRESS GetPhysicalAddress
;
242 EFI_FVB_GET_BLOCK_SIZE GetBlockSize
;
245 EFI_FVB_ERASE_BLOCKS EraseBlocks
;
246 EFI_HANDLE ParentHandle
;
247 } EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
;
249 extern EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid
;