Attention is currently required from: Philipp Hug, Arthur Heymans, ron minnich. Hello Arthur Heymans,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/63072
to review the following change.
Change subject: arch/riscv/mcall.h: Fix building with clang ......................................................................
arch/riscv/mcall.h: Fix building with clang
Having multiple statements hidden inside a macro that supposedly returns a pointer does not work well with clang. Moving the stack register to a global variable fixes this.
Change-Id: If24b2766404b892a006926f0cd45771ceebf1275 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/riscv/include/mcall.h 1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/72/63072/1
diff --git a/src/arch/riscv/include/mcall.h b/src/arch/riscv/include/mcall.h index 803ee3e..12483ca 100644 --- a/src/arch/riscv/include/mcall.h +++ b/src/arch/riscv/include/mcall.h @@ -54,9 +54,10 @@ sizeof(hls_t) == HLS_SIZE, "HLS_SIZE must equal to sizeof(hls_t)");
-#define MACHINE_STACK_TOP() ({ \ +register uintptr_t sp asm("sp"); + +#define MACHINE_STACK_TOP() ({ \ /* coverity[uninit_use] : FALSE */ \ - register uintptr_t sp asm ("sp"); \ (void*)((sp + RISCV_PGSIZE) & -RISCV_PGSIZE); })
// hart-local storage, at top of stack