@@ -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
new file mode 100644
@@ -0,0 +1,30 @@
+/*
+ * QEMU KVM RISC-V specific function stubs
+ *
+ * Copyright (c) 2020 Huawei Technologies Co., Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2 or later, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "kvm_riscv.h"
+
+void kvm_riscv_reset_vcpu(RISCVCPU *cpu)
+{
+ abort();
+}
+
+void kvm_riscv_set_irq(RISCVCPU *cpu, int irq, int level)
+{
+ abort();
+}
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'))
-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,11 @@
+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'))