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
39 IN OUT UINTN
*NumBytes
,
45 Writes specified number of bytes from the input buffer to the block
47 @param[in] Instance The FV instance to be read from
48 @param[in] Lba The logical block address to be write to
49 @param[in] Offset Offset into the block at which to begin writing
50 @param[in,out] NumBytes Pointer that on input contains the total size of
51 the buffer. On output, it contains the total number
52 of bytes actually written.
53 @param[in] Buffer Pointer to a caller allocated buffer that contains
54 the source for the write
56 @retval EFI_EFI_SUCCESS Buffer written to FVB
57 @retval EFI_INVALID_PARAMETER invalid parameter
65 IN OUT UINTN
*NumBytes
,
71 Erases and initializes a firmware volume block
73 @param[in] Instance The FV instance to be erased
74 @param[in] Lba The logical block address to be erased
76 @retval EFI_EFI_SUCCESS Lba was erased
77 @retval EFI_INVALID_PARAMETER invalid parameter
88 Retrieves attributes, insures positive polarity of attribute bits, returns
89 resulting attributes in output parameter
91 @param[in] Instance The FV instance
92 @param[out] Attributes The FV instance whose attributes is going to be
95 @retval EFI_EFI_SUCCESS Valid Attributes were returned
96 @retval EFI_INVALID_PARAMETER invalid parameter
100 EfiFvbGetVolumeAttributes (
102 OUT EFI_FVB_ATTRIBUTES
*Attributes
107 Modifies the current settings of the firmware volume according to the
108 input parameter, and returns the new setting of the volume
110 @param[in] Instance The FV instance
111 @param[in] Attributes On input, it is a pointer to EFI_FVB_ATTRIBUTES
112 containing the desired firmware volume settings.
113 On successful return, it contains the new settings
114 of the firmware volume
116 @retval EFI_EFI_SUCCESS Attributes were updated
117 @retval EFI_INVALID_PARAMETER invalid parameter
121 EfiFvbSetVolumeAttributes (
123 IN EFI_FVB_ATTRIBUTES Attributes
128 Retrieves the physical address of a memory mapped FV
130 @param[in] Instance The FV instance
131 @param[out] BaseAddress Pointer to a caller allocated EFI_PHYSICAL_ADDRESS
132 that on successful return, contains the base address
133 of the firmware volume.
135 @retval EFI_EFI_SUCCESS BaseAddress was returned
136 @retval EFI_INVALID_PARAMETER invalid parameter
140 EfiFvbGetPhysicalAddress (
142 OUT EFI_PHYSICAL_ADDRESS
*BaseAddress
147 Retrieve the size of a logical block
149 @param[in] Instance The FV instance
150 @param[in] Lba Indicates which block to return the size for.
151 @param[out] BlockSizze A pointer to a caller allocated UINTN in which
152 the size of the block is returned
153 @param[out] NumOfBlocks a pointer to a caller allocated UINTN in which the
154 number of consecutive blocks starting with Lba is
155 returned. All blocks in this range have a size of
158 @retval EFI_EFI_SUCCESS BlockSize and NumOfBlocks returned
159 @retval EFI_INVALID_PARAMETER invalid parameter
166 OUT UINTN
*BlockSize
,
167 OUT UINTN
*NumOfBlocks
172 Erases and initializes a specified range of a firmware volume
174 @param[in] Instance The FV instance
175 @param[in] StartLba The starting logical block index to be erased
176 @param[in] OffsetStartLba Offset into the starting block at which to
178 @param[in] LastLba The last logical block index to be erased
179 @param[in] OffsetLastLba Offset into the last block at which to end erasing
181 @retval EFI_EFI_SUCCESS Range was erased
182 @retval EFI_INVALID_PARAMETER invalid parameter
183 @retval EFI_UNSUPPORTED Range can not be erased
187 EfiFvbEraseCustomBlockRange (
190 IN UINTN OffsetStartLba
,
192 IN UINTN OffsetLastLba