drv/intel/fsp2_0/hand_off_block: rework fsp_find_extension_hob_by_guid

Use the new fsp_hob_iterator_get_next_guid_extension function in
fsp_find_extension_hob_by_guid instead of iterating through the HOB list
in this function.

TEST=AMD_FSP_DMI_HOB is still found and the same type 17 DMI info is
printed on the console.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I4d4ce14c8a5494763de3f65ed049f98a768c40a5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69478
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Felix Held 2022-11-12 01:52:52 +01:00
parent 2516947fd9
commit e2949b7c9c
1 changed files with 5 additions and 13 deletions

View File

@ -233,22 +233,14 @@ void fsp_find_reserved_memory(struct range_entry *re)
const void *fsp_find_extension_hob_by_guid(const uint8_t *guid, size_t *size)
{
const uint8_t *hob_guid;
const struct hob_header *hob = fsp_get_hob_list();
const struct hob_header *hob_iterator;
const void *hob_guid;
if (!hob)
if (fsp_hob_iterator_init(&hob_iterator) != CB_SUCCESS)
return NULL;
for (; hob->type != HOB_TYPE_END_OF_HOB_LIST; hob = fsp_next_hob(hob)) {
if (hob->type != HOB_TYPE_GUID_EXTENSION)
continue;
hob_guid = hob_header_to_struct(hob);
if (fsp_guid_compare(hob_guid, guid)) {
*size = hob->length - (HOB_HEADER_LEN + 16);
return hob_header_to_extension_hob(hob);
}
}
if (fsp_hob_iterator_get_next_guid_extension(&hob_iterator, guid, &hob_guid, size) == CB_SUCCESS)
return hob_guid;
return NULL;
}