Skip to contentSkip to conversation

remove i386/pc dependency from non-PC world (part 1)

PATCH Applied Philippe Mathieu-Daudé 15 participants 93 messages Sep 22, 2017 – Oct 17, 2017 1 message not in the archive

Subsystems (3)

v1 of 5 Applied Latest is v5 →

lore
Share & tools
lore
#0 lore raw

cover remove i386/pc dependency from non-PC world (part 1)

Hi,

quite a bunch of patches and files modified, but the diffstat is not that big.

First part is from clean-includes script, Then comes code movement, about no logical changes.

Now some non-x86 builds and cocci spatch run a bit faster :)

I updated some MAINTAINERS entries while here.

Also I couldn't test the KVM/XEN/HAX part.

Regards,

Phil.

Philippe Mathieu-Daudé (34):
hw: use "qemu/osdep.h" as first #include in source files
hw: remove "qemu/osdep.h" from header files
block: remove "qemu/osdep.h" from header file
misc: remove headers implicitly included
misc: remove duplicated includes
ppc: remove duplicated includes
i386/hax: remove duplicated includes
nios2: remove duplicated includes
misc: avoid "include/" in include path
amd_iommu: avoid needless includes in header file i386/pc: use TYPE_PORT92
misc: remove old i386 dependency
hw/ide: remove old i386 dependency
hw/ipmi: remove old i386 dependency
hw/i2c: remove old i386 dependency
hw/tpm: remove old i386 dependency
hw/virtio-balloon: remove old i386 dependency hw/unicore32: restrict hw addr defines to source file hw/acpi: ACPI_PM_* defines are not restricted to i386 arch hw/timer/i8254: rename pit_init() -> i8254_pit_init() hw/display/vga: remove the old i386/pc dependency hw/input/i8042: extract API from hw/i386/pc.h hw/dma/i8257: rename DMA_init() to i8257_dma_init() hw/timer/mc146818: rename rtc_init() -> mc146818_init() hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h" hw/net/e1000: use TYPE_PCI_E1000
hw/net/e1000e: use TYPE_PCI_E1000E
hw/net/pcnet: use TYPE_PCI_PCNET
hw/net/rtl8139: use TYPE_PCI_RTL8139
hw/net/ne2000: use TYPE_PCI_NE2000
hw/alpha: remove old i386 dependency
misc: drop old i386 dependency

 block/dmg.h                                 |  1 -
 hw/alpha/alpha_sys.h                        |  2 -
 hw/audio/fmopl.h                            |  1 -
 hw/display/vga_int.h                        |  3 +-
 hw/display/{vga.h => vga_int_regs.h}        |  0
 hw/i386/amd_iommu.h                         |  5 --
 hw/net/ne2000.h                             |  3 ++
 hw/pci/pci_internal.h                       | 16 ++++++
 include/hw/acpi/acpi.h                      | 12 +++++
 include/hw/acpi/ipmi.h                      |  1 -
 include/hw/cpu/core.h                       |  1 -
 include/hw/display/vga.h                    | 25 ++++++++++
 include/hw/{isa/i8257.h => dma/i8257_dma.h} |  6 +++
 include/hw/i2c/ppc4xx_i2c.h                 |  1 -
 include/hw/i386/pc.h                        | 56 ---------------------
 include/hw/input/i8042.h                    | 30 +++++++++++
 include/hw/isa/isa.h                        |  2 -
 include/hw/net/ne2000-isa.h                 | 33 +++++++++++++
 include/hw/net/pci.h                        | 26 ++++++++++
 include/hw/pci/pci.h                        |  4 --
 include/hw/timer/i8254.h                    |  5 +-
 include/hw/timer/i8254_internal.h           |  2 +-
 include/hw/timer/m48t59.h                   |  2 +
 include/hw/timer/mc146818rtc.h              |  3 +-
 include/hw/unicore32/puv3.h                 | 10 ----
 include/sysemu/hax.h                        |  1 -
 target/i386/hax-darwin.h                    |  3 --
 target/i386/hax-windows.h                   |  2 -
 target/nios2/cpu.h                          |  1 -
 accel/tcg/translate-all.c                   |  1 -
 bsd-user/main.c                             |  1 -
 chardev/wctablet.c                          |  4 --
 disas/nios2.c                               |  3 --
 exec.c                                      |  3 --
 hw/acpi/ipmi-stub.c                         |  1 +
 hw/alpha/dp264.c                            | 10 ++--
 hw/alpha/pci.c                              |  2 +
 hw/alpha/typhoon.c                          |  2 +-
 hw/arm/realview.c                           |  3 +-
 hw/arm/spitz.c                              |  1 -
 hw/arm/versatilepb.c                        |  3 +-
 hw/arm/virt.c                               |  1 +
 hw/audio/fmopl.c                            |  1 -
 hw/audio/pcspk.c                            |  1 -
 hw/char/debugcon.c                          |  1 -
 hw/char/xen_console.c                       |  1 -
 hw/core/machine.c                           |  1 -
 hw/cpu/core.c                               |  1 +
 hw/display/vga-isa-mm.c                     |  4 +-
 hw/display/vga-isa.c                        |  2 +-
 hw/display/vga.c                            |  4 +-
 hw/dma/i82374.c                             |  3 +-
 hw/dma/i8257.c                              |  4 +-
 hw/i2c/pm_smbus.c                           |  1 -
 hw/i2c/smbus_ich9.c                         |  1 -
 hw/i386/amd_iommu.c                         |  5 +-
 hw/i386/kvm/pci-assign.c                    |  1 -
 hw/i386/pc.c                                | 18 ++++---
 hw/i386/pci-assign-load-rom.c               |  1 -
 hw/i386/xen/xen_platform.c                  |  1 -
 hw/ide/ahci.c                               |  1 -
 hw/ide/cmd646.c                             |  1 -
 hw/ide/core.c                               |  3 +-
 hw/ide/ich.c                                |  1 -
 hw/ide/isa.c                                |  1 -
 hw/ide/microdrive.c                         |  1 -
 hw/ide/pci.c                                |  1 -
 hw/ide/piix.c                               |  2 +-
 hw/ide/via.c                                |  1 -
 hw/input/adb.c                              |  2 +-
 hw/input/pckbd.c                            |  2 +-
 hw/input/vmmouse.c                          |  3 +-
 hw/intc/lm32_pic.c                          |  1 -
 hw/ipmi/isa_ipmi_bt.c                       |  1 -
 hw/ipmi/isa_ipmi_kcs.c                      |  1 -
 hw/isa/i82378.c                             |  5 +-
 hw/isa/vt82c686.c                           |  1 -
 hw/mips/mips_fulong2e.c                     | 13 +++--
 hw/mips/mips_jazz.c                         |  9 ++--
 hw/mips/mips_malta.c                        | 13 +++--
 hw/mips/mips_r4k.c                          |  8 +--
 hw/misc/ivshmem.c                           |  1 -
 hw/misc/sga.c                               |  1 -
 hw/misc/vmport.c                            |  1 +
 hw/moxie/moxiesim.c                         |  1 -
 hw/net/e1000e.c                             |  6 +--
 hw/net/ne2000-isa.c                         |  6 +--
 hw/net/ne2000.c                             |  5 +-
 hw/net/pcnet-pci.c                          |  3 +-
 hw/net/rtl8139.c                            |  7 ++-
 hw/nios2/boot.c                             |  1 -
 hw/pci-bridge/pci_expander_bridge.c         |  1 -
 hw/pci/pci.c                                | 67 +------------------------
 hw/pci/pci_nic.c                            | 77 +++++++++++++++++++++++++++++
 hw/ppc/e500.c                               |  1 +
 hw/ppc/mac_newworld.c                       |  3 +-
 hw/ppc/mac_oldworld.c                       |  3 +-
 hw/ppc/pnv.c                                |  2 +-
 hw/ppc/ppc440_bamboo.c                      |  3 +-
 hw/ppc/prep.c                               | 13 +++--
 hw/ppc/spapr.c                              |  1 +
 hw/ppc/spapr_cpu_core.c                     |  1 +
 hw/ppc/spapr_hcall.c                        |  1 -
 hw/s390x/css.c                              |  1 -
 hw/scsi/vhost-user-scsi.c                   |  1 -
 hw/sh4/r2d.c                                |  5 +-
 hw/smbios/smbios_type_38-stub.c             |  1 +
 hw/sparc/sun4m.c                            |  5 --
 hw/sparc64/sun4u.c                          | 10 ++--
 hw/ssi/aspeed_smc.c                         |  3 +-
 hw/timer/i8254.c                            |  1 -
 hw/timer/i8254_common.c                     |  1 -
 hw/timer/m48t59-isa.c                       |  2 +-
 hw/timer/mc146818rtc.c                      |  2 +-
 hw/tpm/tpm_passthrough.c                    |  1 -
 hw/tpm/tpm_tis.c                            |  1 -
 hw/unicore32/puv3.c                         | 17 ++++---
 hw/vfio/ccw.c                               |  2 +-
 hw/virtio/vhost-vsock.c                     |  2 +-
 hw/virtio/virtio-balloon.c                  |  2 +-
 hw/watchdog/wdt_ib700.c                     |  1 -
 linux-user/main.c                           |  1 -
 monitor.c                                   |  1 -
 net/colo-compare.c                          |  1 -
 numa.c                                      |  1 -
 target/i386/hax-darwin.c                    |  8 +--
 target/nios2/helper.c                       |  7 +--
 target/nios2/op_helper.c                    |  1 +
 target/nios2/translate.c                    |  1 +
 target/openrisc/exception_helper.c          |  1 -
 target/ppc/kvm.c                            |  3 --
 tests/test-aio-multithread.c                |  1 -
 tests/test-clone-visitor.c                  |  1 -
 tests/vhost-user-test.c                     |  1 -
 tests/vmgenid-test.c                        |  3 --
 util/qemu-sockets.c                         |  1 -
 vl.c                                        |  3 +-
 hw/pci/Makefile.objs                        |  1 +
 MAINTAINERS                                 | 13 ++++-
 139 files changed, 389 insertions(+), 337 deletions(-)
 rename hw/display/{vga.h => vga_int_regs.h} (100%)
 create mode 100644 hw/pci/pci_internal.h
 create mode 100644 include/hw/display/vga.h
 rename include/hw/{isa/i8257.h => dma/i8257_dma.h} (86%)
 create mode 100644 include/hw/input/i8042.h
 create mode 100644 include/hw/net/ne2000-isa.h
 create mode 100644 include/hw/net/pci.h
 create mode 100644 hw/pci/pci_nic.c
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/34 hw: use "qemu/osdep.h" as first #include in source files

applied using ./scripts/clean-includes

---
 hw/acpi/ipmi-stub.c             | 1 +
 hw/audio/fmopl.c                | 1 -
 hw/cpu/core.c                   | 1 +
 hw/ppc/spapr_cpu_core.c         | 1 +
 hw/smbios/smbios_type_38-stub.c | 1 +
 hw/vfio/ccw.c                   | 2 +-
 hw/virtio/vhost-vsock.c         | 2 +-
 7 files changed, 6 insertions(+), 3 deletions(-)
hw/acpi/ipmi-stub.c +1 -0
index 98b6dcee0d..f525f71c2d 100644
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hw/acpi/ipmi.h"
 
 void build_acpi_ipmi_devices(Aml *table, BusState *bus)
hw/audio/fmopl.c +0 -1
index 5cfb6a96dd..9f50a89b4a 100644
@@ -34,7 +34,6 @@
 #include <math.h>
 //#include "driver.h"		/* use M.A.M.E. */
 #include "fmopl.h"
-#include "qemu/osdep.h"
 #ifndef PI
 #define PI 3.14159265358979323846
 #endif
hw/cpu/core.c +1 -0
index bd578ab80c..7e42e2c87a 100644
@@ -6,6 +6,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+#include "qemu/osdep.h"
 #include "hw/cpu/core.h"
 #include "qapi/visitor.h"
 #include "qapi/error.h"
hw/ppc/spapr_cpu_core.c +1 -0
index c08ee7571a..4a4f0c60fe 100644
@@ -6,6 +6,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+#include "qemu/osdep.h"
 #include "hw/cpu/core.h"
 #include "hw/ppc/spapr_cpu_core.h"
 #include "target/ppc/cpu.h"
hw/smbios/smbios_type_38-stub.c +1 -0
index 9528c2c28e..5b83c9b1f1 100644
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hw/smbios/ipmi.h"
 
 void smbios_build_type_38_table(void)
hw/vfio/ccw.c +1 -1
index a8baadf57a..4810fa0b50 100644
@@ -11,11 +11,11 @@
  * directory.
  */
 
+#include "qemu/osdep.h"
 #include <linux/vfio.h>
 #include <linux/vfio_ccw.h>
 #include <sys/ioctl.h>
 
-#include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/vfio/vfio.h"
hw/virtio/vhost-vsock.c +1 -1
index 49e0022533..c11c1eb83e 100644
@@ -11,8 +11,8 @@
  * top-level directory.
  */
 
-#include <sys/ioctl.h>
 #include "qemu/osdep.h"
+#include <sys/ioctl.h>
 #include "standard-headers/linux/virtio_vsock.h"
 #include "qapi/error.h"
 #include "hw/virtio/virtio-bus.h"
Signature · 1 line
2.14.1
Reviewed-by on v1 1/34
#2 lore raw

Re: [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files

Quoted 13 lines · Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

---
 hw/acpi/ipmi-stub.c             | 1 +
 hw/audio/fmopl.c                | 1 -
 hw/cpu/core.c                   | 1 +
 hw/ppc/spapr_cpu_core.c         | 1 +
 hw/smbios/smbios_type_38-stub.c | 1 +
 hw/vfio/ccw.c                   | 2 +-
 hw/virtio/vhost-vsock.c         | 2 +-
 7 files changed, 6 insertions(+), 3 deletions(-)

thanks
-- PMM

Acked-by on v1 1/34
#3 lore raw

Re: [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files

In reply to Philippe Mathieu-Daudé
Quoted 3 lines · Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

ppc portion

Quoted 101 lines
---
 hw/acpi/ipmi-stub.c             | 1 +
 hw/audio/fmopl.c                | 1 -
 hw/cpu/core.c                   | 1 +
 hw/ppc/spapr_cpu_core.c         | 1 +
 hw/smbios/smbios_type_38-stub.c | 1 +
 hw/vfio/ccw.c                   | 2 +-
 hw/virtio/vhost-vsock.c         | 2 +-
 7 files changed, 6 insertions(+), 3 deletions(-)
hw/acpi/ipmi-stub.c +1 -0
index 98b6dcee0d..f525f71c2d 100644
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hw/acpi/ipmi.h"
 
 void build_acpi_ipmi_devices(Aml *table, BusState *bus)
hw/audio/fmopl.c +0 -1
index 5cfb6a96dd..9f50a89b4a 100644
@@ -34,7 +34,6 @@
 #include <math.h>
 //#include "driver.h"		/* use M.A.M.E. */
 #include "fmopl.h"
-#include "qemu/osdep.h"
 #ifndef PI
 #define PI 3.14159265358979323846
 #endif
hw/cpu/core.c +1 -0
index bd578ab80c..7e42e2c87a 100644
@@ -6,6 +6,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+#include "qemu/osdep.h"
 #include "hw/cpu/core.h"
 #include "qapi/visitor.h"
 #include "qapi/error.h"
hw/ppc/spapr_cpu_core.c +1 -0
index c08ee7571a..4a4f0c60fe 100644
@@ -6,6 +6,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+#include "qemu/osdep.h"
 #include "hw/cpu/core.h"
 #include "hw/ppc/spapr_cpu_core.h"
 #include "target/ppc/cpu.h"
hw/smbios/smbios_type_38-stub.c +1 -0
index 9528c2c28e..5b83c9b1f1 100644
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "hw/smbios/ipmi.h"
 
 void smbios_build_type_38_table(void)
hw/vfio/ccw.c +1 -1
index a8baadf57a..4810fa0b50 100644
@@ -11,11 +11,11 @@
  * directory.
  */
 
+#include "qemu/osdep.h"
 #include <linux/vfio.h>
 #include <linux/vfio_ccw.h>
 #include <sys/ioctl.h>
 
-#include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/vfio/vfio.h"
hw/virtio/vhost-vsock.c +1 -1
index 49e0022533..c11c1eb83e 100644
@@ -11,8 +11,8 @@
  * top-level directory.
  */
 
-#include <sys/ioctl.h>
 #include "qemu/osdep.h"
+#include <sys/ioctl.h>
 #include "standard-headers/linux/virtio_vsock.h"
 #include "qapi/error.h"
 #include "hw/virtio/virtio-bus.h"
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Acked-by on v1 1/34
#4 lore raw

Re: [Qemu-devel] [PATCH 01/34] hw: use "qemu/osdep.h" as first #include in source files

In reply to Philippe Mathieu-Daudé
Quoted 21 lines · On Fri, 22 Sep 2017 12:39:41 -0300 Philippe Mathieu-Daudé <[email protected]>…

applied using ./scripts/clean-includes

---
 hw/acpi/ipmi-stub.c             | 1 +
 hw/audio/fmopl.c                | 1 -
 hw/cpu/core.c                   | 1 +
 hw/ppc/spapr_cpu_core.c         | 1 +
 hw/smbios/smbios_type_38-stub.c | 1 +
 hw/vfio/ccw.c                   | 2 +-
 hw/virtio/vhost-vsock.c         | 2 +-
 7 files changed, 6 insertions(+), 3 deletions(-)
hw/vfio/ccw.c +0 -0
index a8baadf57a..4810fa0b50 100644
@@ -11,11 +11,11 @@
  * directory.
  */

hw/vfio/ccw.c line 21

Quoted 10 lines
hw/vfio/ccw.c +1 -1
 
+#include "qemu/osdep.h"
 #include <linux/vfio.h>
 #include <linux/vfio_ccw.h>
 #include <sys/ioctl.h>
 
-#include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/vfio/vfio.h"
#5 lore raw

PATCH 2/34 hw: remove "qemu/osdep.h" from header files

In reply to Philippe Mathieu-Daudé

while here, add entries for ppc4xx_i2c in MAINTAINERS

applied using ./scripts/clean-includes

---

Zoltán you might want to add yourself a reviewer entry on ppc4xx :)

R: Balaton Zoltan <[email protected]>

 include/hw/acpi/ipmi.h      | 1 -
 include/hw/cpu/core.h       | 1 -
 include/hw/i2c/ppc4xx_i2c.h | 1 -
 MAINTAINERS                 | 2 ++
 4 files changed, 2 insertions(+), 3 deletions(-)
include/hw/acpi/ipmi.h +0 -1
index ab2bb29048..c38483565c 100644
@@ -9,7 +9,6 @@
 #ifndef HW_ACPI_IPMI_H
 #define HW_ACPI_IPMI_H
 
-#include "qemu/osdep.h"
 #include "hw/acpi/aml-build.h"
 
 /*
include/hw/cpu/core.h +0 -1
index 79ac79c29c..b7470644d8 100644
@@ -9,7 +9,6 @@
 #ifndef HW_CPU_CORE_H
 #define HW_CPU_CORE_H
 
-#include "qemu/osdep.h"
 #include "hw/qdev.h"
 
 #define TYPE_CPU_CORE "cpu-core"
include/hw/i2c/ppc4xx_i2c.h +0 -1
index e53042f6d4..3450bda577 100644
@@ -25,7 +25,6 @@
 #ifndef PPC4XX_I2C_H
 #define PPC4XX_I2C_H
 
-#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "hw/sysbus.h"
 #include "hw/i2c/i2c.h"
MAINTAINERS +2 -0
index 762e37bfd6..7f49f1d046 100644
@@ -945,7 +945,9 @@ M: Alexander Graf <[email protected]>
 L: [email protected]
 S: Odd Fixes
 F: hw/ppc/ppc4*.c
+F: hw/i2c/ppc4xx_i2c.c
 F: include/hw/ppc/ppc4xx.h
+F: include/hw/i2c/ppc4xx_i2c.h
 
 ppce500
 M: Alexander Graf <[email protected]>
Signature · 1 line
2.14.1
Reviewed-by Tested-by
#7 lore raw

Re: [Qemu-devel] [PATCH 02/34] hw: remove "qemu/osdep.h" from header files

Quoted 9 lines · Peter Maydell
Quoted 6 lines · Philippe Mathieu-Daudé

while here, add entries for ppc4xx_i2c in MAINTAINERS

applied using ./scripts/clean-includes

---

This is doing two things at once and would ideally be two patches. Still,

I agree.

Quoted 1 line

I applied this series and did some basic testing, so

Quoted 3 lines

thanks
-- PMM

Reviewed-by Tested-by
#8 lore raw

Re: [Qemu-trivial] [Qemu-devel] [PATCH 02/34] hw: remove "qemu/osdep.h" from header files

In reply to Peter Maydell
Quoted 9 lines · Peter Maydell
Quoted 6 lines · Philippe Mathieu-Daudé

while here, add entries for ppc4xx_i2c in MAINTAINERS

applied using ./scripts/clean-includes

---

This is doing two things at once and would ideally be two patches. Still,

I agree.

Quoted 1 line

I applied this series and did some basic testing, so

Quoted 3 lines

thanks
-- PMM

#9 lore raw

Re: [Qemu-devel] [PATCH 02/34] hw: remove "qemu/osdep.h" from header files

In reply to Peter Maydell
Quoted 10 lines · Peter Maydell
Quoted 6 lines · Philippe Mathieu-Daudé

while here, add entries for ppc4xx_i2c in MAINTAINERS

applied using ./scripts/clean-includes

---

This is doing two things at once and would ideally be two patches. Still,

OK I'll split "while here" patches.

Quoted 2 lines

Thanks!

#10 lore raw

PATCH 3/34 block: remove "qemu/osdep.h" from header file

In reply to Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

---
 block/dmg.h | 1 -
 1 file changed, 1 deletion(-)
block/dmg.h +0 -1
index b592d6fa8b..2ecf239ba5 100644
@@ -26,7 +26,6 @@
 #ifndef BLOCK_DMG_H
 #define BLOCK_DMG_H
 
-#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include <zlib.h>
Signature · 1 line
2.14.1
Reviewed-by on v1 3/34
#11 lore raw

Re: [Qemu-devel] [PATCH 03/34] block: remove "qemu/osdep.h" from header file

Quoted 12 lines · Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

---
 block/dmg.h | 1 -
 1 file changed, 1 deletion(-)
block/dmg.h +0 -0
index b592d6fa8b..2ecf239ba5 100644

block/dmg.h

Quoted 8 lines
block/dmg.h +0 -2
@@ -26,7 +26,6 @@
 #ifndef BLOCK_DMG_H
 #define BLOCK_DMG_H
 
-#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include <zlib.h>
--

thanks
-- PMM

#12 lore raw

PATCH 4/34 misc: remove headers implicitly included

In reply to Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

---
 hw/audio/fmopl.h             | 1 -
 bsd-user/main.c              | 1 -
 chardev/wctablet.c           | 4 ----
 hw/scsi/vhost-user-scsi.c    | 1 -
 linux-user/main.c            | 1 -
 net/colo-compare.c           | 1 -
 tests/test-aio-multithread.c | 1 -
 tests/test-clone-visitor.c   | 1 -
 tests/vmgenid-test.c         | 3 ---
 9 files changed, 14 deletions(-)
hw/audio/fmopl.h +0 -1
index f4065f425c..e7e578a48e 100644
@@ -1,7 +1,6 @@
 #ifndef FMOPL_H
 #define FMOPL_H
 
-#include <stdint.h>
 
 typedef void (*OPL_TIMERHANDLER)(void *param, int channel, double interval_Sec);
 
bsd-user/main.c +0 -1
index 836daac15c..bf27a5b44f 100644
@@ -32,7 +32,6 @@
 #include "qemu/envlist.h"
 #include "exec/log.h"
 #include "trace/control.h"
-#include "glib-compat.h"
 
 int singlestep;
 unsigned long mmap_min_addr;
chardev/wctablet.c +0 -4
index 6c13c2c58a..969d014574 100644
@@ -25,10 +25,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-#include <time.h>
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
hw/scsi/vhost-user-scsi.c +0 -1
index 500fa6a067..9efa26da7d 100644
@@ -18,7 +18,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
-#include "qemu/typedefs.h"
 #include "qom/object.h"
 #include "hw/fw-path-provider.h"
 #include "hw/qdev-core.h"
linux-user/main.c +0 -1
index 829f974662..85d7f6d3f7 100644
@@ -35,7 +35,6 @@
 #include "elf.h"
 #include "exec/log.h"
 #include "trace/control.h"
-#include "glib-compat.h"
 
 char *exec_path;
 
net/colo-compare.c +0 -1
index b3f35d729a..27ea7d4de9 100644
@@ -23,7 +23,6 @@
 #include "qom/object_interfaces.h"
 #include "qemu/iov.h"
 #include "qom/object.h"
-#include "qemu/typedefs.h"
 #include "net/queue.h"
 #include "chardev/char-fe.h"
 #include "qemu/sockets.h"
tests/test-aio-multithread.c +0 -1
index 549d784915..ad78c6b28b 100644
@@ -11,7 +11,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <glib.h>
 #include "block/aio.h"
 #include "qapi/error.h"
 #include "qemu/coroutine.h"
tests/test-clone-visitor.c +0 -1
index 96982163e4..ac6afc562e 100644
@@ -8,7 +8,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <glib.h>
 
 #include "qemu-common.h"
 #include "qapi/clone-visitor.h"
tests/vmgenid-test.c +0 -3
index 918c82c82a..2f96ad453e 100644
@@ -8,9 +8,6 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <glib.h>
-#include <string.h>
-#include <unistd.h>
 #include "qemu/osdep.h"
 #include "qemu/bitmap.h"
 #include "qemu/uuid.h"
Signature · 1 line
2.14.1
Reviewed-by on v1 4/34
#14 lore raw

Re: [Qemu-devel] [PATCH 04/34] misc: remove headers implicitly included

In reply to Philippe Mathieu-Daudé
Quoted 14 lines · Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

---
 hw/audio/fmopl.h             | 1 -
 bsd-user/main.c              | 1 -
 chardev/wctablet.c           | 4 ----
 hw/scsi/vhost-user-scsi.c    | 1 -
 linux-user/main.c            | 1 -
 net/colo-compare.c           | 1 -
 tests/test-aio-multithread.c | 1 -
 tests/test-clone-visitor.c   | 1 -
 tests/vmgenid-test.c         | 3 ---
 9 files changed, 14 deletions(-)
#15 lore raw

PATCH 5/34 misc: remove duplicated includes

In reply to Philippe Mathieu-Daudé

exec: housekeeping (funny since 02d0e095031)

applied using ./scripts/clean-includes

---
 accel/tcg/translate-all.c          | 1 -
 exec.c                             | 3 ---
 hw/arm/spitz.c                     | 1 -
 hw/char/xen_console.c              | 1 -
 hw/core/machine.c                  | 1 -
 hw/s390x/css.c                     | 1 -
 target/openrisc/exception_helper.c | 1 -
 tests/vhost-user-test.c            | 1 -
 util/qemu-sockets.c                | 1 -
 vl.c                               | 1 -
 10 files changed, 12 deletions(-)
accel/tcg/translate-all.c +0 -1
index 2d1ed06065..fb2ad21092 100644
@@ -31,7 +31,6 @@
 #include "tcg.h"
 #if defined(CONFIG_USER_ONLY)
 #include "qemu.h"
-#include "exec/exec-all.h"
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <sys/param.h>
 #if __FreeBSD_version >= 700104
exec.c +0 -3
index a25a4c6018..a1fe82189c 100644
@@ -18,8 +18,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#ifndef _WIN32
-#endif
 
 #include "qemu/cutils.h"
 #include "cpu.h"
@@ -51,7 +49,6 @@
 #include "trace-root.h"
 
 #ifdef CONFIG_FALLOCATE_PUNCH_HOLE
-#include <fcntl.h>
 #include <linux/falloc.h>
 #endif
 
hw/arm/spitz.c +0 -1
index feccdb00d3..ac1e15cbbc 100644
@@ -29,7 +29,6 @@
 #include "sysemu/block-backend.h"
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
-#include "sysemu/sysemu.h"
 #include "cpu.h"
 
 #undef REG_FMT
hw/char/xen_console.c +0 -1
index 3643dfe067..5e68326c19 100644
@@ -27,7 +27,6 @@
 #include "hw/hw.h"
 #include "chardev/char-fe.h"
 #include "hw/xen/xen_backend.h"
-#include "qapi/error.h"
 
 #include <xen/io/console.h>
 
hw/core/machine.c +0 -1
index 80647edc2a..4ad0e9a082 100644
@@ -20,7 +20,6 @@
 #include "sysemu/numa.h"
 #include "qemu/error-report.h"
 #include "qemu/cutils.h"
-#include "sysemu/numa.h"
 #include "sysemu/qtest.h"
 
 static char *machine_get_accel(Object *obj, Error **errp)
hw/s390x/css.c +0 -1
index 75d4f301fb..3938fa5909 100644
@@ -13,7 +13,6 @@
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "hw/qdev.h"
-#include "qemu/error-report.h"
 #include "qemu/bitops.h"
 #include "qemu/error-report.h"
 #include "exec/address-spaces.h"
target/openrisc/exception_helper.c +0 -1
index a8a5f69b05..6073a5b21c 100644
@@ -21,7 +21,6 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/helper-proto.h"
-#include "exec/exec-all.h"
 #include "exception.h"
 
 void HELPER(exception)(CPUOpenRISCState *env, uint32_t excp)
tests/vhost-user-test.c +0 -1
index 4b98018478..e2c89ed376 100644
@@ -21,7 +21,6 @@
 #include "libqos/libqos.h"
 #include "libqos/pci-pc.h"
 #include "libqos/virtio-pci.h"
-#include "qapi/error.h"
 
 #include "libqos/malloc-pc.h"
 #include "hw/virtio/virtio-net.h"
util/qemu-sockets.c +0 -1
index d149383bb9..d700caef45 100644
@@ -26,7 +26,6 @@
 #include "qapi/error.h"
 #include "qemu/sockets.h"
 #include "qemu/main-loop.h"
-#include "qapi/clone-visitor.h"
 #include "qapi/qobject-input-visitor.h"
 #include "qapi/qobject-output-visitor.h"
 #include "qapi-visit.h"
vl.c +0 -1
index 88ae727486..d6cb6751e6 100644
@@ -95,7 +95,6 @@ int main(int argc, char **argv)
 #include "sysemu/kvm.h"
 #include "sysemu/hax.h"
 #include "qapi/qobject-input-visitor.h"
-#include "qapi/qobject-input-visitor.h"
 #include "qapi-visit.h"
 #include "qapi/qmp/qjson.h"
 #include "qemu/option.h"
Signature · 1 line
2.14.1
Reviewed-by on v1 5/34
#16 lore raw

Re: [Qemu-arm] [PATCH 05/34] misc: remove duplicated includes

Quoted 5 lines · Philippe Mathieu-Daudé

exec: housekeeping (funny since 02d0e095031)

applied using ./scripts/clean-includes

Quoted 12 lines
---
 accel/tcg/translate-all.c          | 1 -
 exec.c                             | 3 ---
 hw/arm/spitz.c                     | 1 -
 hw/char/xen_console.c              | 1 -
 hw/core/machine.c                  | 1 -
 hw/s390x/css.c                     | 1 -
 target/openrisc/exception_helper.c | 1 -
 tests/vhost-user-test.c            | 1 -
 util/qemu-sockets.c                | 1 -
 vl.c                               | 1 -
 10 files changed, 12 deletions(-)

thanks
-- PMM

Acked-by on v1 5/34
#17 lore raw

Re: [Qemu-arm] [PATCH 05/34] misc: remove duplicated includes

In reply to Philippe Mathieu-Daudé
Quoted 23 lines · On Fri, 22 Sep 2017 12:39:45 -0300 Philippe Mathieu-Daudé <[email protected]>…

exec: housekeeping (funny since 02d0e095031)

applied using ./scripts/clean-includes

---
 accel/tcg/translate-all.c          | 1 -
 exec.c                             | 3 ---
 hw/arm/spitz.c                     | 1 -
 hw/char/xen_console.c              | 1 -
 hw/core/machine.c                  | 1 -
 hw/s390x/css.c                     | 1 -
 target/openrisc/exception_helper.c | 1 -
 tests/vhost-user-test.c            | 1 -
 util/qemu-sockets.c                | 1 -
 vl.c                               | 1 -
 10 files changed, 12 deletions(-)
hw/s390x/css.c +0 -0
index 75d4f301fb..3938fa5909 100644

hw/s390x/css.c line 18

Quoted 7 lines
hw/s390x/css.c +0 -1
@@ -13,7 +13,6 @@
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "hw/qdev.h"
-#include "qemu/error-report.h"
 #include "qemu/bitops.h"
 #include "qemu/error-report.h"
 #include "exec/address-spaces.h"
Reviewed-by on v1 5/34
#18 lore raw

Re: [Qemu-devel] [PATCH 05/34] misc: remove duplicated includes

In reply to Philippe Mathieu-Daudé
Quoted 5 lines · Philippe Mathieu-Daudé

exec: housekeeping (funny since 02d0e095031)

applied using ./scripts/clean-includes

Quoted 13 lines
---
 accel/tcg/translate-all.c          | 1 -
 exec.c                             | 3 ---
 hw/arm/spitz.c                     | 1 -
 hw/char/xen_console.c              | 1 -
 hw/core/machine.c                  | 1 -
 hw/s390x/css.c                     | 1 -
 target/openrisc/exception_helper.c | 1 -
 tests/vhost-user-test.c            | 1 -
 util/qemu-sockets.c                | 1 -
 vl.c                               | 1 -
 10 files changed, 12 deletions(-)
Signature · 1 line
Anthony PERARD
#19 lore raw

PATCH 6/34 ppc: remove duplicated includes

In reply to Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

not needed since 7ebaf795560

---
 hw/ppc/spapr_hcall.c | 1 -
 target/ppc/kvm.c     | 3 ---
 2 files changed, 4 deletions(-)
hw/ppc/spapr_hcall.c +0 -1
index 57bb411394..2aeee28fe6 100644
@@ -13,7 +13,6 @@
 #include "trace.h"
 #include "kvm_ppc.h"
 #include "hw/ppc/spapr_ovec.h"
-#include "qemu/error-report.h"
 #include "mmu-book3s-v3.h"
 
 struct SPRSyncState {
target/ppc/kvm.c +0 -3
index 1deaf106d2..c9105af393 100644
@@ -47,9 +47,6 @@
 #include "sysemu/hostmem.h"
 #include "qemu/cutils.h"
 #include "qemu/mmap-alloc.h"
-#if defined(TARGET_PPC64)
-#include "hw/ppc/spapr_cpu_core.h"
-#endif
 #include "elf.h"
 #include "sysemu/kvm_int.h"
 
Signature · 1 line
2.14.1
Reviewed-by on v1 6/34
#20 lore raw

Re: [Qemu-devel] [PATCH 06/34] ppc: remove duplicated includes

Quoted 27 lines · Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

not needed since 7ebaf795560

---
 hw/ppc/spapr_hcall.c | 1 -
 target/ppc/kvm.c     | 3 ---
 2 files changed, 4 deletions(-)
hw/ppc/spapr_hcall.c +0 -1
index 57bb411394..2aeee28fe6 100644
@@ -13,7 +13,6 @@
 #include "trace.h"
 #include "kvm_ppc.h"
 #include "hw/ppc/spapr_ovec.h"
-#include "qemu/error-report.h"
 #include "mmu-book3s-v3.h"
 
 struct SPRSyncState {
target/ppc/kvm.c +0 -0
index 1deaf106d2..c9105af393 100644

target/ppc/kvm.c

Quoted 10 lines
target/ppc/kvm.c +0 -4
@@ -47,9 +47,6 @@
 #include "sysemu/hostmem.h"
 #include "qemu/cutils.h"
 #include "qemu/mmap-alloc.h"
-#if defined(TARGET_PPC64)
-#include "hw/ppc/spapr_cpu_core.h"
-#endif
 #include "elf.h"
 #include "sysemu/kvm_int.h"
 
--

thanks
-- PMM

Acked-by on v1 6/34
#21 lore raw

Re: [Qemu-devel] [PATCH 06/34] ppc: remove duplicated includes

In reply to Philippe Mathieu-Daudé
Quoted 5 lines · Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

not needed since 7ebaf795560

Quoted 31 lines
---
 hw/ppc/spapr_hcall.c | 1 -
 target/ppc/kvm.c     | 3 ---
 2 files changed, 4 deletions(-)
hw/ppc/spapr_hcall.c +0 -1
index 57bb411394..2aeee28fe6 100644
@@ -13,7 +13,6 @@
 #include "trace.h"
 #include "kvm_ppc.h"
 #include "hw/ppc/spapr_ovec.h"
-#include "qemu/error-report.h"
 #include "mmu-book3s-v3.h"
 
 struct SPRSyncState {
target/ppc/kvm.c +0 -3
index 1deaf106d2..c9105af393 100644
@@ -47,9 +47,6 @@
 #include "sysemu/hostmem.h"
 #include "qemu/cutils.h"
 #include "qemu/mmap-alloc.h"
-#if defined(TARGET_PPC64)
-#include "hw/ppc/spapr_cpu_core.h"
-#endif
 #include "elf.h"
 #include "sysemu/kvm_int.h"
 
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#22 lore raw

PATCH 7/34 i386/hax: remove duplicated includes

In reply to Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

---
 include/sysemu/hax.h      | 1 -
 target/i386/hax-darwin.h  | 3 ---
 target/i386/hax-windows.h | 2 --
 target/i386/hax-darwin.c  | 8 ++------
 4 files changed, 2 insertions(+), 12 deletions(-)
include/sysemu/hax.h +0 -1
index 232a68ab1b..f252399623 100644
@@ -22,7 +22,6 @@
 #ifndef QEMU_HAX_H
 #define QEMU_HAX_H
 
-#include "config-host.h"
 #include "qemu-common.h"
 
 int hax_sync_vcpus(void);
target/i386/hax-darwin.h +0 -3
index 0c0968b77d..fb8e25a096 100644
@@ -15,10 +15,7 @@
 #ifndef TARGET_I386_HAX_DARWIN_H
 #define TARGET_I386_HAX_DARWIN_H
 
-#include <sys/types.h>
 #include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <stdarg.h>
 
 #define HAX_INVALID_FD  (-1)
 static inline int hax_invalid_fd(hax_fd fd)
target/i386/hax-windows.h +0 -2
index 1d8f68de91..f7c3e99246 100644
@@ -24,8 +24,6 @@
 #include <memory.h>
 #include <malloc.h>
 #include <winioctl.h>
-#include <string.h>
-#include <stdio.h>
 #include <windef.h>
 
 #define HAX_INVALID_FD INVALID_HANDLE_VALUE
target/i386/hax-darwin.c +2 -6
index 1c5bbd0a2d..ee9417454c 100644
@@ -11,13 +11,9 @@
  */
 
 /* HAX module interface - darwin version */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-
 #include "qemu/osdep.h"
+#include <sys/ioctl.h>
+
 #include "target/i386/hax-i386.h"
 
 hax_fd hax_mod_open(void)
Signature · 1 line
2.14.1
Reviewed-by on v1 7/34
#23 lore raw

Re: [Qemu-devel] [PATCH 07/34] i386/hax: remove duplicated includes

Quoted 9 lines · Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

---
 include/sysemu/hax.h      | 1 -
 target/i386/hax-darwin.h  | 3 ---
 target/i386/hax-windows.h | 2 --
 target/i386/hax-darwin.c  | 8 ++------
 4 files changed, 2 insertions(+), 12 deletions(-)

I suspect the includes in hax-windows.h could be trimmed a bit more (since we're guaranteed that if CONFIG_WIN32 then we've included sysemu/os-win32.h), but this is fine as it stands.

thanks
-- PMM

#24 lore raw

PATCH 8/34 nios2: remove duplicated includes

In reply to Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

---
 target/nios2/cpu.h       | 1 -
 disas/nios2.c            | 3 ---
 hw/nios2/boot.c          | 1 -
 target/nios2/helper.c    | 7 ++-----
 target/nios2/op_helper.c | 1 +
 target/nios2/translate.c | 1 +
 6 files changed, 4 insertions(+), 10 deletions(-)
target/nios2/cpu.h +0 -1
index 50d803a217..fda02c39b9 100644
@@ -20,7 +20,6 @@
 #ifndef CPU_NIOS2_H
 #define CPU_NIOS2_H
 
-#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 #define TARGET_LONG_BITS 32
disas/nios2.c +0 -3
index b342936d21..de11f04cc4 100644
@@ -1756,7 +1756,6 @@ extern const int nios2_num_r2_reg_range_mappings;
 #endif /* _NIOS2_H */
 
 /*#include "sysdep.h"
-#include <stdio.h>
 #include "opcode/nios2.h"
 */
 /* Register string table */
@@ -2521,8 +2520,6 @@ const int nios2_num_r2_reg_range_mappings = 8;
 #include "dis-asm.h"
 #include "opcode/nios2.h"
 #include "libiberty.h"
-#include <string.h>
-#include <assert.h>
 */
 /* No symbol table is available when this code runs out in an embedded
    system as when it is used for disassembler support in a monitor.  */
hw/nios2/boot.c +0 -1
index 2b31f5b844..94f436e7fb 100644
@@ -34,7 +34,6 @@
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
-#include "qemu-common.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/sysemu.h"
 #include "hw/loader.h"
target/nios2/helper.c +2 -5
index ef9ee05798..9f741a8f19 100644
@@ -18,12 +18,9 @@
  * <http://www.gnu.org/licenses/lgpl-2.1.html>
  */
 
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#include "cpu.h"
 #include "qemu/osdep.h"
+
+#include "cpu.h"
 #include "qemu/host-utils.h"
 #include "qapi/error.h"
 #include "exec/exec-all.h"
target/nios2/op_helper.c +1 -0
index efb1c489c9..c853aeae02 100644
@@ -18,6 +18,7 @@
  * <http://www.gnu.org/licenses/lgpl-2.1.html>
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/cpu_ldst.h"
target/nios2/translate.c +1 -0
index 6b0961837d..796d399bd1 100644
@@ -21,6 +21,7 @@
  * <http://www.gnu.org/licenses/lgpl-2.1.html>
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "tcg-op.h"
 #include "exec/exec-all.h"
Signature · 1 line
2.14.1
Reviewed-by on v1 8/34
#25 lore raw

Re: [Qemu-devel] [PATCH 08/34] nios2: remove duplicated includes

Quoted 37 lines · Philippe Mathieu-Daudé

applied using ./scripts/clean-includes

---
 target/nios2/cpu.h       | 1 -
 disas/nios2.c            | 3 ---
 hw/nios2/boot.c          | 1 -
 target/nios2/helper.c    | 7 ++-----
 target/nios2/op_helper.c | 1 +
 target/nios2/translate.c | 1 +
 6 files changed, 4 insertions(+), 10 deletions(-)
target/nios2/cpu.h +0 -1
index 50d803a217..fda02c39b9 100644
@@ -20,7 +20,6 @@
 #ifndef CPU_NIOS2_H
 #define CPU_NIOS2_H
 
-#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 #define TARGET_LONG_BITS 32
disas/nios2.c +0 -1
index b342936d21..de11f04cc4 100644
@@ -1756,7 +1756,6 @@ extern const int nios2_num_r2_reg_range_mappings;
 #endif /* _NIOS2_H */
 
 /*#include "sysdep.h"
-#include <stdio.h>
 #include "opcode/nios2.h"
 */
 /* Register string table */

disas/nios2.c const int nios2_num_r2_reg_range_mappings = 8; · line 2523

Quoted 6 lines
disas/nios2.c +0 -2
@@ -2521,8 +2520,6 @@ const int nios2_num_r2_reg_range_mappings = 8;
 #include "dis-asm.h"
 #include "opcode/nios2.h"
 #include "libiberty.h"
-#include <string.h>
-#include <assert.h>
 */

These are in commented out bits of code anyway, but I guess it doesn't hurt and it'll prevent the script complaining later.

Quoted 50 lines
disas/nios2.c +0 -0
 /* No symbol table is available when this code runs out in an embedded
    system as when it is used for disassembler support in a monitor.  */
hw/nios2/boot.c +0 -1
index 2b31f5b844..94f436e7fb 100644
@@ -34,7 +34,6 @@
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
-#include "qemu-common.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/sysemu.h"
 #include "hw/loader.h"
target/nios2/helper.c +2 -5
index ef9ee05798..9f741a8f19 100644
@@ -18,12 +18,9 @@
  * <http://www.gnu.org/licenses/lgpl-2.1.html>
  */
 
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#include "cpu.h"
 #include "qemu/osdep.h"
+
+#include "cpu.h"
 #include "qemu/host-utils.h"
 #include "qapi/error.h"
 #include "exec/exec-all.h"
target/nios2/op_helper.c +1 -0
index efb1c489c9..c853aeae02 100644
@@ -18,6 +18,7 @@
  * <http://www.gnu.org/licenses/lgpl-2.1.html>
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/cpu_ldst.h"
target/nios2/translate.c +0 -0
index 6b0961837d..796d399bd1 100644

target/nios2/translate.c line 27

Quoted 7 lines
target/nios2/translate.c +1 -0
@@ -21,6 +21,7 @@
  * <http://www.gnu.org/licenses/lgpl-2.1.html>
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "tcg-op.h"
 #include "exec/exec-all.h"

thanks
-- PMM

#26 lore raw

PATCH 9/34 misc: avoid "include/" in include path

In reply to Philippe Mathieu-Daudé

while here, remove unused #include from aspeed_smc.h

---
 hw/input/adb.c      | 2 +-
 hw/ssi/aspeed_smc.c | 3 +--
 numa.c              | 1 -
 3 files changed, 2 insertions(+), 4 deletions(-)
hw/input/adb.c +1 -1
index fcca3a8eb9..924a3f9fd5 100644
@@ -24,8 +24,8 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/input/adb.h"
+#include "hw/input/adb-keys.h"
 #include "ui/console.h"
-#include "include/hw/input/adb-keys.h"
 #include "ui/input.h"
 #include "sysemu/sysemu.h"
 
hw/ssi/aspeed_smc.c +1 -2
index cb515730c5..5059396bc6 100644
@@ -26,8 +26,7 @@
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
-#include "include/qemu/error-report.h"
-#include "exec/address-spaces.h"
+#include "qemu/error-report.h"
 
 #include "hw/ssi/aspeed_smc.h"
 
numa.c +0 -1
index 100a67febf..ebc553b5d9 100644
@@ -29,7 +29,6 @@
 #include "qemu/bitmap.h"
 #include "qom/cpu.h"
 #include "qemu/error-report.h"
-#include "include/exec/cpu-common.h" /* for RAM_ADDR_FMT */
 #include "qapi-visit.h"
 #include "qapi/opts-visitor.h"
 #include "hw/boards.h"
Signature · 1 line
2.14.1
Reviewed-by on v1 9/34
#27 lore raw

Re: [Qemu-devel] [PATCH 09/34] misc: avoid "include/" in include path

Quoted 50 lines · Philippe Mathieu-Daudé

while here, remove unused #include from aspeed_smc.h

---
 hw/input/adb.c      | 2 +-
 hw/ssi/aspeed_smc.c | 3 +--
 numa.c              | 1 -
 3 files changed, 2 insertions(+), 4 deletions(-)
hw/input/adb.c +1 -1
index fcca3a8eb9..924a3f9fd5 100644
@@ -24,8 +24,8 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/input/adb.h"
+#include "hw/input/adb-keys.h"
 #include "ui/console.h"
-#include "include/hw/input/adb-keys.h"
 #include "ui/input.h"
 #include "sysemu/sysemu.h"
 
hw/ssi/aspeed_smc.c +1 -2
index cb515730c5..5059396bc6 100644
@@ -26,8 +26,7 @@
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
-#include "include/qemu/error-report.h"
-#include "exec/address-spaces.h"
+#include "qemu/error-report.h"
 
 #include "hw/ssi/aspeed_smc.h"
 
numa.c +0 -2
index 100a67febf..ebc553b5d9 100644
@@ -29,7 +29,6 @@
 #include "qemu/bitmap.h"
 #include "qom/cpu.h"
 #include "qemu/error-report.h"
-#include "include/exec/cpu-common.h" /* for RAM_ADDR_FMT */
 #include "qapi-visit.h"
 #include "qapi/opts-visitor.h"
 #include "hw/boards.h"
--
Quoted 1 line

2.14.1

"while here" usually indicates a patch should be split.

Otherwise

thanks
-- PMM

#28 lore raw

PATCH 10/34 amd_iommu: avoid needless includes in header file

In reply to Philippe Mathieu-Daudé

instead move them to the source file

---
 hw/i386/amd_iommu.h | 5 -----
 hw/i386/amd_iommu.c | 5 ++++-
 2 files changed, 4 insertions(+), 6 deletions(-)
hw/i386/amd_iommu.h +0 -5
index d370ae3549..aeef802364 100644
@@ -23,11 +23,6 @@
 
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
-#include "hw/pci/msi.h"
-#include "hw/sysbus.h"
-#include "sysemu/dma.h"
-#include "hw/i386/pc.h"
-#include "hw/pci/pci_bus.h"
 #include "hw/i386/x86-iommu.h"
 
 /* Capability registers */
hw/i386/amd_iommu.c +4 -1
index 334938a280..e1bf9c5329 100644
@@ -20,7 +20,10 @@
  * Cache implementation inspired by hw/i386/intel_iommu.c
  */
 #include "qemu/osdep.h"
-#include "hw/i386/amd_iommu.h"
+#include "hw/i386/pc.h"
+#include "hw/pci/msi.h"
+#include "hw/pci/pci_bus.h"
+#include "amd_iommu.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "trace.h"
Signature · 1 line
2.14.1
#30 lore raw

PATCH 11/34 i386/pc: use TYPE_PORT92

In reply to Philippe Mathieu-Daudé
---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/pc.c +1 -1
index 05985d4927..f116cede91 100644
@@ -1577,7 +1577,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
         qdev_prop_set_ptr(dev, "ps2_mouse", i8042);
         qdev_init_nofail(dev);
     }
-    port92 = isa_create_simple(isa_bus, "port92");
+    port92 = isa_create_simple(isa_bus, TYPE_PORT92);
     port92_init(port92, a20_line[1]);
     g_free(a20_line);
 
Signature · 1 line
2.14.1
Reviewed-by on v1 11/34
#31 lore raw

Re: [Qemu-devel] [PATCH 11/34] i386/pc: use TYPE_PORT92

Quoted 10 lines · Philippe Mathieu-Daudé
---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/pc.c +0 -0
index 05985d4927..f116cede91 100644

hw/i386/pc.c void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, · line 1582

Quoted 7 lines
hw/i386/pc.c +1 -1
@@ -1577,7 +1577,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
         qdev_prop_set_ptr(dev, "ps2_mouse", i8042);
         qdev_init_nofail(dev);
     }
-    port92 = isa_create_simple(isa_bus, "port92");
+    port92 = isa_create_simple(isa_bus, TYPE_PORT92);
     port92_init(port92, a20_line[1]);
     g_free(a20_line);
#32 lore raw

PATCH 12/34 misc: remove old i386 dependency

In reply to Philippe Mathieu-Daudé
---
 hw/audio/pcspk.c                    | 1 -
 hw/i386/kvm/pci-assign.c            | 1 -
 hw/i386/pci-assign-load-rom.c       | 1 -
 hw/i386/xen/xen_platform.c          | 1 -
 hw/isa/vt82c686.c                   | 1 -
 hw/misc/ivshmem.c                   | 1 -
 hw/misc/sga.c                       | 1 -
 hw/pci-bridge/pci_expander_bridge.c | 1 -
 monitor.c                           | 1 -
 9 files changed, 9 deletions(-)
hw/audio/pcspk.c +0 -1
index 0206f7399b..908696d483 100644
@@ -24,7 +24,6 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "hw/audio/soundhw.h"
 #include "audio/audio.h"
hw/i386/kvm/pci-assign.c +0 -1
index 33e20cb3e8..3f103a99db 100644
@@ -25,7 +25,6 @@
 #include <linux/kvm.h>
 #include "qapi/error.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "qemu/error-report.h"
 #include "ui/console.h"
 #include "hw/loader.h"
hw/i386/pci-assign-load-rom.c +0 -1
index 43429b66be..2c3a60392e 100644
@@ -4,7 +4,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "qemu/error-report.h"
 #include "ui/console.h"
 #include "hw/loader.h"
hw/i386/xen/xen_platform.c +0 -1
index 9ba7474566..880926f442 100644
@@ -26,7 +26,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/ide.h"
 #include "hw/pci/pci.h"
 #include "hw/irq.h"
hw/isa/vt82c686.c +0 -1
index 50dc83df77..2484a956c7 100644
@@ -12,7 +12,6 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/vt82c686.h"
 #include "hw/i2c/i2c.h"
 #include "hw/i2c/smbus.h"
hw/misc/ivshmem.c +0 -1
index b3ef3ec1e3..971bd759f4 100644
@@ -20,7 +20,6 @@
 #include "qapi/error.h"
 #include "qemu/cutils.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
hw/misc/sga.c +0 -1
index 03b006d6f0..97fd63f176 100644
@@ -26,7 +26,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/pci/pci.h"
-#include "hw/i386/pc.h"
 #include "hw/loader.h"
 #include "sysemu/sysemu.h"
 
hw/pci-bridge/pci_expander_bridge.c +0 -1
index ff59abf208..3295af3d20 100644
@@ -16,7 +16,6 @@
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_host.h"
 #include "hw/pci/pci_bridge.h"
-#include "hw/i386/pc.h"
 #include "qemu/range.h"
 #include "qemu/error-report.h"
 #include "sysemu/numa.h"
monitor.c +0 -1
index 058045b3cb..a1ae6a26f2 100644
@@ -28,7 +28,6 @@
 #include "hw/hw.h"
 #include "monitor/qdev.h"
 #include "hw/usb.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "sysemu/watchdog.h"
 #include "hw/loader.h"
Signature · 1 line
2.14.1
Reviewed-by on v1 12/34
#33 lore raw

Re: [Qemu-devel] [PATCH 12/34] misc: remove old i386 dependency

Quoted 12 lines · Philippe Mathieu-Daudé
---
 hw/audio/pcspk.c                    | 1 -
 hw/i386/kvm/pci-assign.c            | 1 -
 hw/i386/pci-assign-load-rom.c       | 1 -
 hw/i386/xen/xen_platform.c          | 1 -
 hw/isa/vt82c686.c                   | 1 -
 hw/misc/ivshmem.c                   | 1 -
 hw/misc/sga.c                       | 1 -
 hw/pci-bridge/pci_expander_bridge.c | 1 -
 monitor.c                           | 1 -
 9 files changed, 9 deletions(-)
Reviewed-by on v1 12/34
#34 lore raw

Re: [Qemu-devel] [PATCH 12/34] misc: remove old i386 dependency

In reply to Philippe Mathieu-Daudé
Quoted 13 lines · Philippe Mathieu-Daudé
---
 hw/audio/pcspk.c                    | 1 -
 hw/i386/kvm/pci-assign.c            | 1 -
 hw/i386/pci-assign-load-rom.c       | 1 -
 hw/i386/xen/xen_platform.c          | 1 -
 hw/isa/vt82c686.c                   | 1 -
 hw/misc/ivshmem.c                   | 1 -
 hw/misc/sga.c                       | 1 -
 hw/pci-bridge/pci_expander_bridge.c | 1 -
 monitor.c                           | 1 -
 9 files changed, 9 deletions(-)
Signature · 1 line
Anthony PERARD
#35 lore raw

PATCH 13/34 hw/ide: remove old i386 dependency

In reply to Philippe Mathieu-Daudé

and remove a duplicated include

---
 hw/ide/ahci.c       | 1 -
 hw/ide/cmd646.c     | 1 -
 hw/ide/core.c       | 3 +--
 hw/ide/ich.c        | 1 -
 hw/ide/isa.c        | 1 -
 hw/ide/microdrive.c | 1 -
 hw/ide/pci.c        | 1 -
 hw/ide/piix.c       | 2 +-
 hw/ide/via.c        | 1 -
 9 files changed, 2 insertions(+), 10 deletions(-)
hw/ide/ahci.c +0 -1
index 32d1296a64..2634f8db3d 100644
@@ -24,7 +24,6 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/pci/msi.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 
 #include "qemu/error-report.h"
hw/ide/cmd646.c +0 -1
index 86b2a8f504..65aff518ec 100644
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
hw/ide/core.c +1 -2
index d63eb4a72e..6438efa8f4 100644
@@ -24,17 +24,16 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/blockdev.h"
 #include "sysemu/dma.h"
 #include "hw/block/block.h"
 #include "sysemu/block-backend.h"
 #include "qemu/cutils.h"
-#include "qemu/error-report.h"
 
 #include "hw/ide/internal.h"
 #include "trace.h"
hw/ide/ich.c +0 -1
index 9472a60cab..48513c7e9d 100644
@@ -63,7 +63,6 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/pci/msi.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
hw/ide/isa.c +0 -1
index 40213d662c..9fb24fc92b 100644
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
hw/ide/microdrive.c +0 -1
index 17917c0b30..fde4d4645e 100644
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pcmcia.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
hw/ide/pci.c +0 -1
index f2dcc0ed77..34237c92fc 100644
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
hw/ide/piix.c +1 -1
index dfb21f65fa..a3afe1fd29 100644
@@ -25,11 +25,11 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/blockdev.h"
 #include "sysemu/dma.h"
 
 #include "hw/ide/pci.h"
hw/ide/via.c +0 -1
index 35c3059325..117ac4d95e 100644
@@ -25,7 +25,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/isa/isa.h"
 #include "sysemu/block-backend.h"
Signature · 1 line
2.14.1
#37 lore raw

PATCH 14/34 hw/ipmi: remove old i386 dependency

In reply to Philippe Mathieu-Daudé
---
 hw/ipmi/isa_ipmi_bt.c  | 1 -
 hw/ipmi/isa_ipmi_kcs.c | 1 -
 2 files changed, 2 deletions(-)
hw/ipmi/isa_ipmi_bt.c +0 -1
index 2fcc3d2e7c..e098fd5206 100644
@@ -26,7 +26,6 @@
 #include "hw/hw.h"
 #include "hw/ipmi/ipmi.h"
 #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
 
 /* Control register */
 #define IPMI_BT_CLR_WR_BIT         0
hw/ipmi/isa_ipmi_kcs.c +0 -1
index 80444977a0..689587b65d 100644
@@ -26,7 +26,6 @@
 #include "hw/hw.h"
 #include "hw/ipmi/ipmi.h"
 #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
 
 #define IPMI_KCS_OBF_BIT        0
 #define IPMI_KCS_IBF_BIT        1
Signature · 1 line
2.14.1
Reviewed-by Tested-by on v1 14/34
#38 lore raw

Re: [Qemu-devel] [PATCH 14/34] hw/ipmi: remove old i386 dependency

Quoted 1 line · Philippe Mathieu-Daudé

As mentioned before, I applied this series and did some basic testing, so

Quoted 29 lines
---
  hw/ipmi/isa_ipmi_bt.c  | 1 -
  hw/ipmi/isa_ipmi_kcs.c | 1 -
  2 files changed, 2 deletions(-)
hw/ipmi/isa_ipmi_bt.c +0 -1
index 2fcc3d2e7c..e098fd5206 100644
@@ -26,7 +26,6 @@
  #include "hw/hw.h"
  #include "hw/ipmi/ipmi.h"
  #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
 
  /* Control register */
  #define IPMI_BT_CLR_WR_BIT         0
hw/ipmi/isa_ipmi_kcs.c +0 -1
index 80444977a0..689587b65d 100644
@@ -26,7 +26,6 @@
  #include "hw/hw.h"
  #include "hw/ipmi/ipmi.h"
  #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
 
  #define IPMI_KCS_OBF_BIT        0
  #define IPMI_KCS_IBF_BIT        1
#39 lore raw

PATCH 15/34 hw/i2c: remove old i386 dependency

In reply to Philippe Mathieu-Daudé
---
 hw/i2c/pm_smbus.c   | 1 -
 hw/i2c/smbus_ich9.c | 1 -
 2 files changed, 2 deletions(-)
hw/i2c/pm_smbus.c +0 -1
index 6fc3923f56..a044dd1b27 100644
@@ -19,7 +19,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/i2c/pm_smbus.h"
 #include "hw/i2c/smbus.h"
 
hw/i2c/smbus_ich9.c +0 -1
index ea51e09186..082cdecba9 100644
@@ -26,7 +26,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/i2c/pm_smbus.h"
 #include "hw/pci/pci.h"
 #include "sysemu/sysemu.h"
Signature · 1 line
2.14.1
#41 lore raw

PATCH 16/34 hw/tpm: remove old i386 dependency

In reply to Philippe Mathieu-Daudé
---
 hw/tpm/tpm_passthrough.c | 1 -
 hw/tpm/tpm_tis.c         | 1 -
 2 files changed, 2 deletions(-)
hw/tpm/tpm_passthrough.c +0 -1
index 9234eb3459..461f551a0c 100644
@@ -29,7 +29,6 @@
 #include "sysemu/tpm_backend.h"
 #include "tpm_int.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "sysemu/tpm_backend_int.h"
 #include "tpm_tis.h"
 #include "tpm_util.h"
hw/tpm/tpm_tis.c +0 -1
index a6440fef91..a3a93f7229 100644
@@ -28,7 +28,6 @@
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci_ids.h"
 #include "tpm_tis.h"
 #include "qapi/error.h"
Signature · 1 line
2.14.1
Reviewed-by on v1 16/34
#42 lore raw

Re: [Qemu-devel] [PATCH 16/34] hw/tpm: remove old i386 dependency

Quoted 1 line · Philippe Mathieu-Daudé
Quoted 29 lines
---
  hw/tpm/tpm_passthrough.c | 1 -
  hw/tpm/tpm_tis.c         | 1 -
  2 files changed, 2 deletions(-)
hw/tpm/tpm_passthrough.c +0 -1
index 9234eb3459..461f551a0c 100644
@@ -29,7 +29,6 @@
  #include "sysemu/tpm_backend.h"
  #include "tpm_int.h"
  #include "hw/hw.h"
-#include "hw/i386/pc.h"
  #include "sysemu/tpm_backend_int.h"
  #include "tpm_tis.h"
  #include "tpm_util.h"
hw/tpm/tpm_tis.c +0 -1
index a6440fef91..a3a93f7229 100644
@@ -28,7 +28,6 @@
  #include "sysemu/block-backend.h"
  #include "exec/address-spaces.h"
  #include "hw/hw.h"
-#include "hw/i386/pc.h"
  #include "hw/pci/pci_ids.h"
  #include "tpm_tis.h"
  #include "qapi/error.h"
#43 lore raw

PATCH 17/34 hw/virtio-balloon: remove old i386 dependency

In reply to Philippe Mathieu-Daudé
---
 hw/virtio/virtio-balloon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/virtio-balloon.c +1 -1
index 37cde38982..14e08d20d0 100644
@@ -18,7 +18,7 @@
 #include "qemu/timer.h"
 #include "qemu-common.h"
 #include "hw/virtio/virtio.h"
-#include "hw/i386/pc.h"
+#include "hw/mem/pc-dimm.h"
 #include "sysemu/balloon.h"
 #include "hw/virtio/virtio-balloon.h"
 #include "sysemu/kvm.h"
Signature · 1 line
2.14.1
Reviewed-by on v1 17/34
#44 lore raw

Re: [Qemu-devel] [PATCH 17/34] hw/virtio-balloon: remove old i386 dependency

Quoted 11 lines · Philippe Mathieu-Daudé
---
 hw/virtio/virtio-balloon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/virtio-balloon.c +0 -0
index 37cde38982..14e08d20d0 100644

hw/virtio/virtio-balloon.c line 24

Quoted 8 lines
hw/virtio/virtio-balloon.c +1 -1
@@ -18,7 +18,7 @@
 #include "qemu/timer.h"
 #include "qemu-common.h"
 #include "hw/virtio/virtio.h"
-#include "hw/i386/pc.h"
+#include "hw/mem/pc-dimm.h"
 #include "sysemu/balloon.h"
 #include "hw/virtio/virtio-balloon.h"
 #include "sysemu/kvm.h"
#45 lore raw

PATCH 18/34 hw/unicore32: restrict hw addr defines to source file

In reply to Philippe Mathieu-Daudé

and drop unused #includes

---
 include/hw/unicore32/puv3.h | 10 ----------
 hw/unicore32/puv3.c         | 16 ++++++++++------
 2 files changed, 10 insertions(+), 16 deletions(-)
include/hw/unicore32/puv3.h +0 -10
index 5a4839f8df..f587a1f622 100644
@@ -14,16 +14,6 @@
 
 #define PUV3_REGS_OFFSET        (0x1000) /* 4K is reasonable */
 
-/* PKUnity System bus (AHB): 0xc0000000 - 0xedffffff (640MB) */
-#define PUV3_DMA_BASE           (0xc0200000) /* AHB-4 */
-
-/* PKUnity Peripheral bus (APB): 0xee000000 - 0xefffffff (128MB) */
-#define PUV3_GPIO_BASE          (0xee500000) /* APB-5 */
-#define PUV3_INTC_BASE          (0xee600000) /* APB-6 */
-#define PUV3_OST_BASE           (0xee800000) /* APB-8 */
-#define PUV3_PM_BASE            (0xeea00000) /* APB-10 */
-#define PUV3_PS2_BASE           (0xeeb00000) /* APB-11 */
-
 /* Hardware interrupts */
 #define PUV3_IRQS_NR            (32)
 
hw/unicore32/puv3.c +10 -6
index 504ea46211..6849bac59c 100644
@@ -11,16 +11,10 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "cpu.h"
 #include "ui/console.h"
-#include "elf.h"
-#include "exec/address-spaces.h"
-#include "hw/sysbus.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
-#include "hw/i386/pc.h"
-#include "qemu/error-report.h"
 #include "sysemu/qtest.h"
 
 #undef DEBUG_PUV3
@@ -29,6 +23,16 @@
 #define KERNEL_LOAD_ADDR        0x03000000
 #define KERNEL_MAX_SIZE         0x00800000 /* Just a guess */
 
+/* PKUnity System bus (AHB): 0xc0000000 - 0xedffffff (640MB) */
+#define PUV3_DMA_BASE           (0xc0200000) /* AHB-4 */
+
+/* PKUnity Peripheral bus (APB): 0xee000000 - 0xefffffff (128MB) */
+#define PUV3_GPIO_BASE          (0xee500000) /* APB-5 */
+#define PUV3_INTC_BASE          (0xee600000) /* APB-6 */
+#define PUV3_OST_BASE           (0xee800000) /* APB-8 */
+#define PUV3_PM_BASE            (0xeea00000) /* APB-10 */
+#define PUV3_PS2_BASE           (0xeeb00000) /* APB-11 */
+
 static void puv3_intc_cpu_handler(void *opaque, int irq, int level)
 {
     UniCore32CPU *cpu = opaque;
Signature · 1 line
2.14.1
Reviewed-by on v1 18/34
#46 lore raw

Re: [Qemu-devel] [PATCH 18/34] hw/unicore32: restrict hw addr defines to source file

Quoted 58 lines · Philippe Mathieu-Daudé

and drop unused #includes

---
 include/hw/unicore32/puv3.h | 10 ----------
 hw/unicore32/puv3.c         | 16 ++++++++++------
 2 files changed, 10 insertions(+), 16 deletions(-)
include/hw/unicore32/puv3.h +0 -10
index 5a4839f8df..f587a1f622 100644
@@ -14,16 +14,6 @@
 
 #define PUV3_REGS_OFFSET        (0x1000) /* 4K is reasonable */
 
-/* PKUnity System bus (AHB): 0xc0000000 - 0xedffffff (640MB) */
-#define PUV3_DMA_BASE           (0xc0200000) /* AHB-4 */
-
-/* PKUnity Peripheral bus (APB): 0xee000000 - 0xefffffff (128MB) */
-#define PUV3_GPIO_BASE          (0xee500000) /* APB-5 */
-#define PUV3_INTC_BASE          (0xee600000) /* APB-6 */
-#define PUV3_OST_BASE           (0xee800000) /* APB-8 */
-#define PUV3_PM_BASE            (0xeea00000) /* APB-10 */
-#define PUV3_PS2_BASE           (0xeeb00000) /* APB-11 */
-
 /* Hardware interrupts */
 #define PUV3_IRQS_NR            (32)
 
hw/unicore32/puv3.c +3 -6
index 504ea46211..6849bac59c 100644
@@ -11,16 +11,10 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "cpu.h"
 #include "ui/console.h"
-#include "elf.h"
-#include "exec/address-spaces.h"
-#include "hw/sysbus.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
-#include "hw/i386/pc.h"
-#include "qemu/error-report.h"
 #include "sysemu/qtest.h"
 
 #undef DEBUG_PUV3
@@ -29,6 +23,16 @@
 #define KERNEL_LOAD_ADDR        0x03000000
 #define KERNEL_MAX_SIZE         0x00800000 /* Just a guess */
 
+/* PKUnity System bus (AHB): 0xc0000000 - 0xedffffff (640MB) */
+#define PUV3_DMA_BASE           (0xc0200000) /* AHB-4 */
+

hw/unicore32/puv3.c line 38

Quoted 10 lines
hw/unicore32/puv3.c +7 -0
+/* PKUnity Peripheral bus (APB): 0xee000000 - 0xefffffff (128MB) */
+#define PUV3_GPIO_BASE          (0xee500000) /* APB-5 */
+#define PUV3_INTC_BASE          (0xee600000) /* APB-6 */
+#define PUV3_OST_BASE           (0xee800000) /* APB-8 */
+#define PUV3_PM_BASE            (0xeea00000) /* APB-10 */
+#define PUV3_PS2_BASE           (0xeeb00000) /* APB-11 */
+
 static void puv3_intc_cpu_handler(void *opaque, int irq, int level)
 {
     UniCore32CPU *cpu = opaque;
#47 lore raw

PATCH 19/34 hw/acpi: ACPI_PM_* defines are not restricted to i386 arch

In reply to Philippe Mathieu-Daudé
---
 include/hw/acpi/acpi.h | 12 ++++++++++++
 include/hw/i386/pc.h   | 13 -------------
 2 files changed, 12 insertions(+), 13 deletions(-)
include/hw/acpi/acpi.h +12 -0
index 7b3d93cf0d..30013b0464 100644
@@ -39,6 +39,18 @@
 #define ACPI_PM2_REGISTER_WIDTH         8
 #define ACPI_PM_TIMER_WIDTH             32
 
+/* PC-style peripherals (also used by other machines).  */
+#define ACPI_PM_PROP_S3_DISABLED "disable_s3"
+#define ACPI_PM_PROP_S4_DISABLED "disable_s4"
+#define ACPI_PM_PROP_S4_VAL "s4_val"
+#define ACPI_PM_PROP_SCI_INT "sci_int"
+#define ACPI_PM_PROP_ACPI_ENABLE_CMD "acpi_enable_cmd"
+#define ACPI_PM_PROP_ACPI_DISABLE_CMD "acpi_disable_cmd"
+#define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
+#define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
+#define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
+#define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
+
 /* PM Timer ticks per second (HZ) */
 #define PM_TIMER_FREQUENCY  3579545
 
include/hw/i386/pc.h +0 -13
index 087d184ef5..b1b4c918af 100644
@@ -151,19 +151,6 @@ struct PCMachineClass {
 #define PC_MACHINE_CLASS(klass) \
     OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
 
-/* PC-style peripherals (also used by other machines).  */
-
-#define ACPI_PM_PROP_S3_DISABLED "disable_s3"
-#define ACPI_PM_PROP_S4_DISABLED "disable_s4"
-#define ACPI_PM_PROP_S4_VAL "s4_val"
-#define ACPI_PM_PROP_SCI_INT "sci_int"
-#define ACPI_PM_PROP_ACPI_ENABLE_CMD "acpi_enable_cmd"
-#define ACPI_PM_PROP_ACPI_DISABLE_CMD "acpi_disable_cmd"
-#define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
-#define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
-#define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
-#define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
-
 /* parallel.c */
 
 void parallel_hds_isa_init(ISABus *bus, int n);
Signature · 1 line
2.14.1
#48 lore raw

PATCH 20/34 hw/timer/i8254: rename pit_init() -> i8254_pit_init()

In reply to Philippe Mathieu-Daudé

- add entry for i82378 in MAINTAINERS
- remove the old i386/pc dependency

---
 include/hw/timer/i8254.h          | 5 +++--
 include/hw/timer/i8254_internal.h | 2 +-
 hw/alpha/dp264.c                  | 2 +-
 hw/i386/pc.c                      | 2 +-
 hw/isa/i82378.c                   | 2 +-
 hw/mips/mips_fulong2e.c           | 2 +-
 hw/mips/mips_jazz.c               | 2 +-
 hw/mips/mips_malta.c              | 2 +-
 hw/mips/mips_r4k.c                | 2 +-
 hw/timer/i8254.c                  | 1 -
 hw/timer/i8254_common.c           | 1 -
 MAINTAINERS                       | 1 +
 12 files changed, 12 insertions(+), 12 deletions(-)
include/hw/timer/i8254.h +3 -2
index 5adae9fa44..5b12eb918e 100644
@@ -26,6 +26,7 @@
 #define HW_I8254_H
 
 #include "hw/hw.h"
+#include "hw/qdev.h"
 #include "hw/isa/isa.h"
 
 #define PIT_FREQ 1193182
@@ -48,8 +49,8 @@ typedef struct PITChannelInfo {
 #define TYPE_I8254 "isa-pit"
 #define TYPE_KVM_I8254 "kvm-pit"
 
-static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq,
-                                  qemu_irq alt_irq)
+static inline ISADevice *i8254_pit_init(ISABus *bus, int base, int isa_irq,
+                                        qemu_irq alt_irq)
 {
     DeviceState *dev;
     ISADevice *d;
include/hw/timer/i8254_internal.h +1 -1
index dc09cc0467..c37a438f82 100644
@@ -26,8 +26,8 @@
 #define QEMU_I8254_INTERNAL_H
 
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
+#include "qemu/timer.h"
 
 typedef struct PITChannelState {
     int count; /* can be 65536 */
hw/alpha/dp264.c +1 -1
index 1b121306c2..1bd5243648 100644
@@ -81,7 +81,7 @@ static void clipper_init(MachineState *machine)
     /* Since we have an SRM-compatible PALcode, use the SRM epoch.  */
     rtc_init(isa_bus, 1900, rtc_irq);
 
-    pit_init(isa_bus, 0x40, 0, NULL);
+    i8254_pit_init(isa_bus, 0x40, 0, NULL);
     isa_create_simple(isa_bus, "i8042");
 
     /* VGA setup.  Don't bother loading the bios.  */
hw/i386/pc.c +1 -1
index f116cede91..5cb0ae67cd 100644
@@ -1551,7 +1551,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
         if (kvm_pit_in_kernel()) {
             pit = kvm_pit_init(isa_bus, 0x40);
         } else {
-            pit = pit_init(isa_bus, 0x40, pit_isa_irq, pit_alt_irq);
+            pit = i8254_pit_init(isa_bus, 0x40, pit_isa_irq, pit_alt_irq);
         }
         if (hpet) {
             /* connect PIT to output control line of the HPET */
hw/isa/i82378.c +1 -1
index 4d29a9900c..7a8baef23c 100644
@@ -97,7 +97,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
     isa_bus_irqs(isabus, s->i8259);
 
     /* 1 82C54 (pit) */
-    isa = pit_init(isabus, 0x40, 0, NULL);
+    isa = i8254_pit_init(isabus, 0x40, 0, NULL);
 
     /* speaker */
     pcspk_init(isabus, isa);
hw/mips/mips_fulong2e.c +1 -1
index 75318680e1..22e6c05fb5 100644
@@ -363,7 +363,7 @@ static void mips_fulong2e_init(MachineState *machine)
     smbus_eeprom_init(smbus, 1, eeprom_spd, sizeof(eeprom_spd));
 
     /* init other devices */
-    pit = pit_init(isa_bus, 0x40, 0, NULL);
+    pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
     DMA_init(isa_bus, 0);
 
     /* Super I/O */
hw/mips/mips_jazz.c +1 -1
index 7e6626dc88..5f37852499 100644
@@ -222,7 +222,7 @@ static void mips_jazz_init(MachineState *machine,
     i8259 = i8259_init(isa_bus, env->irq[4]);
     isa_bus_irqs(isa_bus, i8259);
     DMA_init(isa_bus, 0);
-    pit = pit_init(isa_bus, 0x40, 0, NULL);
+    pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
     pcspk_init(isa_bus, pit);
 
     /* Video card */
hw/mips/mips_malta.c +1 -1
index 2adb9bcf89..de547d732f 100644
@@ -1217,7 +1217,7 @@ void mips_malta_init(MachineState *machine)
                           isa_get_irq(NULL, 9), NULL, 0, NULL);
     smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
     g_free(smbus_eeprom_buf);
-    pit = pit_init(isa_bus, 0x40, 0, NULL);
+    pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
     DMA_init(isa_bus, 0);
 
     /* Super I/O */
hw/mips/mips_r4k.c +1 -1
index 1272d4ef9d..48fad52540 100644
@@ -280,7 +280,7 @@ void mips_r4k_init(MachineState *machine)
 
     rtc_init(isa_bus, 2000, NULL);
 
-    pit = pit_init(isa_bus, 0x40, 0, NULL);
+    pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
 
     serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
 
hw/timer/i8254.c +0 -1
index 5e61ad50a8..dbc4a0baec 100644
@@ -23,7 +23,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "qemu/timer.h"
 #include "hw/timer/i8254.h"
hw/timer/i8254_common.c +0 -1
index ee064aa819..c850950699 100644
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "qemu/timer.h"
 #include "hw/timer/i8254.h"
MAINTAINERS +1 -0
index 7f49f1d046..f7d377ead9 100644
@@ -705,6 +705,7 @@ F: hw/ppc/prep.c
 F: hw/ppc/prep_systemio.c
 F: hw/ppc/rs6000_mc.c
 F: hw/pci-host/prep.[hc]
+F: hw/isa/i82378.c
 F: hw/isa/pc87312.[hc]
 F: pc-bios/ppc_rom.bin
 
Signature · 1 line
2.14.1
Reviewed-by on v1 20/34
#49 lore raw

Re: [Qemu-devel] [PATCH 20/34] hw/timer/i8254: rename pit_init() -> i8254_pit_init()

Quoted 4 lines · Philippe Mathieu-Daudé

- add entry for i82378 in MAINTAINERS
- remove the old i386/pc dependency

Quoted 15 lines
---
  include/hw/timer/i8254.h          | 5 +++--
  include/hw/timer/i8254_internal.h | 2 +-
  hw/alpha/dp264.c                  | 2 +-
  hw/i386/pc.c                      | 2 +-
  hw/isa/i82378.c                   | 2 +-
  hw/mips/mips_fulong2e.c           | 2 +-
  hw/mips/mips_jazz.c               | 2 +-
  hw/mips/mips_malta.c              | 2 +-
  hw/mips/mips_r4k.c                | 2 +-
  hw/timer/i8254.c                  | 1 -
  hw/timer/i8254_common.c           | 1 -
  MAINTAINERS                       | 1 +
  12 files changed, 12 insertions(+), 12 deletions(-)
#50 lore raw

PATCH 22/34 hw/input/i8042: extract API from hw/i386/pc.h

In reply to Philippe Mathieu-Daudé

- include vmmouse
- add entries in MAINTAINERS (pckbd.c, i8042.h)

---
 include/hw/i386/pc.h     | 11 -----------
 include/hw/input/i8042.h | 30 ++++++++++++++++++++++++++++++
 hw/alpha/dp264.c         |  3 ++-
 hw/i386/pc.c             |  5 +++--
 hw/input/pckbd.c         |  2 +-
 hw/input/vmmouse.c       |  3 +--
 hw/mips/mips_fulong2e.c  |  3 ++-
 hw/mips/mips_jazz.c      |  1 +
 hw/mips/mips_malta.c     |  3 ++-
 hw/mips/mips_r4k.c       |  3 ++-
 hw/misc/vmport.c         |  1 +
 hw/ppc/prep.c            |  5 +++--
 hw/sparc64/sun4u.c       |  3 ++-
 hw/unicore32/puv3.c      |  1 +
 MAINTAINERS              |  4 +++-
 15 files changed, 54 insertions(+), 24 deletions(-)
 create mode 100644 include/hw/input/i8042.h
include/hw/i386/pc.h +0 -11
index 25ba378bd8..6a2e947332 100644
@@ -193,17 +193,6 @@ static inline void vmport_init(ISABus *bus)
 }
 
 void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
-void vmmouse_get_data(uint32_t *data);
-void vmmouse_set_data(const uint32_t *data);
-
-/* pckbd.c */
-#define I8042_A20_LINE "a20"
-
-void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
-                   MemoryRegion *region, ram_addr_t size,
-                   hwaddr mask);
-void i8042_isa_mouse_fake_event(void *opaque);
-void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
 
 /* pc.c */
 extern int fd_bootchk;
include/hw/input/i8042.h new file +30 -0
new file mode 100644
index 0000000000..836417304b
@@ -0,0 +1,30 @@
+/*
+ * QEMU PS/2 Controller
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef HW_INPUT_I8042_H
+#define HW_INPUT_I8042_H
+
+#include "hw/hw.h"
+#include "hw/isa/isa.h"
+
+#define TYPE_I8042 "i8042"
+
+#define I8042_A20_LINE "a20"
+
+void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
+                   MemoryRegion *region, ram_addr_t size,
+                   hwaddr mask);
+void i8042_isa_mouse_fake_event(void *opaque);
+void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
+
+#define TYPE_VMMOUSE "vmmouse"
+
+void vmmouse_get_data(uint32_t *data);
+void vmmouse_set_data(const uint32_t *data);
+
+#endif /* HW_INPUT_I8042_H */
hw/alpha/dp264.c +2 -1
index 1bd5243648..2253990654 100644
@@ -19,6 +19,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/ide.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "hw/char/serial.h"
 #include "qemu/cutils.h"
 
@@ -82,7 +83,7 @@ static void clipper_init(MachineState *machine)
     rtc_init(isa_bus, 1900, rtc_irq);
 
     i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     /* VGA setup.  Don't bother loading the bios.  */
     pci_vga_init(pci_bus);
hw/i386/pc.c +3 -2
index 5cb0ae67cd..3aa10c780b 100644
@@ -40,6 +40,7 @@
 #include "multiboot.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "hw/audio/pcspk.h"
 #include "hw/pci/msi.h"
 #include "hw/sysbus.h"
@@ -1564,11 +1565,11 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
     parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS);
 
     a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2);
-    i8042 = isa_create_simple(isa_bus, "i8042");
+    i8042 = isa_create_simple(isa_bus, TYPE_I8042);
     i8042_setup_a20_line(i8042, a20_line[0]);
     if (!no_vmport) {
         vmport_init(isa_bus);
-        vmmouse = isa_try_create(isa_bus, "vmmouse");
+        vmmouse = isa_try_create(isa_bus, TYPE_VMMOUSE);
     } else {
         vmmouse = NULL;
     }
hw/input/pckbd.c +1 -1
index c479f827b6..f17f18e51b 100644
@@ -26,6 +26,7 @@
 #include "hw/isa/isa.h"
 #include "hw/i386/pc.h"
 #include "hw/input/ps2.h"
+#include "hw/input/i8042.h"
 #include "sysemu/sysemu.h"
 
 /* debug PC keyboard */
@@ -480,7 +481,6 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
     qemu_register_reset(kbd_reset, s);
 }
 
-#define TYPE_I8042 "i8042"
 #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042)
 
 typedef struct ISAKBDState {
hw/input/vmmouse.c +1 -2
index b6d22086f4..c48c07c564 100644
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "ui/console.h"
-#include "hw/input/ps2.h"
+#include "hw/input/i8042.h"
 #include "hw/i386/pc.h"
 #include "hw/qdev.h"
 
@@ -52,7 +52,6 @@
 #define DPRINTF(fmt, ...) do { } while (0)
 #endif
 
-#define TYPE_VMMOUSE "vmmouse"
 #define VMMOUSE(obj) OBJECT_CHECK(VMMouseState, (obj), TYPE_VMMOUSE)
 
 typedef struct VMMouseState
hw/mips/mips_fulong2e.c +2 -1
index 22e6c05fb5..a35745a407 100644
@@ -42,6 +42,7 @@
 #include "hw/isa/vt82c686.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
@@ -367,7 +368,7 @@ static void mips_fulong2e_init(MachineState *machine)
     DMA_init(isa_bus, 0);
 
     /* Super I/O */
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     rtc_init(isa_bus, 2000, NULL);
 
hw/mips/mips_jazz.c +1 -0
index 25f0294236..1bbef7eeb5 100644
@@ -41,6 +41,7 @@
 #include "hw/timer/i8254.h"
 #include "hw/display/vga.h"
 #include "hw/audio/pcspk.h"
+#include "hw/input/i8042.h"
 #include "sysemu/block-backend.h"
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
hw/mips/mips_malta.c +2 -1
index de547d732f..45c7f589aa 100644
@@ -45,6 +45,7 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
@@ -1221,7 +1222,7 @@ void mips_malta_init(MachineState *machine)
     DMA_init(isa_bus, 0);
 
     /* Super I/O */
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     rtc_init(isa_bus, 2000, NULL);
     serial_hds_isa_init(isa_bus, 0, 2);
hw/mips/mips_r4k.c +2 -1
index 48fad52540..946097a31f 100644
@@ -27,6 +27,7 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
@@ -295,7 +296,7 @@ void mips_r4k_init(MachineState *machine)
                      hd[MAX_IDE_DEVS * i],
 		     hd[MAX_IDE_DEVS * i + 1]);
 
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 }
 
 static void mips_machine_init(MachineClass *mc)
hw/misc/vmport.c +1 -0
index 165500223f..bc078eb20a 100644
@@ -25,6 +25,7 @@
 #include "hw/hw.h"
 #include "hw/isa/isa.h"
 #include "hw/i386/pc.h"
+#include "hw/input/i8042.h"
 #include "sysemu/hw_accel.h"
 #include "hw/qdev.h"
 
hw/ppc/prep.c +3 -2
index 94138a4e8c..16f4537093 100644
@@ -41,6 +41,7 @@
 #include "hw/ide.h"
 #include "hw/loader.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/isa/pc87312.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/arch_init.h"
@@ -643,7 +644,7 @@ static void ppc_prep_init(MachineState *machine)
                      hd[2 * i],
 		     hd[2 * i + 1]);
     }
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     cpu = POWERPC_CPU(first_cpu);
     sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];
@@ -775,7 +776,7 @@ static void ibm_40p_init(MachineState *machine)
 
     /* add some more devices */
     if (defaults_enabled()) {
-        isa_create_simple(isa_bus, "i8042");
+        isa_create_simple(isa_bus, TYPE_I8042);
         m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
 
         dev = DEVICE(isa_create(isa_bus, "cs4231a"));
hw/sparc64/sun4u.c +2 -1
index c3280aaf38..973daed977 100644
@@ -31,6 +31,7 @@
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
 #include "hw/timer/m48t59.h"
+#include "hw/input/i8042.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
 #include "qemu/timer.h"
@@ -488,7 +489,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
 
     pci_cmd646_ide_init(pci_bus, hd, 1);
 
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     /* Floppy */
     for(i = 0; i < MAX_FD; i++) {
hw/unicore32/puv3.c +1 -0
index 6849bac59c..cf79c89f12 100644
@@ -19,6 +19,7 @@
 
 #undef DEBUG_PUV3
 #include "hw/unicore32/puv3.h"
+#include "hw/input/i8042.h"
 
 #define KERNEL_LOAD_ADDR        0x03000000
 #define KERNEL_MAX_SIZE         0x00800000 /* Just a guess */
MAINTAINERS +3 -1
index f7d377ead9..cc1f8bb66b 100644
@@ -834,12 +834,13 @@ F: hw/misc/sga.c
 PC Chipset
 M: Michael S. Tsirkin <[email protected]>
 M: Paolo Bonzini <[email protected]>
-S: Support
+S: Supported
 F: hw/char/debugcon.c
 F: hw/char/parallel.c
 F: hw/char/serial*
 F: hw/dma/i8257*
 F: hw/i2c/pm_smbus.c
+F: hw/input/pckbd.c
 F: hw/intc/apic*
 F: hw/intc/ioapic*
 F: hw/intc/i8259*
@@ -849,6 +850,7 @@ F: hw/timer/hpet*
 F: hw/timer/i8254*
 F: hw/timer/mc146818rtc*
 F: include/hw/i2c/pm_smbus.h
+F: include/hw/input/i8042.h
 F: include/hw/timer/hpet.h
 F: include/hw/timer/i8254*
 F: include/hw/timer/mc146818rtc*
Signature · 1 line
2.14.1
Reviewed-by on v1 22/34
#51 lore raw

Re: [Qemu-devel] [PATCH 22/34] hw/input/i8042: extract API from hw/i386/pc.h

Quoted 21 lines · Philippe Mathieu-Daudé

- include vmmouse
- add entries in MAINTAINERS (pckbd.c, i8042.h)

---
  include/hw/i386/pc.h     | 11 -----------
  include/hw/input/i8042.h | 30 ++++++++++++++++++++++++++++++
  hw/alpha/dp264.c         |  3 ++-
  hw/i386/pc.c             |  5 +++--
  hw/input/pckbd.c         |  2 +-
  hw/input/vmmouse.c       |  3 +--
  hw/mips/mips_fulong2e.c  |  3 ++-
  hw/mips/mips_jazz.c      |  1 +
  hw/mips/mips_malta.c     |  3 ++-
  hw/mips/mips_r4k.c       |  3 ++-
  hw/misc/vmport.c         |  1 +
  hw/ppc/prep.c            |  5 +++--
  hw/sparc64/sun4u.c       |  3 ++-
  hw/unicore32/puv3.c      |  1 +
  MAINTAINERS              |  4 +++-
  15 files changed, 54 insertions(+), 24 deletions(-)
Quoted 1 line

create mode 100644 include/hw/input/i8042.h

Acked-by on v1 22/34
#52 lore raw

Re: [Qemu-devel] [PATCH 22/34] hw/input/i8042: extract API from hw/i386/pc.h

In reply to Philippe Mathieu-Daudé
Quoted 4 lines · Philippe Mathieu-Daudé

- include vmmouse
- add entries in MAINTAINERS (pckbd.c, i8042.h)

ppc portions

Quoted 342 lines
---
 include/hw/i386/pc.h     | 11 -----------
 include/hw/input/i8042.h | 30 ++++++++++++++++++++++++++++++
 hw/alpha/dp264.c         |  3 ++-
 hw/i386/pc.c             |  5 +++--
 hw/input/pckbd.c         |  2 +-
 hw/input/vmmouse.c       |  3 +--
 hw/mips/mips_fulong2e.c  |  3 ++-
 hw/mips/mips_jazz.c      |  1 +
 hw/mips/mips_malta.c     |  3 ++-
 hw/mips/mips_r4k.c       |  3 ++-
 hw/misc/vmport.c         |  1 +
 hw/ppc/prep.c            |  5 +++--
 hw/sparc64/sun4u.c       |  3 ++-
 hw/unicore32/puv3.c      |  1 +
 MAINTAINERS              |  4 +++-
 15 files changed, 54 insertions(+), 24 deletions(-)
 create mode 100644 include/hw/input/i8042.h
include/hw/i386/pc.h +0 -11
index 25ba378bd8..6a2e947332 100644
@@ -193,17 +193,6 @@ static inline void vmport_init(ISABus *bus)
 }
 
 void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
-void vmmouse_get_data(uint32_t *data);
-void vmmouse_set_data(const uint32_t *data);
-
-/* pckbd.c */
-#define I8042_A20_LINE "a20"
-
-void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
-                   MemoryRegion *region, ram_addr_t size,
-                   hwaddr mask);
-void i8042_isa_mouse_fake_event(void *opaque);
-void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
 
 /* pc.c */
 extern int fd_bootchk;
include/hw/input/i8042.h new file +30 -0
new file mode 100644
index 0000000000..836417304b
@@ -0,0 +1,30 @@
+/*
+ * QEMU PS/2 Controller
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef HW_INPUT_I8042_H
+#define HW_INPUT_I8042_H
+
+#include "hw/hw.h"
+#include "hw/isa/isa.h"
+
+#define TYPE_I8042 "i8042"
+
+#define I8042_A20_LINE "a20"
+
+void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
+                   MemoryRegion *region, ram_addr_t size,
+                   hwaddr mask);
+void i8042_isa_mouse_fake_event(void *opaque);
+void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
+
+#define TYPE_VMMOUSE "vmmouse"
+
+void vmmouse_get_data(uint32_t *data);
+void vmmouse_set_data(const uint32_t *data);
+
+#endif /* HW_INPUT_I8042_H */
hw/alpha/dp264.c +2 -1
index 1bd5243648..2253990654 100644
@@ -19,6 +19,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/ide.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "hw/char/serial.h"
 #include "qemu/cutils.h"
 
@@ -82,7 +83,7 @@ static void clipper_init(MachineState *machine)
     rtc_init(isa_bus, 1900, rtc_irq);
 
     i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     /* VGA setup.  Don't bother loading the bios.  */
     pci_vga_init(pci_bus);
hw/i386/pc.c +3 -2
index 5cb0ae67cd..3aa10c780b 100644
@@ -40,6 +40,7 @@
 #include "multiboot.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "hw/audio/pcspk.h"
 #include "hw/pci/msi.h"
 #include "hw/sysbus.h"
@@ -1564,11 +1565,11 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
     parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS);
 
     a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2);
-    i8042 = isa_create_simple(isa_bus, "i8042");
+    i8042 = isa_create_simple(isa_bus, TYPE_I8042);
     i8042_setup_a20_line(i8042, a20_line[0]);
     if (!no_vmport) {
         vmport_init(isa_bus);
-        vmmouse = isa_try_create(isa_bus, "vmmouse");
+        vmmouse = isa_try_create(isa_bus, TYPE_VMMOUSE);
     } else {
         vmmouse = NULL;
     }
hw/input/pckbd.c +1 -1
index c479f827b6..f17f18e51b 100644
@@ -26,6 +26,7 @@
 #include "hw/isa/isa.h"
 #include "hw/i386/pc.h"
 #include "hw/input/ps2.h"
+#include "hw/input/i8042.h"
 #include "sysemu/sysemu.h"
 
 /* debug PC keyboard */
@@ -480,7 +481,6 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
     qemu_register_reset(kbd_reset, s);
 }
 
-#define TYPE_I8042 "i8042"
 #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042)
 
 typedef struct ISAKBDState {
hw/input/vmmouse.c +1 -2
index b6d22086f4..c48c07c564 100644
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "ui/console.h"
-#include "hw/input/ps2.h"
+#include "hw/input/i8042.h"
 #include "hw/i386/pc.h"
 #include "hw/qdev.h"
 
@@ -52,7 +52,6 @@
 #define DPRINTF(fmt, ...) do { } while (0)
 #endif
 
-#define TYPE_VMMOUSE "vmmouse"
 #define VMMOUSE(obj) OBJECT_CHECK(VMMouseState, (obj), TYPE_VMMOUSE)
 
 typedef struct VMMouseState
hw/mips/mips_fulong2e.c +2 -1
index 22e6c05fb5..a35745a407 100644
@@ -42,6 +42,7 @@
 #include "hw/isa/vt82c686.h"
 #include "hw/timer/mc146818rtc.h"
 #include "hw/timer/i8254.h"
+#include "hw/input/i8042.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
@@ -367,7 +368,7 @@ static void mips_fulong2e_init(MachineState *machine)
     DMA_init(isa_bus, 0);
 
     /* Super I/O */
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     rtc_init(isa_bus, 2000, NULL);
 
hw/mips/mips_jazz.c +1 -0
index 25f0294236..1bbef7eeb5 100644
@@ -41,6 +41,7 @@
 #include "hw/timer/i8254.h"
 #include "hw/display/vga.h"
 #include "hw/audio/pcspk.h"
+#include "hw/input/i8042.h"
 #include "sysemu/block-backend.h"
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
hw/mips/mips_malta.c +2 -1
index de547d732f..45c7f589aa 100644
@@ -45,6 +45,7 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
@@ -1221,7 +1222,7 @@ void mips_malta_init(MachineState *machine)
     DMA_init(isa_bus, 0);
 
     /* Super I/O */
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     rtc_init(isa_bus, 2000, NULL);
     serial_hds_isa_init(isa_bus, 0, 2);
hw/mips/mips_r4k.c +2 -1
index 48fad52540..946097a31f 100644
@@ -27,6 +27,7 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
@@ -295,7 +296,7 @@ void mips_r4k_init(MachineState *machine)
                      hd[MAX_IDE_DEVS * i],
 		     hd[MAX_IDE_DEVS * i + 1]);
 
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 }
 
 static void mips_machine_init(MachineClass *mc)
hw/misc/vmport.c +1 -0
index 165500223f..bc078eb20a 100644
@@ -25,6 +25,7 @@
 #include "hw/hw.h"
 #include "hw/isa/isa.h"
 #include "hw/i386/pc.h"
+#include "hw/input/i8042.h"
 #include "sysemu/hw_accel.h"
 #include "hw/qdev.h"
 
hw/ppc/prep.c +3 -2
index 94138a4e8c..16f4537093 100644
@@ -41,6 +41,7 @@
 #include "hw/ide.h"
 #include "hw/loader.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/input/i8042.h"
 #include "hw/isa/pc87312.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/arch_init.h"
@@ -643,7 +644,7 @@ static void ppc_prep_init(MachineState *machine)
                      hd[2 * i],
 		     hd[2 * i + 1]);
     }
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     cpu = POWERPC_CPU(first_cpu);
     sysctrl->reset_irq = cpu->env.irq_inputs[PPC6xx_INPUT_HRESET];
@@ -775,7 +776,7 @@ static void ibm_40p_init(MachineState *machine)
 
     /* add some more devices */
     if (defaults_enabled()) {
-        isa_create_simple(isa_bus, "i8042");
+        isa_create_simple(isa_bus, TYPE_I8042);
         m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
 
         dev = DEVICE(isa_create(isa_bus, "cs4231a"));
hw/sparc64/sun4u.c +2 -1
index c3280aaf38..973daed977 100644
@@ -31,6 +31,7 @@
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
 #include "hw/timer/m48t59.h"
+#include "hw/input/i8042.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
 #include "qemu/timer.h"
@@ -488,7 +489,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
 
     pci_cmd646_ide_init(pci_bus, hd, 1);
 
-    isa_create_simple(isa_bus, "i8042");
+    isa_create_simple(isa_bus, TYPE_I8042);
 
     /* Floppy */
     for(i = 0; i < MAX_FD; i++) {
hw/unicore32/puv3.c +1 -0
index 6849bac59c..cf79c89f12 100644
@@ -19,6 +19,7 @@
 
 #undef DEBUG_PUV3
 #include "hw/unicore32/puv3.h"
+#include "hw/input/i8042.h"
 
 #define KERNEL_LOAD_ADDR        0x03000000
 #define KERNEL_MAX_SIZE         0x00800000 /* Just a guess */
MAINTAINERS +3 -1
index f7d377ead9..cc1f8bb66b 100644
@@ -834,12 +834,13 @@ F: hw/misc/sga.c
 PC Chipset
 M: Michael S. Tsirkin <[email protected]>
 M: Paolo Bonzini <[email protected]>
-S: Support
+S: Supported
 F: hw/char/debugcon.c
 F: hw/char/parallel.c
 F: hw/char/serial*
 F: hw/dma/i8257*
 F: hw/i2c/pm_smbus.c
+F: hw/input/pckbd.c
 F: hw/intc/apic*
 F: hw/intc/ioapic*
 F: hw/intc/i8259*
@@ -849,6 +850,7 @@ F: hw/timer/hpet*
 F: hw/timer/i8254*
 F: hw/timer/mc146818rtc*
 F: include/hw/i2c/pm_smbus.h
+F: include/hw/input/i8042.h
 F: include/hw/timer/hpet.h
 F: include/hw/timer/i8254*
 F: include/hw/timer/mc146818rtc*
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#53 lore raw

PATCH 23/34 hw/dma/i8257: rename DMA_init() to i8257_dma_init()

In reply to Philippe Mathieu-Daudé

- move the header from hw/isa/ to hw/dma/
- add entry for i82374 in MAINTAINERS
- remove the old i386/pc dependency

---
 include/hw/{isa/i8257.h => dma/i8257_dma.h} | 6 ++++++
 include/hw/isa/isa.h                        | 2 --
 hw/dma/i82374.c                             | 3 ++-
 hw/dma/i8257.c                              | 4 ++--
 hw/i386/pc.c                                | 3 ++-
 hw/mips/mips_fulong2e.c                     | 3 ++-
 hw/mips/mips_jazz.c                         | 3 ++-
 hw/mips/mips_malta.c                        | 3 ++-
 hw/sparc/sun4m.c                            | 4 ----
 hw/sparc64/sun4u.c                          | 4 ----
 MAINTAINERS                                 | 2 ++
 11 files changed, 20 insertions(+), 17 deletions(-)
 rename include/hw/{isa/i8257.h => dma/i8257_dma.h} (86%)
include/hw/dma/i8257_dma.h renamed from include/hw/isa/i8257.h +6 -0
similarity index 86%
rename from include/hw/isa/i8257.h
rename to include/hw/dma/i8257_dma.h
index 88a2766a3f..0041565177 100644
@@ -1,6 +1,10 @@
 #ifndef HW_I8257_H
 #define HW_I8257_H
 
+#include "hw/hw.h"
+#include "hw/isa/isa.h"
+#include "exec/ioport.h"
+
 #define TYPE_I8257 "i8257"
 
 typedef struct I8257Regs {
@@ -40,4 +44,6 @@ typedef struct I8257State {
     PortioList portio_pageh;
 } I8257State;
 
+void i8257_dma_init(ISABus *bus, int high_page_enable);
+
 #endif
include/hw/isa/isa.h +0 -2
index 95593408ef..b9dbab24b4 100644
@@ -151,6 +151,4 @@ static inline ISABus *isa_bus_from_device(ISADevice *d)
     return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
 }
 
-/* i8257.c */
-void DMA_init(ISABus *bus, int high_page_enable);
 #endif
hw/dma/i82374.c +2 -1
index 6c0f975df0..4048bedcf2 100644
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/isa/isa.h"
+#include "hw/dma/i8257_dma.h"
 
 #define TYPE_I82374 "i82374"
 #define I82374(obj) OBJECT_CHECK(I82374State, (obj), TYPE_I82374)
@@ -123,7 +124,7 @@ static void i82374_realize(DeviceState *dev, Error **errp)
     portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj),
                     s->iobase);
 
-    DMA_init(isa_bus_from_device(ISA_DEVICE(dev)), 1);
+    i8257_dma_init(isa_bus_from_device(ISA_DEVICE(dev)), 1);
     memset(s->commands, 0, sizeof(s->commands));
 }
 
hw/dma/i8257.c +2 -2
index bd23e893bf..a8f26b003b 100644
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/isa/isa.h"
-#include "hw/isa/i8257.h"
+#include "hw/dma/i8257_dma.h"
 #include "qemu/main-loop.h"
 #include "trace.h"
 
@@ -622,7 +622,7 @@ static void i8257_register_types(void)
 
 type_init(i8257_register_types)
 
-void DMA_init(ISABus *bus, int high_page_enable)
+void i8257_dma_init(ISABus *bus, int high_page_enable)
 {
     ISADevice *isa1, *isa2;
     DeviceState *d;
hw/i386/pc.c +2 -1
index 3aa10c780b..76d4be5991 100644
@@ -39,6 +39,7 @@
 #include "elf.h"
 #include "multiboot.h"
 #include "hw/timer/mc146818rtc.h"
+#include "hw/dma/i8257_dma.h"
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
 #include "hw/audio/pcspk.h"
@@ -1582,7 +1583,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
     port92_init(port92, a20_line[1]);
     g_free(a20_line);
 
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
     for(i = 0; i < MAX_FD; i++) {
         fd[i] = drive_get(IF_FLOPPY, 0, i);
hw/mips/mips_fulong2e.c +2 -1
index a35745a407..6dc6a0ac18 100644
@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/dma/i8257_dma.h"
 #include "hw/char/serial.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
@@ -365,7 +366,7 @@ static void mips_fulong2e_init(MachineState *machine)
 
     /* init other devices */
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_I8042);
hw/mips/mips_jazz.c +2 -1
index 1bbef7eeb5..1b54602c1d 100644
@@ -27,6 +27,7 @@
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
 #include "hw/i386/pc.h"
+#include "hw/dma/i8257_dma.h"
 #include "hw/char/serial.h"
 #include "hw/isa/isa.h"
 #include "hw/block/fdc.h"
@@ -223,7 +224,7 @@ static void mips_jazz_init(MachineState *machine,
     /* ISA devices */
     i8259 = i8259_init(isa_bus, env->irq[4]);
     isa_bus_irqs(isa_bus, i8259);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
     pcspk_init(isa_bus, pit);
 
hw/mips/mips_malta.c +2 -1
index 45c7f589aa..050da36f1d 100644
@@ -27,6 +27,7 @@
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/dma/i8257_dma.h"
 #include "hw/char/serial.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
@@ -1219,7 +1220,7 @@ void mips_malta_init(MachineState *machine)
     smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
     g_free(smbus_eeprom_buf);
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_I8042);
hw/sparc/sun4m.c +0 -4
index e1bdd4828d..a4ba3d2917 100644
@@ -101,10 +101,6 @@ struct sun4m_hwdef {
     uint8_t nvram_machine_id;
 };
 
-void DMA_init(ISABus *bus, int high_page_enable)
-{
-}
-
 static void fw_cfg_boot_set(void *opaque, const char *boot_device,
                             Error **errp)
 {
hw/sparc64/sun4u.c +0 -4
index 973daed977..fd10741607 100644
@@ -86,10 +86,6 @@ typedef struct EbusState {
     MemoryRegion bar1;
 } EbusState;
 
-void DMA_init(ISABus *bus, int high_page_enable)
-{
-}
-
 static void fw_cfg_boot_set(void *opaque, const char *boot_device,
                             Error **errp)
 {
MAINTAINERS +2 -0
index cc1f8bb66b..a79723601c 100644
@@ -707,6 +707,7 @@ F: hw/ppc/rs6000_mc.c
 F: hw/pci-host/prep.[hc]
 F: hw/isa/i82378.c
 F: hw/isa/pc87312.[hc]
+F: hw/dma/i82374.c
 F: pc-bios/ppc_rom.bin
 
 sPAPR
@@ -849,6 +850,7 @@ F: hw/misc/pc-testdev.c
 F: hw/timer/hpet*
 F: hw/timer/i8254*
 F: hw/timer/mc146818rtc*
+F: include/hw/dma/i8257_dma.h
 F: include/hw/i2c/pm_smbus.h
 F: include/hw/input/i8042.h
 F: include/hw/timer/hpet.h
Signature · 1 line
2.14.1
#54 lore raw

Re: [Qemu-devel] [PATCH 23/34] hw/dma/i8257: rename DMA_init() to i8257_dma_init()

Hi,

Quoted 39 lines · Philippe Mathieu-Daudé

- move the header from hw/isa/ to hw/dma/
- add entry for i82374 in MAINTAINERS
- remove the old i386/pc dependency

---
  include/hw/{isa/i8257.h => dma/i8257_dma.h} | 6 ++++++
  include/hw/isa/isa.h                        | 2 --
  hw/dma/i82374.c                             | 3 ++-
  hw/dma/i8257.c                              | 4 ++--
  hw/i386/pc.c                                | 3 ++-
  hw/mips/mips_fulong2e.c                     | 3 ++-
  hw/mips/mips_jazz.c                         | 3 ++-
  hw/mips/mips_malta.c                        | 3 ++-
  hw/sparc/sun4m.c                            | 4 ----
  hw/sparc64/sun4u.c                          | 4 ----
  MAINTAINERS                                 | 2 ++
  11 files changed, 20 insertions(+), 17 deletions(-)

rename include/hw/{isa/i8257.h => dma/i8257_dma.h} (86%)

include/hw/dma/i8257_dma.h renamed from include/hw/isa/i8257.h +4 -0
similarity index 86%
rename from include/hw/isa/i8257.h
rename to include/hw/dma/i8257_dma.h
index 88a2766a3f..0041565177 100644
@@ -1,6 +1,10 @@
  #ifndef HW_I8257_H
  #define HW_I8257_H
 
+#include "hw/hw.h"
+#include "hw/isa/isa.h"
+#include "exec/ioport.h"
+
  #define TYPE_I8257 "i8257"
 
  typedef struct I8257Regs {

include/hw/dma/i8257_dma.h typedef struct I8257State { · line 48

Quoted 5 lines
include/hw/dma/i8257_dma.h renamed from include/hw/isa/i8257.h +2 -0
@@ -40,4 +44,6 @@ typedef struct I8257State {
      PortioList portio_pageh;
  } I8257State;
 
+void i8257_dma_init(ISABus *bus, int high_page_enable);
+

As you're changing the DMA_init prototype, can you add an Error **errp parameter, and pass &error_abort in each caller?

See http://lists.gnu.org/archive/html/qemu-devel/2017-09/msg00262.html for more details

Hervé

Quoted 190 lines
include/hw/dma/i8257_dma.h renamed from include/hw/isa/i8257.h +0 -0
  #endif
include/hw/isa/isa.h +0 -2
index 95593408ef..b9dbab24b4 100644
@@ -151,6 +151,4 @@ static inline ISABus *isa_bus_from_device(ISADevice *d)
      return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
  }
 
-/* i8257.c */
-void DMA_init(ISABus *bus, int high_page_enable);
  #endif
hw/dma/i82374.c +2 -1
index 6c0f975df0..4048bedcf2 100644
@@ -24,6 +24,7 @@
 
  #include "qemu/osdep.h"
  #include "hw/isa/isa.h"
+#include "hw/dma/i8257_dma.h"
 
  #define TYPE_I82374 "i82374"
  #define I82374(obj) OBJECT_CHECK(I82374State, (obj), TYPE_I82374)
@@ -123,7 +124,7 @@ static void i82374_realize(DeviceState *dev, Error **errp)
      portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj),
                      s->iobase);
 
-    DMA_init(isa_bus_from_device(ISA_DEVICE(dev)), 1);
+    i8257_dma_init(isa_bus_from_device(ISA_DEVICE(dev)), 1);
      memset(s->commands, 0, sizeof(s->commands));
  }
 
hw/dma/i8257.c +2 -2
index bd23e893bf..a8f26b003b 100644
@@ -24,7 +24,7 @@
  #include "qemu/osdep.h"
  #include "hw/hw.h"
  #include "hw/isa/isa.h"
-#include "hw/isa/i8257.h"
+#include "hw/dma/i8257_dma.h"
  #include "qemu/main-loop.h"
  #include "trace.h"
 
@@ -622,7 +622,7 @@ static void i8257_register_types(void)
 
  type_init(i8257_register_types)
 
-void DMA_init(ISABus *bus, int high_page_enable)
+void i8257_dma_init(ISABus *bus, int high_page_enable)
  {
      ISADevice *isa1, *isa2;
      DeviceState *d;
hw/i386/pc.c +2 -1
index 3aa10c780b..76d4be5991 100644
@@ -39,6 +39,7 @@
  #include "elf.h"
  #include "multiboot.h"
  #include "hw/timer/mc146818rtc.h"
+#include "hw/dma/i8257_dma.h"
  #include "hw/timer/i8254.h"
  #include "hw/input/i8042.h"
  #include "hw/audio/pcspk.h"
@@ -1582,7 +1583,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
      port92_init(port92, a20_line[1]);
      g_free(a20_line);
 
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
      for(i = 0; i < MAX_FD; i++) {
          fd[i] = drive_get(IF_FLOPPY, 0, i);
hw/mips/mips_fulong2e.c +2 -1
index a35745a407..6dc6a0ac18 100644
@@ -22,6 +22,7 @@
  #include "qapi/error.h"
  #include "hw/hw.h"
  #include "hw/i386/pc.h"
+#include "hw/dma/i8257_dma.h"
  #include "hw/char/serial.h"
  #include "hw/block/fdc.h"
  #include "net/net.h"
@@ -365,7 +366,7 @@ static void mips_fulong2e_init(MachineState *machine)
 
      /* init other devices */
      pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
      /* Super I/O */
      isa_create_simple(isa_bus, TYPE_I8042);
hw/mips/mips_jazz.c +2 -1
index 1bbef7eeb5..1b54602c1d 100644
@@ -27,6 +27,7 @@
  #include "hw/mips/mips.h"
  #include "hw/mips/cpudevs.h"
  #include "hw/i386/pc.h"
+#include "hw/dma/i8257_dma.h"
  #include "hw/char/serial.h"
  #include "hw/isa/isa.h"
  #include "hw/block/fdc.h"
@@ -223,7 +224,7 @@ static void mips_jazz_init(MachineState *machine,
      /* ISA devices */
      i8259 = i8259_init(isa_bus, env->irq[4]);
      isa_bus_irqs(isa_bus, i8259);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
      pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
      pcspk_init(isa_bus, pit);
 
hw/mips/mips_malta.c +2 -1
index 45c7f589aa..050da36f1d 100644
@@ -27,6 +27,7 @@
  #include "cpu.h"
  #include "hw/hw.h"
  #include "hw/i386/pc.h"
+#include "hw/dma/i8257_dma.h"
  #include "hw/char/serial.h"
  #include "hw/block/fdc.h"
  #include "net/net.h"
@@ -1219,7 +1220,7 @@ void mips_malta_init(MachineState *machine)
      smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
      g_free(smbus_eeprom_buf);
      pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    DMA_init(isa_bus, 0);
+    i8257_dma_init(isa_bus, 0);
 
      /* Super I/O */
      isa_create_simple(isa_bus, TYPE_I8042);
hw/sparc/sun4m.c +0 -4
index e1bdd4828d..a4ba3d2917 100644
@@ -101,10 +101,6 @@ struct sun4m_hwdef {
      uint8_t nvram_machine_id;
  };
 
-void DMA_init(ISABus *bus, int high_page_enable)
-{
-}
-
  static void fw_cfg_boot_set(void *opaque, const char *boot_device,
                              Error **errp)
  {
hw/sparc64/sun4u.c +0 -4
index 973daed977..fd10741607 100644
@@ -86,10 +86,6 @@ typedef struct EbusState {
      MemoryRegion bar1;
  } EbusState;
 
-void DMA_init(ISABus *bus, int high_page_enable)
-{
-}
-
  static void fw_cfg_boot_set(void *opaque, const char *boot_device,
                              Error **errp)
  {
MAINTAINERS +2 -0
index cc1f8bb66b..a79723601c 100644
@@ -707,6 +707,7 @@ F: hw/ppc/rs6000_mc.c
  F: hw/pci-host/prep.[hc]
  F: hw/isa/i82378.c
  F: hw/isa/pc87312.[hc]
+F: hw/dma/i82374.c
  F: pc-bios/ppc_rom.bin
 
  sPAPR
@@ -849,6 +850,7 @@ F: hw/misc/pc-testdev.c
  F: hw/timer/hpet*
  F: hw/timer/i8254*
  F: hw/timer/mc146818rtc*
+F: include/hw/dma/i8257_dma.h
  F: include/hw/i2c/pm_smbus.h
  F: include/hw/input/i8042.h
  F: include/hw/timer/hpet.h
#55 lore raw

Re: [Qemu-devel] [Qemu-trivial] [PATCH 23/34] hw/dma/i8257: rename DMA_init() to i8257_dma_init()

Quoted 1 line · Hervé Poussineau

Le 22/09/2017 à 18:01, Philippe Mathieu-Daudé a écrit :

[...]

Quoted 6 lines

include/hw/dma/i8257_dma.h typedef struct I8257State { · line 48

Quoted 2 lines
include/hw/dma/i8257_dma.h renamed from include/hw/isa/i8257.h +2 -0
+void i8257_dma_init(ISABus *bus, int high_page_enable);
+

As you're changing the DMA_init prototype, can you add an Error **errp parameter, and pass &error_abort in each caller?

See http://lists.gnu.org/archive/html/qemu-devel/2017-09/msg00262.html for more details

If Eduardo doesn't have a patch ready I can do it.

#56 lore raw

Re: [Qemu-devel] [Qemu-trivial] [PATCH 23/34] hw/dma/i8257: rename DMA_init() to i8257_dma_init()

Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 1 line · Hervé Poussineau

Le 22/09/2017 à 18:01, Philippe Mathieu-Daudé a écrit :

[...]

Quoted 6 lines

include/hw/dma/i8257_dma.h typedef struct I8257State { · line 48

Quoted 2 lines
include/hw/dma/i8257_dma.h renamed from include/hw/isa/i8257.h +2 -0
+void i8257_dma_init(ISABus *bus, int high_page_enable);
+

As you're changing the DMA_init prototype, can you add an Error **errp parameter, and pass &error_abort in each caller?

Quoted 4 lines
Quoted 2 lines

See http://lists.gnu.org/archive/html/qemu-devel/2017-09/msg00262.html
for more details

If Eduardo doesn't have a patch ready I can do it.

Please go ahead.
You can also use my patch set (v2) for that as a base if you want.
https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg08007.html

Signature · 2 lines
Eduardo Otubo
Senior Software Engineer @ RedHat
#57 lore raw

PATCH 24/34 hw/timer/mc146818: rename rtc_init() -> mc146818_init()

In reply to Philippe Mathieu-Daudé

and remove the old i386/pc dependency

---
 include/hw/timer/mc146818rtc.h | 3 ++-
 hw/alpha/dp264.c               | 2 +-
 hw/i386/pc.c                   | 2 +-
 hw/isa/i82378.c                | 3 ++-
 hw/mips/mips_fulong2e.c        | 2 +-
 hw/mips/mips_jazz.c            | 2 +-
 hw/mips/mips_malta.c           | 2 +-
 hw/mips/mips_r4k.c             | 2 +-
 hw/ppc/pnv.c                   | 2 +-
 hw/timer/mc146818rtc.c         | 2 +-
 10 files changed, 12 insertions(+), 10 deletions(-)
include/hw/timer/mc146818rtc.h +2 -1
index 7c8e64b203..fe6ed63f71 100644
@@ -6,7 +6,8 @@
 
 #define TYPE_MC146818_RTC "mc146818rtc"
 
-ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq);
+ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
+                             qemu_irq intercept_irq);
 void rtc_set_memory(ISADevice *dev, int addr, int val);
 int rtc_get_memory(ISADevice *dev, int addr);
 
hw/alpha/dp264.c +1 -1
index 2253990654..df6dadf13f 100644
@@ -80,7 +80,7 @@ static void clipper_init(MachineState *machine)
                            clipper_pci_map_irq);
 
     /* Since we have an SRM-compatible PALcode, use the SRM epoch.  */
-    rtc_init(isa_bus, 1900, rtc_irq);
+    mc146818_rtc_init(isa_bus, 1900, rtc_irq);
 
     i8254_pit_init(isa_bus, 0x40, 0, NULL);
     isa_create_simple(isa_bus, TYPE_I8042);
hw/i386/pc.c +1 -1
index 76d4be5991..788844e0de 100644
@@ -1545,7 +1545,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
             rtc_irq = qdev_get_gpio_in(hpet, HPET_LEGACY_RTC_INT);
         }
     }
-    *rtc_state = rtc_init(isa_bus, 2000, rtc_irq);
+    *rtc_state = mc146818_rtc_init(isa_bus, 2000, rtc_irq);
 
     qemu_register_boot_set(pc_boot_set, *rtc_state);
 
hw/isa/i82378.c +2 -1
index 7a8baef23c..14b006cadc 100644
@@ -21,6 +21,7 @@
 #include "hw/pci/pci.h"
 #include "hw/i386/pc.h"
 #include "hw/timer/i8254.h"
+#include "hw/timer/mc146818rtc.h"
 #include "hw/audio/pcspk.h"
 
 #define TYPE_I82378 "i82378"
@@ -106,7 +107,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
     isa = isa_create_simple(isabus, "i82374");
 
     /* timer */
-    isa_create_simple(isabus, "mc146818rtc");
+    isa_create_simple(isabus, TYPE_MC146818_RTC);
 }
 
 static void i82378_init(Object *obj)
hw/mips/mips_fulong2e.c +1 -1
index 6dc6a0ac18..7ebbffa8f2 100644
@@ -371,7 +371,7 @@ static void mips_fulong2e_init(MachineState *machine)
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_I8042);
 
-    rtc_init(isa_bus, 2000, NULL);
+    mc146818_rtc_init(isa_bus, 2000, NULL);
 
     serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
     parallel_hds_isa_init(isa_bus, 1);
hw/mips/mips_jazz.c +1 -1
index 1b54602c1d..439bbd71fe 100644
@@ -295,7 +295,7 @@ static void mips_jazz_init(MachineState *machine,
     fdctrl_init_sysbus(qdev_get_gpio_in(rc4030, 1), -1, 0x80003000, fds);
 
     /* Real time clock */
-    rtc_init(isa_bus, 1980, NULL);
+    mc146818_rtc_init(isa_bus, 1980, NULL);
     memory_region_init_io(rtc, NULL, &rtc_ops, NULL, "rtc", 0x1000);
     memory_region_add_subregion(address_space, 0x80004000, rtc);
 
hw/mips/mips_malta.c +1 -1
index 050da36f1d..6945fa47c3 100644
@@ -1225,7 +1225,7 @@ void mips_malta_init(MachineState *machine)
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_I8042);
 
-    rtc_init(isa_bus, 2000, NULL);
+    mc146818_rtc_init(isa_bus, 2000, NULL);
     serial_hds_isa_init(isa_bus, 0, 2);
     parallel_hds_isa_init(isa_bus, 1);
 
hw/mips/mips_r4k.c +1 -1
index 946097a31f..349da59912 100644
@@ -279,7 +279,7 @@ void mips_r4k_init(MachineState *machine)
     i8259 = i8259_init(isa_bus, env->irq[2]);
     isa_bus_irqs(isa_bus, i8259);
 
-    rtc_init(isa_bus, 2000, NULL);
+    mc146818_rtc_init(isa_bus, 2000, NULL);
 
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
 
hw/ppc/pnv.c +1 -1
index 47221158d4..d188b899c5 100644
@@ -647,7 +647,7 @@ static void ppc_powernv_init(MachineState *machine)
     serial_hds_isa_init(pnv->isa_bus, 0, MAX_SERIAL_PORTS);
 
     /* Create an RTC ISA device too */
-    rtc_init(pnv->isa_bus, 2000, NULL);
+    mc146818_rtc_init(pnv->isa_bus, 2000, NULL);
 
     /* OpenPOWER systems use a IPMI SEL Event message to notify the
      * host to powerdown */
hw/timer/mc146818rtc.c +1 -1
index 82843ed03f..f7d8c4bae4 100644
@@ -997,7 +997,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
     qdev_init_gpio_out(dev, &s->irq, 1);
 }
 
-ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
+ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
 {
     DeviceState *dev;
     ISADevice *isadev;
Signature · 1 line
2.14.1
Reviewed-by on v1 24/34
#58 lore raw

Re: [Qemu-devel] [PATCH 24/34] hw/timer/mc146818: rename rtc_init() -> mc146818_init()

Quoted 15 lines · Philippe Mathieu-Daudé

and remove the old i386/pc dependency

---
  include/hw/timer/mc146818rtc.h | 3 ++-
  hw/alpha/dp264.c               | 2 +-
  hw/i386/pc.c                   | 2 +-
  hw/isa/i82378.c                | 3 ++-
  hw/mips/mips_fulong2e.c        | 2 +-
  hw/mips/mips_jazz.c            | 2 +-
  hw/mips/mips_malta.c           | 2 +-
  hw/mips/mips_r4k.c             | 2 +-
  hw/ppc/pnv.c                   | 2 +-
  hw/timer/mc146818rtc.c         | 2 +-
  10 files changed, 12 insertions(+), 10 deletions(-)
Reviewed-by on v1 24/34
#59 lore raw

Re: [Qemu-devel] [PATCH 24/34] hw/timer/mc146818: rename rtc_init() -> mc146818_init()

In reply to Philippe Mathieu-Daudé
Quoted 3 lines · Philippe Mathieu-Daudé

and remove the old i386/pc dependency

Quoted 152 lines
---
 include/hw/timer/mc146818rtc.h | 3 ++-
 hw/alpha/dp264.c               | 2 +-
 hw/i386/pc.c                   | 2 +-
 hw/isa/i82378.c                | 3 ++-
 hw/mips/mips_fulong2e.c        | 2 +-
 hw/mips/mips_jazz.c            | 2 +-
 hw/mips/mips_malta.c           | 2 +-
 hw/mips/mips_r4k.c             | 2 +-
 hw/ppc/pnv.c                   | 2 +-
 hw/timer/mc146818rtc.c         | 2 +-
 10 files changed, 12 insertions(+), 10 deletions(-)
include/hw/timer/mc146818rtc.h +2 -1
index 7c8e64b203..fe6ed63f71 100644
@@ -6,7 +6,8 @@
 
 #define TYPE_MC146818_RTC "mc146818rtc"
 
-ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq);
+ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
+                             qemu_irq intercept_irq);
 void rtc_set_memory(ISADevice *dev, int addr, int val);
 int rtc_get_memory(ISADevice *dev, int addr);
 
hw/alpha/dp264.c +1 -1
index 2253990654..df6dadf13f 100644
@@ -80,7 +80,7 @@ static void clipper_init(MachineState *machine)
                            clipper_pci_map_irq);
 
     /* Since we have an SRM-compatible PALcode, use the SRM epoch.  */
-    rtc_init(isa_bus, 1900, rtc_irq);
+    mc146818_rtc_init(isa_bus, 1900, rtc_irq);
 
     i8254_pit_init(isa_bus, 0x40, 0, NULL);
     isa_create_simple(isa_bus, TYPE_I8042);
hw/i386/pc.c +1 -1
index 76d4be5991..788844e0de 100644
@@ -1545,7 +1545,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
             rtc_irq = qdev_get_gpio_in(hpet, HPET_LEGACY_RTC_INT);
         }
     }
-    *rtc_state = rtc_init(isa_bus, 2000, rtc_irq);
+    *rtc_state = mc146818_rtc_init(isa_bus, 2000, rtc_irq);
 
     qemu_register_boot_set(pc_boot_set, *rtc_state);
 
hw/isa/i82378.c +2 -1
index 7a8baef23c..14b006cadc 100644
@@ -21,6 +21,7 @@
 #include "hw/pci/pci.h"
 #include "hw/i386/pc.h"
 #include "hw/timer/i8254.h"
+#include "hw/timer/mc146818rtc.h"
 #include "hw/audio/pcspk.h"
 
 #define TYPE_I82378 "i82378"
@@ -106,7 +107,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
     isa = isa_create_simple(isabus, "i82374");
 
     /* timer */
-    isa_create_simple(isabus, "mc146818rtc");
+    isa_create_simple(isabus, TYPE_MC146818_RTC);
 }
 
 static void i82378_init(Object *obj)
hw/mips/mips_fulong2e.c +1 -1
index 6dc6a0ac18..7ebbffa8f2 100644
@@ -371,7 +371,7 @@ static void mips_fulong2e_init(MachineState *machine)
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_I8042);
 
-    rtc_init(isa_bus, 2000, NULL);
+    mc146818_rtc_init(isa_bus, 2000, NULL);
 
     serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS);
     parallel_hds_isa_init(isa_bus, 1);
hw/mips/mips_jazz.c +1 -1
index 1b54602c1d..439bbd71fe 100644
@@ -295,7 +295,7 @@ static void mips_jazz_init(MachineState *machine,
     fdctrl_init_sysbus(qdev_get_gpio_in(rc4030, 1), -1, 0x80003000, fds);
 
     /* Real time clock */
-    rtc_init(isa_bus, 1980, NULL);
+    mc146818_rtc_init(isa_bus, 1980, NULL);
     memory_region_init_io(rtc, NULL, &rtc_ops, NULL, "rtc", 0x1000);
     memory_region_add_subregion(address_space, 0x80004000, rtc);
 
hw/mips/mips_malta.c +1 -1
index 050da36f1d..6945fa47c3 100644
@@ -1225,7 +1225,7 @@ void mips_malta_init(MachineState *machine)
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_I8042);
 
-    rtc_init(isa_bus, 2000, NULL);
+    mc146818_rtc_init(isa_bus, 2000, NULL);
     serial_hds_isa_init(isa_bus, 0, 2);
     parallel_hds_isa_init(isa_bus, 1);
 
hw/mips/mips_r4k.c +1 -1
index 946097a31f..349da59912 100644
@@ -279,7 +279,7 @@ void mips_r4k_init(MachineState *machine)
     i8259 = i8259_init(isa_bus, env->irq[2]);
     isa_bus_irqs(isa_bus, i8259);
 
-    rtc_init(isa_bus, 2000, NULL);
+    mc146818_rtc_init(isa_bus, 2000, NULL);
 
     pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
 
hw/ppc/pnv.c +1 -1
index 47221158d4..d188b899c5 100644
@@ -647,7 +647,7 @@ static void ppc_powernv_init(MachineState *machine)
     serial_hds_isa_init(pnv->isa_bus, 0, MAX_SERIAL_PORTS);
 
     /* Create an RTC ISA device too */
-    rtc_init(pnv->isa_bus, 2000, NULL);
+    mc146818_rtc_init(pnv->isa_bus, 2000, NULL);
 
     /* OpenPOWER systems use a IPMI SEL Event message to notify the
      * host to powerdown */
hw/timer/mc146818rtc.c +1 -1
index 82843ed03f..f7d8c4bae4 100644
@@ -997,7 +997,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
     qdev_init_gpio_out(dev, &s->irq, 1);
 }
 
-ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
+ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
 {
     DeviceState *dev;
     ISADevice *isadev;
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#60 lore raw

PATCH 25/34 hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS

In reply to Philippe Mathieu-Daudé
---
 include/hw/timer/m48t59.h | 2 ++
 hw/ppc/prep.c             | 2 +-
 hw/timer/m48t59-isa.c     | 2 +-
 MAINTAINERS               | 2 ++
 4 files changed, 6 insertions(+), 2 deletions(-)
include/hw/timer/m48t59.h +2 -0
index db5e43a8da..069bb045d7 100644
@@ -25,6 +25,8 @@ typedef struct NvramClass {
     void (*toggle_lock)(Nvram *obj, int lock);
 } NvramClass;
 
+#define TYPE_M48T59_ISA "isa-m48t59"
+
 Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
                        int base_year, int type);
 Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
hw/ppc/prep.c +1 -1
index 16f4537093..1f8ef4819b 100644
@@ -777,7 +777,7 @@ static void ibm_40p_init(MachineState *machine)
     /* add some more devices */
     if (defaults_enabled()) {
         isa_create_simple(isa_bus, TYPE_I8042);
-        m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
+        m48t59 = NVRAM(isa_create_simple(isa_bus, TYPE_M48T59_ISA));
 
         dev = DEVICE(isa_create(isa_bus, "cs4231a"));
         qdev_prop_set_uint32(dev, "iobase", 0x830);
hw/timer/m48t59-isa.c +1 -1
index ea1ba703d7..077346f7ca 100644
@@ -49,7 +49,7 @@ typedef struct M48txxISADeviceClass {
 
 static M48txxInfo m48txx_isa_info[] = {
     {
-        .bus_name = "isa-m48t59",
+        .bus_name = TYPE_M48T59_ISA,
         .model = 59,
         .size = 0x2000,
     }
MAINTAINERS +2 -0
index a79723601c..3cb6bc190c 100644
@@ -708,6 +708,8 @@ F: hw/pci-host/prep.[hc]
 F: hw/isa/i82378.c
 F: hw/isa/pc87312.[hc]
 F: hw/dma/i82374.c
+F: hw/timer/m48t59-isa.c
+F: include/hw/timer/m48t59.h
 F: pc-bios/ppc_rom.bin
 
 sPAPR
Signature · 1 line
2.14.1
Acked-by on v1 25/34
#62 lore raw

Re: [Qemu-devel] [PATCH 25/34] hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS

In reply to Philippe Mathieu-Daudé
Quoted 1 line · Philippe Mathieu-Daudé

ppc portion

Quoted 59 lines
---
 include/hw/timer/m48t59.h | 2 ++
 hw/ppc/prep.c             | 2 +-
 hw/timer/m48t59-isa.c     | 2 +-
 MAINTAINERS               | 2 ++
 4 files changed, 6 insertions(+), 2 deletions(-)
include/hw/timer/m48t59.h +2 -0
index db5e43a8da..069bb045d7 100644
@@ -25,6 +25,8 @@ typedef struct NvramClass {
     void (*toggle_lock)(Nvram *obj, int lock);
 } NvramClass;
 
+#define TYPE_M48T59_ISA "isa-m48t59"
+
 Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
                        int base_year, int type);
 Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
hw/ppc/prep.c +1 -1
index 16f4537093..1f8ef4819b 100644
@@ -777,7 +777,7 @@ static void ibm_40p_init(MachineState *machine)
     /* add some more devices */
     if (defaults_enabled()) {
         isa_create_simple(isa_bus, TYPE_I8042);
-        m48t59 = NVRAM(isa_create_simple(isa_bus, "isa-m48t59"));
+        m48t59 = NVRAM(isa_create_simple(isa_bus, TYPE_M48T59_ISA));
 
         dev = DEVICE(isa_create(isa_bus, "cs4231a"));
         qdev_prop_set_uint32(dev, "iobase", 0x830);
hw/timer/m48t59-isa.c +1 -1
index ea1ba703d7..077346f7ca 100644
@@ -49,7 +49,7 @@ typedef struct M48txxISADeviceClass {
 
 static M48txxInfo m48txx_isa_info[] = {
     {
-        .bus_name = "isa-m48t59",
+        .bus_name = TYPE_M48T59_ISA,
         .model = 59,
         .size = 0x2000,
     }
MAINTAINERS +2 -0
index a79723601c..3cb6bc190c 100644
@@ -708,6 +708,8 @@ F: hw/pci-host/prep.[hc]
 F: hw/isa/i82378.c
 F: hw/isa/pc87312.[hc]
 F: hw/dma/i82374.c
+F: hw/timer/m48t59-isa.c
+F: include/hw/timer/m48t59.h
 F: pc-bios/ppc_rom.bin
 
 sPAPR
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#63 lore raw

PATCH 26/34 hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c

In reply to Philippe Mathieu-Daudé

- add "hw/net/ne2000-isa.h" (and new entry in MAINTAINERS)
- remove the old i386 dependency

---
 hw/net/ne2000.h             |  3 +++
 include/hw/i386/pc.h        | 20 --------------------
 include/hw/net/ne2000-isa.h | 33 +++++++++++++++++++++++++++++++++
 hw/i386/pc.c                |  1 +
 hw/mips/mips_r4k.c          |  1 +
 hw/net/ne2000-isa.c         |  6 ++----
 hw/net/ne2000.c             |  2 --
 hw/ppc/prep.c               |  1 +
 MAINTAINERS                 |  1 +
 9 files changed, 42 insertions(+), 26 deletions(-)
 create mode 100644 include/hw/net/ne2000-isa.h
hw/net/ne2000.h +3 -0
index d213dccae3..adb8021bd1 100644
@@ -1,6 +1,9 @@
 #ifndef HW_NE2000_H
 #define HW_NE2000_H
 
+#include "hw/hw.h"
+#include "net/net.h"
+
 #define NE2000_PMEM_SIZE    (32*1024)
 #define NE2000_PMEM_START   (16*1024)
 #define NE2000_PMEM_END     (NE2000_PMEM_SIZE+NE2000_PMEM_START)
include/hw/i386/pc.h +0 -20
index 6a2e947332..020792c2e8 100644
@@ -291,26 +291,6 @@ PCIBus *find_i440fx(void);
 extern PCIDevice *piix4_dev;
 int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn);
 
-/* ne2000.c */
-static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
-{
-    DeviceState *dev;
-    ISADevice *isadev;
-
-    qemu_check_nic_model(nd, "ne2k_isa");
-
-    isadev = isa_try_create(bus, "ne2k_isa");
-    if (!isadev) {
-        return false;
-    }
-    dev = DEVICE(isadev);
-    qdev_prop_set_uint32(dev, "iobase", base);
-    qdev_prop_set_uint32(dev, "irq",    irq);
-    qdev_set_nic_properties(dev, nd);
-    qdev_init_nofail(dev);
-    return true;
-}
-
 /* pc_sysfw.c */
 void pc_system_firmware_init(MemoryRegion *rom_memory,
                              bool isapc_ram_fw);
include/hw/net/ne2000-isa.h new file +33 -0
new file mode 100644
index 0000000000..ff2bed9c95
@@ -0,0 +1,33 @@
+/*
+ * QEMU NE2000 emulation -- isa bus windup
+ *
+ * Copyright (c) 2003-2004 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "hw/hw.h"
+#include "hw/qdev.h"
+#include "hw/isa/isa.h"
+#include "net/net.h"
+
+#define TYPE_ISA_NE2000 "ne2k_isa"
+
+static inline ISADevice *isa_ne2000_init(ISABus *bus, int base, int irq,
+                                         NICInfo *nd)
+{
+    ISADevice *d;
+
+    qemu_check_nic_model(nd, "ne2k_isa");
+
+    d = isa_try_create(bus, TYPE_ISA_NE2000);
+    if (d) {
+        DeviceState *dev = DEVICE(d);
+
+        qdev_prop_set_uint32(dev, "iobase", base);
+        qdev_prop_set_uint32(dev, "irq",    irq);
+        qdev_set_nic_properties(dev, nd);
+        qdev_init_nofail(dev);
+    }
+    return d;
+}
hw/i386/pc.c +1 -0
index 788844e0de..085577e066 100644
@@ -71,6 +71,7 @@
 #include "qom/cpu.h"
 #include "hw/nmi.h"
 #include "hw/i386/intel_iommu.h"
+#include "hw/net/ne2000-isa.h"
 
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ
hw/mips/mips_r4k.c +1 -0
index 349da59912..33ff89f02c 100644
@@ -18,6 +18,7 @@
 #include "hw/char/serial.h"
 #include "hw/isa/isa.h"
 #include "net/net.h"
+#include "hw/net/ne2000-isa.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/block/flash.h"
hw/net/ne2000-isa.c +2 -4
index f3455339ee..70e5c1d3d4 100644
@@ -22,17 +22,15 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
+#include "hw/net/ne2000-isa.h"
 #include "hw/qdev.h"
-#include "net/net.h"
 #include "ne2000.h"
+#include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 
-#define TYPE_ISA_NE2000 "ne2k_isa"
 #define ISA_NE2000(obj) OBJECT_CHECK(ISANE2000State, (obj), TYPE_ISA_NE2000)
 
 typedef struct ISANE2000State {
hw/net/ne2000.c +0 -2
index 798d681e25..29bd4adb3f 100644
@@ -22,9 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "hw/hw.h"
 #include "hw/pci/pci.h"
-#include "net/net.h"
 #include "ne2000.h"
 #include "hw/loader.h"
 #include "sysemu/sysemu.h"
hw/ppc/prep.c +1 -0
index 1f8ef4819b..fb330a1769 100644
@@ -43,6 +43,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/input/i8042.h"
 #include "hw/isa/pc87312.h"
+#include "hw/net/ne2000-isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/kvm.h"
MAINTAINERS +1 -0
index 3cb6bc190c..37917af0f0 100644
@@ -973,6 +973,7 @@ Network devices
 M: Jason Wang <[email protected]>
 S: Odd Fixes
 F: hw/net/
+F: include/hw/net/
 F: tests/virtio-net-test.c
 T: git git://github.com/jasowang/qemu.git net
 
Signature · 1 line
2.14.1
Reviewed-by on v1 26/34
#64 lore raw

Re: [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c

Quoted 15 lines · Philippe Mathieu-Daudé

- add "hw/net/ne2000-isa.h" (and new entry in MAINTAINERS)
- remove the old i386 dependency

---
  hw/net/ne2000.h             |  3 +++
  include/hw/i386/pc.h        | 20 --------------------
  include/hw/net/ne2000-isa.h | 33 +++++++++++++++++++++++++++++++++
  hw/i386/pc.c                |  1 +
  hw/mips/mips_r4k.c          |  1 +
  hw/net/ne2000-isa.c         |  6 ++----
  hw/net/ne2000.c             |  2 --
  hw/ppc/prep.c               |  1 +
  MAINTAINERS                 |  1 +
  9 files changed, 42 insertions(+), 26 deletions(-)
Quoted 1 line

create mode 100644 include/hw/net/ne2000-isa.h

Acked-by on v1 26/34
#65 lore raw

Re: [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c

In reply to Philippe Mathieu-Daudé
Quoted 4 lines · Philippe Mathieu-Daudé

- add "hw/net/ne2000-isa.h" (and new entry in MAINTAINERS)
- remove the old i386 dependency

ppc portion

Quoted 183 lines
---
 hw/net/ne2000.h             |  3 +++
 include/hw/i386/pc.h        | 20 --------------------
 include/hw/net/ne2000-isa.h | 33 +++++++++++++++++++++++++++++++++
 hw/i386/pc.c                |  1 +
 hw/mips/mips_r4k.c          |  1 +
 hw/net/ne2000-isa.c         |  6 ++----
 hw/net/ne2000.c             |  2 --
 hw/ppc/prep.c               |  1 +
 MAINTAINERS                 |  1 +
 9 files changed, 42 insertions(+), 26 deletions(-)
 create mode 100644 include/hw/net/ne2000-isa.h
hw/net/ne2000.h +3 -0
index d213dccae3..adb8021bd1 100644
@@ -1,6 +1,9 @@
 #ifndef HW_NE2000_H
 #define HW_NE2000_H
 
+#include "hw/hw.h"
+#include "net/net.h"
+
 #define NE2000_PMEM_SIZE    (32*1024)
 #define NE2000_PMEM_START   (16*1024)
 #define NE2000_PMEM_END     (NE2000_PMEM_SIZE+NE2000_PMEM_START)
include/hw/i386/pc.h +0 -20
index 6a2e947332..020792c2e8 100644
@@ -291,26 +291,6 @@ PCIBus *find_i440fx(void);
 extern PCIDevice *piix4_dev;
 int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn);
 
-/* ne2000.c */
-static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
-{
-    DeviceState *dev;
-    ISADevice *isadev;
-
-    qemu_check_nic_model(nd, "ne2k_isa");
-
-    isadev = isa_try_create(bus, "ne2k_isa");
-    if (!isadev) {
-        return false;
-    }
-    dev = DEVICE(isadev);
-    qdev_prop_set_uint32(dev, "iobase", base);
-    qdev_prop_set_uint32(dev, "irq",    irq);
-    qdev_set_nic_properties(dev, nd);
-    qdev_init_nofail(dev);
-    return true;
-}
-
 /* pc_sysfw.c */
 void pc_system_firmware_init(MemoryRegion *rom_memory,
                              bool isapc_ram_fw);
include/hw/net/ne2000-isa.h new file +33 -0
new file mode 100644
index 0000000000..ff2bed9c95
@@ -0,0 +1,33 @@
+/*
+ * QEMU NE2000 emulation -- isa bus windup
+ *
+ * Copyright (c) 2003-2004 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "hw/hw.h"
+#include "hw/qdev.h"
+#include "hw/isa/isa.h"
+#include "net/net.h"
+
+#define TYPE_ISA_NE2000 "ne2k_isa"
+
+static inline ISADevice *isa_ne2000_init(ISABus *bus, int base, int irq,
+                                         NICInfo *nd)
+{
+    ISADevice *d;
+
+    qemu_check_nic_model(nd, "ne2k_isa");
+
+    d = isa_try_create(bus, TYPE_ISA_NE2000);
+    if (d) {
+        DeviceState *dev = DEVICE(d);
+
+        qdev_prop_set_uint32(dev, "iobase", base);
+        qdev_prop_set_uint32(dev, "irq",    irq);
+        qdev_set_nic_properties(dev, nd);
+        qdev_init_nofail(dev);
+    }
+    return d;
+}
hw/i386/pc.c +1 -0
index 788844e0de..085577e066 100644
@@ -71,6 +71,7 @@
 #include "qom/cpu.h"
 #include "hw/nmi.h"
 #include "hw/i386/intel_iommu.h"
+#include "hw/net/ne2000-isa.h"
 
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ
hw/mips/mips_r4k.c +1 -0
index 349da59912..33ff89f02c 100644
@@ -18,6 +18,7 @@
 #include "hw/char/serial.h"
 #include "hw/isa/isa.h"
 #include "net/net.h"
+#include "hw/net/ne2000-isa.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/block/flash.h"
hw/net/ne2000-isa.c +2 -4
index f3455339ee..70e5c1d3d4 100644
@@ -22,17 +22,15 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
+#include "hw/net/ne2000-isa.h"
 #include "hw/qdev.h"
-#include "net/net.h"
 #include "ne2000.h"
+#include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 
-#define TYPE_ISA_NE2000 "ne2k_isa"
 #define ISA_NE2000(obj) OBJECT_CHECK(ISANE2000State, (obj), TYPE_ISA_NE2000)
 
 typedef struct ISANE2000State {
hw/net/ne2000.c +0 -2
index 798d681e25..29bd4adb3f 100644
@@ -22,9 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "hw/hw.h"
 #include "hw/pci/pci.h"
-#include "net/net.h"
 #include "ne2000.h"
 #include "hw/loader.h"
 #include "sysemu/sysemu.h"
hw/ppc/prep.c +1 -0
index 1f8ef4819b..fb330a1769 100644
@@ -43,6 +43,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/input/i8042.h"
 #include "hw/isa/pc87312.h"
+#include "hw/net/ne2000-isa.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/kvm.h"
MAINTAINERS +1 -0
index 3cb6bc190c..37917af0f0 100644
@@ -973,6 +973,7 @@ Network devices
 M: Jason Wang <[email protected]>
 S: Odd Fixes
 F: hw/net/
+F: include/hw/net/
 F: tests/virtio-net-test.c
 T: git git://github.com/jasowang/qemu.git net
 
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#66 lore raw

PATCH 27/34 hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"

In reply to Philippe Mathieu-Daudé
---
 hw/pci/pci_internal.h | 16 +++++++++++
 include/hw/net/pci.h  | 20 +++++++++++++
 include/hw/pci/pci.h  |  4 ---
 hw/arm/virt.c         |  1 +
 hw/mips/mips_malta.c  |  1 +
 hw/pci/pci.c          | 67 ++------------------------------------------
 hw/pci/pci_nic.c      | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ppc/e500.c         |  1 +
 hw/ppc/spapr.c        |  1 +
 hw/pci/Makefile.objs  |  1 +
 10 files changed, 120 insertions(+), 69 deletions(-)
 create mode 100644 hw/pci/pci_internal.h
 create mode 100644 include/hw/net/pci.h
 create mode 100644 hw/pci/pci_nic.c
hw/pci/pci_internal.h new file +16 -0
new file mode 100644
index 0000000000..d967468767
@@ -0,0 +1,16 @@
+/*
+ * QEMU PCI internal
+ *
+ * Copyright (c) 2005 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef QEMU_HW_PCI_INTERNAL_H
+#define QEMU_HW_PCI_INTERNAL_H
+
+#include "hw/pci/pci_bus.h"
+
+PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr);
+
+#endif
include/hw/net/pci.h new file +20 -0
new file mode 100644
index 0000000000..529591b7f3
@@ -0,0 +1,20 @@
+/*
+ * QEMU network devices
+ *
+ * Copyright (c) 2005 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef QEMU_HW_NET_PCI_H
+#define QEMU_HW_NET_PCI_H
+
+#include "net/net.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
+
+PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
+                               const char *default_model,
+                               const char *default_devaddr);
+
+#endif
include/hw/pci/pci.h +0 -4
index aa7ef9cf69..6a0f7b5472 100644
@@ -422,10 +422,6 @@ void pci_device_set_intx_routing_notifier(PCIDevice *dev,
                                           PCIINTxRoutingNotifier notifier);
 void pci_device_reset(PCIDevice *dev);
 
-PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
-                               const char *default_model,
-                               const char *default_devaddr);
-
 PCIDevice *pci_vga_init(PCIBus *bus);
 
 int pci_bus_num(PCIBus *s);
hw/arm/virt.c +1 -0
index 9e18b410d7..39fab3acb9 100644
@@ -35,6 +35,7 @@
 #include "hw/arm/primecell.h"
 #include "hw/arm/virt.h"
 #include "hw/devices.h"
+#include "hw/net/pci.h"
 #include "net/net.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/device_tree.h"
hw/mips/mips_malta.c +1 -0
index 6945fa47c3..fb6a2f9363 100644
@@ -48,6 +48,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
+#include "hw/net/pci.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 #include "hw/sysbus.h"             /* SysBusDevice */
hw/pci/pci.c +2 -65

91 lines not on this page · raw message

hw/pci/pci_nic.c new file +77 -0

77 lines not on this page · raw message

hw/ppc/e500.c +1 -0
index db0e49ab8f..482757ca7b 100644
@@ -24,6 +24,7 @@
 #include "hw/hw.h"
 #include "hw/char/serial.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
hw/ppc/spapr.c +1 -0
index 17ea77618c..96007051e2 100644
@@ -56,6 +56,7 @@
 #include "hw/pci-host/spapr.h"
 #include "hw/ppc/xics.h"
 #include "hw/pci/msi.h"
+#include "hw/net/pci.h"
 
 #include "hw/pci/pci.h"
 #include "hw/scsi/scsi.h"
hw/pci/Makefile.objs +1 -0
index 9f905e6344..125428fd54 100644
@@ -1,4 +1,5 @@
 common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
+common-obj-$(CONFIG_PCI) += pci_nic.o
 common-obj-$(CONFIG_PCI) += msix.o msi.o
 common-obj-$(CONFIG_PCI) += shpc.o
 common-obj-$(CONFIG_PCI) += slotid_cap.o
Signature · 1 line
2.14.1
Acked-by on v1 27/34
#67 lore raw

Re: [Qemu-arm] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"

Quoted 1 line · Philippe Mathieu-Daudé

ppc portions

Quoted 319 lines
---
 hw/pci/pci_internal.h | 16 +++++++++++
 include/hw/net/pci.h  | 20 +++++++++++++
 include/hw/pci/pci.h  |  4 ---
 hw/arm/virt.c         |  1 +
 hw/mips/mips_malta.c  |  1 +
 hw/pci/pci.c          | 67 ++------------------------------------------
 hw/pci/pci_nic.c      | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ppc/e500.c         |  1 +
 hw/ppc/spapr.c        |  1 +
 hw/pci/Makefile.objs  |  1 +
 10 files changed, 120 insertions(+), 69 deletions(-)
 create mode 100644 hw/pci/pci_internal.h
 create mode 100644 include/hw/net/pci.h
 create mode 100644 hw/pci/pci_nic.c
hw/pci/pci_internal.h new file +16 -0
new file mode 100644
index 0000000000..d967468767
@@ -0,0 +1,16 @@
+/*
+ * QEMU PCI internal
+ *
+ * Copyright (c) 2005 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef QEMU_HW_PCI_INTERNAL_H
+#define QEMU_HW_PCI_INTERNAL_H
+
+#include "hw/pci/pci_bus.h"
+
+PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr);
+
+#endif
include/hw/net/pci.h new file +20 -0
new file mode 100644
index 0000000000..529591b7f3
@@ -0,0 +1,20 @@
+/*
+ * QEMU network devices
+ *
+ * Copyright (c) 2005 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef QEMU_HW_NET_PCI_H
+#define QEMU_HW_NET_PCI_H
+
+#include "net/net.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
+
+PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
+                               const char *default_model,
+                               const char *default_devaddr);
+
+#endif
include/hw/pci/pci.h +0 -4
index aa7ef9cf69..6a0f7b5472 100644
@@ -422,10 +422,6 @@ void pci_device_set_intx_routing_notifier(PCIDevice *dev,
                                           PCIINTxRoutingNotifier notifier);
 void pci_device_reset(PCIDevice *dev);
 
-PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
-                               const char *default_model,
-                               const char *default_devaddr);
-
 PCIDevice *pci_vga_init(PCIBus *bus);
 
 int pci_bus_num(PCIBus *s);
hw/arm/virt.c +1 -0
index 9e18b410d7..39fab3acb9 100644
@@ -35,6 +35,7 @@
 #include "hw/arm/primecell.h"
 #include "hw/arm/virt.h"
 #include "hw/devices.h"
+#include "hw/net/pci.h"
 #include "net/net.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/device_tree.h"
hw/mips/mips_malta.c +1 -0
index 6945fa47c3..fb6a2f9363 100644
@@ -48,6 +48,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/input/i8042.h"
 #include "hw/timer/i8254.h"
+#include "hw/net/pci.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 #include "hw/sysbus.h"             /* SysBusDevice */
hw/pci/pci.c +2 -65
index 1e6fb88eba..9b678c8fd0 100644
@@ -28,7 +28,6 @@
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_host.h"
 #include "monitor/monitor.h"
-#include "net/net.h"
 #include "sysemu/sysemu.h"
 #include "hw/loader.h"
 #include "qemu/error-report.h"
@@ -41,6 +40,7 @@
 #include "hw/hotplug.h"
 #include "hw/boards.h"
 #include "qemu/cutils.h"
+#include "pci_internal.h"
 
 //#define DEBUG_PCI
 #ifdef DEBUG_PCI
@@ -671,8 +671,7 @@ static int pci_parse_devaddr(const char *addr, int *domp, int *busp,
     return 0;
 }
 
-static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root,
-                                 const char *devaddr)
+PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr)
 {
     int dom, bus;
     unsigned slot;
@@ -1812,68 +1811,6 @@ PciInfoList *qmp_query_pci(Error **errp)
     return head;
 }
 
-static const char * const pci_nic_models[] = {
-    "ne2k_pci",
-    "i82551",
-    "i82557b",
-    "i82559er",
-    "rtl8139",
-    "e1000",
-    "pcnet",
-    "virtio",
-    "sungem",
-    NULL
-};
-
-static const char * const pci_nic_names[] = {
-    "ne2k_pci",
-    "i82551",
-    "i82557b",
-    "i82559er",
-    "rtl8139",
-    "e1000",
-    "pcnet",
-    "virtio-net-pci",
-    "sungem",
-    NULL
-};
-
-/* Initialize a PCI NIC.  */
-PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
-                               const char *default_model,
-                               const char *default_devaddr)
-{
-    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
-    PCIBus *bus;
-    PCIDevice *pci_dev;
-    DeviceState *dev;
-    int devfn;
-    int i;
-
-    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
-        exit(0);
-    }
-
-    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
-    if (i < 0) {
-        exit(1);
-    }
-
-    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
-    if (!bus) {
-        error_report("Invalid PCI device address %s for device %s",
-                     devaddr, pci_nic_names[i]);
-        exit(1);
-    }
-
-    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
-    dev = &pci_dev->qdev;
-    qdev_set_nic_properties(dev, nd);
-    qdev_init_nofail(dev);
-
-    return pci_dev;
-}
-
 PCIDevice *pci_vga_init(PCIBus *bus)
 {
     switch (vga_interface_type) {
hw/pci/pci_nic.c new file +77 -0
new file mode 100644
index 0000000000..fb1a10ff12
@@ -0,0 +1,77 @@
+/*
+ * QEMU PCI network interface
+ *
+ * Copyright (c) 2004 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
+#include "hw/net/pci.h"
+#include "net/net.h"
+#include "pci_internal.h"
+
+static const char *const pci_nic_models[] = {
+    "ne2k_pci",
+    "i82551",
+    "i82557b",
+    "i82559er",
+    "rtl8139",
+    "e1000",
+    "pcnet",
+    "virtio",
+    "sungem",
+    NULL
+};
+
+static const char *const pci_nic_names[] = {
+    "ne2k_pci",
+    "i82551",
+    "i82557b",
+    "i82559er",
+    "rtl8139",
+    "e1000",
+    "pcnet",
+    "virtio-net-pci",
+    "sungem",
+    NULL
+};
+
+/* Initialize a PCI NIC.  */
+PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
+                               const char *default_model,
+                               const char *default_devaddr)
+{
+    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
+    PCIBus *bus;
+    PCIDevice *pci_dev;
+    DeviceState *dev;
+    int devfn;
+    int i;
+
+    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
+        exit(0);
+    }
+
+    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
+    if (i < 0) {
+        exit(1);
+    }
+
+    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
+    if (!bus) {
+        error_report("Invalid PCI device address %s for device %s",
+                     devaddr, pci_nic_names[i]);
+        exit(1);
+    }
+
+    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
+    dev = &pci_dev->qdev;
+    qdev_set_nic_properties(dev, nd);
+    qdev_init_nofail(dev);
+
+    return pci_dev;
+}
hw/ppc/e500.c +1 -0
index db0e49ab8f..482757ca7b 100644
@@ -24,6 +24,7 @@
 #include "hw/hw.h"
 #include "hw/char/serial.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
hw/ppc/spapr.c +1 -0
index 17ea77618c..96007051e2 100644
@@ -56,6 +56,7 @@
 #include "hw/pci-host/spapr.h"
 #include "hw/ppc/xics.h"
 #include "hw/pci/msi.h"
+#include "hw/net/pci.h"
 
 #include "hw/pci/pci.h"
 #include "hw/scsi/scsi.h"
hw/pci/Makefile.objs +1 -0
index 9f905e6344..125428fd54 100644
@@ -1,4 +1,5 @@
 common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
+common-obj-$(CONFIG_PCI) += pci_nic.o
 common-obj-$(CONFIG_PCI) += msix.o msi.o
 common-obj-$(CONFIG_PCI) += shpc.o
 common-obj-$(CONFIG_PCI) += slotid_cap.o
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#68 lore raw

Re: [Qemu-arm] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"

In reply to Philippe Mathieu-Daudé

Hi Philippe,

It seems the patch is doing much more than
what is mentioned in the subject.

Quoted 23 lines · Philippe Mathieu-Daudé
---
  hw/pci/pci_internal.h | 16 +++++++++++
  include/hw/net/pci.h  | 20 +++++++++++++
  include/hw/pci/pci.h  |  4 ---
  hw/arm/virt.c         |  1 +
  hw/mips/mips_malta.c  |  1 +
  hw/pci/pci.c          | 67 ++------------------------------------------
  hw/pci/pci_nic.c      | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++
  hw/ppc/e500.c         |  1 +
  hw/ppc/spapr.c        |  1 +
  hw/pci/Makefile.objs  |  1 +
  10 files changed, 120 insertions(+), 69 deletions(-)

create mode 100644 hw/pci/pci_internal.h
create mode 100644 include/hw/net/pci.h
create mode 100644 hw/pci/pci_nic.c

hw/pci/pci_internal.h new file +0 -0
new file mode 100644
index 0000000000..d967468767

hw/pci/pci_internal.h line 5

Quoted 5 lines
hw/pci/pci_internal.h new file +5 -0
@@ -0,0 +1,16 @@
+/*
+ * QEMU PCI internal
+ *
+ * Copyright (c) 2005 Fabrice Bellard
+ * > + * This work is licensed under the terms of the GNU GPL, version 2 

or later.

hw/pci/pci_internal.h line 16

Quoted 10 lines
hw/pci/pci_internal.h new file +10 -0
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef QEMU_HW_PCI_INTERNAL_H
+#define QEMU_HW_PCI_INTERNAL_H
+
+#include "hw/pci/pci_bus.h"
+
+PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr);
+
+#endif

Why don't add the function directly to hw/pci/pci_nic.c ? We have only one calling site anyway.

I have nothing against adding an internal H file, but then we would need to add there *all* the functions used only by the pci sub-system. And that may be out of the scope of your series.

Quoted 15 lines
include/hw/net/pci.h new file +9 -0
new file mode 100644
index 0000000000..529591b7f3
@@ -0,0 +1,20 @@
+/*
+ * QEMU network devices
+ *
+ * Copyright (c) 2005 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef QEMU_HW_NET_PCI_H

include/hw/net/pci.h line 19

Quoted 10 lines
include/hw/net/pci.h new file +10 -0
+#define QEMU_HW_NET_PCI_H
+
+#include "net/net.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
+
+PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
+                               const char *default_model,
+                               const char *default_devaddr);
+

Can you add a short explanation on how the split helps removing i386/pc dependency from non-PC world?
- it is not straight forward, at least for me.

Thanks,
Marcel

Quoted 257 lines
include/hw/net/pci.h new file +1 -0
+#endif
include/hw/pci/pci.h +0 -4
index aa7ef9cf69..6a0f7b5472 100644
@@ -422,10 +422,6 @@ void pci_device_set_intx_routing_notifier(PCIDevice *dev,
                                            PCIINTxRoutingNotifier notifier);
  void pci_device_reset(PCIDevice *dev);
 
-PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
-                               const char *default_model,
-                               const char *default_devaddr);
-
  PCIDevice *pci_vga_init(PCIBus *bus);
 
  int pci_bus_num(PCIBus *s);
hw/arm/virt.c +1 -0
index 9e18b410d7..39fab3acb9 100644
@@ -35,6 +35,7 @@
  #include "hw/arm/primecell.h"
  #include "hw/arm/virt.h"
  #include "hw/devices.h"
+#include "hw/net/pci.h"
  #include "net/net.h"
  #include "sysemu/block-backend.h"
  #include "sysemu/device_tree.h"
hw/mips/mips_malta.c +1 -0
index 6945fa47c3..fb6a2f9363 100644
@@ -48,6 +48,7 @@
  #include "hw/timer/mc146818rtc.h"
  #include "hw/input/i8042.h"
  #include "hw/timer/i8254.h"
+#include "hw/net/pci.h"
  #include "sysemu/blockdev.h"
  #include "exec/address-spaces.h"
  #include "hw/sysbus.h"             /* SysBusDevice */
hw/pci/pci.c +2 -65
index 1e6fb88eba..9b678c8fd0 100644
@@ -28,7 +28,6 @@
  #include "hw/pci/pci_bus.h"
  #include "hw/pci/pci_host.h"
  #include "monitor/monitor.h"
-#include "net/net.h"
  #include "sysemu/sysemu.h"
  #include "hw/loader.h"
  #include "qemu/error-report.h"
@@ -41,6 +40,7 @@
  #include "hw/hotplug.h"
  #include "hw/boards.h"
  #include "qemu/cutils.h"
+#include "pci_internal.h"
 
  //#define DEBUG_PCI
  #ifdef DEBUG_PCI
@@ -671,8 +671,7 @@ static int pci_parse_devaddr(const char *addr, int *domp, int *busp,
      return 0;
  }
 
-static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root,
-                                 const char *devaddr)
+PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr)
  {
      int dom, bus;
      unsigned slot;
@@ -1812,68 +1811,6 @@ PciInfoList *qmp_query_pci(Error **errp)
      return head;
  }
 
-static const char * const pci_nic_models[] = {
-    "ne2k_pci",
-    "i82551",
-    "i82557b",
-    "i82559er",
-    "rtl8139",
-    "e1000",
-    "pcnet",
-    "virtio",
-    "sungem",
-    NULL
-};
-
-static const char * const pci_nic_names[] = {
-    "ne2k_pci",
-    "i82551",
-    "i82557b",
-    "i82559er",
-    "rtl8139",
-    "e1000",
-    "pcnet",
-    "virtio-net-pci",
-    "sungem",
-    NULL
-};
-
-/* Initialize a PCI NIC.  */
-PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
-                               const char *default_model,
-                               const char *default_devaddr)
-{
-    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
-    PCIBus *bus;
-    PCIDevice *pci_dev;
-    DeviceState *dev;
-    int devfn;
-    int i;
-
-    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
-        exit(0);
-    }
-
-    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
-    if (i < 0) {
-        exit(1);
-    }
-
-    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
-    if (!bus) {
-        error_report("Invalid PCI device address %s for device %s",
-                     devaddr, pci_nic_names[i]);
-        exit(1);
-    }
-
-    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
-    dev = &pci_dev->qdev;
-    qdev_set_nic_properties(dev, nd);
-    qdev_init_nofail(dev);
-
-    return pci_dev;
-}
-
  PCIDevice *pci_vga_init(PCIBus *bus)
  {
      switch (vga_interface_type) {
hw/pci/pci_nic.c new file +77 -0
new file mode 100644
index 0000000000..fb1a10ff12
@@ -0,0 +1,77 @@
+/*
+ * QEMU PCI network interface
+ *
+ * Copyright (c) 2004 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
+#include "hw/net/pci.h"
+#include "net/net.h"
+#include "pci_internal.h"
+
+static const char *const pci_nic_models[] = {
+    "ne2k_pci",
+    "i82551",
+    "i82557b",
+    "i82559er",
+    "rtl8139",
+    "e1000",
+    "pcnet",
+    "virtio",
+    "sungem",
+    NULL
+};
+
+static const char *const pci_nic_names[] = {
+    "ne2k_pci",
+    "i82551",
+    "i82557b",
+    "i82559er",
+    "rtl8139",
+    "e1000",
+    "pcnet",
+    "virtio-net-pci",
+    "sungem",
+    NULL
+};
+
+/* Initialize a PCI NIC.  */
+PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
+                               const char *default_model,
+                               const char *default_devaddr)
+{
+    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
+    PCIBus *bus;
+    PCIDevice *pci_dev;
+    DeviceState *dev;
+    int devfn;
+    int i;
+
+    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
+        exit(0);
+    }
+
+    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
+    if (i < 0) {
+        exit(1);
+    }
+
+    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
+    if (!bus) {
+        error_report("Invalid PCI device address %s for device %s",
+                     devaddr, pci_nic_names[i]);
+        exit(1);
+    }
+
+    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
+    dev = &pci_dev->qdev;
+    qdev_set_nic_properties(dev, nd);
+    qdev_init_nofail(dev);
+
+    return pci_dev;
+}
hw/ppc/e500.c +1 -0
index db0e49ab8f..482757ca7b 100644
@@ -24,6 +24,7 @@
  #include "hw/hw.h"
  #include "hw/char/serial.h"
  #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
  #include "hw/boards.h"
  #include "sysemu/sysemu.h"
  #include "sysemu/kvm.h"
hw/ppc/spapr.c +1 -0
index 17ea77618c..96007051e2 100644
@@ -56,6 +56,7 @@
  #include "hw/pci-host/spapr.h"
  #include "hw/ppc/xics.h"
  #include "hw/pci/msi.h"
+#include "hw/net/pci.h"
 
  #include "hw/pci/pci.h"
  #include "hw/scsi/scsi.h"
hw/pci/Makefile.objs +1 -0
index 9f905e6344..125428fd54 100644
@@ -1,4 +1,5 @@
  common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
+common-obj-$(CONFIG_PCI) += pci_nic.o
  common-obj-$(CONFIG_PCI) += msix.o msi.o
  common-obj-$(CONFIG_PCI) += shpc.o
  common-obj-$(CONFIG_PCI) += slotid_cap.o
#69 lore raw

Re: [Qemu-arm] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"

Hi Marcel,

Quoted 36 lines · Marcel Apfelbaum

Hi Philippe,

It seems the patch is doing much more than
what is mentioned in the subject.

Quoted 24 lines · Philippe Mathieu-Daudé

---
  hw/pci/pci_internal.h | 16 +++++++++++
  include/hw/net/pci.h  | 20 +++++++++++++ include/hw/pci/pci.h  |  4 ---
  hw/arm/virt.c         |  1 +
  hw/mips/mips_malta.c  |  1 +
  hw/pci/pci.c          | 67 ++------------------------------------------ hw/pci/pci_nic.c      | 77
+++++++++++++++++++++++++++++++++++++++++++++++++++
  hw/ppc/e500.c         |  1 +
  hw/ppc/spapr.c        |  1 +
  hw/pci/Makefile.objs  |  1 +

  10 files changed, 120 insertions(+), 69 deletions(-)

  create mode 100644 hw/pci/pci_internal.h
  create mode 100644 include/hw/net/pci.h
  create mode 100644 hw/pci/pci_nic.c

hw/pci/pci_internal.h new file +0 -0
new file mode 100644
index 0000000000..d967468767

hw/pci/pci_internal.h line 5

Quoted 5 lines
hw/pci/pci_internal.h new file +5 -0
@@ -0,0 +1,16 @@
+/*
+ * QEMU PCI internal
+ *
+ * Copyright (c) 2005 Fabrice Bellard
+ * > + * This work is licensed under the terms of the GNU GPL, version 2 

or later.

Quoted 14 lines

hw/pci/pci_internal.h

Quoted 11 lines
hw/pci/pci_internal.h new file +8 -0
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef QEMU_HW_PCI_INTERNAL_H
+#define QEMU_HW_PCI_INTERNAL_H
+
+#include "hw/pci/pci_bus.h"
+
+PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char 

*devaddr);

hw/pci/pci_internal.h new file +2 -0
+
+#endif

Why don't add the function directly to hw/pci/pci_nic.c ? We have only one calling site anyway.

You right!

Quoted 31 lines

I have nothing against adding an internal H file, but then we would need to add there *all* the functions used only by the pci sub-system. And that may be out of the scope of your series.

Quoted 22 lines
include/hw/net/pci.h new file +6 -0
new file mode 100644
index 0000000000..529591b7f3
@@ -0,0 +1,20 @@
+/*
+ * QEMU network devices
+ *
+ * Copyright (c) 2005 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or 

later.
+ * See the COPYING file in the top-level directory.
+ */

include/hw/net/pci.h new file +7 -0
+#ifndef QEMU_HW_NET_PCI_H
+#define QEMU_HW_NET_PCI_H
+
+#include "net/net.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
+
Quoted 8 lines

include/hw/net/pci.h line 19

Quoted 4 lines
include/hw/net/pci.h new file +4 -0
+PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
+                               const char *default_model,
+                               const char *default_devaddr);
+

Can you add a short explanation on how the split helps removing i386/pc dependency from non-PC world?
- it is not straight forward, at least for me.

I thought there was an old dependency on "hw/pci/pci.h" to something from i386/pc, so every machine using a PCI NIC would have this dependency. Extracting the NIC part as "hw/net/pci.h" would solve this issue. I didn't check attentively but it seems I was wrong, so I'll either drop this patch or reword it.

Regards,

Phil.

Quoted 261 lines

Thanks,
Marcel

Quoted 255 lines
include/hw/net/pci.h new file +1 -0
+#endif
include/hw/pci/pci.h +0 -4
index aa7ef9cf69..6a0f7b5472 100644
@@ -422,10 +422,6 @@ void 
 pci_device_set_intx_routing_notifier(PCIDevice *dev,
                                             PCIINTxRoutingNotifier notifier);
   void pci_device_reset(PCIDevice *dev);
-PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
-                               const char *default_model,
-                               const char *default_devaddr);
-
   PCIDevice *pci_vga_init(PCIBus *bus);
   int pci_bus_num(PCIBus *s);
hw/arm/virt.c +1 -0
index 9e18b410d7..39fab3acb9 100644
@@ -35,6 +35,7 @@
   #include "hw/arm/primecell.h"
   #include "hw/arm/virt.h"
   #include "hw/devices.h"
+#include "hw/net/pci.h"
   #include "net/net.h"
   #include "sysemu/block-backend.h"
   #include "sysemu/device_tree.h"
hw/mips/mips_malta.c +1 -0
index 6945fa47c3..fb6a2f9363 100644
@@ -48,6 +48,7 @@
   #include "hw/timer/mc146818rtc.h"
   #include "hw/input/i8042.h"
   #include "hw/timer/i8254.h"
+#include "hw/net/pci.h"
   #include "sysemu/blockdev.h"
   #include "exec/address-spaces.h"
   #include "hw/sysbus.h"             /* SysBusDevice */
hw/pci/pci.c +2 -3
index 1e6fb88eba..9b678c8fd0 100644
@@ -28,7 +28,6 @@
   #include "hw/pci/pci_bus.h"
   #include "hw/pci/pci_host.h"
   #include "monitor/monitor.h"
-#include "net/net.h"
   #include "sysemu/sysemu.h"
   #include "hw/loader.h"
   #include "qemu/error-report.h"
@@ -41,6 +40,7 @@
   #include "hw/hotplug.h"
   #include "hw/boards.h"
   #include "qemu/cutils.h"
+#include "pci_internal.h"
   //#define DEBUG_PCI
   #ifdef DEBUG_PCI
@@ -671,8 +671,7 @@ static int pci_parse_devaddr(const char *addr, int 
 *domp, int *busp,
       return 0;
   }
-static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root,
-                                 const char *devaddr)
+PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char 
 *devaddr)
   {
       int dom, bus;

      unsigned slot;

hw/pci/pci.c +0 -62
@@ -1812,68 +1811,6 @@ PciInfoList *qmp_query_pci(Error **errp)
       return head;
   }
-static const char * const pci_nic_models[] = {
-    "ne2k_pci",
-    "i82551",
-    "i82557b",
-    "i82559er",
-    "rtl8139",
-    "e1000",
-    "pcnet",
-    "virtio",
-    "sungem",
-    NULL
-};
-
-static const char * const pci_nic_names[] = {
-    "ne2k_pci",
-    "i82551",
-    "i82557b",
-    "i82559er",
-    "rtl8139",
-    "e1000",
-    "pcnet",
-    "virtio-net-pci",
-    "sungem",
-    NULL
-};
-
-/* Initialize a PCI NIC.  */
-PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
-                               const char *default_model,
-                               const char *default_devaddr)
-{
-    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
-    PCIBus *bus;
-    PCIDevice *pci_dev;
-    DeviceState *dev;
-    int devfn;
-    int i;
-
-    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
-        exit(0);
-    }
-
-    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
-    if (i < 0) {
-        exit(1);
-    }
-
-    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
-    if (!bus) {
-        error_report("Invalid PCI device address %s for device %s",
-                     devaddr, pci_nic_names[i]);
-        exit(1);
-    }
-
-    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
-    dev = &pci_dev->qdev;
-    qdev_set_nic_properties(dev, nd);
-    qdev_init_nofail(dev);
-
-    return pci_dev;
-}
-
   PCIDevice *pci_vga_init(PCIBus *bus)
   {
       switch (vga_interface_type) {
hw/pci/pci_nic.c new file +6 -0
new file mode 100644
index 0000000000..fb1a10ff12
@@ -0,0 +1,77 @@
+/*
+ * QEMU PCI network interface
+ *
+ * Copyright (c) 2004 Fabrice Bellard
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or 

later.
+ * See the COPYING file in the top-level directory.
+ */

hw/pci/pci_nic.c new file +69 -0
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_bus.h"
+#include "hw/net/pci.h"
+#include "net/net.h"
+#include "pci_internal.h"
+
+static const char *const pci_nic_models[] = {
+    "ne2k_pci",
+    "i82551",
+    "i82557b",
+    "i82559er",
+    "rtl8139",
+    "e1000",
+    "pcnet",
+    "virtio",
+    "sungem",
+    NULL
+};
+
+static const char *const pci_nic_names[] = {
+    "ne2k_pci",
+    "i82551",
+    "i82557b",
+    "i82559er",
+    "rtl8139",
+    "e1000",
+    "pcnet",
+    "virtio-net-pci",
+    "sungem",
+    NULL
+};
+
+/* Initialize a PCI NIC.  */
+PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
+                               const char *default_model,
+                               const char *default_devaddr)
+{
+    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
+    PCIBus *bus;
+    PCIDevice *pci_dev;
+    DeviceState *dev;
+    int devfn;
+    int i;
+
+    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
+        exit(0);
+    }
+
+    i = qemu_find_nic_model(nd, pci_nic_models, default_model);
+    if (i < 0) {
+        exit(1);
+    }
+
+    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
+    if (!bus) {
+        error_report("Invalid PCI device address %s for device %s",
+                     devaddr, pci_nic_names[i]);
+        exit(1);
+    }
+
+    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
+    dev = &pci_dev->qdev;
+    qdev_set_nic_properties(dev, nd);
+    qdev_init_nofail(dev);
+
+    return pci_dev;
+}
hw/ppc/e500.c +1 -0
index db0e49ab8f..482757ca7b 100644
@@ -24,6 +24,7 @@
   #include "hw/hw.h"
   #include "hw/char/serial.h"
   #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
   #include "hw/boards.h"
   #include "sysemu/sysemu.h"
   #include "sysemu/kvm.h"
hw/ppc/spapr.c +1 -0
index 17ea77618c..96007051e2 100644
@@ -56,6 +56,7 @@
   #include "hw/pci-host/spapr.h"
   #include "hw/ppc/xics.h"
   #include "hw/pci/msi.h"
+#include "hw/net/pci.h"
   #include "hw/pci/pci.h"
   #include "hw/scsi/scsi.h"
hw/pci/Makefile.objs +0 -0
index 9f905e6344..125428fd54 100644
@@ -1,4 +1,5 @@

  common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o +common-obj-$(CONFIG_PCI) += pci_nic.o common-obj-$(CONFIG_PCI) += msix.o msi.o common-obj-$(CONFIG_PCI) += shpc.o common-obj-$(CONFIG_PCI) += slotid_cap.o

#70 lore raw

Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"

Hi Marcel,

Quoted 3 lines
Quoted 3 lines

It seems the patch is doing much more than
what is mentioned in the subject.

[...]

Quoted 9 lines
Quoted 3 lines

Can you add a short explanation on how the split helps removing i386/pc dependency from non-PC world?
- it is not straight forward, at least for me.

I thought there was an old dependency on "hw/pci/pci.h" to something from i386/pc, so every machine using a PCI NIC would have this dependency. Extracting the NIC part as "hw/net/pci.h" would solve this issue. I didn't check attentively but it seems I was wrong, so I'll either drop this patch or reword it.

I finally opted to drop it for this series and include it reworded in part 2 which include more PCI-related patches.

Regards,

Phil.

#71 lore raw

PATCH 28/34 hw/net/e1000: use TYPE_PCI_E1000

In reply to Philippe Mathieu-Daudé
---
 include/hw/net/pci.h   | 2 ++
 hw/alpha/dp264.c       | 3 ++-
 hw/i386/pc.c           | 3 ++-
 hw/ppc/ppc440_bamboo.c | 3 ++-
 4 files changed, 8 insertions(+), 3 deletions(-)
include/hw/net/pci.h +2 -0
index 529591b7f3..b24b5257a5 100644
@@ -13,6 +13,8 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
 
+#define TYPE_PCI_E1000      "e1000"
+
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
                                const char *default_devaddr);
hw/alpha/dp264.c +2 -1
index df6dadf13f..65947fe1bf 100644
@@ -21,6 +21,7 @@
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
 #include "hw/char/serial.h"
+#include "hw/net/pci.h"
 #include "qemu/cutils.h"
 
 #define MAX_IDE_BUS 2
@@ -93,7 +94,7 @@ static void clipper_init(MachineState *machine)
 
     /* Network setup.  e1000 is good enough, failing Tulip support.  */
     for (i = 0; i < nb_nics; i++) {
-        pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
+        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_E1000, NULL);
     }
 
     /* IDE disk setup.  */
hw/i386/pc.c +2 -1
index 085577e066..3cdeb148aa 100644
@@ -72,6 +72,7 @@
 #include "hw/nmi.h"
 #include "hw/i386/intel_iommu.h"
 #include "hw/net/ne2000-isa.h"
+#include "hw/net/pci.h"
 
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ
@@ -1606,7 +1607,7 @@ void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus)
         if (!pci_bus || (nd->model && strcmp(nd->model, "ne2k_isa") == 0)) {
             pc_init_ne2k_isa(isa_bus, nd);
         } else {
-            pci_nic_init_nofail(nd, pci_bus, "e1000", NULL);
+            pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_E1000, NULL);
         }
     }
     rom_reset_order_override();
hw/ppc/ppc440_bamboo.c +2 -1
index f92d47f28d..6387dbda9f 100644
@@ -24,6 +24,7 @@
 #include "elf.h"
 #include "exec/address-spaces.h"
 #include "hw/char/serial.h"
+#include "hw/net/pci.h"
 #include "hw/ppc/ppc.h"
 #include "ppc405.h"
 #include "sysemu/sysemu.h"
@@ -248,7 +249,7 @@ static void bamboo_init(MachineState *machine)
         for (i = 0; i < nb_nics; i++) {
             /* There are no PCI NICs on the Bamboo board, but there are
              * PCI slots, so we can pick whatever default model we want. */
-            pci_nic_init_nofail(&nd_table[i], pcibus, "e1000", NULL);
+            pci_nic_init_nofail(&nd_table[i], pcibus, TYPE_PCI_E1000, NULL);
         }
     }
 
Signature · 1 line
2.14.1
Acked-by on v1 28/34
#72 lore raw

Re: [Qemu-devel] [PATCH 28/34] hw/net/e1000: use TYPE_PCI_E1000

Quoted 1 line · Philippe Mathieu-Daudé

ppc portion

Quoted 83 lines
---
 include/hw/net/pci.h   | 2 ++
 hw/alpha/dp264.c       | 3 ++-
 hw/i386/pc.c           | 3 ++-
 hw/ppc/ppc440_bamboo.c | 3 ++-
 4 files changed, 8 insertions(+), 3 deletions(-)
include/hw/net/pci.h +2 -0
index 529591b7f3..b24b5257a5 100644
@@ -13,6 +13,8 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
 
+#define TYPE_PCI_E1000      "e1000"
+
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
                                const char *default_devaddr);
hw/alpha/dp264.c +2 -1
index df6dadf13f..65947fe1bf 100644
@@ -21,6 +21,7 @@
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
 #include "hw/char/serial.h"
+#include "hw/net/pci.h"
 #include "qemu/cutils.h"
 
 #define MAX_IDE_BUS 2
@@ -93,7 +94,7 @@ static void clipper_init(MachineState *machine)
 
     /* Network setup.  e1000 is good enough, failing Tulip support.  */
     for (i = 0; i < nb_nics; i++) {
-        pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
+        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_E1000, NULL);
     }
 
     /* IDE disk setup.  */
hw/i386/pc.c +2 -1
index 085577e066..3cdeb148aa 100644
@@ -72,6 +72,7 @@
 #include "hw/nmi.h"
 #include "hw/i386/intel_iommu.h"
 #include "hw/net/ne2000-isa.h"
+#include "hw/net/pci.h"
 
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ
@@ -1606,7 +1607,7 @@ void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus)
         if (!pci_bus || (nd->model && strcmp(nd->model, "ne2k_isa") == 0)) {
             pc_init_ne2k_isa(isa_bus, nd);
         } else {
-            pci_nic_init_nofail(nd, pci_bus, "e1000", NULL);
+            pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_E1000, NULL);
         }
     }
     rom_reset_order_override();
hw/ppc/ppc440_bamboo.c +2 -1
index f92d47f28d..6387dbda9f 100644
@@ -24,6 +24,7 @@
 #include "elf.h"
 #include "exec/address-spaces.h"
 #include "hw/char/serial.h"
+#include "hw/net/pci.h"
 #include "hw/ppc/ppc.h"
 #include "ppc405.h"
 #include "sysemu/sysemu.h"
@@ -248,7 +249,7 @@ static void bamboo_init(MachineState *machine)
         for (i = 0; i < nb_nics; i++) {
             /* There are no PCI NICs on the Bamboo board, but there are
              * PCI slots, so we can pick whatever default model we want. */
-            pci_nic_init_nofail(&nd_table[i], pcibus, "e1000", NULL);
+            pci_nic_init_nofail(&nd_table[i], pcibus, TYPE_PCI_E1000, NULL);
         }
     }
 
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#73 lore raw

PATCH 29/34 hw/net/e1000e: use TYPE_PCI_E1000E

In reply to Philippe Mathieu-Daudé
---
 include/hw/net/pci.h | 1 +
 hw/net/e1000e.c      | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
include/hw/net/pci.h +1 -0
index b24b5257a5..92111f86f3 100644
@@ -14,6 +14,7 @@
 #include "hw/pci/pci_bus.h"
 
 #define TYPE_PCI_E1000      "e1000"
+#define TYPE_PCI_E1000E     "e1000e"
 
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
hw/net/e1000e.c +3 -3
index 6c42b4478c..494f8cced6 100644
@@ -40,6 +40,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
+#include "hw/net/pci.h"
 
 #include "hw/net/e1000_regs.h"
 
@@ -49,8 +50,7 @@
 #include "trace.h"
 #include "qapi/error.h"
 
-#define TYPE_E1000E "e1000e"
-#define E1000E(obj) OBJECT_CHECK(E1000EState, (obj), TYPE_E1000E)
+#define E1000E(obj) OBJECT_CHECK(E1000EState, (obj), TYPE_PCI_E1000E)
 
 typedef struct E1000EState {
     PCIDevice parent_obj;
@@ -703,7 +703,7 @@ static void e1000e_instance_init(Object *obj)
 }
 
 static const TypeInfo e1000e_info = {
-    .name = TYPE_E1000E,
+    .name =   TYPE_PCI_E1000E,
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(E1000EState),
     .class_init = e1000e_class_init,
Signature · 1 line
2.14.1
#74 lore raw

Re: [Qemu-devel] [PATCH 29/34] hw/net/e1000e: use TYPE_PCI_E1000E

Quoted 42 lines · Philippe Mathieu-Daudé
---
 include/hw/net/pci.h | 1 +
 hw/net/e1000e.c      | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
include/hw/net/pci.h +1 -0
index b24b5257a5..92111f86f3 100644
@@ -14,6 +14,7 @@
 #include "hw/pci/pci_bus.h"
 
 #define TYPE_PCI_E1000      "e1000"
+#define TYPE_PCI_E1000E     "e1000e"
 
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
hw/net/e1000e.c +2 -2
index 6c42b4478c..494f8cced6 100644
@@ -40,6 +40,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
+#include "hw/net/pci.h"
 
 #include "hw/net/e1000_regs.h"
 
@@ -49,8 +50,7 @@
 #include "trace.h"
 #include "qapi/error.h"
 
-#define TYPE_E1000E "e1000e"
-#define E1000E(obj) OBJECT_CHECK(E1000EState, (obj), TYPE_E1000E)
+#define E1000E(obj) OBJECT_CHECK(E1000EState, (obj), TYPE_PCI_E1000E)
 
 typedef struct E1000EState {
     PCIDevice parent_obj;

hw/net/e1000e.c static void e1000e_instance_init(Object *obj) · line 709

Quoted 8 lines
hw/net/e1000e.c +1 -1
@@ -703,7 +703,7 @@ static void e1000e_instance_init(Object *obj)
 }
 
 static const TypeInfo e1000e_info = {
-    .name = TYPE_E1000E,
+    .name =   TYPE_PCI_E1000E,
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(E1000EState),
     .class_init = e1000e_class_init,

That seems unnecessary to me, since it's not used anywhere outside of e1000e.c. I'd suggest to drop this patch.

Thomas

#75 lore raw

PATCH 30/34 hw/net/pcnet: use TYPE_PCI_PCNET

In reply to Philippe Mathieu-Daudé
---
 include/hw/net/pci.h | 1 +
 hw/mips/mips_malta.c | 2 +-
 hw/net/pcnet-pci.c   | 3 +--
 hw/ppc/prep.c        | 3 ++-
 4 files changed, 5 insertions(+), 4 deletions(-)
include/hw/net/pci.h +1 -0
index 92111f86f3..5ad5487a91 100644
@@ -15,6 +15,7 @@
 
 #define TYPE_PCI_E1000      "e1000"
 #define TYPE_PCI_E1000E     "e1000e"
+#define TYPE_PCI_PCNET      "pcnet"
 
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
hw/mips/mips_malta.c +1 -1
index fb6a2f9363..921678fdb0 100644
@@ -597,7 +597,7 @@ static void network_init(PCIBus *pci_bus)
             /* The malta board has a PCNet card using PCI SLOT 11 */
             default_devaddr = "0b";
 
-        pci_nic_init_nofail(nd, pci_bus, "pcnet", default_devaddr);
+        pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_PCNET, default_devaddr);
     }
 }
 
hw/net/pcnet-pci.c +1 -2
index 0acf8a4879..878e2c89c1 100644
@@ -29,6 +29,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "net/net.h"
 #include "hw/loader.h"
 #include "qemu/timer.h"
@@ -46,8 +47,6 @@
 //#define PCNET_DEBUG_TMD
 //#define PCNET_DEBUG_MATCH
 
-#define TYPE_PCI_PCNET "pcnet"
-
 #define PCI_PCNET(obj) \
      OBJECT_CHECK(PCIPCNetState, (obj), TYPE_PCI_PCNET)
 
hw/ppc/prep.c +2 -1
index fb330a1769..b2c7a62ebc 100644
@@ -44,6 +44,7 @@
 #include "hw/input/i8042.h"
 #include "hw/isa/pc87312.h"
 #include "hw/net/ne2000-isa.h"
+#include "hw/net/pci.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/kvm.h"
@@ -800,7 +801,7 @@ static void ibm_40p_init(MachineState *machine)
         pci_vga_init(pci_bus);
 
         for (i = 0; i < nb_nics; i++) {
-            pci_nic_init_nofail(&nd_table[i], pci_bus, "pcnet",
+            pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_PCNET,
                                 i == 0 ? "3" : NULL);
         }
     }
Signature · 1 line
2.14.1
Acked-by on v1 30/34
#77 lore raw

Re: [Qemu-devel] [PATCH 30/34] hw/net/pcnet: use TYPE_PCI_PCNET

In reply to Philippe Mathieu-Daudé
Quoted 1 line · Philippe Mathieu-Daudé

ppc portion

Quoted 74 lines
---
 include/hw/net/pci.h | 1 +
 hw/mips/mips_malta.c | 2 +-
 hw/net/pcnet-pci.c   | 3 +--
 hw/ppc/prep.c        | 3 ++-
 4 files changed, 5 insertions(+), 4 deletions(-)
include/hw/net/pci.h +1 -0
index 92111f86f3..5ad5487a91 100644
@@ -15,6 +15,7 @@
 
 #define TYPE_PCI_E1000      "e1000"
 #define TYPE_PCI_E1000E     "e1000e"
+#define TYPE_PCI_PCNET      "pcnet"
 
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
hw/mips/mips_malta.c +1 -1
index fb6a2f9363..921678fdb0 100644
@@ -597,7 +597,7 @@ static void network_init(PCIBus *pci_bus)
             /* The malta board has a PCNet card using PCI SLOT 11 */
             default_devaddr = "0b";
 
-        pci_nic_init_nofail(nd, pci_bus, "pcnet", default_devaddr);
+        pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_PCNET, default_devaddr);
     }
 }
 
hw/net/pcnet-pci.c +1 -2
index 0acf8a4879..878e2c89c1 100644
@@ -29,6 +29,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "net/net.h"
 #include "hw/loader.h"
 #include "qemu/timer.h"
@@ -46,8 +47,6 @@
 //#define PCNET_DEBUG_TMD
 //#define PCNET_DEBUG_MATCH
 
-#define TYPE_PCI_PCNET "pcnet"
-
 #define PCI_PCNET(obj) \
      OBJECT_CHECK(PCIPCNetState, (obj), TYPE_PCI_PCNET)
 
hw/ppc/prep.c +2 -1
index fb330a1769..b2c7a62ebc 100644
@@ -44,6 +44,7 @@
 #include "hw/input/i8042.h"
 #include "hw/isa/pc87312.h"
 #include "hw/net/ne2000-isa.h"
+#include "hw/net/pci.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/kvm.h"
@@ -800,7 +801,7 @@ static void ibm_40p_init(MachineState *machine)
         pci_vga_init(pci_bus);
 
         for (i = 0; i < nb_nics; i++) {
-            pci_nic_init_nofail(&nd_table[i], pci_bus, "pcnet",
+            pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_PCNET,
                                 i == 0 ? "3" : NULL);
         }
     }
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#78 lore raw

PATCH 31/34 hw/net/rtl8139: use TYPE_PCI_RTL8139

In reply to Philippe Mathieu-Daudé
---
 include/hw/net/pci.h    | 1 +
 hw/arm/realview.c       | 3 ++-
 hw/arm/versatilepb.c    | 3 ++-
 hw/mips/mips_fulong2e.c | 3 ++-
 hw/net/rtl8139.c        | 7 +++----
 hw/sh4/r2d.c            | 5 +++--
 6 files changed, 13 insertions(+), 9 deletions(-)
include/hw/net/pci.h +1 -0
index 5ad5487a91..43ed3b0145 100644
@@ -16,6 +16,7 @@
 #define TYPE_PCI_E1000      "e1000"
 #define TYPE_PCI_E1000E     "e1000e"
 #define TYPE_PCI_PCNET      "pcnet"
+#define TYPE_PCI_RTL8139    "rtl8139"
 
 PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
hw/arm/realview.c +2 -1
index 87cd1e583c..35f0da28e4 100644
@@ -20,6 +20,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/i2c/i2c.h"
+#include "hw/net/pci.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
 #include "qemu/error-report.h"
@@ -269,7 +270,7 @@ static void realview_init(MachineState *machine,
             done_nic = 1;
         } else {
             if (pci_bus) {
-                pci_nic_init_nofail(nd, pci_bus, "rtl8139", NULL);
+                pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_RTL8139, NULL);
             }
         }
     }
hw/arm/versatilepb.c +2 -1
index 418792cd02..297aad78e1 100644
@@ -18,6 +18,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/pci/pci.h"
 #include "hw/i2c/i2c.h"
+#include "hw/net/pci.h"
 #include "hw/boards.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
@@ -271,7 +272,7 @@ static void versatile_init(MachineState *machine, int board_id)
             smc91c111_init(nd, 0x10010000, sic[25]);
             done_smc = 1;
         } else {
-            pci_nic_init_nofail(nd, pci_bus, "rtl8139", NULL);
+            pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_RTL8139, NULL);
         }
     }
     if (machine_usb(machine)) {
hw/mips/mips_fulong2e.c +2 -1
index 7ebbffa8f2..fe618953c9 100644
@@ -44,6 +44,7 @@
 #include "hw/timer/mc146818rtc.h"
 #include "hw/timer/i8254.h"
 #include "hw/input/i8042.h"
+#include "hw/net/pci.h"
 #include "sysemu/blockdev.h"
 #include "exec/address-spaces.h"
 #include "sysemu/qtest.h"
@@ -253,7 +254,7 @@ static void network_init (PCIBus *pci_bus)
             default_devaddr = "07";
         }
 
-        pci_nic_init_nofail(nd, pci_bus, "rtl8139", default_devaddr);
+        pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_RTL8139, default_devaddr);
     }
 }
 
hw/net/rtl8139.c +3 -4
index 3be24bbee7..0f952eceba 100644
@@ -59,6 +59,7 @@
 #include "net/net.h"
 #include "net/eth.h"
 #include "hw/loader.h"
+#include "hw/net/pci.h"
 #include "sysemu/sysemu.h"
 #include "qemu/iov.h"
 
@@ -90,10 +91,8 @@ static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...)
 }
 #endif
 
-#define TYPE_RTL8139 "rtl8139"
-
 #define RTL8139(obj) \
-     OBJECT_CHECK(RTL8139State, (obj), TYPE_RTL8139)
+     OBJECT_CHECK(RTL8139State, (obj), TYPE_PCI_RTL8139)
 
 /* Symbolic offsets to registers. */
 enum RTL8139_registers {
@@ -3437,7 +3436,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo rtl8139_info = {
-    .name          = TYPE_RTL8139,
+    .name          = TYPE_PCI_RTL8139,
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(RTL8139State),
     .class_init    = rtl8139_class_init,
hw/sh4/r2d.c +3 -2
index 16b9ed2db2..dde60b2bc2 100644
@@ -39,6 +39,7 @@
 #include "hw/ide.h"
 #include "hw/loader.h"
 #include "hw/usb.h"
+#include "hw/net/pci.h"
 #include "hw/block/flash.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
@@ -303,8 +304,8 @@ static void r2d_init(MachineState *machine)
 
     /* NIC: rtl8139 on-board, and 2 slots. */
     for (i = 0; i < nb_nics; i++)
-        pci_nic_init_nofail(&nd_table[i], pci_bus,
-                            "rtl8139", i==0 ? "2" : NULL);
+        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_RTL8139,
+                            i == 0 ? "2" : NULL);
 
     /* USB keyboard */
     usb_create_simple(usb_bus_find(-1), "usb-kbd");
Signature · 1 line
2.14.1
Reviewed-by on v1 31/34
#79 lore raw

Re: [Qemu-arm] [PATCH 31/34] hw/net/rtl8139: use TYPE_PCI_RTL8139

Quoted 9 lines · Philippe Mathieu-Daudé
---
 include/hw/net/pci.h    | 1 +
 hw/arm/realview.c       | 3 ++-
 hw/arm/versatilepb.c    | 3 ++-
 hw/mips/mips_fulong2e.c | 3 ++-
 hw/net/rtl8139.c        | 7 +++----
 hw/sh4/r2d.c            | 5 +++--
 6 files changed, 13 insertions(+), 9 deletions(-)
#80 lore raw

PATCH 32/34 hw/net/ne2000: use TYPE_PCI_NE2000

In reply to Philippe Mathieu-Daudé
---
 include/hw/net/pci.h  | 1 +
 hw/net/ne2000.c       | 3 ++-
 hw/ppc/mac_newworld.c | 3 ++-
 hw/ppc/mac_oldworld.c | 3 ++-
 hw/ppc/prep.c         | 2 +-
 hw/sparc64/sun4u.c    | 3 ++-
 6 files changed, 10 insertions(+), 5 deletions(-)
include/hw/net/pci.h +1 -0
index 43ed3b0145..da733dd1d9 100644
@@ -15,6 +15,7 @@
 
 #define TYPE_PCI_E1000      "e1000"
 #define TYPE_PCI_E1000E     "e1000e"
+#define TYPE_PCI_NE2000     "ne2k_pci"
 #define TYPE_PCI_PCNET      "pcnet"
 #define TYPE_PCI_RTL8139    "rtl8139"
 
hw/net/ne2000.c +2 -1
index 29bd4adb3f..b0a664d302 100644
@@ -23,6 +23,7 @@
  */
 #include "qemu/osdep.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "ne2000.h"
 #include "hw/loader.h"
 #include "sysemu/sysemu.h"
@@ -779,7 +780,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo ne2000_info = {
-    .name          = "ne2k_pci",
+    .name          = TYPE_PCI_NE2000,
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCINE2000State),
     .class_init    = ne2000_class_init,
hw/ppc/mac_newworld.c +2 -1
index 33b46cb50b..2afc35c27f 100644
@@ -55,6 +55,7 @@
 #include "hw/ppc/mac_dbdma.h"
 #include "hw/timer/m48t59.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "net/net.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
@@ -435,7 +436,7 @@ static void ppc_core99_init(MachineState *machine)
     }
 
     for (i = 0; i < nb_nics; i++) {
-        pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
+        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
     }
 
     /* The NewWorld NVRAM is not located in the MacIO device */
hw/ppc/mac_oldworld.c +2 -1
index 193b9047d9..8096e5a126 100644
@@ -34,6 +34,7 @@
 #include "net/net.h"
 #include "hw/isa/isa.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "hw/boards.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/char/escc.h"
@@ -278,7 +279,7 @@ static void ppc_heathrow_init(MachineState *machine)
                              escc_mem, 0, memory_region_size(escc_mem));
 
     for(i = 0; i < nb_nics; i++)
-        pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
+        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
 
 
     ide_drive_get(hd, ARRAY_SIZE(hd));
hw/ppc/prep.c +1 -1
index b2c7a62ebc..103beafef3 100644
@@ -636,7 +636,7 @@ static void ppc_prep_init(MachineState *machine)
             isa_ne2000_init(isa_bus, ne2000_io[i], ne2000_irq[i],
                             &nd_table[i]);
         } else {
-            pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
+            pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
         }
     }
 
hw/sparc64/sun4u.c +2 -1
index fd10741607..67879c5135 100644
@@ -32,6 +32,7 @@
 #include "hw/char/serial.h"
 #include "hw/timer/m48t59.h"
 #include "hw/input/i8042.h"
+#include "hw/net/pci.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
 #include "qemu/timer.h"
@@ -476,7 +477,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
 
             onboard_nic_idx = i;
         } else {
-            pci_nic_init_nofail(nd, pci_bus, "ne2k_pci", NULL);
+            pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_NE2000, NULL);
         }
     }
     onboard_nic_idx = MAX(onboard_nic_idx, 0);
Signature · 1 line
2.14.1
Reviewed-by on v1 32/34
#81 lore raw

Re: [Qemu-devel] [PATCH 32/34] hw/net/ne2000: use TYPE_PCI_NE2000

Quoted 9 lines · Philippe Mathieu-Daudé
---
  include/hw/net/pci.h  | 1 +
  hw/net/ne2000.c       | 3 ++-
  hw/ppc/mac_newworld.c | 3 ++-
  hw/ppc/mac_oldworld.c | 3 ++-
  hw/ppc/prep.c         | 2 +-
  hw/sparc64/sun4u.c    | 3 ++-
  6 files changed, 10 insertions(+), 5 deletions(-)
Acked-by on v1 32/34
#82 lore raw

Re: [Qemu-devel] [PATCH 32/34] hw/net/ne2000: use TYPE_PCI_NE2000

In reply to Philippe Mathieu-Daudé
Quoted 1 line · Philippe Mathieu-Daudé

ppc portions

Quoted 118 lines
---
 include/hw/net/pci.h  | 1 +
 hw/net/ne2000.c       | 3 ++-
 hw/ppc/mac_newworld.c | 3 ++-
 hw/ppc/mac_oldworld.c | 3 ++-
 hw/ppc/prep.c         | 2 +-
 hw/sparc64/sun4u.c    | 3 ++-
 6 files changed, 10 insertions(+), 5 deletions(-)
include/hw/net/pci.h +1 -0
index 43ed3b0145..da733dd1d9 100644
@@ -15,6 +15,7 @@
 
 #define TYPE_PCI_E1000      "e1000"
 #define TYPE_PCI_E1000E     "e1000e"
+#define TYPE_PCI_NE2000     "ne2k_pci"
 #define TYPE_PCI_PCNET      "pcnet"
 #define TYPE_PCI_RTL8139    "rtl8139"
 
hw/net/ne2000.c +2 -1
index 29bd4adb3f..b0a664d302 100644
@@ -23,6 +23,7 @@
  */
 #include "qemu/osdep.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "ne2000.h"
 #include "hw/loader.h"
 #include "sysemu/sysemu.h"
@@ -779,7 +780,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo ne2000_info = {
-    .name          = "ne2k_pci",
+    .name          = TYPE_PCI_NE2000,
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCINE2000State),
     .class_init    = ne2000_class_init,
hw/ppc/mac_newworld.c +2 -1
index 33b46cb50b..2afc35c27f 100644
@@ -55,6 +55,7 @@
 #include "hw/ppc/mac_dbdma.h"
 #include "hw/timer/m48t59.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "net/net.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
@@ -435,7 +436,7 @@ static void ppc_core99_init(MachineState *machine)
     }
 
     for (i = 0; i < nb_nics; i++) {
-        pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
+        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
     }
 
     /* The NewWorld NVRAM is not located in the MacIO device */
hw/ppc/mac_oldworld.c +2 -1
index 193b9047d9..8096e5a126 100644
@@ -34,6 +34,7 @@
 #include "net/net.h"
 #include "hw/isa/isa.h"
 #include "hw/pci/pci.h"
+#include "hw/net/pci.h"
 #include "hw/boards.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/char/escc.h"
@@ -278,7 +279,7 @@ static void ppc_heathrow_init(MachineState *machine)
                              escc_mem, 0, memory_region_size(escc_mem));
 
     for(i = 0; i < nb_nics; i++)
-        pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
+        pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
 
 
     ide_drive_get(hd, ARRAY_SIZE(hd));
hw/ppc/prep.c +1 -1
index b2c7a62ebc..103beafef3 100644
@@ -636,7 +636,7 @@ static void ppc_prep_init(MachineState *machine)
             isa_ne2000_init(isa_bus, ne2000_io[i], ne2000_irq[i],
                             &nd_table[i]);
         } else {
-            pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
+            pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_NE2000, NULL);
         }
     }
 
hw/sparc64/sun4u.c +2 -1
index fd10741607..67879c5135 100644
@@ -32,6 +32,7 @@
 #include "hw/char/serial.h"
 #include "hw/timer/m48t59.h"
 #include "hw/input/i8042.h"
+#include "hw/net/pci.h"
 #include "hw/block/fdc.h"
 #include "net/net.h"
 #include "qemu/timer.h"
@@ -476,7 +477,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
 
             onboard_nic_idx = i;
         } else {
-            pci_nic_init_nofail(nd, pci_bus, "ne2k_pci", NULL);
+            pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_NE2000, NULL);
         }
     }
     onboard_nic_idx = MAX(onboard_nic_idx, 0);
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#83 lore raw

PATCH 33/34 hw/alpha: remove old i386 dependency

In reply to Philippe Mathieu-Daudé
---
 hw/alpha/alpha_sys.h | 2 --
 hw/alpha/pci.c       | 2 ++
 hw/alpha/typhoon.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
hw/alpha/alpha_sys.h +0 -2
index b6d8369ed7..ac685c1c46 100644
@@ -5,8 +5,6 @@
 
 #include "target/alpha/cpu-qom.h"
 #include "hw/pci/pci.h"
-#include "hw/pci/pci_host.h"
-#include "hw/ide.h"
 #include "hw/i386/pc.h"
 #include "hw/irq.h"
 
hw/alpha/pci.c +2 -0
index 8dde637bfe..c370762ea6 100644
@@ -8,6 +8,8 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_host.h"
 #include "alpha_sys.h"
 #include "qemu/log.h"
 #include "sysemu/sysemu.h"
hw/alpha/typhoon.c +1 -1
index ae11e012c7..75ac4ed354 100644
@@ -11,9 +11,9 @@
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/devices.h"
+#include "hw/pci/pci_host.h"
 #include "sysemu/sysemu.h"
 #include "alpha_sys.h"
-#include "exec/address-spaces.h"
 
 
 #define TYPE_TYPHOON_PCI_HOST_BRIDGE "typhoon-pcihost"
Signature · 1 line
2.14.1
#84 lore raw

Re: [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency

Quoted 12 lines · Philippe Mathieu-Daudé
---
 hw/alpha/alpha_sys.h | 2 --
 hw/alpha/pci.c       | 2 ++
 hw/alpha/typhoon.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
hw/alpha/alpha_sys.h +0 -0
index b6d8369ed7..ac685c1c46 100644

hw/alpha/alpha_sys.h line 8

Quoted 6 lines
hw/alpha/alpha_sys.h +0 -2
@@ -5,8 +5,6 @@
 
 #include "target/alpha/cpu-qom.h"
 #include "hw/pci/pci.h"
-#include "hw/pci/pci_host.h"
-#include "hw/ide.h"
 #include "hw/i386/pc.h"

Didn't you want to remove that pc.h line according to the patch description?

Thomas

#85 lore raw

Re: [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency

Hi Thomas,

Quoted 14 lines · Thomas Huth
Quoted 13 lines · Philippe Mathieu-Daudé
---
  hw/alpha/alpha_sys.h | 2 --
  hw/alpha/pci.c       | 2 ++
  hw/alpha/typhoon.c   | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
hw/alpha/alpha_sys.h +0 -0
index b6d8369ed7..ac685c1c46 100644
@@ -5,8 +5,6 @@
 
Quoted 7 lines

hw/alpha/alpha_sys.h line 8

Quoted 5 lines
hw/alpha/alpha_sys.h +0 -2
  #include "target/alpha/cpu-qom.h"
  #include "hw/pci/pci.h"
-#include "hw/pci/pci_host.h"
-#include "hw/ide.h"
  #include "hw/i386/pc.h"

Didn't you want to remove that pc.h line according to the patch description?

Not yet :( This include is still needed for the i8259 PIC. This change is done in the part 2 (following series).

That said, I should improve the patch description :)

#86 lore raw

Re: [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency

In reply to Philippe Mathieu-Daudé

2017-09-22 12:01 GMT-04:00 Philippe Mathieu-Daudé <[email protected]>:

hw/alpha/alpha_sys.h line 8

Quoted 11 lines
hw/alpha/alpha_sys.h +0 -2
index b6d8369ed7..ac685c1c46 100644
@@ -5,8 +5,6 @@
 
 #include "target/alpha/cpu-qom.h"
 #include "hw/pci/pci.h"
-#include "hw/pci/pci_host.h"
-#include "hw/ide.h"
 

Why are you deleting pci/pci_host.h here?
Alternately, why are you leaving pci/pci.h?

hw/alpha/pci.c line 13

Quoted 11 lines
hw/alpha/pci.c +2 -0
index 8dde637bfe..c370762ea6 100644
@@ -8,6 +8,8 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_host.h"
 

One way we have a double-include of pci/pci.h here, the other way we shouldn't re-include either.

r~

#87 lore raw

Re: [Qemu-devel] [PATCH 33/34] hw/alpha: remove old i386 dependency

Quoted 8 lines · Richard Henderson

2017-09-22 12:01 GMT-04:00 Philippe Mathieu-Daudé <[email protected]>:

Quoted 6 lines
hw/alpha/alpha_sys.h +0 -0
index b6d8369ed7..ac685c1c46 100644
@@ -5,8 +5,6 @@
 
Quoted 7 lines

hw/alpha/alpha_sys.h line 10

Quoted 5 lines
hw/alpha/alpha_sys.h +0 -2
 #include "target/alpha/cpu-qom.h"
 #include "hw/pci/pci.h"
-#include "hw/pci/pci_host.h"
-#include "hw/ide.h"
 

Why are you deleting pci/pci_host.h here?

Indeed it is required since PCIBus is defined there.

Quoted 9 lines

Alternately, why are you leaving pci/pci.h?

Quoted 6 lines
hw/alpha/pci.c +0 -0
index 8dde637bfe..c370762ea6 100644
@@ -8,6 +8,8 @@
 
Quoted 8 lines

hw/alpha/pci.c

Quoted 5 lines
hw/alpha/pci.c +2 -0
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "hw/pci/pci.h"
+#include "hw/pci/pci_host.h"
 

One way we have a double-include of pci/pci.h here, the other way we shouldn't re-include either.

Please ignore this patch.

#88 lore raw

PATCH 34/34 misc: drop old i386 dependency

In reply to Philippe Mathieu-Daudé

while here, add an entry for wdt_ib700 in MAINTAINERS

---
 hw/char/debugcon.c      | 1 -
 hw/intc/lm32_pic.c      | 1 -
 hw/moxie/moxiesim.c     | 1 -
 hw/sparc/sun4m.c        | 1 -
 hw/watchdog/wdt_ib700.c | 1 -
 MAINTAINERS             | 1 +
 6 files changed, 1 insertion(+), 5 deletions(-)
hw/char/debugcon.c +0 -1
index 95ccec6f8b..e2abc61b04 100644
@@ -29,7 +29,6 @@
 #include "hw/hw.h"
 #include "chardev/char-fe.h"
 #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
 
 #define TYPE_ISA_DEBUGCON_DEVICE "isa-debugcon"
 #define ISA_DEBUGCON_DEVICE(obj) \
hw/intc/lm32_pic.c +0 -1
index 09e15115fb..db6c7afc2f 100644
@@ -20,7 +20,6 @@
 #include "qemu/osdep.h"
 
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "monitor/monitor.h"
 #include "hw/sysbus.h"
 #include "trace.h"
hw/moxie/moxiesim.c +0 -1
index 5ea8dd3a93..5c9a4211ac 100644
@@ -30,7 +30,6 @@
 #include "cpu.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "net/net.h"
 #include "sysemu/sysemu.h"
hw/sparc/sun4m.c +0 -1
index a4ba3d2917..f6fda6eb13 100644
@@ -36,7 +36,6 @@
 #include "net/net.h"
 #include "hw/boards.h"
 #include "hw/scsi/esp.h"
-#include "hw/i386/pc.h"
 #include "hw/isa/isa.h"
 #include "hw/nvram/sun_nvram.h"
 #include "hw/nvram/chrp_nvram.h"
hw/watchdog/wdt_ib700.c +0 -1
index 532afe89e7..d045032bf4 100644
@@ -25,7 +25,6 @@
 #include "sysemu/watchdog.h"
 #include "hw/hw.h"
 #include "hw/isa/isa.h"
-#include "hw/i386/pc.h"
 
 /*#define IB700_DEBUG 1*/
 
MAINTAINERS +1 -0
index 37917af0f0..3b767e4012 100644
@@ -852,6 +852,7 @@ F: hw/misc/pc-testdev.c
 F: hw/timer/hpet*
 F: hw/timer/i8254*
 F: hw/timer/mc146818rtc*
+F: hw/watchdog/wdt_ib700.c
 F: include/hw/dma/i8257_dma.h
 F: include/hw/i2c/pm_smbus.h
 F: include/hw/input/i8042.h
Signature · 1 line
2.14.1
Reviewed-by on v1 34/34
#89 lore raw

Re: [Qemu-devel] [PATCH 34/34] misc: drop old i386 dependency

Quoted 11 lines · Philippe Mathieu-Daudé

while here, add an entry for wdt_ib700 in MAINTAINERS

---
 hw/char/debugcon.c      | 1 -
 hw/intc/lm32_pic.c      | 1 -
 hw/moxie/moxiesim.c     | 1 -
 hw/sparc/sun4m.c        | 1 -
 hw/watchdog/wdt_ib700.c | 1 -
 MAINTAINERS             | 1 +
 6 files changed, 1 insertion(+), 5 deletions(-)

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#91 lore raw

Re: [Qemu-devel] [PATCH 21/34] hw/display/vga: remove the old i386/pc dependency

Quoted 18 lines · Philippe Mathieu-Daudé

move public API to "hw/display/vga.h" and private registers to "hw/display/vga_int_regs.h"

---
./scripts/get_maintainer.pl -f hw/display/vga*
get_maintainer.pl: No maintainers found...

  hw/display/vga_int.h                 |  3 ++-
  hw/display/{vga.h => vga_int_regs.h} |  0
  include/hw/display/vga.h             | 25 +++++++++++++++++++++++++
  include/hw/i386/pc.h                 | 12 ------------
  hw/display/vga-isa-mm.c              |  4 +---
  hw/display/vga-isa.c                 |  2 +-
  hw/display/vga.c                     |  4 ++--
  hw/mips/mips_jazz.c                  |  1 +
  vl.c                                 |  2 +-
  9 files changed, 33 insertions(+), 20 deletions(-)
Quoted 3 lines

rename hw/display/{vga.h => vga_int_regs.h} (100%) create mode 100644 include/hw/display/vga.h

#92 lore raw
In reply to Philippe Mathieu-Daudé

This was an old(ish) patchset. Aplying it now.

Quoted 11 lines · Philippe Mathieu-Daudé

Hi,

quite a bunch of patches and files modified, but the diffstat is not that big.

First part is from clean-includes script, Then comes code movement, about no logical changes.

Now some non-x86 builds and cocci spatch run a bit faster :)

I updated some MAINTAINERS entries while here.

Quoted 8 lines

Also I couldn't test the KVM/XEN/HAX part.

Regards,

Phil.

Philippe Mathieu-Daudé (34):
hw: use "qemu/osdep.h" as first #include in source files

applied

Quoted 1 line

hw: remove "qemu/osdep.h" from header files

not applied, doing two things, suggested split-up
(I'm fine with it as it is)

Quoted 1 line

block: remove "qemu/osdep.h" from header file

applied

Quoted 1 line

misc: remove headers implicitly included

applied

Quoted 1 line

misc: remove duplicated includes

applied

Quoted 1 line

ppc: remove duplicated includes

applied

Quoted 1 line

i386/hax: remove duplicated includes

applied (note it can be trimmed more)

Quoted 1 line

nios2: remove duplicated includes

applied

Quoted 1 line

misc: avoid "include/" in include path

not applied, probably should be split, but I'm fine with it as it is

Quoted 1 line

amd_iommu: avoid needless includes in header file

applied

Quoted 1 line

i386/pc: use TYPE_PORT92

applied

Quoted 1 line

misc: remove old i386 dependency

applied

Quoted 1 line

hw/ide: remove old i386 dependency

applied

Quoted 1 line

hw/ipmi: remove old i386 dependency

applied

Quoted 1 line

hw/i2c: remove old i386 dependency

applied

Quoted 1 line

hw/tpm: remove old i386 dependency

applied

Quoted 1 line

hw/virtio-balloon: remove old i386 dependency

applied

Quoted 1 line

hw/unicore32: restrict hw addr defines to source file

applied

Quoted 1 line

hw/acpi: ACPI_PM_* defines are not restricted to i386 arch

applied

Quoted 1 line

hw/timer/i8254: rename pit_init() -> i8254_pit_init()

not applied, split?

Quoted 1 line

hw/display/vga: remove the old i386/pc dependency

somehow I can't find this patch, neither in my inbox nor in patchwork

Quoted 1 line

hw/input/i8042: extract API from hw/i386/pc.h

CHECK

Quoted 1 line

hw/dma/i8257: rename DMA_init() to i8257_dma_init()

not applied, pending **errp addition

Quoted 1 line

hw/timer/mc146818: rename rtc_init() -> mc146818_init()

applied

Quoted 1 line

hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS

not applied, it went out of context without i8257_dma_init rename btw, why do we prefer these TYPE_XXX things instead of simple "xxx" stuff?

Quoted 1 line

hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c

applied

Quoted 1 line

hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"

not applied, it does more than mentioned

Quoted 5 lines

hw/net/e1000: use TYPE_PCI_E1000
hw/net/e1000e: use TYPE_PCI_E1000E
hw/net/pcnet: use TYPE_PCI_PCNET
hw/net/rtl8139: use TYPE_PCI_RTL8139
hw/net/ne2000: use TYPE_PCI_NE2000

Not applied, at least not yet, why do we use these TYPE_XX stuff to start with?

Quoted 1 line

hw/alpha: remove old i386 dependency

not applied

Quoted 1 line

misc: drop old i386 dependency

applied, except of the MAINTAINERS part.

Applying these series is quite a bit boring task I'd say :)

Thanks,

/mjt

#93 lore raw

Hi Michael,

Thanks for your comments!

Quoted 3 lines
Quoted 1 line

hw: remove "qemu/osdep.h" from header files

not applied, doing two things, suggested split-up
(I'm fine with it as it is)

split out MAINTAINERS entry

Quoted 2 lines
Quoted 1 line

i386/hax: remove duplicated includes

applied (note it can be trimmed more)

done in another patch.

Quoted 2 lines
Quoted 1 line

misc: avoid "include/" in include path

not applied, probably should be split, but I'm fine with it as it is

split out numa.c

Quoted 2 lines
Quoted 1 line

hw/timer/i8254: rename pit_init() -> i8254_pit_init()

not applied, split?

split out MAINTAINERS entry

Quoted 2 lines
Quoted 1 line

hw/display/vga: remove the old i386/pc dependency

somehow I can't find this patch, neither in my inbox nor in patchwork

weird...

Quoted 2 lines
Quoted 1 line

hw/input/i8042: extract API from hw/i386/pc.h

CHECK

split out MAINTAINERS entry

Quoted 2 lines
Quoted 1 line

hw/dma/i8257: rename DMA_init() to i8257_dma_init()

not applied, pending **errp addition

attempt to fix it...

Quoted 3 lines
Quoted 1 line

hw/timer/m48t59: use TYPE_M48T59_ISA, add entries to MAINTAINERS

not applied, it went out of context without i8257_dma_init rename btw, why do we prefer these TYPE_XXX things instead of simple "xxx" stuff?

split out MAINTAINERS entry, dropped out TYPE_M48T59_ISA use.

Quoted 2 lines
Quoted 1 line

hw/pci: declare pci_nic_init_nofail() in "hw/net/pci.h"

not applied, it does more than mentioned

dropped from this series.

Quoted 8 lines
Quoted 5 lines

hw/net/e1000: use TYPE_PCI_E1000
hw/net/e1000e: use TYPE_PCI_E1000E
hw/net/pcnet: use TYPE_PCI_PCNET
hw/net/rtl8139: use TYPE_PCI_RTL8139
hw/net/ne2000: use TYPE_PCI_NE2000

Not applied, at least not yet, why do we use these TYPE_XX stuff to start with?

TYPE_XX is the interface, having the devices using TYPE_XX instead of hardcoded name guarantee safe rename/refactor.

anyway, dropped.

Quoted 1 line

Applying these series is quite a bit boring task I'd say :)

separating them from the whole branch too! but they are required for the final objective which I'll send in 3 or 4 parts.

Regards,

Phil.