On 11/1/23 21:02, Richard Henderson wrote:
On 1/10/23 08:43, Philippe Mathieu-Daudé wrote:
+++ b/target/arm/cpu.h
@@ -26,6 +26,7 @@
#include "cpu-qom.h"
#include "exec/cpu-defs.h"
#include "qapi/qapi-types-common.h"
+#include "hw/arm/cpu.h"
I'm not a fan of this.
If you want a smaller version of cpu-qom.h here in target/arm/, for use
by hw/, that's one thing. But target/ should not be reaching back into
hw/, IMO.
I concur, but currently we have:
$ git grep '#include "hw' target | wc -l
220
$ git grep -h '#include "hw' target | sort | uniq -c
1 #include "hw/acpi/acpi.h"
1 #include "hw/acpi/ghes.h"
1 #include "hw/arm/boot.h"
1 #include "hw/arm/virt.h"
19 #include "hw/boards.h"
2 #include "hw/clock.h"
3 #include "hw/core/accel-cpu.h"
24 #include "hw/core/cpu.h"
20 #include "hw/core/sysemu-cpu-ops.h"
24 #include "hw/core/tcg-cpu-ops.h"
1 #include "hw/hppa/hppa_hardware.h"
3 #include "hw/hw.h"
1 #include "hw/hyperv/hyperv-proto.h"
2 #include "hw/hyperv/hyperv.h"
2 #include "hw/i386/apic-msidef.h"
2 #include "hw/i386/apic.h"
8 #include "hw/i386/apic_internal.h"
1 #include "hw/i386/e820_memory_layout.h"
1 #include "hw/i386/intel_iommu.h"
1 #include "hw/i386/ioapic.h"
2 #include "hw/i386/pc.h"
1 #include "hw/i386/sgx-epc.h"
1 #include "hw/i386/topology.h"
1 #include "hw/i386/x86-iommu.h"
2 #include "hw/i386/x86.h"
1 #include "hw/intc/riscv_aclint.h"
8 #include "hw/irq.h"
1 #include "hw/isa/isa.h"
5 #include "hw/loader.h"
1 #include "hw/loongarch/virt.h"
2 #include "hw/mips/cpudevs.h"
2 #include "hw/pci/msi.h"
1 #include "hw/pci/msix.h"
3 #include "hw/pci/pci.h"
1 #include "hw/ppc/openpic_kvm.h"
5 #include "hw/ppc/ppc.h"
2 #include "hw/ppc/spapr.h"
1 #include "hw/ppc/spapr_cpu_core.h"
2 #include "hw/qdev-clock.h"
12 #include "hw/qdev-properties.h"
11 #include "hw/registerfields.h"
2 #include "hw/s390x/ebcdic.h"
5 #include "hw/s390x/ioinst.h"
2 #include "hw/s390x/ipl.h"
8 #include "hw/s390x/pv.h"
2 #include "hw/s390x/s390-pci-bus.h"
2 #include "hw/s390x/s390-pci-inst.h"
2 #include "hw/s390x/s390-virtio-ccw.h"
2 #include "hw/s390x/s390-virtio-hcall.h"
3 #include "hw/s390x/s390_flic.h"
1 #include "hw/s390x/sclp.h"
2 #include "hw/s390x/storage-keys.h"
1 #include "hw/s390x/tod.h"
1 #include "hw/sh4/sh_intc.h"
2 #include "hw/sysbus.h"
1 #include "hw/watchdog/wdt_diag288.h"
1 #include "hw/xtensa/xtensa-isa.h"
Assuming we want to have a self-contained libtarget$arch, how can we
deal with HW tied to the arch such CPU timers or NVIC?