summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/riscv/include/mcall.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/arch/riscv/include/mcall.h b/src/arch/riscv/include/mcall.h
index 803ee3e66b..b0b4bc768b 100644
--- a/src/arch/riscv/include/mcall.h
+++ b/src/arch/riscv/include/mcall.h
@@ -54,10 +54,10 @@ _Static_assert(
sizeof(hls_t) == HLS_SIZE,
"HLS_SIZE must equal to sizeof(hls_t)");
+register uintptr_t 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))