[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 01/10] target/riscv: Remove the hardcoded RVXLEN macro
From: |
Alistair Francis |
Subject: |
[PATCH v3 01/10] target/riscv: Remove the hardcoded RVXLEN macro |
Date: |
Sat, 24 Apr 2021 13:28:33 +1000 |
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>
---
target/riscv/cpu.h | 6 ------
target/riscv/cpu.c | 6 +++++-
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index add734bbbd..7e879fb9ca 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -54,12 +54,6 @@
#define RV32 ((target_ulong)1 << (TARGET_LONG_BITS - 2))
#define RV64 ((target_ulong)2 << (TARGET_LONG_BITS - 2))
-#if defined(TARGET_RISCV32)
-#define RVXLEN RV32
-#elif defined(TARGET_RISCV64)
-#define RVXLEN RV64
-#endif
-
#define RV(x) ((target_ulong)1 << (x - 'A'))
#define RVI RV('I')
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 04ac03f8c9..3191fd0082 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -147,7 +147,11 @@ static void set_resetvec(CPURISCVState *env, target_ulong
resetvec)
static void riscv_any_cpu_init(Object *obj)
{
CPURISCVState *env = &RISCV_CPU(obj)->env;
- set_misa(env, RVXLEN | RVI | RVM | RVA | RVF | RVD | RVC | RVU);
+#if defined(TARGET_RISCV32)
+ set_misa(env, RV32 | RVI | RVM | RVA | RVF | RVD | RVC | RVU);
+#elif defined(TARGET_RISCV64)
+ set_misa(env, RV64 | RVI | RVM | RVA | RVF | RVD | RVC | RVU);
+#endif
set_priv_version(env, PRIV_VERSION_1_11_0);
}
--
2.31.1
- [PATCH v3 00/10] RISC-V: Steps towards running 32-bit guests on, Alistair Francis, 2021/04/23
- [PATCH v3 01/10] target/riscv: Remove the hardcoded RVXLEN macro,
Alistair Francis <=
- [PATCH v3 02/10] target/riscv: Remove the hardcoded SSTATUS_SD macro, Alistair Francis, 2021/04/23
- [PATCH v3 03/10] target/riscv: Remove the hardcoded HGATP_MODE macro, Alistair Francis, 2021/04/23
- [PATCH v3 04/10] target/riscv: Remove the hardcoded MSTATUS_SD macro, Alistair Francis, 2021/04/23
- [PATCH v3 05/10] target/riscv: Remove the hardcoded SATP_MODE macro, Alistair Francis, 2021/04/23
- [PATCH v3 06/10] target/riscv: Remove the unused HSTATUS_WPRI macro, Alistair Francis, 2021/04/23
- [PATCH v3 07/10] target/riscv: Remove an unused CASE_OP_32_64 macro, Alistair Francis, 2021/04/23
- [PATCH v3 08/10] target/riscv: Consolidate RV32/64 32-bit instructions, Alistair Francis, 2021/04/23