Message ID | 20230216162126.809482-3-dbarboza@ventanamicro.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | make write_misa a no-op and FEATURE_* cleanups | expand |
On 2/16/23 06:21, Daniel Henrique Barboza wrote: > +static inline RISCVCPUConfig riscv_cpu_cfg(CPURISCVState *env) > +{ > + return env_archcpu(env)->cfg; > +} This structure is 144 bytes. I don't think you want to be copying it around like that. Better to return a const pointer. r~
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 01803a020d..368a522b5b 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -653,6 +653,11 @@ static inline RISCVMXL riscv_cpu_mxl(CPURISCVState *env) #endif #define riscv_cpu_mxl_bits(env) (1UL << (4 + riscv_cpu_mxl(env))) +static inline 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