Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/83360?usp=email )
Change subject: [wip]cbmem_entry_start: change the return value to uintptr_t ......................................................................
[wip]cbmem_entry_start: change the return value to uintptr_t
Change-Id: I0ec3ba6a16b190b2242ee693f501d0de37692eda Signed-off-by: Elyes Haouas ehaouas@noos.fr --- M src/acpi/acpi.c M src/drivers/smmstore/ramstage.c M src/include/cbmem.h M src/lib/bmp_logo.c M src/lib/cbmem_stage_cache.c M src/lib/imd_cbmem.c M tests/lib/imd_cbmem-test.c 7 files changed, 15 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/83360/1
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index 06aa038c..c7eae15 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -180,11 +180,11 @@ header->length = current - (unsigned long)mcfg; }
-static void *get_tcpa_log(u32 *size) +static uintptr_t get_tcpa_log(u32 *size) { const struct cbmem_entry *ce; const u32 tcpa_default_log_len = 0x10000; - void *lasa; + uintptr_t lasa; ce = cbmem_entry_find(CBMEM_ID_TCPA_TCG_LOG); if (ce) { lasa = cbmem_entry_start(ce); @@ -212,7 +212,7 @@
acpi_tcpa_t *tcpa = (acpi_tcpa_t *)header; u32 tcpa_log_len; - void *lasa; + uintptr_t lasa;
lasa = get_tcpa_log(&tcpa_log_len); if (!lasa) @@ -226,11 +226,11 @@ tcpa->lasa = (uintptr_t)lasa; }
-static void *get_tpm2_log(u32 *size) +static uintptr_t get_tpm2_log(u32 *size) { const struct cbmem_entry *ce; const u32 tpm2_default_log_len = 0x10000; - void *lasa; + uintptr_t lasa; ce = cbmem_entry_find(CBMEM_ID_TPM2_TCG_LOG); if (ce) { lasa = cbmem_entry_start(ce); @@ -258,7 +258,7 @@
acpi_tpm2_t *tpm2 = (acpi_tpm2_t *)header; u32 tpm2_log_len; - void *lasa; + uintptr_t lasa;
/* * Some payloads like SeaBIOS depend on log area to use TPM2. @@ -298,7 +298,7 @@ cbtable = cbmem_entry_find(CBMEM_ID_CBTABLE); if (!cbtable) return; - base = (uintptr_t)cbmem_entry_start(cbtable); + base = cbmem_entry_start(cbtable); size = cbmem_entry_size(cbtable);
acpigen_write_device("CTBL"); diff --git a/src/drivers/smmstore/ramstage.c b/src/drivers/smmstore/ramstage.c index 857fe89..e8168b6 100644 --- a/src/drivers/smmstore/ramstage.c +++ b/src/drivers/smmstore/ramstage.c @@ -27,7 +27,7 @@
store->tag = LB_TAG_SMMSTOREV2; store->size = sizeof(*store); - store->com_buffer = (uintptr_t)cbmem_entry_start(e); + store->com_buffer = cbmem_entry_start(e); store->com_buffer_size = cbmem_entry_size(e); store->mmap_addr = info.mmap_addr; store->num_blocks = info.num_blocks; diff --git a/src/include/cbmem.h b/src/include/cbmem.h index de305ae..2cc63cc 100644 --- a/src/include/cbmem.h +++ b/src/include/cbmem.h @@ -81,7 +81,7 @@ int cbmem_entry_remove(const struct cbmem_entry *entry);
/* cbmem_entry accessors to get pointer and size of a cbmem_entry. */ -void *cbmem_entry_start(const struct cbmem_entry *entry); +uintptr_t cbmem_entry_start(const struct cbmem_entry *entry); u64 cbmem_entry_size(const struct cbmem_entry *entry);
/* Returns 0 if old cbmem was recovered. Recovery is only attempted if diff --git a/src/lib/bmp_logo.c b/src/lib/bmp_logo.c index becb605..b7d2bea 100644 --- a/src/lib/bmp_logo.c +++ b/src/lib/bmp_logo.c @@ -16,9 +16,9 @@ } #endif
-void *bmp_load_logo(size_t *logo_size) +uintptr_t bmp_load_logo(size_t *logo_size) { - void *logo_buffer; + uintptr_t logo_buffer;
/* CBMEM is locked for S3 resume path. */ if (acpi_is_wakeup_s3()) diff --git a/src/lib/cbmem_stage_cache.c b/src/lib/cbmem_stage_cache.c index 5e76fb0..392b91f 100644 --- a/src/lib/cbmem_stage_cache.c +++ b/src/lib/cbmem_stage_cache.c @@ -52,7 +52,7 @@ memcpy(c, base, size); }
-void stage_cache_get_raw(int stage_id, void **base, size_t *size) +void stage_cache_get_raw(int stage_id, uintptr_t *base, size_t *size) { const struct cbmem_entry *e;
@@ -71,7 +71,7 @@ { struct stage_cache *meta; const struct cbmem_entry *e; - void *c; + uintptr_t c; size_t size; void *load_addr;
diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c index a88cf98..d76353e 100644 --- a/src/lib/imd_cbmem.c +++ b/src/lib/imd_cbmem.c @@ -186,7 +186,7 @@ return imd_entry_size(cbmem_to_imd(entry)); }
-void *cbmem_entry_start(const struct cbmem_entry *entry) +uintptr_t cbmem_entry_start(const struct cbmem_entry *entry) { return imd_entry_at(&imd, cbmem_to_imd(entry)); } diff --git a/tests/lib/imd_cbmem-test.c b/tests/lib/imd_cbmem-test.c index 6c0ba5a..3e4b969 100644 --- a/tests/lib/imd_cbmem-test.c +++ b/tests/lib/imd_cbmem-test.c @@ -343,7 +343,7 @@ /* Check pointers correctness and size for each entry */ entry1 = cbmem_entry_find(id1); assert_ptr_equal(cbm_e1, entry1); - assert_int_equal(0, (uintptr_t)cbmem_entry_start(cbm_e1) % CBMEM_SM_ALIGN); + assert_int_equal(0, cbmem_entry_start(cbm_e1) % CBMEM_SM_ALIGN); assert_int_equal(entry1_size, cbmem_entry_size(entry1));
entry2 = cbmem_entry_find(id2);