Skip to content

Commit 3820602

Browse files
committed
target/riscv: Remove the hardcoded RVXLEN macro
Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Message-id: a07bc0c6dc4958681b4f93cbc5d0acc31ed3344a.1619234854.git.alistair.francis@wdc.com
1 parent 6cfcf77 commit 3820602

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

target/riscv/cpu.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ static void set_resetvec(CPURISCVState *env, target_ulong resetvec)
147147
static void riscv_any_cpu_init(Object *obj)
148148
{
149149
CPURISCVState *env = &RISCV_CPU(obj)->env;
150-
set_misa(env, RVXLEN | RVI | RVM | RVA | RVF | RVD | RVC | RVU);
150+
#if defined(TARGET_RISCV32)
151+
set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVU);
152+
#elif defined(TARGET_RISCV64)
153+
set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVU);
154+
#endif
151155
set_priv_version(env, PRIV_VERSION_1_11_0);
152156
}
153157

target/riscv/cpu.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@
5454
#define RV32 ((target_ulong)1 << (TARGET_LONG_BITS - 2))
5555
#define RV64 ((target_ulong)2 << (TARGET_LONG_BITS - 2))
5656

57-
#if defined(TARGET_RISCV32)
58-
#define RVXLEN RV32
59-
#elif defined(TARGET_RISCV64)
60-
#define RVXLEN RV64
61-
#endif
62-
6357
#define RV(x) ((target_ulong)1 << (x - 'A'))
6458

6559
#define RVI RV('I')

0 commit comments

Comments
 (0)