| 165 | UINT32 mFvBaseAddressNumber = 0; |
| 166 | |
| 167 | EFI_STATUS |
| 168 | ParseFvInf ( |
| 169 | IN MEMORY_FILE *InfFile, |
| 170 | OUT FV_INFO *FvInfo |
| 171 | ) |
| 172 | /*++ |
| 173 | |
| 174 | Routine Description: |
| 175 | |
| 176 | This function parses a FV.INF file and copies info into a FV_INFO structure. |
| 177 | |
| 178 | Arguments: |
| 179 | |
| 180 | InfFile Memory file image. |
| 181 | FvInfo Information read from INF file. |
| 182 | |
| 183 | Returns: |
| 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 | // |
no test coverage detected