@@ -88,7 +88,7 @@ typedef enum {
#define MAX_RISCV_PMPS (16)
#if !defined(CONFIG_USER_ONLY)
-#include "pmp.h"
+#include "sysemu/pmp.h"
#include "debug.h"
#endif
similarity index 100%
rename from target/riscv/instmap.h
rename to target/riscv/sysemu/instmap.h
similarity index 100%
rename from target/riscv/kvm_riscv.h
rename to target/riscv/sysemu/kvm_riscv.h
similarity index 100%
rename from target/riscv/pmp.h
rename to target/riscv/sysemu/pmp.h
similarity index 100%
rename from target/riscv/pmu.h
rename to target/riscv/sysemu/pmu.h
similarity index 100%
rename from target/riscv/time_helper.h
rename to target/riscv/sysemu/time_helper.h
@@ -30,7 +30,7 @@
#include "hw/char/serial.h"
#include "target/riscv/cpu.h"
#include "hw/core/sysbus-fdt.h"
-#include "target/riscv/pmu.h"
+#include "target/riscv/sysemu/pmu.h"
#include "hw/riscv/riscv_hart.h"
#include "hw/riscv/virt.h"
#include "hw/riscv/boot.h"
@@ -24,10 +24,10 @@
#include "cpu.h"
#include "cpu_vendorid.h"
#ifndef CONFIG_USER_ONLY
-#include "pmu.h"
-#include "time_helper.h"
+#include "sysemu/pmu.h"
+#include "sysemu/time_helper.h"
#include "sysemu/kvm.h"
-#include "kvm_riscv.h"
+#include "sysemu/kvm_riscv.h"
#endif
#include "internals.h"
#include "exec/exec-all.h"
@@ -22,9 +22,9 @@
#include "qemu/main-loop.h"
#include "cpu.h"
#include "internals.h"
-#include "pmu.h"
+#include "sysemu/pmu.h"
#include "exec/exec-all.h"
-#include "instmap.h"
+#include "sysemu/instmap.h"
#include "tcg/tcg-op.h"
#include "trace.h"
#include "semihosting/common-semi.h"
@@ -22,8 +22,8 @@
#include "qemu/timer.h"
#include "cpu.h"
#ifndef CONFIG_USER_ONLY
-#include "pmu.h"
-#include "time_helper.h"
+#include "sysemu/pmu.h"
+#include "sysemu/time_helper.h"
#endif
#include "qemu/main-loop.h"
#include "exec/exec-all.h"
similarity index 100%
rename from target/riscv/arch_dump.c
rename to target/riscv/sysemu/arch_dump.c
similarity index 100%
rename from target/riscv/kvm-stub.c
rename to target/riscv/sysemu/kvm-stub.c
similarity index 100%
rename from target/riscv/kvm.c
rename to target/riscv/sysemu/kvm.c
similarity index 100%
rename from target/riscv/machine.c
rename to target/riscv/sysemu/machine.c
similarity index 100%
rename from target/riscv/monitor.c
rename to target/riscv/sysemu/monitor.c
similarity index 100%
rename from target/riscv/pmp.c
rename to target/riscv/sysemu/pmp.c
similarity index 100%
rename from target/riscv/pmu.c
rename to target/riscv/sysemu/pmu.c
similarity index 100%
rename from target/riscv/riscv-qmp-cmds.c
rename to target/riscv/sysemu/riscv-qmp-cmds.c
similarity index 100%
rename from target/riscv/time_helper.c
rename to target/riscv/sysemu/time_helper.c
@@ -7,6 +7,8 @@ gen = [
]
riscv_ss = ss.source_set()
+riscv_system_ss = ss.source_set()
+
riscv_ss.add(gen)
riscv_ss.add(files(
'cpu.c',
@@ -22,19 +24,12 @@ riscv_ss.add(files(
'crypto_helper.c',
'zce_helper.c'
))
-riscv_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('kvm-stub.c'))
-riscv_system_ss = ss.source_set()
riscv_system_ss.add(files(
- 'arch_dump.c',
- 'pmp.c',
'debug.c',
- 'monitor.c',
- 'machine.c',
- 'pmu.c',
- 'time_helper.c',
- 'riscv-qmp-cmds.c',
))
+subdir('sysemu')
+
target_arch += {'riscv': riscv_ss}
target_softmmu_arch += {'riscv': riscv_system_ss}
new file mode 100644
@@ -0,0 +1,12 @@
+riscv_system_ss.add(files(
+ 'arch_dump.c',
+ 'machine.c',
+ 'monitor.c',
+ 'pmp.c',
+ 'pmu.c',
+ 'riscv-qmp-cmds.c',
+ 'time_helper.c',
+))
+
+riscv_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'),
+ if_false: files('kvm-stub.c'))
Move sysemu-specific files to the a new 'sysemu' sub-directory, adapt meson rules. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- target/riscv/cpu.h | 2 +- target/riscv/{ => sysemu}/instmap.h | 0 target/riscv/{ => sysemu}/kvm_riscv.h | 0 target/riscv/{ => sysemu}/pmp.h | 0 target/riscv/{ => sysemu}/pmu.h | 0 target/riscv/{ => sysemu}/time_helper.h | 0 hw/riscv/virt.c | 2 +- target/riscv/cpu.c | 6 +++--- target/riscv/cpu_helper.c | 4 ++-- target/riscv/csr.c | 4 ++-- target/riscv/{ => sysemu}/arch_dump.c | 0 target/riscv/{ => sysemu}/kvm-stub.c | 0 target/riscv/{ => sysemu}/kvm.c | 0 target/riscv/{ => sysemu}/machine.c | 0 target/riscv/{ => sysemu}/monitor.c | 0 target/riscv/{ => sysemu}/pmp.c | 0 target/riscv/{ => sysemu}/pmu.c | 0 target/riscv/{ => sysemu}/riscv-qmp-cmds.c | 0 target/riscv/{ => sysemu}/time_helper.c | 0 target/riscv/meson.build | 13 ++++--------- target/riscv/sysemu/meson.build | 12 ++++++++++++ 21 files changed, 25 insertions(+), 18 deletions(-) rename target/riscv/{ => sysemu}/instmap.h (100%) rename target/riscv/{ => sysemu}/kvm_riscv.h (100%) rename target/riscv/{ => sysemu}/pmp.h (100%) rename target/riscv/{ => sysemu}/pmu.h (100%) rename target/riscv/{ => sysemu}/time_helper.h (100%) rename target/riscv/{ => sysemu}/arch_dump.c (100%) rename target/riscv/{ => sysemu}/kvm-stub.c (100%) rename target/riscv/{ => sysemu}/kvm.c (100%) rename target/riscv/{ => sysemu}/machine.c (100%) rename target/riscv/{ => sysemu}/monitor.c (100%) rename target/riscv/{ => sysemu}/pmp.c (100%) rename target/riscv/{ => sysemu}/pmu.c (100%) rename target/riscv/{ => sysemu}/riscv-qmp-cmds.c (100%) rename target/riscv/{ => sysemu}/time_helper.c (100%) create mode 100644 target/riscv/sysemu/meson.build