MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / ParseFvInf

Function ParseFvInf

BaseTools/Source/C/GenFv/GenFvInternalLib.c:167–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165UINT32 mFvBaseAddressNumber = 0;
166
167EFI_STATUS
168ParseFvInf (
169 IN MEMORY_FILE *InfFile,
170 OUT FV_INFO *FvInfo
171 )
172/*++
173
174Routine Description:
175
176 This function parses a FV.INF file and copies info into a FV_INFO structure.
177
178Arguments:
179
180 InfFile Memory file image.
181 FvInfo Information read from INF file.
182
183Returns:
184
185 EFI_SUCCESS INF file information successfully retrieved.
186 EFI_ABORTED INF file has an invalid format.
187 EFI_NOT_FOUND A required string was not found in the INF file.
188--*/
189{
190 CHAR8 Value[MAX_LONG_FILE_PATH];
191 UINT64 Value64;
192 UINTN Index;
193 UINTN Number;
194 EFI_STATUS Status;
195 EFI_GUID GuidValue;
196
197 //
198 // Read the FV base address
199 //
200 if (!mFvDataInfo.BaseAddressSet) {
201 Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_FV_BASE_ADDRESS_STRING, 0, Value);
202 if (Status == EFI_SUCCESS) {
203 //
204 // Get the base address
205 //
206 Status = AsciiStringToUint64 (Value, FALSE, &Value64);
207 if (EFI_ERROR (Status)) {
208 Error (NULL, 0, 2000, "Invalid parameter", "%s = %s", EFI_FV_BASE_ADDRESS_STRING, Value);
209 return EFI_ABORTED;
210 }
211 DebugMsg (NULL, 0, 9, "rebase address", "%s = %s", EFI_FV_BASE_ADDRESS_STRING, Value);
212
213 FvInfo->BaseAddress = Value64;
214 FvInfo->BaseAddressSet = TRUE;
215 }
216 }
217
218 //
219 // Read the FV File System Guid
220 //
221 if (!FvInfo->FvFileSystemGuidSet) {
222 Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_FV_FILESYSTEMGUID_STRING, 0, Value);
223 if (Status == EFI_SUCCESS) {
224 //

Callers 1

GenerateFvImageFunction · 0.85

Calls 9

FindTokenFunction · 0.85
AsciiStringToUint64Function · 0.85
DebugMsgFunction · 0.85
StringToGuidFunction · 0.85
ErrorFunction · 0.50
memcpyFunction · 0.50
strcpyFunction · 0.50
strcmpFunction · 0.50
WarningFunction · 0.50

Tested by

no test coverage detected