diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2022-11-12 01:52:52 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-11-14 18:53:34 +0000 |
commit | e2949b7c9c2d75589449547387c35dd1f3b11403 (patch) | |
tree | 7b945c6c75861179084c8054e272df131374fe5c /src/drivers | |
parent | 2516947fd95c771295abbb53f5a856535d96dcff (diff) |
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>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/intel/fsp2_0/hand_off_block.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c index 2738c78988..2ded336994 100644 --- a/src/drivers/intel/fsp2_0/hand_off_block.c +++ b/src/drivers/intel/fsp2_0/hand_off_block.c @@ -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; } |