On 9/2/25 08:34, Paolo Bonzini wrote:
On 2/6/25 19:18, Philippe Mathieu-Daudé wrote:
"cpu.h" is target-specific. Definitions which can be used
by hw/ code when building QOM blocks can be in "cpu-qom.h",
which is target-agnostic.

Move the MISA bits (removing the pointless target_ulong cast)
and the IRQ index definitions.

This seems wrong.  Why not move from cpu.h to cpu_bits.h, and include that?

Because of ...


Paolo

Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
  target/riscv/cpu-qom.h  | 40 ++++++++++++++++++++++++++++++++++++++++
  target/riscv/cpu.h      | 24 ------------------------
  target/riscv/cpu_bits.h | 15 ---------------
  3 files changed, 40 insertions(+), 39 deletions(-)


diff --git a/target/riscv/cpu_bits.h b/target/riscv/cpu_bits.h
index f97c48a3943..80701bc77fe 100644
--- a/target/riscv/cpu_bits.h
+++ b/target/riscv/cpu_bits.h
@@ -720,21 +720,6 @@ typedef enum RISCVException {
  #define RISCV_EXCP_INT_FLAG                0x80000000
  #define RISCV_EXCP_INT_MASK                0x7fffffff
-/* Interrupt causes */
-#define IRQ_U_SOFT                         0
-#define IRQ_S_SOFT                         1
-#define IRQ_VS_SOFT                        2
-#define IRQ_M_SOFT                         3
-#define IRQ_U_TIMER                        4
-#define IRQ_S_TIMER                        5
-#define IRQ_VS_TIMER                       6
-#define IRQ_M_TIMER                        7
-#define IRQ_U_EXT                          8
-#define IRQ_S_EXT                          9
-#define IRQ_VS_EXT                         10
-#define IRQ_M_EXT                          11
-#define IRQ_S_GEXT                         12
-#define IRQ_PMU_OVF                        13
  #define IRQ_LOCAL_MAX                      64
  /* -1 is due to bit zero of hgeip and hgeie being ROZ. */
  #define IRQ_LOCAL_GUEST_MAX                (TARGET_LONG_BITS - 1)

... this TARGET_LONG_BITS use in cpu_bits.h.

and:

target/riscv/cpu_bits.h:1070:44: error: attempt to use a poisoned identifier
 1070 | #define CPU_INTERRUPT_RNMI                 CPU_INTERRUPT_TGT_EXT_0
      |                                            ^

But I got your idea and will only move these 2 to "cpu.h".

Reply via email to