hw: replace hw/i386/pc.h with a header just for the i8259
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 12 Dec 2019 16:15:43 +0000 (17:15 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Dec 2019 18:33:49 +0000 (19:33 +0100)
Remove the need to include i386/pc.h to get to the i8259 functions.
This is enough to remove the inclusion of hw/i386/pc.h from all non-x86
files.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
27 files changed:
hw/alpha/alpha_sys.h
hw/alpha/dp264.c
hw/hppa/hppa_sys.h
hw/hppa/machine.c
hw/i386/kvm/i8259.c
hw/i386/microvm.c
hw/i386/pc.c
hw/i386/x86.c
hw/input/pckbd.c
hw/intc/Kconfig
hw/intc/apic.c
hw/intc/i8259.c
hw/intc/i8259_common.c
hw/intc/ioapic.c
hw/isa/i82378.c
hw/isa/lpc_ich9.c
hw/isa/piix4.c
hw/mips/gt64xxx_pci.c
hw/mips/mips_fulong2e.c
hw/mips/mips_jazz.c
hw/mips/mips_r4k.c
hw/pci-host/bonito.c
hw/pci-host/prep.c
include/hw/i386/pc.h
include/hw/intc/i8259.h [new file with mode: 0644]
include/hw/isa/i8259_internal.h
target/i386/monitor.c

index 4e127a6de806ab1948517dfe4c0227ab3574e46e..95033d7f0b8a6b2280c7af321cc02b8858e733d0 100644 (file)
@@ -7,7 +7,8 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "hw/ide.h"
-#include "hw/i386/pc.h"
+#include "hw/boards.h"
+#include "hw/intc/i8259.h"
 
 
 PCIBus *typhoon_init(ram_addr_t, ISABus **, qemu_irq *, AlphaCPU *[4],
index 51b3cf7a6128acffdb446d895dfabb5a0d4be71b..f2026fda6d9f83b3009bf45408ff836eda37ad79 100644 (file)
@@ -19,6 +19,7 @@
 #include "hw/timer/i8254.h"
 #include "hw/isa/superio.h"
 #include "hw/dma/i8257.h"
+#include "net/net.h"
 #include "qemu/cutils.h"
 
 #define MAX_IDE_BUS 2
index 43d25d21fcc1974186d1fbfffd75f8dc4a89eaba..4e5019695ed188fb44b6bf1506f1036d3c043d80 100644 (file)
@@ -6,7 +6,8 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "hw/ide.h"
-#include "hw/i386/pc.h"
+#include "hw/boards.h"
+#include "hw/intc/i8259.h"
 
 #include "hppa_hardware.h"
 
index b30aba6d5439dab2b35c47a789cb96e5f671c0f8..5d0de26140c66edafc4f7bc0967bf239d695f5e4 100644 (file)
@@ -19,6 +19,7 @@
 #include "hppa_sys.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
+#include "net/net.h"
 #include "qemu/log.h"
 
 #define MAX_IDE_BUS 2
index d0c1b1deac1d8a1dbd60706c95812ff3f5386ae7..e404fdcdac77cf7088f226389afc7921e9b4d35f 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/isa/i8259_internal.h"
+#include "hw/intc/i8259.h"
 #include "qemu/module.h"
 #include "hw/i386/apic_internal.h"
 #include "hw/irq.h"
index def37e60f79443ebe6df2d11a90674e3cbcc0006..20683191ba25137ea24db9447feeb58922f288b8 100644 (file)
@@ -34,6 +34,7 @@
 #include "hw/i386/x86.h"
 #include "hw/i386/pc.h"
 #include "target/i386/cpu.h"
+#include "hw/intc/i8259.h"
 #include "hw/timer/i8254.h"
 #include "hw/rtc/mc146818rtc.h"
 #include "hw/char/serial.h"
index 4bb1710fa400e305188ac7a4574db87886f08e83..b4384e2db440f8da7faf18e4137ef1a324224738 100644 (file)
@@ -44,6 +44,7 @@
 #include "migration/vmstate.h"
 #include "multiboot.h"
 #include "hw/rtc/mc146818rtc.h"
+#include "hw/intc/i8259.h"
 #include "hw/dma/i8257.h"
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
index 394edc2f720985c0910396181eeba2129fa4eb01..3e4aee5ac2a5c500dcf9b63049c17a73a4272811 100644 (file)
@@ -39,6 +39,7 @@
 #include "target/i386/cpu.h"
 #include "hw/i386/topology.h"
 #include "hw/i386/fw_cfg.h"
+#include "hw/intc/i8259.h"
 
 #include "hw/acpi/cpu_hotplug.h"
 #include "hw/nmi.h"
index f0acfd86f7f21b08d2ee9ea29682f81dec195cbd..2f09f780ba9e10fbf79939ebbdc495e43f8d32b8 100644 (file)
@@ -26,7 +26,6 @@
 #include "qemu/log.h"
 #include "hw/isa/isa.h"
 #include "migration/vmstate.h"
-#include "hw/i386/pc.h"
 #include "hw/input/ps2.h"
 #include "hw/irq.h"
 #include "hw/input/i8042.h"
index 5347f8412c1c9e850045a15cf728f4e08482b6d7..10a680b53a28e6e46a65cf73c1ae057a289dde19 100644 (file)
@@ -9,6 +9,7 @@ config PL190
 
 config IOAPIC
     bool
+    select I8259
 
 config ARM_GIC
     bool
@@ -21,6 +22,7 @@ config OPENPIC
 config APIC
     bool
     select MSI_NONBROKEN
+    select I8259
 
 config ARM_GIC_KVM
     bool
index 2a74f7b4bfe4d4b58ae08e23385ca6b62da185eb..bd404679650b54f50bda91e73f1eb2bff996e029 100644 (file)
 #include "hw/i386/apic_internal.h"
 #include "hw/i386/apic.h"
 #include "hw/i386/ioapic.h"
+#include "hw/intc/i8259.h"
 #include "hw/pci/msi.h"
 #include "qemu/host-utils.h"
 #include "trace.h"
-#include "hw/i386/pc.h"
 #include "hw/i386/apic-msidef.h"
 #include "qapi/error.h"
 
index 211a98962e99882f8b495fa91041207fa9c0b627..51b27f6a34b720ce9f9e71bde3367d96c903fec7 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "hw/i386/pc.h"
+#include "hw/intc/i8259.h"
 #include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "qemu/timer.h"
index bd37bb5e68086649d783ab19c22aab1d9a21e123..e7b1a1043655cf203ee3ae5759af7c300a188d35 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "hw/i386/pc.h"
+#include "hw/intc/i8259.h"
 #include "hw/isa/i8259_internal.h"
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
index ead14e1888b962d60683f7405b710a6ccb7ec689..4f5577678a8cc25a4be6570ee0e2e54cc70b15bd 100644 (file)
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "monitor/monitor.h"
-#include "hw/i386/pc.h"
 #include "hw/i386/apic.h"
 #include "hw/i386/ioapic.h"
 #include "hw/i386/ioapic_internal.h"
+#include "hw/i386/x86.h"
+#include "hw/intc/i8259.h"
 #include "hw/pci/msi.h"
 #include "hw/qdev-properties.h"
 #include "sysemu/kvm.h"
index de276cdf104f1983b08083d3e598c693ed984b3e..dcb6b479ea0db9d47c89b91f25d16c5fd9348abb 100644 (file)
@@ -19,8 +19,8 @@
 
 #include "qemu/osdep.h"
 #include "hw/pci/pci.h"
-#include "hw/i386/pc.h"
 #include "hw/irq.h"
+#include "hw/intc/i8259.h"
 #include "hw/timer/i8254.h"
 #include "migration/vmstate.h"
 #include "hw/audio/pcspk.h"
index 17c292e306d2006493c36d85e6b6e88131ccfed1..170792a4fcf37b1583abf8806f8967f7d5d417d3 100644 (file)
@@ -35,7 +35,6 @@
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
 #include "migration/vmstate.h"
-#include "hw/i386/pc.h"
 #include "hw/irq.h"
 #include "hw/isa/apm.h"
 #include "hw/i386/ioapic.h"
index 86678e6829535f0e7981b3e5312205da8e5bea1a..7edec5e149b1096c85298b60b9b8762f4018880b 100644 (file)
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/irq.h"
-#include "hw/i386/pc.h"
 #include "hw/southbridge/piix.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
+#include "hw/intc/i8259.h"
 #include "hw/dma/i8257.h"
 #include "hw/timer/i8254.h"
 #include "hw/rtc/mc146818rtc.h"
index f1af840d8e808877fbbc00f9a9ef823a31e6f1c0..b2ea13f09da1c0375b01f6d4270904c0c63efc93 100644 (file)
@@ -30,7 +30,7 @@
 #include "hw/pci/pci_host.h"
 #include "hw/southbridge/piix.h"
 #include "migration/vmstate.h"
-#include "hw/i386/pc.h"
+#include "hw/intc/i8259.h"
 #include "hw/irq.h"
 #include "exec/address-spaces.h"
 #include "trace.h"
index 03a27e176796d65d437b888c031412e1cd1b99cf..9eaa6e2222f1b02d081fafcbf68a5859426c45dc 100644 (file)
@@ -23,7 +23,7 @@
 #include "qemu/units.h"
 #include "qapi/error.h"
 #include "cpu.h"
-#include "hw/i386/pc.h"
+#include "hw/intc/i8259.h"
 #include "hw/dma/i8257.h"
 #include "hw/isa/superio.h"
 #include "net/net.h"
index ac4d7acb2bd5664bab88bf44b5a932ce1fc8d15d..291fd6c1b8459216687daab68271d778485bad61 100644 (file)
@@ -26,7 +26,7 @@
 #include "qemu-common.h"
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
-#include "hw/i386/pc.h"
+#include "hw/intc/i8259.h"
 #include "hw/dma/i8257.h"
 #include "hw/char/serial.h"
 #include "hw/char/parallel.h"
index 3891be657ce2cdee321af03a11e2e4e5d5045ccc..fd926a3575c85c6354be8d936d77a543af14acd7 100644 (file)
@@ -15,7 +15,7 @@
 #include "cpu.h"
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
-#include "hw/i386/pc.h"
+#include "hw/intc/i8259.h"
 #include "hw/char/serial.h"
 #include "hw/isa/isa.h"
 #include "net/net.h"
index 4692d419e516d46e540c7adc25da637c7d0c04a3..cc6545c8a8cdf5093c0815197f95795519d33302 100644 (file)
@@ -41,7 +41,6 @@
 #include "qemu/osdep.h"
 #include "qemu/error-report.h"
 #include "hw/pci/pci.h"
-#include "hw/i386/pc.h"
 #include "hw/irq.h"
 #include "hw/mips/mips.h"
 #include "hw/pci/pci_host.h"
index 85d7ba90374b6b5a558155e4445b5caa62a35f18..afa136ded3ab40dd0013b3ebc8bc2315668e4af1 100644 (file)
@@ -32,7 +32,7 @@
 #include "hw/pci/pci_host.h"
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
-#include "hw/i386/pc.h"
+#include "hw/intc/i8259.h"
 #include "hw/irq.h"
 #include "hw/loader.h"
 #include "hw/or-irq.h"
index 61a998de4665c9e7508d2b6ea2cf8a33618c0b66..e2cd453ffa60ef0569313dac9a40f6ca0a03bcc0 100644 (file)
@@ -134,14 +134,6 @@ typedef struct PCMachineClass {
 #define PC_MACHINE_CLASS(klass) \
     OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
 
-/* i8259.c */
-
-extern DeviceState *isa_pic;
-qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq);
-qemu_irq *kvm_i8259_init(ISABus *bus);
-int pic_read_irq(DeviceState *d);
-int pic_get_output(DeviceState *d);
-
 /* ioapic.c */
 
 /* Global System Interrupts */
diff --git a/include/hw/intc/i8259.h b/include/hw/intc/i8259.h
new file mode 100644 (file)
index 0000000..e2b1e8c
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef HW_I8259_H
+#define HW_I8259_H
+
+/* i8259.c */
+
+extern DeviceState *isa_pic;
+qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq);
+qemu_irq *kvm_i8259_init(ISABus *bus);
+int pic_get_output(DeviceState *d);
+int pic_read_irq(DeviceState *d);
+
+#endif
index ee189e4a7796320a7691e83372d44599d8caedea..861d70d8f8bc29075e0ce059f934c11fecb275af 100644 (file)
@@ -25,9 +25,9 @@
 #ifndef QEMU_I8259_INTERNAL_H
 #define QEMU_I8259_INTERNAL_H
 
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "hw/intc/intc.h"
+#include "hw/intc/i8259.h"
 
 typedef struct PICCommonState PICCommonState;
 
index 9fb4d641d510789e845632d929055e5a49472f32..27ebfa3ad22002ff30e3b10fd6e86b192a0ea46a 100644 (file)
@@ -28,7 +28,6 @@
 #include "monitor/hmp-target.h"
 #include "monitor/hmp.h"
 #include "qapi/qmp/qdict.h"
-#include "hw/i386/pc.h"
 #include "sysemu/kvm.h"
 #include "sysemu/sev.h"
 #include "qapi/error.h"