[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 13/15] target/riscv: cpu_helper: Remove compile time XLEN chec
From: |
Alistair Francis |
Subject: |
[PATCH v2 13/15] target/riscv: cpu_helper: Remove compile time XLEN checks |
Date: |
Tue, 8 Dec 2020 14:56:44 -0800 |
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
target/riscv/cpu_helper.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index a2787b1d48..1fc9273cea 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -446,11 +446,13 @@ restart:
return TRANSLATE_PMP_FAIL;
}
-#if defined(TARGET_RISCV32)
- target_ulong pte = address_space_ldl(cs->as, pte_addr, attrs, &res);
-#elif defined(TARGET_RISCV64)
- target_ulong pte = address_space_ldq(cs->as, pte_addr, attrs, &res);
-#endif
+ target_ulong pte;
+ if (riscv_cpu_is_32bit(env)) {
+ pte = address_space_ldl(cs->as, pte_addr, attrs, &res);
+ } else {
+ pte = address_space_ldq(cs->as, pte_addr, attrs, &res);
+ }
+
if (res != MEMTX_OK) {
return TRANSLATE_FAIL;
}
--
2.29.2
- Re: [PATCH v2 09/15] target/riscv: fpu_helper: Match function defs in HELPER macros, (continued)
- [PATCH v2 11/15] target/riscv: Specify the XLEN for CPUs, Alistair Francis, 2020/12/08
- [PATCH v2 10/15] target/riscv: Add a riscv_cpu_is_32bit() helper function, Alistair Francis, 2020/12/08
- [PATCH v2 12/15] target/riscv: cpu: Remove compile time XLEN checks, Alistair Francis, 2020/12/08
- [PATCH v2 13/15] target/riscv: cpu_helper: Remove compile time XLEN checks,
Alistair Francis <=
- [PATCH v2 14/15] target/riscv: csr: Remove compile time XLEN checks, Alistair Francis, 2020/12/08
- [PATCH v2 15/15] target/riscv: cpu: Set XLEN independently from target, Alistair Francis, 2020/12/08
- Re: [PATCH v2 00/15] RISC-V: Start to remove xlen preprocess, Palmer Dabbelt, 2020/12/14