[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 01/10] target/riscv: introduce riscv_cpu_cfg()
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v7 01/10] target/riscv: introduce riscv_cpu_cfg() |
Date: |
Wed, 22 Feb 2023 15:51:56 -0300 |
We're going to do changes that requires accessing the RISCVCPUConfig
struct from the RISCVCPU, having access only to a CPURISCVState 'env'
pointer. Add a helper to make the code easier to read.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
target/riscv/cpu.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 7128438d8e..215423499e 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -654,6 +654,11 @@ static inline RISCVMXL riscv_cpu_mxl(CPURISCVState *env)
#endif
#define riscv_cpu_mxl_bits(env) (1UL << (4 + riscv_cpu_mxl(env)))
+static inline const RISCVCPUConfig *riscv_cpu_cfg(CPURISCVState *env)
+{
+ return &env_archcpu(env)->cfg;
+}
+
#if defined(TARGET_RISCV32)
#define cpu_recompute_xl(env) ((void)(env), MXL_RV32)
#else
--
2.39.2
- [PATCH v7 00/10] make write_misa a no-op and FEATURE_* cleanups, Daniel Henrique Barboza, 2023/02/22
- [PATCH v7 01/10] target/riscv: introduce riscv_cpu_cfg(),
Daniel Henrique Barboza <=
- [PATCH v7 02/10] target/riscv: do not mask unsupported QEMU extensions in write_misa(), Daniel Henrique Barboza, 2023/02/22
- [PATCH v7 03/10] target/riscv: allow MISA writes as experimental, Daniel Henrique Barboza, 2023/02/22
- Re: [PATCH v7 03/10] target/riscv: allow MISA writes as experimental, liweiwei, 2023/02/22
- Re: [PATCH v7 03/10] target/riscv: allow MISA writes as experimental, Andrew Jones, 2023/02/23
- Re: [PATCH v7 03/10] target/riscv: allow MISA writes as experimental, Bin Meng, 2023/02/28
- Re: [PATCH v7 03/10] target/riscv: allow MISA writes as experimental, liweiwei, 2023/02/28
- Re: [PATCH v7 03/10] target/riscv: allow MISA writes as experimental, LIU Zhiwei, 2023/02/28
- [PATCH v7 04/10] target/riscv: remove RISCV_FEATURE_DEBUG, Daniel Henrique Barboza, 2023/02/22
- [PATCH v7 05/10] target/riscv/cpu.c: error out if EPMP is enabled without PMP, Daniel Henrique Barboza, 2023/02/22
- [PATCH v7 06/10] target/riscv: remove RISCV_FEATURE_EPMP, Daniel Henrique Barboza, 2023/02/22