From 869b24c75aab2f90f2bf2ce176610396c3e678e9 Mon Sep 17 00:00:00 2001 From: Miguel Silva Date: Mon, 14 Oct 2024 16:24:45 +0100 Subject: [PATCH] fix(literal-size): Change literal from 1ULL to 1UL When compiling for RV32, the expected size of the argument used is 32-bit. Using 1ULL forces the argument to be 64-bit since shift operations take the size of the largest operand. This results in the error Werror=arith-conversion when compiling for RV32 Signed-off-by: Miguel Silva --- src/arch/riscv/inc/arch/csrs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/riscv/inc/arch/csrs.h b/src/arch/riscv/inc/arch/csrs.h index 9539028c..36072bfe 100644 --- a/src/arch/riscv/inc/arch/csrs.h +++ b/src/arch/riscv/inc/arch/csrs.h @@ -104,7 +104,7 @@ #define SSTATUS_XS_DIRTY (3ULL << SSTATUS_XS_OFF) #define SSTATUS_SUM (1ULL << 18) #define SSTATUS_MXR (1ULL << 19) -#define SSTATUS_SD (1ULL << 63) +#define SSTATUS_SD (1ULL << ((REGLEN * 8) - 1)) #define SIE_USIE (1ULL << 0) #define SIE_SSIE (1ULL << 1)