Attention is currently required from: Philipp Hug, ron minnich.
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74570 )
Change subject: arch/risc/mcall.h: Make the stack pointer global ......................................................................
arch/risc/mcall.h: Make the stack pointer global
Clang complains about the stack pointer register variable being uninitialized. This can remediated by making the variable global. Change to be more unambiguous.
Change-Id: I24602372833aa9d413bf396853b223263fd873ed Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/riscv/include/mcall.h 1 file changed, 17 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/74570/1
diff --git a/src/arch/riscv/include/mcall.h b/src/arch/riscv/include/mcall.h index 803ee3e..bb60979 100644 --- a/src/arch/riscv/include/mcall.h +++ b/src/arch/riscv/include/mcall.h @@ -54,10 +54,11 @@ sizeof(hls_t) == HLS_SIZE, "HLS_SIZE must equal to sizeof(hls_t)");
+register unsigned long current_stack_pointer __asm__("sp"); + #define MACHINE_STACK_TOP() ({ \ /* coverity[uninit_use] : FALSE */ \ - register uintptr_t sp asm ("sp"); \ - (void*)((sp + RISCV_PGSIZE) & -RISCV_PGSIZE); }) + (void*)((current_stack_pointer + RISCV_PGSIZE) & -RISCV_PGSIZE); })
// hart-local storage, at top of stack #define HLS() ((hls_t*)(MACHINE_STACK_TOP() - HLS_SIZE))