2 Firmeware Volume BLock Service Library
4 Copyright (c) 2006 - 2007, Intel Corporation.<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __EDK_FVB_SERVICE_LIB_H__
16 #define __EDK_FVB_SERVICE_LIB_H__
19 Reads specified number of bytes into a buffer from the specified block.
21 @param[in] Instance The FV instance to be read from.
22 @param[in] Lba The logical block address to be read from
23 @param[in] Offset Offset into the block at which to begin reading
24 @param[in, out] NumBytes Pointer that on input contains the total size of
25 the buffer. On output, it contains the total number
27 @param[in] Buffer Pointer to a caller allocated buffer that will be
28 used to hold the data read.
30 @retval EFI_EFI_SUCCESS Buffer contains data read from FVB
31 @retval EFI_INVALID_PARAMETER invalid parameter
40 IN OUT UINTN
*NumBytes
,
46 Writes specified number of bytes from the input buffer to the block.
48 @param[in] Instance The FV instance to be read from.
49 @param[in] Lba The logical block address to be write to
50 @param[in] Offset Offset into the block at which to begin writing
51 @param[in, out] NumBytes Pointer that on input contains the total size of
52 the buffer. On output, it contains the total number
53 of bytes actually written.
54 @param[in] Buffer Pointer to a caller allocated buffer that contains
55 the source for the write.
57 @retval EFI_EFI_SUCCESS Buffer written to FVB
58 @retval EFI_INVALID_PARAMETER invalid parameter
67 IN OUT UINTN
*NumBytes
,
73 Erases and initializes a firmware volume block.
75 @param[in] Instance The FV instance to be erased.
76 @param[in] Lba The logical block address to be erased.
78 @retval EFI_EFI_SUCCESS Lba was erased
79 @retval EFI_INVALID_PARAMETER invalid parameter
91 Retrieves attributes, insures positive polarity of attribute bits, returns
92 resulting attributes in output parameter.
94 @param[in] Instance The FV instance.
95 @param[out] Attributes The FV instance whose attributes is going to be
98 @retval EFI_EFI_SUCCESS Valid Attributes were returned
99 @retval EFI_INVALID_PARAMETER invalid parameter
104 EfiFvbGetVolumeAttributes (
106 OUT EFI_FVB_ATTRIBUTES
*Attributes
111 Modifies the current settings of the firmware volume according to the
112 input parameter, and returns the new setting of the volume.
114 @param[in] Instance The FV instance.
115 @param[in, out]Attributes On input, it is a pointer to EFI_FVB_ATTRIBUTES
116 containing the desired firmware volume settings.
117 On successful return, it contains the new settings
118 of the firmware volume.
120 @retval EFI_EFI_SUCCESS Attributes were updated
121 @retval EFI_INVALID_PARAMETER invalid parameter
126 EfiFvbSetVolumeAttributes (
128 IN OUT EFI_FVB_ATTRIBUTES
*Attributes
133 Retrieves the physical address of a memory mapped FV.
135 @param[in] Instance The FV instance
136 @param[out] BaseAddress Pointer to a caller allocated EFI_PHYSICAL_ADDRESS
137 that on successful return, contains the base address
138 of the firmware volume.
140 @retval EFI_EFI_SUCCESS BaseAddress was returned
141 @retval EFI_INVALID_PARAMETER invalid parameter
146 EfiFvbGetPhysicalAddress (
148 OUT EFI_PHYSICAL_ADDRESS
*BaseAddress
153 Retrieve the size of a logical block.
155 @param[in] Instance The FV instance
156 @param[in] Lba Indicates which block to return the size for.
157 @param[out] BlockSize A pointer to a caller allocated UINTN in which
158 the size of the block is returned.
159 @param[out] NumOfBlocks a pointer to a caller allocated UINTN in which the
160 number of consecutive blocks starting with Lba is
161 returned. All blocks in this range have a size of
164 @retval EFI_EFI_SUCCESS BlockSize and NumOfBlocks returned
165 @retval EFI_INVALID_PARAMETER invalid parameter
173 OUT UINTN
*BlockSize
,
174 OUT UINTN
*NumOfBlocks
179 Erases and initializes a specified range of a firmware volume.
181 @param[in] Instance The FV instance.
182 @param[in] StartLba The starting logical block index to be erased.
183 @param[in] OffsetStartLba Offset into the starting block at which to
185 @param[in] LastLba The last logical block index to be erased.
186 @param[in] OffsetLastLba Offset into the last block at which to end erasing.
188 @retval EFI_EFI_SUCCESS Range was erased
189 @retval EFI_INVALID_PARAMETER invalid parameter
190 @retval EFI_UNSUPPORTED Range can not be erased
195 EfiFvbEraseCustomBlockRange (
198 IN UINTN OffsetStartLba
,
200 IN UINTN OffsetLastLba