On 13/10/23 06:13, Richard Henderson wrote:
On 10/10/23 02:28, Philippe Mathieu-Daudé wrote:
TYPE_RISCV_CPU_BASE depends on the TARGET_RISCV32/TARGET_RISCV64
definitions which are target specific. Such target specific
definition taints "cpu-qom.h".
Since "cpu-qom.h" must be target agnostic, remove its target
specific definition uses by inlining TYPE_RISCV_CPU_BASE in the
two machines using it.
"target/riscv/cpu-qom.h" is now fully target agnostic.
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
target/riscv/cpu-qom.h | 8 +-------
hw/riscv/spike.c | 8 +++++++-
hw/riscv/virt.c | 8 +++++++-
3 files changed, 15 insertions(+), 9 deletions(-)
@@ -43,12 +43,6 @@
#define TYPE_RISCV_CPU_VEYRON_V1
RISCV_CPU_TYPE_NAME("veyron-v1")
#define TYPE_RISCV_CPU_HOST RISCV_CPU_TYPE_NAME("host")
-#if defined(TARGET_RISCV32)
-# define TYPE_RISCV_CPU_BASE TYPE_RISCV_CPU_BASE32
-#elif defined(TARGET_RISCV64)
-# define TYPE_RISCV_CPU_BASE TYPE_RISCV_CPU_BASE64
-#endif
Move to cpu.h (or elsewhere) instead of replicating in two hw/ files?
Yes, better.