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