This is an automated email from Gerrit. "Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7600
-- gerrit commit 446c8eb6fcf040b05d745ab6bde43402487629b4 Author: Antonio Borneo <borneo.anto...@gmail.com> Date: Sun Apr 9 01:31:43 2023 +0200 target: riscv: use 'ULL' suffix for long constants On 32 bit hosts, gcc should consider constants without suffix as 32 bits values. Use the suffix 'ULL' to guarantee it is a 64 bit. Detected through 'sparse' tool. Change-Id: I9af3d3a6e8cd878034e38263114479049fe707cf Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com> diff --git a/src/target/riscv/encoding.h b/src/target/riscv/encoding.h index c2da4e6767..5e2d13b859 100644 --- a/src/target/riscv/encoding.h +++ b/src/target/riscv/encoding.h @@ -30,13 +30,13 @@ #define MSTATUS_TW 0x00200000 #define MSTATUS_TSR 0x00400000 #define MSTATUS32_SD 0x80000000 -#define MSTATUS_UXL 0x0000000300000000 -#define MSTATUS_SXL 0x0000000C00000000 -#define MSTATUS_SBE 0x0000001000000000 -#define MSTATUS_MBE 0x0000002000000000 -#define MSTATUS_GVA 0x0000004000000000 -#define MSTATUS_MPV 0x0000008000000000 -#define MSTATUS64_SD 0x8000000000000000 +#define MSTATUS_UXL 0x0000000300000000ULL +#define MSTATUS_SXL 0x0000000C00000000ULL +#define MSTATUS_SBE 0x0000001000000000ULL +#define MSTATUS_MBE 0x0000002000000000ULL +#define MSTATUS_GVA 0x0000004000000000ULL +#define MSTATUS_MPV 0x0000008000000000ULL +#define MSTATUS64_SD 0x8000000000000000ULL #define MSTATUSH_SBE 0x00000010 #define MSTATUSH_MBE 0x00000020 @@ -55,10 +55,10 @@ #define SSTATUS_SUM 0x00040000 #define SSTATUS_MXR 0x00080000 #define SSTATUS32_SD 0x80000000 -#define SSTATUS_UXL 0x0000000300000000 -#define SSTATUS64_SD 0x8000000000000000 +#define SSTATUS_UXL 0x0000000300000000ULL +#define SSTATUS64_SD 0x8000000000000000ULL -#define HSTATUS_VSXL 0x300000000 +#define HSTATUS_VSXL 0x300000000ULL #define HSTATUS_VTSR 0x00400000 #define HSTATUS_VTW 0x00200000 #define HSTATUS_VTVM 0x00100000 @@ -156,28 +156,28 @@ #define MENVCFG_CBIE 0x00000030 #define MENVCFG_CBCFE 0x00000040 #define MENVCFG_CBZE 0x00000080 -#define MENVCFG_PBMTE 0x4000000000000000 -#define MENVCFG_STCE 0x8000000000000000 +#define MENVCFG_PBMTE 0x4000000000000000ULL +#define MENVCFG_STCE 0x8000000000000000ULL #define MENVCFGH_PBMTE 0x40000000 #define MENVCFGH_STCE 0x80000000 #define MSTATEEN0_CS 0x00000001 #define MSTATEEN0_FCSR 0x00000002 -#define MSTATEEN0_HCONTEXT 0x0200000000000000 -#define MSTATEEN0_HENVCFG 0x4000000000000000 -#define MSTATEEN_HSTATEEN 0x8000000000000000 +#define MSTATEEN0_HCONTEXT 0x0200000000000000ULL +#define MSTATEEN0_HENVCFG 0x4000000000000000ULL +#define MSTATEEN_HSTATEEN 0x8000000000000000ULL #define MSTATEEN0H_HCONTEXT 0x02000000 #define MSTATEEN0H_HENVCFG 0x40000000 #define MSTATEENH_HSTATEEN 0x80000000 -#define MHPMEVENT_VUINH 0x0400000000000000 -#define MHPMEVENT_VSINH 0x0800000000000000 -#define MHPMEVENT_UINH 0x1000000000000000 -#define MHPMEVENT_SINH 0x2000000000000000 -#define MHPMEVENT_MINH 0x4000000000000000 -#define MHPMEVENT_OF 0x8000000000000000 +#define MHPMEVENT_VUINH 0x0400000000000000ULL +#define MHPMEVENT_VSINH 0x0800000000000000ULL +#define MHPMEVENT_UINH 0x1000000000000000ULL +#define MHPMEVENT_SINH 0x2000000000000000ULL +#define MHPMEVENT_MINH 0x4000000000000000ULL +#define MHPMEVENT_OF 0x8000000000000000ULL #define MHPMEVENTH_VUINH 0x04000000 #define MHPMEVENTH_VSINH 0x08000000 @@ -198,9 +198,9 @@ #define HSTATEEN0_CS 0x00000001 #define HSTATEEN0_FCSR 0x00000002 -#define HSTATEEN0_SCONTEXT 0x0200000000000000 -#define HSTATEEN0_SENVCFG 0x4000000000000000 -#define HSTATEEN_SSTATEEN 0x8000000000000000 +#define HSTATEEN0_SCONTEXT 0x0200000000000000ULL +#define HSTATEEN0_SENVCFG 0x4000000000000000ULL +#define HSTATEEN_SSTATEEN 0x8000000000000000ULL #define HSTATEEN0H_SCONTEXT 0x02000000 #define HSTATEEN0H_SENVCFG 0x40000000 @@ -229,9 +229,9 @@ #define SATP32_MODE 0x80000000 #define SATP32_ASID 0x7FC00000 #define SATP32_PPN 0x003FFFFF -#define SATP64_MODE 0xF000000000000000 -#define SATP64_ASID 0x0FFFF00000000000 -#define SATP64_PPN 0x00000FFFFFFFFFFF +#define SATP64_MODE 0xF000000000000000ULL +#define SATP64_ASID 0x0FFFF00000000000ULL +#define SATP64_PPN 0x00000FFFFFFFFFFFULL #define SATP_MODE_OFF 0 #define SATP_MODE_SV32 1 @@ -244,9 +244,9 @@ #define HGATP32_VMID 0x1FC00000 #define HGATP32_PPN 0x003FFFFF -#define HGATP64_MODE 0xF000000000000000 -#define HGATP64_VMID 0x03FFF00000000000 -#define HGATP64_PPN 0x00000FFFFFFFFFFF +#define HGATP64_MODE 0xF000000000000000ULL +#define HGATP64_VMID 0x03FFF00000000000ULL +#define HGATP64_PPN 0x00000FFFFFFFFFFFULL #define HGATP_MODE_OFF 0 #define HGATP_MODE_SV32X4 1 @@ -291,10 +291,10 @@ #define PTE_A 0x040 /* Accessed */ #define PTE_D 0x080 /* Dirty */ #define PTE_SOFT 0x300 /* Reserved for Software */ -#define PTE_RSVD 0x1FC0000000000000 /* Reserved for future standard use */ -#define PTE_PBMT 0x6000000000000000 /* Svpbmt: Page-based memory types */ -#define PTE_N 0x8000000000000000 /* Svnapot: NAPOT translation contiguity */ -#define PTE_ATTR 0xFFC0000000000000 /* All attributes and reserved bits */ +#define PTE_RSVD 0x1FC0000000000000ULL /* Reserved for future standard use */ +#define PTE_PBMT 0x6000000000000000ULL /* Svpbmt: Page-based memory types */ +#define PTE_N 0x8000000000000000ULL /* Svnapot: NAPOT translation contiguity */ +#define PTE_ATTR 0xFFC0000000000000ULL /* All attributes and reserved bits */ #define PTE_PPN_SHIFT 10 --