]>
Commit | Line | Data |
---|---|---|
842f5579 A |
1 | /** @file\r |
2 | Firmeware Volume BLock Service Library\r | |
fb3df220 | 3 | \r |
842f5579 A |
4 | Copyright (c) 2006 - 2007, Intel Corporation\r |
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 |
fb3df220 | 15 | #ifndef __EDK_FVB_SERVICE_LIB_H__\r |
16 | #define __EDK_FVB_SERVICE_LIB_H__\r | |
17 | \r | |
18 | EFI_STATUS\r | |
19 | EfiFvbReadBlock (\r | |
20 | IN UINTN Instance,\r | |
21 | IN EFI_LBA Lba,\r | |
22 | IN UINTN Offset,\r | |
23 | IN OUT UINTN *NumBytes,\r | |
24 | IN UINT8 *Buffer\r | |
25 | )\r | |
26 | /*++\r | |
27 | \r | |
28 | Routine Description:\r | |
29 | Reads specified number of bytes into a buffer from the specified block\r | |
30 | \r | |
31 | Arguments:\r | |
32 | Instance - The FV instance to be read from\r | |
33 | Lba - The logical block address to be read from\r | |
34 | Offset - Offset into the block at which to begin reading\r | |
35 | NumBytes - Pointer that on input contains the total size of\r | |
36 | the buffer. On output, it contains the total number\r | |
37 | of bytes read\r | |
38 | Buffer - Pointer to a caller allocated buffer that will be\r | |
39 | used to hold the data read\r | |
40 | \r | |
41 | Returns: \r | |
42 | \r | |
43 | Status code\r | |
44 | \r | |
45 | EFI_INVALID_PARAMETER - invalid parameter\r | |
46 | \r | |
47 | --*/\r | |
48 | ;\r | |
49 | \r | |
50 | EFI_STATUS\r | |
51 | EfiFvbWriteBlock (\r | |
52 | IN UINTN Instance,\r | |
53 | IN EFI_LBA Lba,\r | |
54 | IN UINTN Offset,\r | |
55 | IN OUT UINTN *NumBytes,\r | |
56 | IN UINT8 *Buffer\r | |
57 | )\r | |
58 | /*++\r | |
59 | \r | |
60 | Routine Description:\r | |
61 | Writes specified number of bytes from the input buffer to the block\r | |
62 | \r | |
63 | Arguments:\r | |
64 | Instance - The FV instance to be written to\r | |
65 | Lba - The starting logical block index to write to\r | |
66 | Offset - Offset into the block at which to begin writing\r | |
67 | NumBytes - Pointer that on input contains the total size of\r | |
68 | the buffer. On output, it contains the total number\r | |
69 | of bytes actually written\r | |
70 | Buffer - Pointer to a caller allocated buffer that contains\r | |
71 | the source for the write\r | |
72 | \r | |
73 | Returns: \r | |
74 | \r | |
75 | Status code\r | |
76 | \r | |
77 | EFI_INVALID_PARAMETER - invalid parameter\r | |
78 | \r | |
79 | --*/\r | |
80 | ;\r | |
81 | \r | |
82 | EFI_STATUS\r | |
83 | EfiFvbEraseBlock (\r | |
84 | IN UINTN Instance,\r | |
85 | IN EFI_LBA Lba\r | |
86 | )\r | |
87 | /*++\r | |
88 | \r | |
89 | Routine Description:\r | |
90 | Erases and initializes a firmware volume block\r | |
91 | \r | |
92 | Arguments:\r | |
93 | Instance - The FV instance to be erased\r | |
94 | Lba - The logical block index to be erased\r | |
95 | \r | |
96 | Returns: \r | |
97 | \r | |
98 | Status code\r | |
99 | \r | |
100 | EFI_INVALID_PARAMETER - invalid parameter\r | |
101 | \r | |
102 | --*/\r | |
103 | ;\r | |
104 | \r | |
105 | EFI_STATUS\r | |
106 | EfiFvbGetVolumeAttributes (\r | |
107 | IN UINTN Instance,\r | |
108 | OUT EFI_FVB_ATTRIBUTES *Attributes\r | |
109 | )\r | |
110 | /*++\r | |
111 | \r | |
112 | Routine Description:\r | |
113 | Retrieves attributes, insures positive polarity of attribute bits, returns\r | |
114 | resulting attributes in output parameter\r | |
115 | \r | |
116 | Arguments:\r | |
117 | Instance - The FV instance whose attributes is going to be \r | |
118 | returned\r | |
119 | Attributes - Output buffer which contains attributes\r | |
120 | \r | |
121 | Returns: \r | |
122 | Status code\r | |
123 | \r | |
124 | EFI_INVALID_PARAMETER - invalid parameter\r | |
125 | \r | |
126 | --*/\r | |
127 | ;\r | |
128 | \r | |
129 | EFI_STATUS\r | |
130 | EfiFvbSetVolumeAttributes (\r | |
131 | IN UINTN Instance,\r | |
132 | IN EFI_FVB_ATTRIBUTES Attributes\r | |
133 | )\r | |
134 | /*++\r | |
135 | \r | |
136 | Routine Description:\r | |
137 | Modifies the current settings of the firmware volume according to the \r | |
138 | input parameter, and returns the new setting of the volume\r | |
139 | \r | |
140 | Arguments:\r | |
141 | Instance - The FV instance whose attributes is going to be \r | |
142 | modified\r | |
143 | Attributes - On input, it is a pointer to EFI_FVB_ATTRIBUTES \r | |
144 | containing the desired firmware volume settings.\r | |
145 | On successful return, it contains the new settings\r | |
146 | of the firmware volume\r | |
147 | \r | |
148 | Returns: \r | |
149 | Status code\r | |
150 | \r | |
151 | EFI_INVALID_PARAMETER - invalid parameter\r | |
152 | \r | |
153 | --*/\r | |
154 | ;\r | |
155 | \r | |
156 | EFI_STATUS\r | |
157 | EfiFvbGetPhysicalAddress (\r | |
158 | IN UINTN Instance,\r | |
159 | OUT EFI_PHYSICAL_ADDRESS *BaseAddress\r | |
160 | )\r | |
161 | /*++\r | |
162 | \r | |
163 | Routine Description:\r | |
164 | Retrieves the physical address of a memory mapped FV\r | |
165 | \r | |
166 | Arguments:\r | |
167 | Instance - The FV instance whose base address is going to be\r | |
168 | returned\r | |
169 | BaseAddress - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS \r | |
170 | that on successful return, contains the base address\r | |
171 | of the firmware volume. \r | |
172 | \r | |
173 | Returns: \r | |
174 | \r | |
175 | Status code\r | |
176 | \r | |
177 | EFI_INVALID_PARAMETER - invalid parameter\r | |
178 | \r | |
179 | --*/\r | |
180 | ;\r | |
181 | \r | |
182 | EFI_STATUS\r | |
183 | EfiFvbGetBlockSize (\r | |
184 | IN UINTN Instance,\r | |
185 | IN EFI_LBA Lba,\r | |
186 | OUT UINTN *BlockSize,\r | |
187 | OUT UINTN *NumOfBlocks\r | |
188 | )\r | |
189 | /*++\r | |
190 | \r | |
191 | Routine Description:\r | |
192 | Retrieve the size of a logical block\r | |
193 | \r | |
194 | Arguments:\r | |
195 | Instance - The FV instance whose block size is going to be\r | |
196 | returned\r | |
197 | Lba - Indicates which block to return the size for.\r | |
198 | BlockSize - A pointer to a caller allocated UINTN in which\r | |
199 | the size of the block is returned\r | |
200 | NumOfBlocks - a pointer to a caller allocated UINTN in which the\r | |
201 | number of consecutive blocks starting with Lba is\r | |
202 | returned. All blocks in this range have a size of\r | |
203 | BlockSize\r | |
204 | \r | |
205 | Returns: \r | |
206 | EFI_SUCCESS - The firmware volume was read successfully and \r | |
207 | contents are in Buffer\r | |
208 | \r | |
209 | EFI_INVALID_PARAMETER - invalid parameter\r | |
210 | \r | |
211 | --*/\r | |
212 | ;\r | |
213 | \r | |
214 | EFI_STATUS\r | |
215 | EfiFvbEraseCustomBlockRange (\r | |
216 | IN UINTN Instance,\r | |
217 | IN EFI_LBA StartLba,\r | |
218 | IN UINTN OffsetStartLba,\r | |
219 | IN EFI_LBA LastLba,\r | |
220 | IN UINTN OffsetLastLba\r | |
221 | )\r | |
222 | /*++\r | |
223 | \r | |
224 | Routine Description:\r | |
225 | Erases and initializes a specified range of a firmware volume\r | |
226 | \r | |
227 | Arguments:\r | |
228 | Instance - The FV instance to be erased\r | |
229 | StartLba - The starting logical block index to be erased\r | |
230 | OffsetStartLba - Offset into the starting block at which to \r | |
231 | begin erasing\r | |
232 | LastLba - The last logical block index to be erased\r | |
233 | OffsetLastLba - Offset into the last block at which to end erasing\r | |
234 | \r | |
235 | Returns: \r | |
236 | \r | |
237 | Status code\r | |
238 | \r | |
239 | EFI_INVALID_PARAMETER - invalid parameter\r | |
240 | \r | |
241 | EFI_UNSUPPORTED - not support\r | |
242 | \r | |
243 | --*/\r | |
244 | ;\r | |
245 | \r | |
246 | #endif\r |