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