[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/60] target/riscv: Move TYPE_RISCV_CPU_BASE definition to 'cpu.h
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 18/60] target/riscv: Move TYPE_RISCV_CPU_BASE definition to 'cpu.h' |
Date: |
Mon, 6 Nov 2023 12:02:50 +0100 |
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 moving TYPE_RISCV_CPU_BASE to
"target/riscv/cpu.h".
"target/riscv/cpu-qom.h" is now fully target agnostic.
Add a comment clarifying that in the header.
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20231013140116.255-12-philmd@linaro.org>
---
target/riscv/cpu-qom.h | 8 +-------
target/riscv/cpu.h | 6 ++++++
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h
index b78169093f..76efb614a6 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.
*
@@ -44,12 +44,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
-
typedef struct CPUArchState CPURISCVState;
OBJECT_DECLARE_CPU_TYPE(RISCVCPU, RISCVCPUClass, RISCV_CPU)
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 144cc94cce..d832696418 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -34,6 +34,12 @@
#define CPU_RESOLVING_TYPE TYPE_RISCV_CPU
+#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
+
#define TCG_GUEST_DEFAULT_MO 0
/*
--
2.41.0
- [PULL 08/60] target: Unify QOM style, (continued)
- [PULL 08/60] target: Unify QOM style, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 09/60] target: Mention 'cpu-qom.h' is target agnostic, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 10/60] target/arm: Move internal declarations from 'cpu-qom.h' to 'cpu.h', Philippe Mathieu-Daudé, 2023/11/06
- [PULL 11/60] target/ppc: Remove CPU_RESOLVING_TYPE from 'cpu-qom.h', Philippe Mathieu-Daudé, 2023/11/06
- [PULL 12/60] target/riscv: Remove CPU_RESOLVING_TYPE from 'cpu-qom.h', Philippe Mathieu-Daudé, 2023/11/06
- [PULL 13/60] target: Declare FOO_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h', Philippe Mathieu-Daudé, 2023/11/06
- [PULL 14/60] target/hexagon: Declare QOM definitions in 'cpu-qom.h', Philippe Mathieu-Daudé, 2023/11/06
- [PULL 15/60] target/loongarch: Declare QOM definitions in 'cpu-qom.h', Philippe Mathieu-Daudé, 2023/11/06
- [PULL 16/60] target/nios2: Declare QOM definitions in 'cpu-qom.h', Philippe Mathieu-Daudé, 2023/11/06
- [PULL 17/60] target/openrisc: Declare QOM definitions in 'cpu-qom.h', Philippe Mathieu-Daudé, 2023/11/06
- [PULL 18/60] target/riscv: Move TYPE_RISCV_CPU_BASE definition to 'cpu.h',
Philippe Mathieu-Daudé <=
- [PULL 19/60] target/ppc: Use env_archcpu() in helper_book3s_msgsndp(), Philippe Mathieu-Daudé, 2023/11/06
- [PULL 20/60] target/riscv: Use env_archcpu() in [check_]nanbox(), Philippe Mathieu-Daudé, 2023/11/06
- [PULL 23/60] target/i386/hvf: Use x86_cpu in simulate_[rdmsr|wrmsr](), Philippe Mathieu-Daudé, 2023/11/06
- [PULL 24/60] target/i386/hvf: Use env_archcpu() in simulate_[rdmsr/wrmsr](), Philippe Mathieu-Daudé, 2023/11/06
- [PULL 26/60] target/i386/hvf: Rename 'CPUState *cpu' variable as 'cs', Philippe Mathieu-Daudé, 2023/11/06
- [PULL 21/60] target/s390x: Use env_archcpu() in handle_diag_308(), Philippe Mathieu-Daudé, 2023/11/06
- [PULL 27/60] target/i386/hvf: Rename 'X86CPU *x86_cpu' variable as 'cpu', Philippe Mathieu-Daudé, 2023/11/06
- [PULL 22/60] target/xtensa: Use env_archcpu() in update_c[compare|count](), Philippe Mathieu-Daudé, 2023/11/06
- [PULL 29/60] target/i386/monitor: synchronize cpu state for lapic info, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 25/60] target/i386/hvf: Use CPUState typedef, Philippe Mathieu-Daudé, 2023/11/06