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