On 14/10/25 22:35, Anton Johansson wrote:
Most of these definitions save riscv_csrr, riscv_csrrw, riscv_csr_read,
riscv_csr_write are only used in target/.  Move declarations to a
separate headers which will soon be made internal to target/.

csr.h is temporarily included from cpu.h to not break includes from
outside target/, this include will be removed in the following commit.

Signed-off-by: Anton Johansson <[email protected]>
Reviewed-by: Pierrick Bouvier <[email protected]>
---
  target/riscv/cpu.h            | 82 +-----------------------------
  target/riscv/csr.h            | 94 +++++++++++++++++++++++++++++++++++
  target/riscv/cpu.c            |  1 +
  target/riscv/csr.c            |  1 +
  target/riscv/gdbstub.c        |  1 +
  target/riscv/kvm/kvm-cpu.c    |  1 +
  target/riscv/op_helper.c      |  1 +
  target/riscv/riscv-qmp-cmds.c |  1 +
  target/riscv/th_csr.c         |  1 +
  9 files changed, 102 insertions(+), 81 deletions(-)
  create mode 100644 target/riscv/csr.h


diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c
index 1934f919c0..f8d3bc0df1 100644
--- a/target/riscv/gdbstub.c
+++ b/target/riscv/gdbstub.c
@@ -20,6 +20,7 @@
  #include "exec/gdbstub.h"
  #include "gdbstub/helpers.h"
  #include "cpu.h"
+#include "csr.h"

  #include "target/riscv/csr.h"

Otherwise,

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>


Reply via email to