2 This file declares Firmware Volume Block protocol.
4 Low level firmware device access routines to abstract firmware device
7 Copyright (c) 2007, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 Module Name: FirmwareVolumeBlock.h
18 @par Revision Reference:
19 This protocol is defined in Framework of EFI Firmware Volume Block specification.
24 #ifndef _FIRMWARE_VOLUME_BLOCK_H_
25 #define _FIRMWARE_VOLUME_BLOCK_H_
29 #define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \
31 0xDE28BC59, 0x6228, 0x41BD, {0xBD, 0xF6, 0xA3, 0xB9, 0xAD, 0xB5, 0x8D, 0xA1 } \
34 typedef struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
;
37 Retrieves Volume attributes. No polarity translations are done.
39 @param This Calling context
40 @param Attributes output buffer which contains attributes
42 @retval EFI_INVALID_PARAMETER
48 (EFIAPI
*EFI_FVB_GET_ATTRIBUTES
) (
49 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*This
,
50 OUT EFI_FVB_ATTRIBUTES
*Attributes
55 Sets Volume attributes. No polarity translations are done.
57 @param This Calling context
58 @param Attributes On input: contains new attributes
59 On output: contains current attributes of FV
61 @retval EFI_INVALID_PARAMETER
67 (EFIAPI
*EFI_FVB_SET_ATTRIBUTES
) (
68 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*This
,
69 IN OUT EFI_FVB_ATTRIBUTES
*Attributes
74 Retrieves the physical address of a memory mapped FV.
76 @param This Calling context
77 @param Attributes Address is a pointer to a caller allocated EFI_PHYSICAL_ADDRESS
78 that on successful return from GetPhysicalAddress() contains the
79 base address of the firmware volume.
81 @retval EFI_UNSUPPORTED
87 (EFIAPI
*EFI_FVB_GET_PHYSICAL_ADDRESS
) (
88 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*This
,
89 OUT EFI_PHYSICAL_ADDRESS
*Address
94 Retrieves the size in bytes of a specific block within an FV.
96 @param This Calling context.
97 @param Lba Indicates which block to return the size for.
98 @param BlockSize BlockSize is a pointer to a caller allocated
99 UINTN in which the size of the block is returned.
100 @param NumberOfBlocks NumberOfBlocks is a pointer to a caller allocated
101 UINTN in which the number of consecutive blocks
102 starting with Lba is returned. All blocks in this
103 range have a size of BlockSize.
105 @retval EFI_INVALID_PARAMETER
111 (EFIAPI
*EFI_FVB_GET_BLOCK_SIZE
) (
112 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*This
,
114 OUT UINTN
*BlockSize
,
115 OUT UINTN
*NumberOfBlocks
120 Reads data beginning at Lba:Offset from FV and places the data in Buffer.
121 The read terminates either when *NumBytes of data have been read, or when
122 a block boundary is reached. *NumBytes is updated to reflect the actual
123 number of bytes read.
125 @param This Calling context
126 @param Lba Block in which to begin read
127 @param Offset Offset in the block at which to begin read
128 @param NumBytes At input, indicates the requested read size. At output, indicates
129 the actual number of bytes read.
130 @param Buffer Data buffer in which to place data read.
132 @retval EFI_INVALID_PARAMETER
133 @retval EFI_NOT_FOUND
134 @retval EFI_DEVICE_ERROR
140 (EFIAPI
*EFI_FVB_READ
) (
141 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*This
,
144 IN OUT UINTN
*NumBytes
,
150 Writes data beginning at Lba:Offset from FV. The write terminates either
151 when *NumBytes of data have been written, or when a block boundary is
152 reached. *NumBytes is updated to reflect the actual number of bytes
155 @param This Calling context
156 @param Lba Block in which to begin write
157 @param Offset Offset in the block at which to begin write
158 @param NumBytes At input, indicates the requested write size. At output, indicates
159 the actual number of bytes written.
160 @param Buffer Buffer containing source data for the write.
162 @retval EFI_INVALID_PARAMETER
163 @retval EFI_NOT_FOUND
164 @retval EFI_DEVICE_ERROR
170 (EFIAPI
*EFI_FVB_WRITE
) (
171 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*This
,
174 IN OUT UINTN
*NumBytes
,
179 #define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFFULL
182 The EraseBlock() function erases one or more blocks as denoted by the
183 variable argument list. The entire parameter list of blocks must be verified
184 prior to erasing any blocks. If a block is requested that does not exist
185 within the associated firmware volume (it has a larger index than the last
186 block of the firmware volume), the EraseBlock() function must return
187 EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.
189 @param This Calling context
190 @param ... Starting LBA followed by Number of Lba to erase. a -1 to terminate
193 @retval EFI_INVALID_PARAMETER
194 @retval EFI_DEVICE_ERROR
196 @retval EFI_ACCESS_DENIED
201 (EFIAPI
*EFI_FVB_ERASE_BLOCKS
) (
202 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
*This
,
208 @par Protocol Description:
209 This protocol provides control over block-oriented firmware devices.
210 Typically, the FFS (or an alternate file system) driver consumes the
211 Firmware Volume Block Protocol and produces the Firmware Volume Protocol.
214 Retrieves the current volume attributes.
217 Sets the current volume attributes.
219 @param GetPhysicalAddress
220 Retrieves the memory-mapped address of the firmware volume.
223 Retrieves the size for a specific block.
226 Reads n bytes into a buffer from the firmware volume hardware.
229 Writes n bytes from a buffer into the firmware volume hardware.
232 Erases specified block(s) and sets all values as indicated by
233 the EFI_FVB_ERASE_POLARITY bit.
236 Handle of the parent firmware volume.
239 struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
{
240 EFI_FVB_GET_ATTRIBUTES GetVolumeAttributes
;
241 EFI_FVB_SET_ATTRIBUTES SetVolumeAttributes
;
242 EFI_FVB_GET_PHYSICAL_ADDRESS GetPhysicalAddress
;
243 EFI_FVB_GET_BLOCK_SIZE GetBlockSize
;
246 EFI_FVB_ERASE_BLOCKS EraseBlocks
;
247 EFI_HANDLE ParentHandle
;
250 extern EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid
;