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