]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/FvbServiceLib.h
Use doxygen comment style for document entity such as struct, enum, variable that...
[mirror_edk2.git] / MdePkg / Include / Library / FvbServiceLib.h
1 /** @file
2 Firmeware Volume BLock Service Library
3
4 Copyright (c) 2006 - 2007, Intel Corporation.<BR>
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 __FVB_SERVICE_LIB_H__
16 #define __FVB_SERVICE_LIB_H__
17
18 /**
19 Reads specified number of bytes into a buffer from the specified block.
20
21 @param[in] Instance The FV instance to be read from.
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
24 @param[in, out] NumBytes Pointer that on input contains the total size of
25 the buffer. On output, it contains the total number
26 of bytes read.
27 @param[in] Buffer Pointer to a caller allocated buffer that will be
28 used to hold the data read.
29
30 @retval EFI_EFI_SUCCESS Buffer contains data read from FVB
31 @retval EFI_INVALID_PARAMETER invalid parameter
32
33 **/
34 EFI_STATUS
35 EFIAPI
36 EfiFvbReadBlock (
37 IN UINTN Instance,
38 IN EFI_LBA Lba,
39 IN UINTN Offset,
40 IN OUT UINTN *NumBytes,
41 OUT UINT8 *Buffer
42 );
43
44
45 /**
46 Writes specified number of bytes from the input buffer to the block.
47
48 @param[in] Instance The FV instance to be read from.
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
51 @param[in, out] NumBytes Pointer that on input contains the total size of
52 the buffer. On output, it contains the total number
53 of bytes actually written.
54 @param[in] Buffer Pointer to a caller allocated buffer that contains
55 the source for the write.
56
57 @retval EFI_EFI_SUCCESS Buffer written to FVB
58 @retval EFI_INVALID_PARAMETER invalid parameter
59
60 **/
61 EFI_STATUS
62 EFIAPI
63 EfiFvbWriteBlock (
64 IN UINTN Instance,
65 IN EFI_LBA Lba,
66 IN UINTN Offset,
67 IN OUT UINTN *NumBytes,
68 IN UINT8 *Buffer
69 );
70
71
72 /**
73 Erases and initializes a firmware volume block.
74
75 @param[in] Instance The FV instance to be erased.
76 @param[in] Lba The logical block address to be erased.
77
78 @retval EFI_EFI_SUCCESS Lba was erased
79 @retval EFI_INVALID_PARAMETER invalid parameter
80
81 **/
82 EFI_STATUS
83 EFIAPI
84 EfiFvbEraseBlock (
85 IN UINTN Instance,
86 IN EFI_LBA Lba
87 );
88
89
90 /**
91 Retrieves attributes, insures positive polarity of attribute bits, returns
92 resulting attributes in output parameter.
93
94 @param[in] Instance The FV instance.
95 @param[out] Attributes The FV instance whose attributes is going to be
96 returned.
97
98 @retval EFI_EFI_SUCCESS Valid Attributes were returned
99 @retval EFI_INVALID_PARAMETER invalid parameter
100
101 **/
102 EFI_STATUS
103 EFIAPI
104 EfiFvbGetVolumeAttributes (
105 IN UINTN Instance,
106 OUT EFI_FVB_ATTRIBUTES *Attributes
107 );
108
109
110 /**
111 Modifies the current settings of the firmware volume according to the
112 input parameter, and returns the new setting of the volume.
113
114 @param[in] Instance The FV instance.
115 @param[in, out]Attributes On input, it is a pointer to EFI_FVB_ATTRIBUTES
116 containing the desired firmware volume settings.
117 On successful return, it contains the new settings
118 of the firmware volume.
119
120 @retval EFI_EFI_SUCCESS Attributes were updated
121 @retval EFI_INVALID_PARAMETER invalid parameter
122
123 **/
124 EFI_STATUS
125 EFIAPI
126 EfiFvbSetVolumeAttributes (
127 IN UINTN Instance,
128 IN OUT EFI_FVB_ATTRIBUTES *Attributes
129 );
130
131
132 /**
133 Retrieves the physical address of a memory mapped FV.
134
135 @param[in] Instance The FV instance
136 @param[out] BaseAddress Pointer to a caller allocated EFI_PHYSICAL_ADDRESS
137 that on successful return, contains the base address
138 of the firmware volume.
139
140 @retval EFI_EFI_SUCCESS BaseAddress was returned
141 @retval EFI_INVALID_PARAMETER invalid parameter
142
143 **/
144 EFI_STATUS
145 EFIAPI
146 EfiFvbGetPhysicalAddress (
147 IN UINTN Instance,
148 OUT EFI_PHYSICAL_ADDRESS *BaseAddress
149 );
150
151
152 /**
153 Retrieve the size of a logical block.
154
155 @param[in] Instance The FV instance
156 @param[in] Lba Indicates which block to return the size for.
157 @param[out] BlockSize A pointer to a caller allocated UINTN in which
158 the size of the block is returned.
159 @param[out] NumOfBlocks a pointer to a caller allocated UINTN in which the
160 number of consecutive blocks starting with Lba is
161 returned. All blocks in this range have a size of
162 BlockSize.
163
164 @retval EFI_EFI_SUCCESS BlockSize and NumOfBlocks returned
165 @retval EFI_INVALID_PARAMETER invalid parameter
166
167 **/
168 EFI_STATUS
169 EFIAPI
170 EfiFvbGetBlockSize (
171 IN UINTN Instance,
172 IN EFI_LBA Lba,
173 OUT UINTN *BlockSize,
174 OUT UINTN *NumOfBlocks
175 );
176
177
178 /**
179 Erases and initializes a specified range of a firmware volume.
180
181 @param[in] Instance The FV instance.
182 @param[in] StartLba The starting logical block index to be erased.
183 @param[in] OffsetStartLba Offset into the starting block at which to
184 begin erasing.
185 @param[in] LastLba The last logical block index to be erased.
186 @param[in] OffsetLastLba Offset into the last block at which to end erasing.
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
191
192 **/
193 EFI_STATUS
194 EFIAPI
195 EfiFvbEraseCustomBlockRange (
196 IN UINTN Instance,
197 IN EFI_LBA StartLba,
198 IN UINTN OffsetStartLba,
199 IN EFI_LBA LastLba,
200 IN UINTN OffsetLastLba
201 );
202
203 #endif