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(-)

diff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h
index 8cb67b84a4..f607687384 100644
--- a/target/riscv/cpu-qom.h
+++ b/target/riscv/cpu-qom.h
@@ -1,5 +1,5 @@
  /*
- * QEMU RISC-V CPU QOM header
+ * QEMU RISC-V CPU QOM header (target agnostic)
   *
   * Copyright (c) 2023 Ventana Micro Systems Inc.
   *
@@ -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?


r~

Reply via email to