Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/54341 )
Change subject: cpu/x86/smm: Fix uintptr_t type mismatches in print statements ......................................................................
cpu/x86/smm: Fix uintptr_t type mismatches in print statements
Fix the uintptr_t type mismatches of the type below:
CC ramstage/cpu/x86/smm/smm_module_loader.o src/cpu/x86/smm/smm_module_loader.c: In function 'smm_create_map': src/cpu/x86/smm/smm_module_loader.c:146:19: error: format '%zx' expects argument of type 'size_t', but argument 3 has type 'uintptr_t' {aka 'long unsigned int'} [-Werror=format=] 146 | " smbase %zx entry %zx\n", | ~~^ | | | unsigned int | %lx 147 | cpus[i].smbase, cpus[i].entry); | ~~~~~~~~~~~~~~ | | | uintptr_t {aka long unsigned int}
Fixes: afb7a814 ("cpu/x86/smm: Introduce SMM module loader version 2") Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de Change-Id: I32bff397c8a033fe34390e6c1a7dfe773707a4e8 --- M src/cpu/x86/smm/smm_module_loader.c 1 file changed, 7 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/41/54341/1
diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c index e3b8417..1a7b448 100644 --- a/src/cpu/x86/smm/smm_module_loader.c +++ b/src/cpu/x86/smm/smm_module_loader.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpi_gnvs.h> +#include <inttypes.h> #include <stdint.h> #include <string.h> #include <rmodule.h> @@ -143,10 +144,10 @@ for (i = 0; i < num_cpus; i++) { printk(BIOS_DEBUG, "CPU 0x%x\n", i); printk(BIOS_DEBUG, - " smbase %zx entry %zx\n", + " smbase %" PRIxPTR " entry %" PRIxPTR "\n", cpus[i].smbase, cpus[i].entry); printk(BIOS_DEBUG, - " ss_start %zx code_end %zx\n", + " ss_start %" PRIxPTR " code_end %" PRIxPTR "\n", cpus[i].ss_start, cpus[i].code_end); seg_count++; if (seg_count >= cpus_in_segment) { @@ -217,13 +218,13 @@ if (cpus[num_cpus].active) { if (cpus[num_cpus - 1].smbase + SMM_ENTRY_OFFSET < stack_top) { printk(BIOS_ERR, "%s: stack encroachment\n", __func__); - printk(BIOS_ERR, "%s: smbase %zx, stack_top %lx\n", + printk(BIOS_ERR, "%s: smbase %" PRIxPTR ", stack_top %lx\n", __func__, cpus[num_cpus].smbase, stack_top); return 0; } }
- printk(BIOS_INFO, "%s: smbase %zx, stack_top %lx\n", + printk(BIOS_INFO, "%s: smbase %" PRIxPTR ", stack_top %lx\n", __func__, cpus[num_cpus-1].smbase, stack_top);
/* start at 1, the first CPU stub code is already there */ @@ -231,9 +232,9 @@ for (i = 1; i < num_cpus; i++) { memcpy((int *)cpus[i].code_start, (int *)cpus[0].code_start, size); printk(BIOS_DEBUG, - "SMM Module: placing smm entry code at %zx, cpu # 0x%x\n", + "SMM Module: placing smm entry code at %" PRIxPTR ", cpu # 0x%x\n", cpus[i].code_start, i); - printk(BIOS_DEBUG, "%s: copying from %zx to %zx 0x%x bytes\n", + printk(BIOS_DEBUG, "%s: copying from %" PRIxPTR " to %" PRIxPTR " 0x%x bytes\n", __func__, cpus[0].code_start, cpus[i].code_start, size); } return 1;