]>
Commit | Line | Data |
---|---|---|
842f5579 A |
1 | /** @file\r |
2 | Firmeware Volume BLock Service Library\r | |
fb3df220 | 3 | \r |
bf231ea6 | 4 | Copyright (c) 2006 - 2007, Intel Corporation.<BR>\r |
842f5579 A |
5 | All rights reserved. This program and the accompanying materials \r |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
fb3df220 | 9 | \r |
842f5579 A |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
fb3df220 | 12 | \r |
842f5579 | 13 | **/\r |
fb3df220 | 14 | \r |
fb3df220 | 15 | #ifndef __EDK_FVB_SERVICE_LIB_H__\r |
16 | #define __EDK_FVB_SERVICE_LIB_H__\r | |
17 | \r | |
bf231ea6 A |
18 | /** |
19 | Reads specified number of bytes into a buffer from the specified block\r | |
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\r | |
25 | the buffer. On output, it contains the total number\r | |
26 | of bytes read | |
27 | @param[in] Buffer Pointer to a caller allocated buffer that will be\r | |
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 | **/\r | |
fb3df220 | 34 | EFI_STATUS\r |
35 | EfiFvbReadBlock (\r | |
36 | IN UINTN Instance,\r | |
37 | IN EFI_LBA Lba,\r | |
38 | IN UINTN Offset,\r | |
39 | IN OUT UINTN *NumBytes,\r | |
40 | IN UINT8 *Buffer\r | |
bf231ea6 | 41 | );\r |
fb3df220 | 42 | \r |
fb3df220 | 43 | \r |
bf231ea6 A |
44 | /** |
45 | Writes specified number of bytes from the input buffer to the block\r | |
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\r | |
51 | the buffer. On output, it contains the total number\r | |
52 | of bytes actually written. | |
53 | @param[in] Buffer Pointer to a caller allocated buffer that contains\r | |
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 | **/\r | |
fb3df220 | 60 | EFI_STATUS\r |
61 | EfiFvbWriteBlock (\r | |
62 | IN UINTN Instance,\r | |
63 | IN EFI_LBA Lba,\r | |
64 | IN UINTN Offset,\r | |
65 | IN OUT UINTN *NumBytes,\r | |
66 | IN UINT8 *Buffer\r | |
bf231ea6 | 67 | );\r |
fb3df220 | 68 | \r |
fb3df220 | 69 | \r |
bf231ea6 A |
70 | /** |
71 | Erases and initializes a firmware volume block\r | |
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 | **/\r | |
fb3df220 | 80 | EFI_STATUS\r |
81 | EfiFvbEraseBlock (\r | |
82 | IN UINTN Instance,\r | |
83 | IN EFI_LBA Lba\r | |
bf231ea6 | 84 | );\r |
fb3df220 | 85 | \r |
fb3df220 | 86 | \r |
bf231ea6 A |
87 | /** |
88 | Retrieves attributes, insures positive polarity of attribute bits, returns\r | |
89 | resulting attributes in output parameter\r | |
90 | ||
91 | @param[in] Instance The FV instance | |
92 | @param[out] Attributes The FV instance whose attributes is going to be \r | |
93 | returned | |
94 | ||
95 | @retval EFI_EFI_SUCCESS Valid Attributes were returned | |
96 | @retval EFI_INVALID_PARAMETER invalid parameter | |
97 | ||
98 | **/\r | |
fb3df220 | 99 | EFI_STATUS\r |
100 | EfiFvbGetVolumeAttributes (\r | |
101 | IN UINTN Instance,\r | |
102 | OUT EFI_FVB_ATTRIBUTES *Attributes\r | |
bf231ea6 | 103 | );\r |
fb3df220 | 104 | \r |
fb3df220 | 105 | \r |
bf231ea6 A |
106 | /** |
107 | Modifies the current settings of the firmware volume according to the \r | |
108 | input parameter, and returns the new setting of the volume\r | |
109 | ||
110 | @param[in] Instance The FV instance | |
111 | @param[in] Attributes On input, it is a pointer to EFI_FVB_ATTRIBUTES \r | |
112 | containing the desired firmware volume settings.\r | |
113 | On successful return, it contains the new settings\r | |
114 | of the firmware volume | |
115 | ||
116 | @retval EFI_EFI_SUCCESS Attributes were updated | |
117 | @retval EFI_INVALID_PARAMETER invalid parameter | |
118 | ||
119 | **/\r | |
fb3df220 | 120 | EFI_STATUS\r |
121 | EfiFvbSetVolumeAttributes (\r | |
d3a58e2d | 122 | IN UINTN Instance,\r |
123 | IN OUT EFI_FVB_ATTRIBUTES *Attributes\r | |
bf231ea6 | 124 | );\r |
fb3df220 | 125 | \r |
fb3df220 | 126 | \r |
bf231ea6 A |
127 | /** |
128 | Retrieves the physical address of a memory mapped FV\r | |
129 | ||
130 | @param[in] Instance The FV instance | |
131 | @param[out] BaseAddress Pointer to a caller allocated EFI_PHYSICAL_ADDRESS \r | |
132 | that on successful return, contains the base address\r | |
133 | of the firmware volume. | |
134 | ||
135 | @retval EFI_EFI_SUCCESS BaseAddress was returned | |
136 | @retval EFI_INVALID_PARAMETER invalid parameter | |
137 | ||
138 | **/\r | |
fb3df220 | 139 | EFI_STATUS\r |
140 | EfiFvbGetPhysicalAddress (\r | |
141 | IN UINTN Instance,\r | |
142 | OUT EFI_PHYSICAL_ADDRESS *BaseAddress\r | |
bf231ea6 | 143 | );\r |
fb3df220 | 144 | \r |
fb3df220 | 145 | \r |
bf231ea6 A |
146 | /** |
147 | Retrieve the size of a logical block\r | |
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\r | |
152 | the size of the block is returned | |
153 | @param[out] NumOfBlocks a pointer to a caller allocated UINTN in which the\r | |
154 | number of consecutive blocks starting with Lba is\r | |
155 | returned. All blocks in this range have a size of\r | |
156 | BlockSize | |
157 | ||
158 | @retval EFI_EFI_SUCCESS BlockSize and NumOfBlocks returned | |
159 | @retval EFI_INVALID_PARAMETER invalid parameter | |
160 | ||
161 | **/\r | |
fb3df220 | 162 | EFI_STATUS\r |
163 | EfiFvbGetBlockSize (\r | |
164 | IN UINTN Instance,\r | |
165 | IN EFI_LBA Lba,\r | |
166 | OUT UINTN *BlockSize,\r | |
167 | OUT UINTN *NumOfBlocks\r | |
bf231ea6 | 168 | );\r |
fb3df220 | 169 | \r |
fb3df220 | 170 | \r |
bf231ea6 A |
171 | /** |
172 | Erases and initializes a specified range of a firmware volume\r | |
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 \r | |
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\r | |
184 | ||
185 | **/\r | |
fb3df220 | 186 | EFI_STATUS\r |
187 | EfiFvbEraseCustomBlockRange (\r | |
188 | IN UINTN Instance,\r | |
189 | IN EFI_LBA StartLba,\r | |
190 | IN UINTN OffsetStartLba,\r | |
191 | IN EFI_LBA LastLba,\r | |
192 | IN UINTN OffsetLastLba\r | |
bf231ea6 | 193 | );\r |
fb3df220 | 194 | \r |
195 | #endif\r |