]>
Commit | Line | Data |
---|---|---|
842f5579 A |
1 | /** @file\r |
2 | Firmeware Volume BLock Service Library\r | |
fb3df220 | 3 | \r |
bf231ea6 | 4 | Copyright (c) 2006 - 2007, Intel Corporation.<BR>\r |
842f5579 A |
5 | All rights reserved. This program and the accompanying materials \r |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
fb3df220 | 9 | \r |
842f5579 A |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
fb3df220 | 12 | \r |
842f5579 | 13 | **/\r |
fb3df220 | 14 | \r |
584125bc | 15 | #ifndef __FVB_SERVICE_LIB_H__\r |
16 | #define __FVB_SERVICE_LIB_H__\r | |
fb3df220 | 17 | \r |
bf231ea6 | 18 | /** |
7acc6db7 | 19 | Reads specified number of bytes into a buffer from the specified block.\r |
bf231ea6 | 20 | |
7acc6db7 | 21 | @param[in] Instance The FV instance to be read from.\r |
bf231ea6 A |
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 | |
7acc6db7 | 24 | @param[in, out] NumBytes Pointer that on input contains the total size of\r |
bf231ea6 | 25 | the buffer. On output, it contains the total number\r |
7acc6db7 | 26 | of bytes read.\r |
c57da111 | 27 | @param[out] Buffer Pointer to a caller allocated buffer that will be\r |
7acc6db7 | 28 | used to hold the data read.\r |
bf231ea6 A |
29 | |
30 | @retval EFI_EFI_SUCCESS Buffer contains data read from FVB | |
31 | @retval EFI_INVALID_PARAMETER invalid parameter | |
32 | ||
33 | **/\r | |
fb3df220 | 34 | EFI_STATUS\r |
9199040c | 35 | EFIAPI\r |
fb3df220 | 36 | EfiFvbReadBlock (\r |
37 | IN UINTN Instance,\r | |
38 | IN EFI_LBA Lba,\r | |
39 | IN UINTN Offset,\r | |
40 | IN OUT UINTN *NumBytes,\r | |
c57da111 | 41 | OUT UINT8 *Buffer\r |
bf231ea6 | 42 | );\r |
fb3df220 | 43 | \r |
fb3df220 | 44 | \r |
bf231ea6 | 45 | /** |
7acc6db7 | 46 | Writes specified number of bytes from the input buffer to the block.\r |
bf231ea6 | 47 | |
7acc6db7 | 48 | @param[in] Instance The FV instance to be read from.\r |
bf231ea6 A |
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 | |
7acc6db7 | 51 | @param[in, out] NumBytes Pointer that on input contains the total size of\r |
bf231ea6 A |
52 | the buffer. On output, it contains the total number\r |
53 | of bytes actually written. | |
54 | @param[in] Buffer Pointer to a caller allocated buffer that contains\r | |
7acc6db7 | 55 | the source for the write.\r |
bf231ea6 A |
56 | |
57 | @retval EFI_EFI_SUCCESS Buffer written to FVB | |
58 | @retval EFI_INVALID_PARAMETER invalid parameter | |
59 | ||
60 | **/\r | |
fb3df220 | 61 | EFI_STATUS\r |
9199040c | 62 | EFIAPI\r |
fb3df220 | 63 | EfiFvbWriteBlock (\r |
64 | IN UINTN Instance,\r | |
65 | IN EFI_LBA Lba,\r | |
66 | IN UINTN Offset,\r | |
67 | IN OUT UINTN *NumBytes,\r | |
68 | IN UINT8 *Buffer\r | |
bf231ea6 | 69 | );\r |
fb3df220 | 70 | \r |
fb3df220 | 71 | \r |
bf231ea6 | 72 | /** |
7acc6db7 | 73 | Erases and initializes a firmware volume block.\r |
bf231ea6 | 74 | |
7acc6db7 | 75 | @param[in] Instance The FV instance to be erased.\r |
76 | @param[in] Lba The logical block address to be erased.\r | |
bf231ea6 A |
77 | |
78 | @retval EFI_EFI_SUCCESS Lba was erased | |
79 | @retval EFI_INVALID_PARAMETER invalid parameter | |
80 | ||
81 | **/\r | |
fb3df220 | 82 | EFI_STATUS\r |
9199040c | 83 | EFIAPI\r |
fb3df220 | 84 | EfiFvbEraseBlock (\r |
85 | IN UINTN Instance,\r | |
86 | IN EFI_LBA Lba\r | |
bf231ea6 | 87 | );\r |
fb3df220 | 88 | \r |
fb3df220 | 89 | \r |
bf231ea6 A |
90 | /** |
91 | Retrieves attributes, insures positive polarity of attribute bits, returns\r | |
7acc6db7 | 92 | resulting attributes in output parameter.\r |
bf231ea6 | 93 | |
7acc6db7 | 94 | @param[in] Instance The FV instance.\r |
bf231ea6 | 95 | @param[out] Attributes The FV instance whose attributes is going to be \r |
7acc6db7 | 96 | returned.\r |
bf231ea6 A |
97 | |
98 | @retval EFI_EFI_SUCCESS Valid Attributes were returned | |
99 | @retval EFI_INVALID_PARAMETER invalid parameter | |
100 | ||
101 | **/\r | |
fb3df220 | 102 | EFI_STATUS\r |
9199040c | 103 | EFIAPI\r |
fb3df220 | 104 | EfiFvbGetVolumeAttributes (\r |
105 | IN UINTN Instance,\r | |
4ba967e7 | 106 | OUT EFI_FVB_ATTRIBUTES_2 *Attributes\r |
bf231ea6 | 107 | );\r |
fb3df220 | 108 | \r |
fb3df220 | 109 | \r |
bf231ea6 A |
110 | /** |
111 | Modifies the current settings of the firmware volume according to the \r | |
7acc6db7 | 112 | input parameter, and returns the new setting of the volume.\r |
bf231ea6 | 113 | |
7acc6db7 | 114 | @param[in] Instance The FV instance.\r |
4ba967e7 | 115 | @param[in, out]Attributes On input, it is a pointer to EFI_FVB_ATTRIBUTES_2 \r |
bf231ea6 A |
116 | containing the desired firmware volume settings.\r |
117 | On successful return, it contains the new settings\r | |
7acc6db7 | 118 | of the firmware volume.\r |
bf231ea6 A |
119 | |
120 | @retval EFI_EFI_SUCCESS Attributes were updated | |
121 | @retval EFI_INVALID_PARAMETER invalid parameter | |
122 | ||
123 | **/\r | |
fb3df220 | 124 | EFI_STATUS\r |
9199040c | 125 | EFIAPI\r |
fb3df220 | 126 | EfiFvbSetVolumeAttributes (\r |
d3a58e2d | 127 | IN UINTN Instance,\r |
4ba967e7 | 128 | IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes\r |
bf231ea6 | 129 | );\r |
fb3df220 | 130 | \r |
fb3df220 | 131 | \r |
bf231ea6 | 132 | /** |
7acc6db7 | 133 | Retrieves the physical address of a memory mapped FV.\r |
bf231ea6 A |
134 | |
135 | @param[in] Instance The FV instance | |
136 | @param[out] BaseAddress Pointer to a caller allocated EFI_PHYSICAL_ADDRESS \r | |
137 | that on successful return, contains the base address\r | |
138 | of the firmware volume. | |
139 | ||
140 | @retval EFI_EFI_SUCCESS BaseAddress was returned | |
141 | @retval EFI_INVALID_PARAMETER invalid parameter | |
142 | ||
143 | **/\r | |
fb3df220 | 144 | EFI_STATUS\r |
9199040c | 145 | EFIAPI\r |
fb3df220 | 146 | EfiFvbGetPhysicalAddress (\r |
147 | IN UINTN Instance,\r | |
148 | OUT EFI_PHYSICAL_ADDRESS *BaseAddress\r | |
bf231ea6 | 149 | );\r |
fb3df220 | 150 | \r |
fb3df220 | 151 | \r |
bf231ea6 | 152 | /** |
7acc6db7 | 153 | Retrieve the size of a logical block.\r |
bf231ea6 A |
154 | |
155 | @param[in] Instance The FV instance | |
156 | @param[in] Lba Indicates which block to return the size for. | |
7acc6db7 | 157 | @param[out] BlockSize A pointer to a caller allocated UINTN in which\r |
158 | the size of the block is returned.\r | |
bf231ea6 A |
159 | @param[out] NumOfBlocks a pointer to a caller allocated UINTN in which the\r |
160 | number of consecutive blocks starting with Lba is\r | |
161 | returned. All blocks in this range have a size of\r | |
7acc6db7 | 162 | BlockSize.\r |
bf231ea6 A |
163 | |
164 | @retval EFI_EFI_SUCCESS BlockSize and NumOfBlocks returned | |
165 | @retval EFI_INVALID_PARAMETER invalid parameter | |
166 | ||
167 | **/\r | |
fb3df220 | 168 | EFI_STATUS\r |
9199040c | 169 | EFIAPI\r |
fb3df220 | 170 | EfiFvbGetBlockSize (\r |
171 | IN UINTN Instance,\r | |
172 | IN EFI_LBA Lba,\r | |
173 | OUT UINTN *BlockSize,\r | |
174 | OUT UINTN *NumOfBlocks\r | |
bf231ea6 | 175 | );\r |
fb3df220 | 176 | \r |
fb3df220 | 177 | \r |
bf231ea6 | 178 | /** |
7acc6db7 | 179 | Erases and initializes a specified range of a firmware volume.\r |
bf231ea6 | 180 | |
7acc6db7 | 181 | @param[in] Instance The FV instance.\r |
182 | @param[in] StartLba The starting logical block index to be erased.\r | |
bf231ea6 | 183 | @param[in] OffsetStartLba Offset into the starting block at which to \r |
7acc6db7 | 184 | begin erasing. \r |
185 | @param[in] LastLba The last logical block index to be erased.\r | |
186 | @param[in] OffsetLastLba Offset into the last block at which to end erasing. \r | |
bf231ea6 A |
187 | |
188 | @retval EFI_EFI_SUCCESS Range was erased | |
189 | @retval EFI_INVALID_PARAMETER invalid parameter | |
190 | @retval EFI_UNSUPPORTED Range can not be erased\r | |
191 | ||
192 | **/\r | |
fb3df220 | 193 | EFI_STATUS\r |
9199040c | 194 | EFIAPI\r |
fb3df220 | 195 | EfiFvbEraseCustomBlockRange (\r |
196 | IN UINTN Instance,\r | |
197 | IN EFI_LBA StartLba,\r | |
198 | IN UINTN OffsetStartLba,\r | |
199 | IN EFI_LBA LastLba,\r | |
200 | IN UINTN OffsetLastLba\r | |
bf231ea6 | 201 | );\r |
fb3df220 | 202 | \r |
203 | #endif\r |