Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47294 )
Change subject: soc/intel/xeon_sp: Look up the IIO_HOB only once ......................................................................
soc/intel/xeon_sp: Look up the IIO_HOB only once
The HOB does not move, place its location in .bss.
Change-Id: I2c6dbe4d64138e45fa1dfe7580ffa70d0441bd88 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/soc/intel/xeon_sp/cpx/soc_util.c 1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/47294/1
diff --git a/src/soc/intel/xeon_sp/cpx/soc_util.c b/src/soc/intel/xeon_sp/cpx/soc_util.c index de6d852..dbaf5d8 100644 --- a/src/soc/intel/xeon_sp/cpx/soc_util.c +++ b/src/soc/intel/xeon_sp/cpx/soc_util.c @@ -78,9 +78,12 @@ const IIO_UDS *get_iio_uds(void) { size_t hob_size; - const IIO_UDS *hob; + static const IIO_UDS *hob; const uint8_t fsp_hob_iio_universal_data_guid[16] = FSP_HOB_IIO_UNIVERSAL_DATA_GUID;
+ if (hob != NULL) + return hob; + hob = fsp_find_extension_hob_by_guid(fsp_hob_iio_universal_data_guid, &hob_size); assert(hob != NULL && hob_size != 0); return hob;
Marc Jones has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47294 )
Change subject: soc/intel/xeon_sp: Look up the IIO_HOB only once ......................................................................
Patch Set 1: Code-Review+2
Hello Marc Jones, build bot (Jenkins), Jonathan Zhang, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47294
to look at the new patch set (#2).
Change subject: soc/intel/xeon_sp: Look up the IIO_HOB only once ......................................................................
soc/intel/xeon_sp: Look up the IIO_HOB only once
The HOB does not move, place its location in .bss.
Change-Id: I2c6dbe4d64138e45fa1dfe7580ffa70d0441bd88 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/soc/intel/xeon_sp/util.c 1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/47294/2
Marc Jones has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47294 )
Change subject: soc/intel/xeon_sp: Look up the IIO_HOB only once ......................................................................
Patch Set 2: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47294 )
Change subject: soc/intel/xeon_sp: Look up the IIO_HOB only once ......................................................................
soc/intel/xeon_sp: Look up the IIO_HOB only once
The HOB does not move, place its location in .bss.
Change-Id: I2c6dbe4d64138e45fa1dfe7580ffa70d0441bd88 Signed-off-by: Arthur Heymans arthur@aheymans.xyz Reviewed-on: https://review.coreboot.org/c/coreboot/+/47294 Reviewed-by: Marc Jones marc@marcjonesconsulting.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/intel/xeon_sp/util.c 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Marc Jones: Looks good to me, approved
diff --git a/src/soc/intel/xeon_sp/util.c b/src/soc/intel/xeon_sp/util.c index feacca4..75f8a8a 100644 --- a/src/soc/intel/xeon_sp/util.c +++ b/src/soc/intel/xeon_sp/util.c @@ -105,9 +105,12 @@ const IIO_UDS *get_iio_uds(void) { size_t hob_size; - const IIO_UDS *hob; + static const IIO_UDS *hob; const uint8_t fsp_hob_iio_universal_data_guid[16] = FSP_HOB_IIO_UNIVERSAL_DATA_GUID;
+ if (hob != NULL) + return hob; + hob = fsp_find_extension_hob_by_guid(fsp_hob_iio_universal_data_guid, &hob_size); assert(hob != NULL && hob_size != 0); return hob;