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