qom: Automated conversion of type checking boilerplate
Subsystems (15)
v4 cover qom: Automated conversion of type checking boilerplate
Latest version of this series can be found at the branch:
https://github.com/ehabkost/qemu-hacks/tree/work/qom-macros-autoconvert
This is an extension of the series previously submitted by Daniel[1], including a script that will convert existing type checker macros automatically.
[1] https://lore.kernel.org/qemu-devel/20200723181410.3145233-1-berrange@redh=
at.com/
Link to series v4:
https://github.com/ehabkost/qemu-hacks/tree/work/qom-macros-autoconvert-v4
Changes from series v3 to v4:
* Rebased to machine-next
* Removed patches that will be submitted separately:
* TYPE_INFO changes
* Patches to crypto code from Daniel
* Rerun conversion scripts. Additional automated changes are in "(pass 3)" p= atches
* Conversion script changes:
* Included copyright headers
* Added scripts/codeconverter/ to MAINTAINERS
Link to series v3:
https://lore.kernel.org/qemu-devel/[email protected]=
om/
https://github.com/ehabkost/qemu-hacks/tree/work/qom-macros-autoconvert-v3
Changes from series v2 to v3:
* Additional automated changes are in "(pass 2)" patches to make review easier, but they can be squashed into the original patches later
* Patch "sifive_u: Rename memmap enum constants"
had to be redone due to conflicts on rebase
* Removed reference to _Generic at
"qom: Make type checker functions accept const pointers"
* Made converter script a little more flexible, and added experimental code to check instance/class size on TypeInfo vars
* Fixed bug I have introduced on usage of OBJECT_DECLARE_SIMPLE_TYPE (bug reported by Roman Bolshakov <[email protected]>)
* New patches added to series:
+ nubus: Rename class type checking macros
+ imx_ccm: Rename IMX_GET_CLASS macro
+ mos6522: Rename QOM macros
+ x86-iommu: Rename QOM type macros
+ rdma: Rename INTERFACE_RDMA_PROVIDER_CLASS macro
+ s390-virtio-ccw: Rename S390_MACHINE_CLASS macro
+ swim: Rename struct SWIM to Swim
+ migration: Rename class type checking macros
+ arm: Fix typo in AARCH64_CPU_GET_CLASS definition
+ rx: Rename QOM type check macros
+ rx: Move typedef RXCPU to cpu-qom.h
+ [automated] Use TYPE_INFO macro (pass 2)
+ [automated] Move QOM typedefs and add missing includes (pass 2)
+ [automated] Use DECLARE_*CHECKER* macros (pass 2)
+ [automated] Use OBJECT_DECLARE_TYPE where possible (pass 2)
+ [automated] Remove redundant instance_size/class_size fields
Link to series v2:
https://lore.kernel.org/qemu-devel/[email protected]=
om/
https://github.com/ehabkost/qemu-hacks/tree/work/qom-macros-autoconvert-v2
Changes from series v1 to v2:
* Don't skip TypeCheckMacro conversion if typedefs
are found in typedefs.h
* Don't look for typedefs if type check macro uses "struct [...]"
* "qom: Fix G_DEFINE_AUTOPTR_CLEANUP_FUNC" was squashed
in the original buggy patch
* 18 new patches that fix inconsistencies in the code,
and make automated changes without --force possible
* pl110:
* Fix typo on commit message
* Rename enum values to VERSION_*
* "[automated]" patches (without --force):
* Re-ran script after after the changes mentioned above. Now the patches change many more QOM type checker macros
* "[semi-automated] Use DECLARE_*CHECKER* when possible (--force mode)":
* Now the patch touches very few macros, and all of them have comments explaining why they are unusual
* Maintainers are now CCed in the cleanup patches
(except for the automated ones, because they are too large)
* TYPE_INFO macro: added commit message note suggested by Daniel
* Added more details to commit message of "Rename enum constants" patches
* Removed confusing paragraph mentioning _Generic from "Make type checker functions accept const pointers" commit message
Link to series v1:
https://lore.kernel.org/qemu-devel/[email protected]=
m/
https://github.com/ehabkost/qemu-hacks/tree/work/qom-macros-autoconvert-v1
The series is divided in the sections below:
Original patches from Daniel
----------------------------
Patches 1-2 are the ones originally submitted by Daniel.
They introduce the macros:
* OBJECT_DECLARE_TYPE
* OBJECT_DECLARE_SIMPLE_TYPE
* OBJECT_DEFINE_TYPE
* OBJECT_DEFINE_TYPE_WITH_INTERFACES
* OBJECT_DEFINE_ABSTRACT_TYPE
Changes to new macros
---------------------
Patches 3-5 extend the macros introduced by Daniel. It includes small bug fixes, change the arguments to a few macros, and introduce a few new macros:
* DECLARE_INSTANCE_CHECKER
* DECLARE_CLASS_CHECKERS
* DECLARE_OBJ_CHECKERS
Automated code conversion
-------------------------
Patch 6 is the code conversion script that will look for common patterns and change them to use the new macros.
Patches 7-18 are all automatically generated by that script, to gradually transform existing code into DECLARE_*CHECKER or OBJECT_DECLARE*_TYPE macros.
Daniel P. Berrang=C3=A9 (2):
qom: make object_ref/unref use a void * instead of Object *.
qom: provide convenient macros for declaring and defining types
Eduardo Habkost (16):
qom: Allow class type name to be specified in OBJECT_DECLARE*
qom: DECLARE_*_CHECKERS macros
qom: Make type checker functions accept const pointers
codeconverter: script for automating QOM code cleanups [automated] Delete duplicate QOM typedefs
[automated] Move QOM typedefs and add missing includes [automated] Move QOM typedefs and add missing includes (pass 2) [automated] Move QOM typedefs and add missing includes (pass 3) [automated] Use DECLARE_*CHECKER* macros
[automated] Use DECLARE_*CHECKER* macros (pass 2) [automated] Use DECLARE_*CHECKER* macros (pass 3) [semi-automated] Use DECLARE_*CHECKER* when possible (--force mode) [automated] Use OBJECT_DECLARE_TYPE where possible [automated] Use OBJECT_DECLARE_TYPE where possible (pass 2) [automated] Use OBJECT_DECLARE_TYPE where possible (pass 3) [automated] Use OBJECT_DECLARE_SIMPLE_TYPE when possible
.../codeconverter/codeconverter/__init__.py | 0 .../codeconverter/codeconverter/patching.py | 397 +++++++++++ .../codeconverter/codeconverter/qom_macros.py | 652 ++++++++++++++++++ .../codeconverter/qom_type_info.py | 434 ++++++++++++ .../codeconverter/codeconverter/regexps.py | 118 ++++ .../codeconverter/test_patching.py | 105 +++ .../codeconverter/test_regexps.py | 282 ++++++++ scripts/codeconverter/codeconverter/utils.py | 72 ++ scripts/codeconverter/converter.py | 123 ++++ chardev/chardev-internal.h | 8 +- hw/9pfs/virtio-9p.h | 11 +- hw/audio/intel-hda.h | 20 +- hw/avr/atmega.h | 9 +- hw/block/nvme.h | 10 +- hw/display/ati_int.h | 9 +- hw/display/qxl.h | 9 +- hw/display/virtio-vga.h | 17 +- hw/i386/amd_iommu.h | 10 +- hw/misc/tmp105.h | 9 +- hw/net/fsl_etsec/etsec.h | 10 +- hw/net/rocker/rocker.h | 5 +- hw/net/tulip.h | 4 +- hw/net/vmxnet3_defs.h | 9 +- hw/ppc/e500-ccsr.h | 9 +- hw/ppc/e500.h | 19 +- hw/ppc/mac.h | 19 +- hw/rdma/vmw/pvrdma.h | 9 +- hw/s390x/ccw-device.h | 17 +- hw/s390x/ipl.h | 6 +- hw/s390x/s390-pci-bus.h | 34 +- hw/s390x/virtio-ccw.h | 141 ++-- hw/scsi/mptsas.h | 5 +- hw/usb/ccid.h | 14 +- hw/usb/hcd-dwc2.h | 9 +- hw/usb/hcd-ehci.h | 36 +- hw/usb/hcd-ohci.h | 9 +- hw/usb/hcd-xhci.h | 7 +- hw/vfio/pci.h | 9 +- hw/virtio/virtio-mem-pci.h | 5 +- hw/virtio/virtio-pci.h | 24 +- hw/virtio/virtio-pmem-pci.h | 5 +- hw/xen/xen_pt.h | 5 +- include/authz/base.h | 15 +- include/authz/list.h | 17 +- include/authz/listfile.h | 17 +- include/authz/pamacct.h | 17 +- include/authz/simple.h | 17 +- include/block/throttle-groups.h | 4 +- include/chardev/char-fd.h | 9 +- include/chardev/char-win.h | 9 +- include/chardev/char.h | 12 +- include/chardev/spice.h | 9 +- include/crypto/secret.h | 6 +- include/crypto/secret_common.h | 12 +- include/crypto/secret_keyring.h | 24 +- include/crypto/tls-cipher-suites.h | 9 +- include/crypto/tlscreds.h | 6 +- include/crypto/tlscredsanon.h | 7 +- include/crypto/tlscredspsk.h | 7 +- include/crypto/tlscredsx509.h | 7 +- include/exec/memory.h | 19 +- include/hw/acpi/acpi_dev_interface.h | 13 +- include/hw/acpi/generic_event_device.h | 10 +- include/hw/acpi/vmgenid.h | 9 +- include/hw/adc/stm32f2xx_adc.h | 10 +- include/hw/arm/allwinner-a10.h | 9 +- include/hw/arm/allwinner-h3.h | 8 +- include/hw/arm/armsse.h | 16 +- include/hw/arm/armv7m.h | 17 +- include/hw/arm/aspeed.h | 14 +- include/hw/arm/aspeed_soc.h | 18 +- include/hw/arm/bcm2835_peripherals.h | 10 +- include/hw/arm/bcm2836.h | 18 +- include/hw/arm/digic.h | 9 +- include/hw/arm/exynos4210.h | 10 +- include/hw/arm/fsl-imx25.h | 9 +- include/hw/arm/fsl-imx31.h | 9 +- include/hw/arm/fsl-imx6.h | 9 +- include/hw/arm/fsl-imx6ul.h | 9 +- include/hw/arm/fsl-imx7.h | 9 +- include/hw/arm/linux-boot-if.h | 11 +- include/hw/arm/msf2-soc.h | 9 +- include/hw/arm/nrf51_soc.h | 10 +- include/hw/arm/omap.h | 20 +- include/hw/arm/pxa.h | 15 +- include/hw/arm/smmu-common.h | 18 +- include/hw/arm/smmuv3.h | 18 +- include/hw/arm/stm32f205_soc.h | 10 +- include/hw/arm/stm32f405_soc.h | 10 +- include/hw/arm/virt.h | 19 +- include/hw/arm/xlnx-versal.h | 9 +- include/hw/arm/xlnx-zynqmp.h | 10 +- include/hw/block/flash.h | 13 +- include/hw/block/swim.h | 15 +- include/hw/boards.h | 8 +- include/hw/char/avr_usart.h | 10 +- include/hw/char/bcm2835_aux.h | 9 +- include/hw/char/cadence_uart.h | 10 +- include/hw/char/cmsdk-apb-uart.h | 10 +- include/hw/char/digic-uart.h | 10 +- include/hw/char/escc.h | 9 +- include/hw/char/ibex_uart.h | 10 +- include/hw/char/imx_serial.h | 9 +- include/hw/char/nrf51_uart.h | 9 +- include/hw/char/pl011.h | 9 +- include/hw/char/renesas_sci.h | 9 +- include/hw/char/serial.h | 25 +- include/hw/char/stm32f2xx_usart.h | 10 +- include/hw/clock.h | 5 +- include/hw/core/cpu.h | 10 +- include/hw/core/generic-loader.h | 10 +- include/hw/core/split-irq.h | 3 +- include/hw/cpu/a15mpcore.h | 10 +- include/hw/cpu/a9mpcore.h | 10 +- include/hw/cpu/arm11mpcore.h | 10 +- include/hw/cpu/cluster.h | 10 +- include/hw/cpu/core.h | 10 +- include/hw/display/bcm2835_fb.h | 9 +- include/hw/display/dpcd.h | 4 +- include/hw/display/i2c-ddc.h | 4 +- include/hw/display/macfb.h | 30 +- include/hw/display/xlnx_dp.h | 9 +- include/hw/dma/bcm2835_dma.h | 10 +- include/hw/dma/i8257.h | 10 +- include/hw/dma/pl080.h | 9 +- include/hw/dma/xlnx-zdma.h | 10 +- include/hw/dma/xlnx-zynq-devcfg.h | 10 +- include/hw/dma/xlnx_dpdma.h | 4 +- include/hw/fw-path-provider.h | 11 +- include/hw/gpio/aspeed_gpio.h | 18 +- include/hw/gpio/bcm2835_gpio.h | 10 +- include/hw/gpio/imx_gpio.h | 9 +- include/hw/gpio/nrf51_gpio.h | 9 +- include/hw/hotplug.h | 11 +- include/hw/hyperv/vmbus-bridge.h | 9 +- include/hw/hyperv/vmbus.h | 17 +- include/hw/i2c/arm_sbcon_i2c.h | 10 +- include/hw/i2c/aspeed_i2c.h | 19 +- include/hw/i2c/i2c.h | 19 +- include/hw/i2c/imx_i2c.h | 9 +- include/hw/i2c/microbit_i2c.h | 10 +- include/hw/i2c/ppc4xx_i2c.h | 9 +- include/hw/i2c/smbus_slave.h | 15 +- include/hw/i386/apic_internal.h | 17 +- include/hw/i386/ich9.h | 10 +- include/hw/i386/intel_iommu.h | 7 +- include/hw/i386/ioapic_internal.h | 16 +- include/hw/i386/microvm.h | 19 +- include/hw/i386/pc.h | 14 +- include/hw/i386/x86-iommu.h | 13 +- include/hw/i386/x86.h | 19 +- include/hw/ide/ahci.h | 22 +- include/hw/ide/internal.h | 19 +- include/hw/ide/pci.h | 9 +- include/hw/input/adb.h | 16 +- include/hw/input/i8042.h | 6 +- include/hw/intc/allwinner-a10-pic.h | 9 +- include/hw/intc/arm_gic.h | 15 +- include/hw/intc/arm_gic_common.h | 21 +- include/hw/intc/arm_gicv3.h | 14 +- include/hw/intc/arm_gicv3_common.h | 16 +- include/hw/intc/arm_gicv3_its_common.h | 11 +- include/hw/intc/armv7m_nvic.h | 10 +- include/hw/intc/aspeed_vic.h | 9 +- include/hw/intc/bcm2835_ic.h | 9 +- include/hw/intc/bcm2836_control.h | 10 +- include/hw/intc/heathrow_pic.h | 9 +- include/hw/intc/ibex_plic.h | 10 +- include/hw/intc/imx_avic.h | 9 +- include/hw/intc/imx_gpcv2.h | 9 +- include/hw/intc/intc.h | 11 +- include/hw/intc/mips_gic.h | 6 +- include/hw/intc/realview_gic.h | 10 +- include/hw/intc/rx_icu.h | 4 +- include/hw/intc/xlnx-pmu-iomod-intc.h | 10 +- include/hw/intc/xlnx-zynqmp-ipi.h | 10 +- include/hw/ipack/ipack.h | 14 +- include/hw/ipmi/ipmi.h | 36 +- include/hw/isa/i8259_internal.h | 15 +- include/hw/isa/isa.h | 28 +- include/hw/isa/pc87312.h | 9 +- include/hw/isa/superio.h | 19 +- include/hw/m68k/mcf_fec.h | 4 +- include/hw/mem/memory-device.h | 11 +- include/hw/mem/nvdimm.h | 11 +- include/hw/mem/pc-dimm.h | 17 +- include/hw/mips/cps.h | 9 +- include/hw/misc/a9scu.h | 9 +- include/hw/misc/allwinner-cpucfg.h | 9 +- include/hw/misc/allwinner-h3-ccu.h | 9 +- include/hw/misc/allwinner-h3-dramc.h | 9 +- include/hw/misc/allwinner-h3-sysctrl.h | 9 +- include/hw/misc/allwinner-sid.h | 9 +- include/hw/misc/arm11scu.h | 9 +- include/hw/misc/armsse-cpuid.h | 9 +- include/hw/misc/armsse-mhu.h | 9 +- include/hw/misc/aspeed_scu.h | 18 +- include/hw/misc/aspeed_sdmc.h | 18 +- include/hw/misc/aspeed_xdma.h | 9 +- include/hw/misc/auxbus.h | 11 +- include/hw/misc/avr_power.h | 9 +- include/hw/misc/bcm2835_mbox.h | 10 +- include/hw/misc/bcm2835_mphi.h | 5 +- include/hw/misc/bcm2835_property.h | 10 +- include/hw/misc/bcm2835_rng.h | 10 +- include/hw/misc/bcm2835_thermal.h | 10 +- include/hw/misc/grlib_ahb_apb_pnp.h | 9 +- include/hw/misc/imx25_ccm.h | 9 +- include/hw/misc/imx31_ccm.h | 9 +- include/hw/misc/imx6_ccm.h | 9 +- include/hw/misc/imx6_src.h | 9 +- include/hw/misc/imx6ul_ccm.h | 9 +- include/hw/misc/imx7_ccm.h | 17 +- include/hw/misc/imx7_gpr.h | 9 +- include/hw/misc/imx7_snvs.h | 9 +- include/hw/misc/imx_ccm.h | 19 +- include/hw/misc/imx_rngc.h | 9 +- include/hw/misc/iotkit-secctl.h | 6 +- include/hw/misc/iotkit-sysctl.h | 10 +- include/hw/misc/iotkit-sysinfo.h | 10 +- include/hw/misc/mac_via.h | 27 +- include/hw/misc/macio/cuda.h | 18 +- include/hw/misc/macio/gpio.h | 9 +- include/hw/misc/macio/macio.h | 43 +- include/hw/misc/macio/pmu.h | 18 +- include/hw/misc/max111x.h | 10 +- include/hw/misc/mips_cmgcr.h | 6 +- include/hw/misc/mips_cpc.h | 9 +- include/hw/misc/mips_itu.h | 9 +- include/hw/misc/mos6522.h | 18 +- include/hw/misc/mps2-fpgaio.h | 9 +- include/hw/misc/mps2-scc.h | 9 +- include/hw/misc/msf2-sysreg.h | 9 +- include/hw/misc/nrf51_rng.h | 9 +- include/hw/misc/pca9552.h | 9 +- include/hw/misc/stm32f2xx_syscfg.h | 10 +- include/hw/misc/stm32f4xx_exti.h | 10 +- include/hw/misc/stm32f4xx_syscfg.h | 10 +- include/hw/misc/tz-mpc.h | 6 +- include/hw/misc/tz-msc.h | 9 +- include/hw/misc/tz-ppc.h | 6 +- include/hw/misc/unimp.h | 10 +- include/hw/misc/vmcoreinfo.h | 9 +- include/hw/misc/zynq-xadc.h | 10 +- include/hw/net/allwinner-sun8i-emac.h | 9 +- include/hw/net/allwinner_emac.h | 9 +- include/hw/net/cadence_gem.h | 9 +- include/hw/net/ftgmac100.h | 17 +- include/hw/net/imx_fec.h | 9 +- include/hw/net/lance.h | 10 +- include/hw/net/lasi_82596.h | 10 +- include/hw/net/msf2-emac.h | 10 +- include/hw/nmi.h | 11 +- include/hw/nubus/mac-nubus-bridge.h | 10 +- include/hw/nubus/nubus.h | 18 +- include/hw/nvram/fw_cfg.h | 21 +- include/hw/nvram/nrf51_nvm.h | 9 +- include/hw/or-irq.h | 3 +- include/hw/pci-bridge/simba.h | 10 +- include/hw/pci-host/designware.h | 16 +- include/hw/pci-host/gpex.h | 19 +- include/hw/pci-host/i440fx.h | 10 +- include/hw/pci-host/pnv_phb3.h | 20 +- include/hw/pci-host/pnv_phb4.h | 21 +- include/hw/pci-host/q35.h | 19 +- include/hw/pci-host/sabre.h | 19 +- include/hw/pci-host/spapr.h | 7 +- include/hw/pci-host/uninorth.h | 31 +- include/hw/pci-host/xilinx-pcie.h | 19 +- include/hw/pci/pci.h | 19 +- include/hw/pci/pci_bridge.h | 4 +- include/hw/pci/pci_host.h | 14 +- include/hw/pci/pcie_host.h | 5 +- include/hw/pci/pcie_port.h | 18 +- include/hw/pcmcia.h | 19 +- include/hw/platform-bus.h | 5 +- include/hw/ppc/mac_dbdma.h | 9 +- include/hw/ppc/openpic.h | 9 +- include/hw/ppc/pnv.h | 75 +- include/hw/ppc/pnv_core.h | 26 +- include/hw/ppc/pnv_homer.h | 22 +- include/hw/ppc/pnv_lpc.h | 28 +- include/hw/ppc/pnv_occ.h | 22 +- include/hw/ppc/pnv_pnor.h | 9 +- include/hw/ppc/pnv_psi.h | 35 +- include/hw/ppc/pnv_xive.h | 16 +- include/hw/ppc/pnv_xscom.h | 10 +- include/hw/ppc/spapr.h | 23 +- include/hw/ppc/spapr_cpu_core.h | 17 +- include/hw/ppc/spapr_drc.h | 80 +-- include/hw/ppc/spapr_irq.h | 12 +- include/hw/ppc/spapr_tpm_proxy.h | 9 +- include/hw/ppc/spapr_vio.h | 19 +- include/hw/ppc/spapr_xive.h | 16 +- include/hw/ppc/xics.h | 31 +- include/hw/ppc/xics_spapr.h | 5 +- include/hw/ppc/xive.h | 77 +-- include/hw/qdev-core.h | 15 +- include/hw/rdma/rdma.h | 11 +- include/hw/register.h | 4 +- include/hw/resettable.h | 11 +- include/hw/riscv/opentitan.h | 10 +- include/hw/riscv/riscv_hart.h | 10 +- include/hw/riscv/sifive_clint.h | 10 +- include/hw/riscv/sifive_e.h | 19 +- include/hw/riscv/sifive_e_prci.h | 10 +- include/hw/riscv/sifive_gpio.h | 9 +- include/hw/riscv/sifive_plic.h | 10 +- include/hw/riscv/sifive_test.h | 10 +- include/hw/riscv/sifive_u.h | 19 +- include/hw/riscv/sifive_u_otp.h | 10 +- include/hw/riscv/sifive_u_prci.h | 10 +- include/hw/riscv/sifive_uart.h | 10 +- include/hw/riscv/spike.h | 10 +- include/hw/riscv/virt.h | 10 +- include/hw/rtc/allwinner-rtc.h | 18 +- include/hw/rtc/aspeed_rtc.h | 9 +- include/hw/rtc/goldfish_rtc.h | 10 +- include/hw/rtc/m48t59.h | 11 +- include/hw/rtc/mc146818rtc.h | 9 +- include/hw/rtc/pl031.h | 9 +- include/hw/rtc/xlnx-zynqmp-rtc.h | 10 +- include/hw/rx/rx62n.h | 9 +- include/hw/s390x/3270-ccw.h | 19 +- include/hw/s390x/ap-device.h | 10 +- include/hw/s390x/css-bridge.h | 18 +- include/hw/s390x/event-facility.h | 34 +- include/hw/s390x/s390-ccw.h | 19 +- include/hw/s390x/s390-virtio-ccw.h | 17 +- include/hw/s390x/s390_flic.h | 30 +- include/hw/s390x/sclp.h | 14 +- include/hw/s390x/storage-attributes.h | 37 +- include/hw/s390x/storage-keys.h | 28 +- include/hw/s390x/tod.h | 18 +- include/hw/s390x/vfio-ccw.h | 7 +- include/hw/scsi/esp.h | 9 +- include/hw/scsi/scsi.h | 19 +- include/hw/sd/allwinner-sdhost.h | 18 +- include/hw/sd/aspeed_sdhci.h | 10 +- include/hw/sd/bcm2835_sdhost.h | 10 +- include/hw/sd/sd.h | 23 +- include/hw/sd/sdhci.h | 13 +- include/hw/southbridge/piix.h | 10 +- include/hw/sparc/sparc32_dma.h | 34 +- include/hw/sparc/sun4m_iommu.h | 9 +- include/hw/sparc/sun4u_iommu.h | 9 +- include/hw/ssi/aspeed_smc.h | 18 +- include/hw/ssi/imx_spi.h | 9 +- include/hw/ssi/mss-spi.h | 9 +- include/hw/ssi/pl022.h | 9 +- include/hw/ssi/ssi.h | 11 +- include/hw/ssi/stm32f2xx_spi.h | 10 +- include/hw/ssi/xilinx_spips.h | 32 +- include/hw/stream.h | 11 +- include/hw/sysbus.h | 17 +- include/hw/timer/a9gtimer.h | 6 +- include/hw/timer/allwinner-a10-pit.h | 6 +- include/hw/timer/arm_mptimer.h | 10 +- include/hw/timer/armv7m_systick.h | 9 +- include/hw/timer/aspeed_timer.h | 19 +- include/hw/timer/avr_timer16.h | 10 +- include/hw/timer/bcm2835_systmr.h | 10 +- include/hw/timer/cmsdk-apb-dualtimer.h | 7 +- include/hw/timer/cmsdk-apb-timer.h | 10 +- include/hw/timer/digic-timer.h | 9 +- include/hw/timer/i8254.h | 9 +- include/hw/timer/imx_epit.h | 9 +- include/hw/timer/imx_gpt.h | 9 +- include/hw/timer/mss-timer.h | 10 +- include/hw/timer/nrf51_timer.h | 9 +- include/hw/timer/renesas_cmt.h | 9 +- include/hw/timer/renesas_tmr.h | 9 +- include/hw/timer/stm32f2xx_timer.h | 10 +- include/hw/usb.h | 17 +- include/hw/usb/chipidea.h | 9 +- include/hw/usb/imx-usb-phy.h | 9 +- include/hw/vfio/vfio-amd-xgbe.h | 11 +- include/hw/vfio/vfio-calxeda-xgmac.h | 21 +- include/hw/vfio/vfio-platform.h | 19 +- include/hw/virtio/vhost-scsi-common.h | 10 +- include/hw/virtio/vhost-scsi.h | 10 +- include/hw/virtio/vhost-user-blk.h | 10 +- include/hw/virtio/vhost-user-fs.h | 10 +- include/hw/virtio/vhost-user-scsi.h | 10 +- include/hw/virtio/vhost-user-vsock.h | 10 +- include/hw/virtio/vhost-vsock-common.h | 10 +- include/hw/virtio/vhost-vsock.h | 10 +- include/hw/virtio/virtio-balloon.h | 10 +- include/hw/virtio/virtio-blk.h | 10 +- include/hw/virtio/virtio-bus.h | 15 +- include/hw/virtio/virtio-crypto.h | 10 +- include/hw/virtio/virtio-gpu-pci.h | 5 +- include/hw/virtio/virtio-gpu.h | 35 +- include/hw/virtio/virtio-input.h | 29 +- include/hw/virtio/virtio-iommu.h | 10 +- include/hw/virtio/virtio-mem.h | 17 +- include/hw/virtio/virtio-mmio.h | 19 +- include/hw/virtio/virtio-net.h | 7 +- include/hw/virtio/virtio-pmem.h | 17 +- include/hw/virtio/virtio-rng.h | 10 +- include/hw/virtio/virtio-scsi.h | 19 +- include/hw/virtio/virtio-serial.h | 22 +- include/hw/virtio/virtio.h | 14 +- include/hw/vmstate-if.h | 11 +- include/hw/watchdog/cmsdk-apb-watchdog.h | 10 +- include/hw/watchdog/wdt_aspeed.h | 19 +- include/hw/watchdog/wdt_diag288.h | 19 +- include/hw/watchdog/wdt_imx2.h | 9 +- include/hw/xen/xen-block.h | 39 +- include/hw/xen/xen-bus.h | 37 +- include/hw/xen/xen-legacy-backend.h | 5 +- include/io/channel-buffer.h | 7 +- include/io/channel-command.h | 7 +- include/io/channel-file.h | 7 +- include/io/channel-socket.h | 7 +- include/io/channel-tls.h | 7 +- include/io/channel-websock.h | 7 +- include/io/channel.h | 12 +- include/io/dns-resolver.h | 13 +- include/io/net-listener.h | 14 +- include/net/can_emu.h | 4 +- include/net/can_host.h | 21 +- include/net/filter.h | 13 +- include/qom/object.h | 327 ++++++++- include/qom/object_interfaces.h | 13 +- include/scsi/pr-manager.h | 16 +- include/sysemu/accel.h | 18 +- include/sysemu/cryptodev.h | 16 +- include/sysemu/hostmem.h | 10 +- include/sysemu/hvf.h | 5 +- include/sysemu/iothread.h | 9 +- include/sysemu/kvm.h | 5 +- include/sysemu/rng-random.h | 5 +- include/sysemu/rng.h | 10 +- include/sysemu/tpm.h | 11 +- include/sysemu/tpm_backend.h | 12 +- include/sysemu/vhost-user-backend.h | 17 +- include/ui/console.h | 10 +- migration/migration.h | 14 +- target/alpha/cpu-qom.h | 14 +- target/arm/cpu-qom.h | 25 +- target/arm/idau.h | 11 +- target/avr/cpu-qom.h | 14 +- target/cris/cpu-qom.h | 14 +- target/hppa/cpu-qom.h | 14 +- target/i386/cpu-qom.h | 14 +- target/lm32/cpu-qom.h | 14 +- target/m68k/cpu-qom.h | 14 +- target/microblaze/cpu-qom.h | 14 +- target/mips/cpu-qom.h | 14 +- target/moxie/cpu.h | 17 +- target/nios2/cpu.h | 17 +- target/openrisc/cpu.h | 17 +- target/ppc/cpu-qom.h | 14 +- target/ppc/cpu.h | 11 +- target/riscv/cpu.h | 17 +- target/rx/cpu-qom.h | 14 +- target/s390x/cpu-qom.h | 14 +- target/sh4/cpu-qom.h | 14 +- target/sparc/cpu-qom.h | 14 +- target/tilegx/cpu.h | 17 +- target/tricore/cpu-qom.h | 14 +- target/unicore32/cpu-qom.h | 14 +- target/xtensa/cpu-qom.h | 14 +- accel/tcg/tcg-all.c | 9 +- backends/cryptodev-builtin.c | 8 +- backends/cryptodev-vhost-user.c | 11 +- backends/dbus-vmstate.c | 16 +- backends/hostmem-file.c | 7 +- backends/hostmem-memfd.c | 7 +- backends/rng-builtin.c | 9 +- backends/rng-egd.c | 10 +- backends/tpm/tpm_emulator.c | 10 +- backends/tpm/tpm_passthrough.c | 7 +- chardev/baum.c | 9 +- chardev/char-parallel.c | 17 +- chardev/char-pty.c | 9 +- chardev/char-ringbuf.c | 10 +- chardev/char-socket.c | 10 +- chardev/char-udp.c | 9 +- chardev/char-win-stdio.c | 10 +- chardev/msmouse.c | 10 +- chardev/testdev.c | 10 +- chardev/wctablet.c | 10 +- hw/acpi/piix4.c | 10 +- hw/alpha/typhoon.c | 10 +- hw/arm/collie.c | 10 +- hw/arm/highbank.c | 10 +- hw/arm/integratorcp.c | 28 +- hw/arm/microbit.c | 10 +- hw/arm/mps2-tz.c | 19 +- hw/arm/mps2.c | 19 +- hw/arm/musca.c | 19 +- hw/arm/musicpal.c | 73 +- hw/arm/palm.c | 10 +- hw/arm/pxa2xx.c | 28 +- hw/arm/pxa2xx_gpio.c | 7 +- hw/arm/pxa2xx_pic.c | 10 +- hw/arm/raspi.c | 19 +- hw/arm/sbsa-ref.c | 10 +- hw/arm/spitz.c | 61 +- hw/arm/stellaris.c | 28 +- hw/arm/strongarm.c | 49 +- hw/arm/tosa.c | 18 +- hw/arm/versatilepb.c | 10 +- hw/arm/vexpress.c | 19 +- hw/arm/xilinx_zynq.c | 10 +- hw/arm/xlnx-versal-virt.c | 10 +- hw/arm/xlnx-zcu102.c | 10 +- hw/arm/z2.c | 17 +- hw/audio/ac97.c | 10 +- hw/audio/adlib.c | 9 +- hw/audio/cs4231.c | 10 +- hw/audio/cs4231a.c | 9 +- hw/audio/es1370.c | 10 +- hw/audio/gus.c | 9 +- hw/audio/hda-codec.c | 4 +- hw/audio/intel-hda.c | 5 +- hw/audio/marvell_88w8618.c | 10 +- hw/audio/milkymist-ac97.c | 7 +- hw/audio/pcspk.c | 9 +- hw/audio/pl041.c | 9 +- hw/audio/sb16.c | 9 +- hw/audio/wm8750.c | 9 +- hw/avr/arduino.c | 19 +- hw/avr/atmega.c | 12 +- hw/block/fdc.c | 34 +- hw/block/m25p80.c | 19 +- hw/block/nand.c | 5 +- hw/block/onenand.c | 9 +- hw/char/debugcon.c | 10 +- hw/char/etraxfs_ser.c | 10 +- hw/char/exynos4210_uart.c | 10 +- hw/char/grlib_apbuart.c | 10 +- hw/char/ipoctal232.c | 5 +- hw/char/lm32_juart.c | 6 +- hw/char/lm32_uart.c | 6 +- hw/char/mcf_uart.c | 9 +- hw/char/milkymist-uart.c | 7 +- hw/char/parallel.c | 10 +- hw/char/sclpconsole-lm.c | 10 +- hw/char/sclpconsole.c | 10 +- hw/char/serial-isa.c | 9 +- hw/char/serial-pci.c | 9 +- hw/char/spapr_vty.c | 10 +- hw/char/terminal3270.c | 10 +- hw/char/virtio-console.c | 10 +- hw/char/xilinx_uartlite.c | 10 +- hw/core/irq.c | 3 +- hw/cpu/realview_mpcore.c | 10 +- hw/display/ads7846.c | 9 +- hw/display/artist.c | 9 +- hw/display/bochs-display.c | 10 +- hw/display/cg3.c | 9 +- hw/display/cirrus_vga.c | 10 +- hw/display/cirrus_vga_isa.c | 10 +- hw/display/exynos4210_fimd.c | 10 +- hw/display/g364fb.c | 9 +- hw/display/jazz_led.c | 9 +- hw/display/milkymist-tmu2.c | 7 +- hw/display/milkymist-vgafb.c | 7 +- hw/display/next-fb.c | 6 +- hw/display/pl110.c | 9 +- hw/display/ramfb-standalone.c | 9 +- hw/display/sii9022.c | 9 +- hw/display/sm501.c | 18 +- hw/display/ssd0303.c | 9 +- hw/display/ssd0323.c | 9 +- hw/display/tcx.c | 9 +- hw/display/vga-isa.c | 9 +- hw/display/vga-pci.c | 9 +- hw/display/vhost-user-gpu-pci.c | 10 +- hw/display/vhost-user-vga.c | 10 +- hw/display/virtio-gpu-pci.c | 10 +- hw/display/virtio-vga.c | 10 +- hw/display/vmware_vga.c | 5 +- hw/dma/i82374.c | 9 +- hw/dma/pl330.c | 4 +- hw/dma/puv3_dma.c | 9 +- hw/dma/pxa2xx_dma.c | 9 +- hw/dma/rc4030.c | 10 +- hw/dma/xilinx_axidma.c | 19 +- hw/gpio/gpio_key.c | 9 +- hw/gpio/max7310.c | 9 +- hw/gpio/mpc8xxx.c | 9 +- hw/gpio/pl061.c | 9 +- hw/gpio/puv3_gpio.c | 9 +- hw/gpio/zaurus.c | 6 +- hw/hppa/dino.c | 10 +- hw/hppa/lasi.c | 10 +- hw/hyperv/hyperv.c | 9 +- hw/hyperv/hyperv_testdev.c | 5 +- hw/i2c/bitbang_i2c.c | 9 +- hw/i2c/exynos4210_i2c.c | 10 +- hw/i2c/mpc_i2c.c | 10 +- hw/i2c/smbus_eeprom.c | 10 +- hw/i2c/smbus_ich9.c | 10 +- hw/i2c/versatile_i2c.c | 7 +- hw/i386/kvm/clock.c | 9 +- hw/i386/kvm/i8254.c | 18 +- hw/i386/kvm/i8259.c | 12 +- hw/i386/kvmvapic.c | 9 +- hw/i386/port92.c | 9 +- hw/i386/vmmouse.c | 10 +- hw/i386/vmport.c | 9 +- hw/i386/xen/xen_platform.c | 10 +- hw/i386/xen/xen_pvdevice.c | 10 +- hw/ide/isa.c | 9 +- hw/ide/microdrive.c | 9 +- hw/ide/mmio.c | 9 +- hw/ide/sii3112.c | 8 +- hw/input/adb-kbd.c | 18 +- hw/input/adb-mouse.c | 18 +- hw/input/lm832x.c | 9 +- hw/input/milkymist-softusb.c | 7 +- hw/input/pl050.c | 9 +- hw/intc/apic.c | 6 +- hw/intc/arm_gic_kvm.c | 17 +- hw/intc/arm_gicv2m.c | 9 +- hw/intc/arm_gicv3_its_kvm.c | 14 +- hw/intc/arm_gicv3_kvm.c | 15 +- hw/intc/etraxfs_pic.c | 5 +- hw/intc/exynos4210_combiner.c | 10 +- hw/intc/exynos4210_gic.c | 19 +- hw/intc/grlib_irqmp.c | 9 +- hw/intc/i8259.c | 10 +- hw/intc/lm32_pic.c | 6 +- hw/intc/loongson_liointc.c | 5 +- hw/intc/nios2_iic.c | 10 +- hw/intc/ompic.c | 6 +- hw/intc/openpic_kvm.c | 10 +- hw/intc/pl190.c | 9 +- hw/intc/puv3_intc.c | 9 +- hw/intc/s390_flic_kvm.c | 12 +- hw/intc/slavio_intctl.c | 10 +- hw/intc/xilinx_intc.c | 4 +- hw/ipack/tpci200.c | 10 +- hw/ipmi/ipmi_bmc_extern.c | 10 +- hw/ipmi/isa_ipmi_bt.c | 10 +- hw/ipmi/isa_ipmi_kcs.c | 10 +- hw/ipmi/pci_ipmi_bt.c | 10 +- hw/ipmi/pci_ipmi_kcs.c | 10 +- hw/ipmi/smbus_ipmi.c | 9 +- hw/isa/i82378.c | 10 +- hw/isa/piix4.c | 10 +- hw/isa/vt82c686.c | 37 +- hw/m68k/mcf_intc.c | 9 +- hw/m68k/next-cube.c | 9 +- hw/m68k/next-kbd.c | 9 +- hw/microblaze/xlnx-zynqmp-pmu.c | 10 +- hw/mips/boston.c | 9 +- hw/mips/gt64xxx_pci.c | 10 +- hw/mips/malta.c | 9 +- hw/misc/applesmc.c | 6 +- hw/misc/arm_integrator_debug.c | 10 +- hw/misc/arm_l2x0.c | 9 +- hw/misc/arm_sysctl.c | 10 +- hw/misc/debugexit.c | 10 +- hw/misc/eccmemctl.c | 9 +- hw/misc/edu.c | 9 +- hw/misc/empty_slot.c | 9 +- hw/misc/exynos4210_clk.c | 10 +- hw/misc/exynos4210_pmu.c | 10 +- hw/misc/exynos4210_rng.c | 10 +- hw/misc/ivshmem.c | 22 +- hw/misc/milkymist-hpdmc.c | 7 +- hw/misc/milkymist-pfpu.c | 7 +- hw/misc/mst_fpga.c | 10 +- hw/misc/pc-testdev.c | 10 +- hw/misc/pca9552.c | 12 +- hw/misc/pci-testdev.c | 10 +- hw/misc/puv3_pm.c | 9 +- hw/misc/pvpanic.c | 10 +- hw/misc/sga.c | 9 +- hw/misc/slavio_misc.c | 17 +- hw/misc/tmp421.c | 18 +- hw/misc/zynq_slcr.c | 9 +- hw/net/can/can_kvaser_pci.c | 10 +- hw/net/can/can_mioe3680_pci.c | 10 +- hw/net/can/can_pcm3680_pci.c | 10 +- hw/net/dp8393x.c | 9 +- hw/net/e1000.c | 19 +- hw/net/e1000e.c | 9 +- hw/net/etraxfs_eth.c | 11 +- hw/net/lan9118.c | 9 +- hw/net/milkymist-minimac2.c | 7 +- hw/net/mipsnet.c | 9 +- hw/net/ne2000-isa.c | 9 +- hw/net/opencores_eth.c | 9 +- hw/net/pcnet-pci.c | 10 +- hw/net/rtl8139.c | 10 +- hw/net/smc91c111.c | 9 +- hw/net/spapr_llan.c | 10 +- hw/net/stellaris_enet.c | 10 +- hw/net/sungem.c | 9 +- hw/net/sunhme.c | 9 +- hw/net/vmxnet3.c | 12 +- hw/net/xgmac.c | 9 +- hw/net/xilinx_axienet.c | 19 +- hw/net/xilinx_ethlite.c | 5 +- hw/nvram/ds1225y.c | 9 +- hw/nvram/eeprom_at24c.c | 9 +- hw/nvram/spapr_nvram.c | 10 +- hw/pci-bridge/dec.c | 9 +- hw/pci-bridge/gen_pcie_root_port.c | 10 +- hw/pci-bridge/pci_bridge_dev.c | 7 +- hw/pci-bridge/pci_expander_bridge.c | 23 +- hw/pci-bridge/pcie_pci_bridge.c | 10 +- hw/pci-host/bonito.c | 14 +- hw/pci-host/grackle.c | 10 +- hw/pci-host/i440fx.c | 10 +- hw/pci-host/pnv_phb3.c | 5 +- hw/pci-host/pnv_phb4.c | 5 +- hw/pci-host/ppce500.c | 13 +- hw/pci-host/prep.c | 19 +- hw/pci-host/versatile.c | 14 +- hw/ppc/mpc8544_guts.c | 6 +- hw/ppc/ppc440_pcix.c | 10 +- hw/ppc/ppc440_uc.c | 10 +- hw/ppc/ppc4xx_pci.c | 7 +- hw/ppc/ppce500_spin.c | 9 +- hw/ppc/prep_systemio.c | 10 +- hw/ppc/rs6000_mc.c | 10 +- hw/ppc/spapr_rng.c | 7 +- hw/rtc/ds1338.c | 9 +- hw/rtc/exynos4210_rtc.c | 10 +- hw/rtc/m41t80.c | 9 +- hw/rtc/m48t59-isa.c | 21 +- hw/rtc/m48t59.c | 19 +- hw/rtc/sun4v-rtc.c | 9 +- hw/rtc/twl92230.c | 9 +- hw/rx/rx-gdbsim.c | 19 +- hw/rx/rx62n.c | 12 +- hw/scsi/esp-pci.c | 19 +- hw/scsi/lsi53c895a.c | 10 +- hw/scsi/megasas.c | 19 +- hw/scsi/scsi-disk.c | 20 +- hw/scsi/spapr_vscsi.c | 10 +- hw/scsi/vmw_pvscsi.c | 18 +- hw/sd/allwinner-sdhost.c | 6 +- hw/sd/bcm2835_sdhost.c | 6 +- hw/sd/milkymist-memcard.c | 7 +- hw/sd/pl181.c | 9 +- hw/sd/pxa2xx_mmci.c | 5 +- hw/sd/sdhci.c | 5 +- hw/sd/ssi-sd.c | 9 +- hw/sh4/sh_pci.c | 10 +- hw/sparc/sun4m.c | 34 +- hw/sparc64/sun4u.c | 33 +- hw/ssi/ssi.c | 4 +- hw/ssi/xilinx_spi.c | 9 +- hw/timer/altera_timer.c | 10 +- hw/timer/arm_timer.c | 18 +- hw/timer/cadence_ttc.c | 10 +- hw/timer/etraxfs_timer.c | 10 +- hw/timer/exynos4210_mct.c | 10 +- hw/timer/exynos4210_pwm.c | 10 +- hw/timer/grlib_gptimer.c | 7 +- hw/timer/hpet.c | 9 +- hw/timer/i8254.c | 10 +- hw/timer/lm32_timer.c | 6 +- hw/timer/milkymist-sysctl.c | 7 +- hw/timer/puv3_ost.c | 9 +- hw/timer/pxa2xx_timer.c | 7 +- hw/timer/slavio_timer.c | 10 +- hw/timer/xilinx_timer.c | 5 +- hw/tpm/tpm_crb.c | 9 +- hw/tpm/tpm_spapr.c | 10 +- hw/tpm/tpm_tis_isa.c | 9 +- hw/tpm/tpm_tis_sysbus.c | 9 +- hw/usb/ccid-card-emulated.c | 7 +- hw/usb/ccid-card-passthru.c | 5 +- hw/usb/dev-audio.c | 9 +- hw/usb/dev-hid.c | 9 +- hw/usb/dev-hub.c | 9 +- hw/usb/dev-mtp.c | 4 +- hw/usb/dev-network.c | 9 +- hw/usb/dev-serial.c | 9 +- hw/usb/dev-smartcard-reader.c | 17 +- hw/usb/dev-storage.c | 9 +- hw/usb/dev-uas.c | 4 +- hw/usb/dev-wacom.c | 9 +- hw/usb/hcd-ohci-pci.c | 9 +- hw/usb/hcd-uhci.c | 4 +- hw/usb/host-libusb.c | 7 +- hw/usb/redirect.c | 4 +- hw/usb/tusb6010.c | 9 +- hw/vfio/ap.c | 10 +- hw/virtio/vhost-scsi-pci.c | 5 +- hw/virtio/vhost-user-blk-pci.c | 5 +- hw/virtio/vhost-user-fs-pci.c | 5 +- hw/virtio/vhost-user-input-pci.c | 5 +- hw/virtio/vhost-user-scsi-pci.c | 5 +- hw/virtio/vhost-user-vsock-pci.c | 5 +- hw/virtio/vhost-vsock-pci.c | 5 +- hw/virtio/virtio-9p-pci.c | 10 +- hw/virtio/virtio-balloon-pci.c | 5 +- hw/virtio/virtio-blk-pci.c | 5 +- hw/virtio/virtio-crypto-pci.c | 5 +- hw/virtio/virtio-input-host-pci.c | 5 +- hw/virtio/virtio-input-pci.c | 9 +- hw/virtio/virtio-iommu-pci.c | 5 +- hw/virtio/virtio-net-pci.c | 5 +- hw/virtio/virtio-rng-pci.c | 5 +- hw/virtio/virtio-scsi-pci.c | 5 +- hw/virtio/virtio-serial-pci.c | 5 +- hw/watchdog/wdt_i6300esb.c | 5 +- hw/watchdog/wdt_ib700.c | 9 +- iothread.c | 6 +- migration/rdma.c | 7 +- net/can/can_socketcan.c | 10 +- net/colo-compare.c | 9 +- net/dump.c | 7 +- net/filter-buffer.c | 9 +- net/filter-mirror.c | 17 +- net/filter-replay.c | 7 +- net/filter-rewriter.c | 11 +- qom/object.c | 6 +- scsi/pr-manager-helper.c | 11 +- target/i386/sev.c | 7 +- tests/check-qom-interface.c | 11 +- tests/check-qom-proplist.c | 16 +- tests/test-qdev-global-props.c | 13 +- ui/console.c | 9 +- ui/gtk.c | 8 +- ui/input-barrier.c | 14 +- ui/input-linux.c | 14 +- ui/spice-app.c | 9 +- MAINTAINERS | 5 + 829 files changed, 7928 insertions(+), 4495 deletions(-) create mode 100644 scripts/codeconverter/codeconverter/__init__.py create mode 100644 scripts/codeconverter/codeconverter/patching.py create mode 100644 scripts/codeconverter/codeconverter/qom_macros.py create mode 100644 scripts/codeconverter/codeconverter/qom_type_info.py create mode 100644 scripts/codeconverter/codeconverter/regexps.py create mode 100644 scripts/codeconverter/codeconverter/test_patching.py create mode 100644 scripts/codeconverter/codeconverter/test_regexps.py create mode 100644 scripts/codeconverter/codeconverter/utils.py create mode 100755 scripts/codeconverter/converter.py
--=20
2.26.2
PATCH v4 1/18 qom: make object_ref/unref use a void * instead of Object *.
From: Daniel P. Berrangé <[email protected]>
The object_ref/unref methods are intended for use with any subclass of the base Object. Using "Object *" in the signature is not adding any meaningful level of type safety, since callers simply use "OBJECT(ptr)" and this expands to an unchecked cast "(Object *)".
By using "void *" we enable the object_unref() method to be used to provide support for g_autoptr() with any subclass.
Message-Id: <[email protected]>
---
Changes v3 -> v4: none
Changes v2 -> v3: none
Changes v1 -> v2: none
--- include/qom/object.h | 4 ++-- qom/object.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-)
include/qom/object.h +2 -2
@@ -1035,7 +1035,7 @@ GSList *object_class_get_list_sorted(const char *implements_type,* as its reference count is greater than zero. * Returns: @obj */ -Object *object_ref (Object *obj); +Object *object_ref (void *obj);/** * object_unref:
@@ -1044,7 +1044,7 @@ Object *object_ref(Object *obj);* Decrease the reference count of a object. A object cannot be freed as long * as its reference count is greater than zero. */ -void object_unref (Object *obj); +void object_unref (void *obj);/** * object_property_try_add:
qom/object.c +4 -2
@@ -1124,8 +1124,9 @@ GSList *object_class_get_list_sorted(const char *implements_type, object_class_cmp); } -Object *object_ref (Object *obj) +Object *object_ref (void *objptr) { +Object *obj =OBJECT (objptr);if (!obj) {return NULL ; }
@@ -1133,8 +1134,9 @@ Object *object_ref(Object *obj)return obj; } -void object_unref (Object *obj) +void object_unref (void *objptr) { +Object *obj =OBJECT (objptr);if (!obj) {return ; }
Signature · 1 line
2.26.2
PATCH v4 2/18 qom: provide convenient macros for declaring and defining types
In reply to Eduardo HabkostFrom: Daniel P. Berrangé <[email protected]>
When creating new QOM types, there is a lot of boilerplate code that must be repeated using a standard pattern. This is tedious to write and liable to suffer from subtle inconsistencies. Thus it would benefit from some simple automation.
QOM was loosely inspired by GLib's GObject, and indeed GObject suffers from the same burden of boilerplate code, but has long provided a set of macros to eliminate this burden in the source implementation. More recently it has also provided a set of macros to eliminate this burden in the header declaration.
In GLib there are the G_DECLARE_* and G_DEFINE_* family of macros for the header declaration and source implementation respectively:
https://developer.gnome.org/gobject/stable/chapter-gobject.html
https://developer.gnome.org/gobject/stable/howto-gobject.html
This patch takes inspiration from GObject to provide the equivalent functionality for QOM.
In the header file, instead of:
typedef struct MyDevice MyDevice;
typedef struct MyDeviceClass MyDeviceClass;
G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref)
#define MY_DEVICE_GET_CLASS(void *obj) \
OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE)
#define MY_DEVICE_CLASS(void *klass) \
OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE)
#define MY_DEVICE(void *obj)
OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE)
struct MyDeviceClass {
DeviceClass parent_class;
};We now have
OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
In cases where the class needs some virtual methods, it can be left to be implemented manually using
OBJECT_DECLARE_TYPE(MyDevice, my_device, MY_DEVICE)
Note that these macros are including support for g_autoptr() for the object types, which is something previously only supported for variables declared as the base Object * type.
Meanwhile in the source file, instead of:
static void my_device_finalize(Object *obj);
static void my_device_class_init(ObjectClass *oc, void *data);
static void my_device_init(Object *obj);
static const TypeInfo my_device_info = {
.parent = TYPE_DEVICE,
.name = TYPE_MY_DEVICE,
.instance_size = sizeof(MyDevice),
.instance_init = my_device_init,
.instance_finalize = my_device_finalize,
.class_size = sizeof(MyDeviceClass),
.class_init = my_device_class_init,
};
static void
my_device_register_types(void)
{
type_register_static(&my_device_info);
}
type_init(my_device_register_types);We now have
OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
Or, if a class needs to implement interfaces:
OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device, MY_DEVICE, DEVICE,
{ TYPE_USER_CREATABLE }, { NULL })
Or, if a class needs to be abstract
OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
IOW, in both cases the maintainer now only has to think about the interesting part of the code which implements useful functionality and avoids much of the boilerplate.
Message-Id: <[email protected]>
---
Changes v3 -> v4: none
Changes v2 -> v3: none
Changes v1 -> v2:
* Squashed "Fix G_DEFINE_AUTOPTR_CLEANUP_FUNC" into this patch
--- include/qom/object.h | 277 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 277 insertions(+)
include/qom/object.h +277 -0
@@ -304,6 +304,119 @@ typedef struct InterfaceInfo InterfaceInfo;* * The first example of such a QOM method was #CPUClass.reset, * another example is #DeviceClass.realize. +* +* # Standard type declaration and definition macros # +* +* A lot of the code outlined above follows a standard pattern and naming +* convention. To reduce the amount of boilerplate code that needs to be +* written for a new type there are two sets of macros to generate the +* common parts in a standard format. +* +* A type is declared using the OBJECT_DECLARE macro family. In types +* which do not require any virtual functions in the class, the +* OBJECT_DECLARE_SIMPLE_TYPE macro is suitable, and is commonly placed +* in the header file: +* +* <example> +* <title>Declaring a simple type</title> +* <programlisting> +* OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) +* </programlisting> +* </example> +* +* This is equivalent to the following: +* +* <example> +* <title>Expansion from declaring a simple type</title> +* <programlisting> +* typedef struct MyDevice MyDevice; +* typedef struct MyDeviceClass MyDeviceClass; +* +* G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref) +* +* #define MY_DEVICE_GET_CLASS(void *obj) \ +* OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE) +* #define MY_DEVICE_CLASS(void *klass) \ +* OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE) +* #define MY_DEVICE(void *obj) +* OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE) +* +* struct MyDeviceClass { +* DeviceClass parent_class; +* }; +* </programlisting> +* </example> +* +* The 'struct MyDevice' needs to be declared separately. +* If the type requires virtual functions to be declared in the class +* struct, then the alternative OBJECT_DECLARE_TYPE() macro can be +* used. This does the same as OBJECT_DECLARE_SIMPLE_TYPE(), but without +* the 'struct MyDeviceClass' definition. +* +* To implement the type, the OBJECT_DEFINE macro family is available. +* In the simple case the OBJECT_DEFINE_TYPE macro is suitable: +* +* <example> +* <title>Defining a simple type</title> +* <programlisting> +* OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) +* </programlisting> +* </example> +* +* This is equivalent to the following: +* +* <example> +* <title>Expansion from defining a simple type</title> +* <programlisting> +* static void my_device_finalize(Object *obj); +* static void my_device_class_init(ObjectClass *oc, void *data); +* static void my_device_init(Object *obj); +* +* static const TypeInfo my_device_info = { +* .parent = TYPE_DEVICE, +* .name = TYPE_MY_DEVICE, +* .instance_size = sizeof(MyDevice), +* .instance_init = my_device_init, +* .instance_finalize = my_device_finalize, +* .class_size = sizeof(MyDeviceClass), +* .class_init = my_device_class_init, +* }; +* +* static void +* my_device_register_types(void) +* { +* type_register_static(&my_device_info); +* } +* type_init(my_device_register_types); +* </programlisting> +* </example> +* +* This is sufficient to get the type registered with the type +* system, and the three standard methods now need to be implemented +* along with any other logic required for the type. +* +* If the type needs to implement one or more interfaces, then the +* OBJECT_DEFINE_TYPE_WITH_INTERFACES() macro can be used instead. +* This accepts an array of interface type names. +* +* <example> +* <title>Defining a simple type implementing interfaces</title> +* <programlisting> +* OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device, +* MY_DEVICE, DEVICE, +* { TYPE_USER_CREATABLE }, { NULL }) +* </programlisting> +* </example> +* +* If the type is not intended to be instantiated, then then +* the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead: +* +* <example> +* <title>Defining a simple type</title> +* <programlisting> +* OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE) +* </programlisting> +* </example> */
@@ -440,6 +553,170 @@ struct ObjectObject *parent; }; +/** +* OBJECT_DECLARE_TYPE: +* @ModuleObjName: the object name with initial capitalization +* @module_obj_name: the object name in lowercase with underscore separators +* @MODULE_OBJ_NAME: the object name in uppercase with underscore separators +* +* This macro is typically used in a header file, and will: +* +* - create the typedefs for the object and class structs +* - register the type for use with g_autoptr +* - provide three standard type cast functions +* +* The object struct and class struct need to be declared manually. +*/ +#define OBJECT_DECLARE_TYPE (ModuleObjName, module_obj_name,MODULE_OBJ_NAME ) \ + typedef struct ModuleObjName ModuleObjName; \ + typedef struct ModuleObjName##Class ModuleObjName##Class; \ + \ + G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName, object_unref) \ + \ + static inline G_GNUC_UNUSED ModuleObjName##Class * \ + MODULE_OBJ_NAME##_GET_CLASS(void *obj) \ + { return OBJECT_GET_CLASS(ModuleObjName##Class, obj, \ + TYPE_##MODULE_OBJ_NAME); } \ + \ + static inline G_GNUC_UNUSED ModuleObjName##Class * \ + MODULE_OBJ_NAME##_CLASS(void *klass) \ + { return OBJECT_CLASS_CHECK(ModuleObjName##Class, klass, \ + TYPE_##MODULE_OBJ_NAME); } \ + \ + static inline G_GNUC_UNUSED ModuleObjName * \ + MODULE_OBJ_NAME(void *obj) \ + { return OBJECT_CHECK(ModuleObjName, obj, \ + TYPE_##MODULE_OBJ_NAME); } + +/** +* OBJECT_DECLARE_SIMPLE_TYPE: +* @ModuleObjName: the object name with initial caps +* @module_obj_name: the object name in lowercase with underscore separators +* @MODULE_OBJ_NAME: the object name in uppercase with underscore separators +* @ParentModuleObjName: the parent object name with initial caps +* +* This does the same as OBJECT_DECLARE_TYPE(), but also declares +* the class struct, thus only the object struct needs to be declare +* manually. +* +* This macro should be used unless the class struct needs to have +* virtual methods declared. +*/ +#define OBJECT_DECLARE_SIMPLE_TYPE (ModuleObjName, module_obj_name, \ +MODULE_OBJ_NAME , ParentModuleObjName) \ + OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \ + struct ModuleObjName##Class { ParentModuleObjName##Class parent_class; }; + + +/** +* OBJECT_DEFINE_TYPE_EXTENDED: +* @ModuleObjName: the object name with initial caps +* @module_obj_name: the object name in lowercase with underscore separators +* @MODULE_OBJ_NAME: the object name in uppercase with underscore separators +* @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore +* separators +* @ABSTRACT: boolean flag to indicate whether the object can be instantiated +* @...: list of initializers for "InterfaceInfo" to declare implemented interfaces +* +* This macro is typically used in a source file, and will: +* +* - declare prototypes for _finalize, _class_init and _init methods +* - declare the TypeInfo struct instance +* - provide the constructor to register the type +* +* After using this macro, implementations of the _finalize, _class_init, +* and _init methods need to be written. Any of these can be zero-line +* no-op impls if no special logic is required for a given type. +* +* This macro should rarely be used, instead one of the more specialized +* macros is usually a better choice. +*/ +#define OBJECT_DEFINE_TYPE_EXTENDED (ModuleObjName, module_obj_name, \ +MODULE_OBJ_NAME ,PARENT_MODULE_OBJ_NAME , \ +ABSTRACT , ...) \ + static void \ + module_obj_name##_finalize(Object *obj); \ + static void \ + module_obj_name##_class_init(ObjectClass *oc, void *data); \ + static void \ + module_obj_name##_init(Object *obj); \ + \ + static const TypeInfo module_obj_name##_info = { \ + .parent = TYPE_##PARENT_MODULE_OBJ_NAME, \ + .name = TYPE_##MODULE_OBJ_NAME, \ + .instance_size = sizeof(ModuleObjName), \ + .instance_init = module_obj_name##_init, \ + .instance_finalize = module_obj_name##_finalize, \ + .class_size = sizeof(ModuleObjName##Class), \ + .class_init = module_obj_name##_class_init, \ + .abstract = ABSTRACT, \ + .interfaces = (InterfaceInfo[]) { __VA_ARGS__ } , \ + }; \ + \ + static void \ + module_obj_name##_register_types(void) \ + { \ + type_register_static(&module_obj_name##_info); \ + } \ + type_init(module_obj_name##_register_types); + +/** +* OBJECT_DEFINE_TYPE: +* @ModuleObjName: the object name with initial caps +* @module_obj_name: the object name in lowercase with underscore separators +* @MODULE_OBJ_NAME: the object name in uppercase with underscore separators +* @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore +* separators +* +* This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suitable +* for the common case of a non-abstract type, without any interfaces. +*/ +#define OBJECT_DEFINE_TYPE (ModuleObjName, module_obj_name,MODULE_OBJ_NAME , \ +PARENT_MODULE_OBJ_NAME ) \ + OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \ + MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \ + false, { NULL }) + +/** +* OBJECT_DEFINE_TYPE_WITH_INTERFACES: +* @ModuleObjName: the object name with initial caps +* @module_obj_name: the object name in lowercase with underscore separators +* @MODULE_OBJ_NAME: the object name in uppercase with underscore separators +* @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore +* separators +* @...: list of initializers for "InterfaceInfo" to declare implemented interfaces +* +* This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suitable +* for the common case of a non-abstract type, with one or more implemented +* interfaces. +* +* Note when passing the list of interfaces, be sure to include the final +* NULL entry, e.g. { TYPE_USER_CREATABLE }, { NULL } +*/ +#define OBJECT_DEFINE_TYPE_WITH_INTERFACES (ModuleObjName, module_obj_name, \ +MODULE_OBJ_NAME , \ +PARENT_MODULE_OBJ_NAME , ...) \ + OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \ + MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \ + false, __VA_ARGS__) + +/** +* OBJECT_DEFINE_ABSTRACT_TYPE: +* @ModuleObjName: the object name with initial caps +* @module_obj_name: the object name in lowercase with underscore separators +* @MODULE_OBJ_NAME: the object name in uppercase with underscore separators +* @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore +* separators +* +* This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suitable +* for defining an abstract type, without any interfaces. +*/ +#define OBJECT_DEFINE_ABSTRACT_TYPE (ModuleObjName, module_obj_name, \ +MODULE_OBJ_NAME ,PARENT_MODULE_OBJ_NAME ) \ + OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \ + MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \ + true, { NULL }) +/** * TypeInfo: * @name: The name of the type.
Signature · 1 line
2.26.2
PATCH v4 3/18 qom: Allow class type name to be specified in OBJECT_DECLARE*
In reply to Eduardo HabkostMany QOM types don't follow the Type/TypeClass pattern on the instance/struct names. Let the class struct name be specified in the OBJECT_DECLARE* macros.
---
Changes v3 -> v4: none
Changes v2 -> v3: none
Changes v1 -> v2: none
--- include/qom/object.h | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-)
include/qom/object.h +18 -17
@@ -555,7 +555,8 @@ struct Object/** * OBJECT_DECLARE_TYPE: -* @ModuleObjName: the object name with initial capitalization +* @InstanceType: instance struct name +* @ClassType: class struct name * @module_obj_name: the object name in lowercase with underscore separators * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators *
@@ -567,33 +568,33 @@ struct Object* * The object struct and class struct need to be declared manually. */ -#define OBJECT_DECLARE_TYPE (ModuleObjName, module_obj_name,MODULE_OBJ_NAME ) \ - typedef struct ModuleObjName ModuleObjName; \ - typedef struct ModuleObjName##Class ModuleObjName##Class; \ +#define OBJECT_DECLARE_TYPE (InstanceType, ClassType, module_obj_name,MODULE_OBJ_NAME ) \ + typedef struct InstanceType InstanceType; \ + typedef struct ClassType ClassType; \ \ - G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName, object_unref) \ + G_DEFINE_AUTOPTR_CLEANUP_FUNC(InstanceType, object_unref) \ \ - static inline G_GNUC_UNUSED ModuleObjName##Class * \ + static inline G_GNUC_UNUSED ClassType * \ MODULE_OBJ_NAME##_GET_CLASS(void *obj) \ - { return OBJECT_GET_CLASS(ModuleObjName##Class, obj, \ + { return OBJECT_GET_CLASS(ClassType, obj, \ TYPE_##MODULE_OBJ_NAME); } \ \ - static inline G_GNUC_UNUSED ModuleObjName##Class * \ + static inline G_GNUC_UNUSED ClassType * \ MODULE_OBJ_NAME##_CLASS(void *klass) \ - { return OBJECT_CLASS_CHECK(ModuleObjName##Class, klass, \ + { return OBJECT_CLASS_CHECK(ClassType, klass, \ TYPE_##MODULE_OBJ_NAME); } \ \ - static inline G_GNUC_UNUSED ModuleObjName * \ + static inline G_GNUC_UNUSED InstanceType * \ MODULE_OBJ_NAME(void *obj) \ - { return OBJECT_CHECK(ModuleObjName, obj, \ + { return OBJECT_CHECK(InstanceType, obj, \ TYPE_##MODULE_OBJ_NAME); }/** * OBJECT_DECLARE_SIMPLE_TYPE: -* @ModuleObjName: the object name with initial caps +* @InstanceType: instance struct name * @module_obj_name: the object name in lowercase with underscore separators * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators -* @ParentModuleObjName: the parent object name with initial caps +* @ParentClassType: class struct name of parent type * * This does the same as OBJECT_DECLARE_TYPE(), but also declares * the class struct, thus only the object struct needs to be declare
@@ -602,10 +603,10 @@ struct Object* This macro should be used unless the class struct needs to have * virtual methods declared. */ -#define OBJECT_DECLARE_SIMPLE_TYPE (ModuleObjName, module_obj_name, \ -MODULE_OBJ_NAME , ParentModuleObjName) \ - OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \ - struct ModuleObjName##Class { ParentModuleObjName##Class parent_class; }; +#define OBJECT_DECLARE_SIMPLE_TYPE (InstanceType, module_obj_name, \ +MODULE_OBJ_NAME , ParentClassType) \ + OBJECT_DECLARE_TYPE(InstanceType, InstanceType##Class, module_obj_name, MODULE_OBJ_NAME) \ + struct InstanceType##Class { ParentClassType parent_class; };/**
Signature · 1 line
2.26.2
PATCH v4 4/18 qom: DECLARE_*_CHECKERS macros
In reply to Eduardo HabkostSometimes the typedefs are buried inside another header, but we want to benefit from the automatic definition of type cast functions. Introduce macros that will let type checkers be defined when typedefs are already available.
---
Changes v3 -> v4: none
Changes v2 -> v3: none
Changes v1 -> v2: none
--- include/qom/object.h | 72 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 14 deletions(-)
include/qom/object.h +58 -14
@@ -553,6 +553,62 @@ struct ObjectObject *parent; }; +/** +* DECLARE_INSTANCE_CHECKER: +* @InstanceType: instance struct name +* @OBJ_NAME: the object name in uppercase with underscore separators +* @TYPENAME: type name +* +* Direct usage of this macro should be avoided, and the complete +* OBJECT_DECLARE_TYPE macro is recommended instead. +* +* This macro will provide the three standard type cast functions for a +* QOM type. +*/ +#define DECLARE_INSTANCE_CHECKER (InstanceType,OBJ_NAME ,TYPENAME ) \ + static inline G_GNUC_UNUSED InstanceType * \ + OBJ_NAME(void *obj) \ + { return OBJECT_CHECK(InstanceType, obj, TYPENAME); } + +/** +* DECLARE_CLASS_CHECKERS: +* @ClassType: class struct name +* @OBJ_NAME: the object name in uppercase with underscore separators +* @TYPENAME: type name +* +* Direct usage of this macro should be avoided, and the complete +* OBJECT_DECLARE_TYPE macro is recommended instead. +* +* This macro will provide the three standard type cast functions for a +* QOM type. +*/ +#define DECLARE_CLASS_CHECKERS (ClassType,OBJ_NAME ,TYPENAME ) \ + static inline G_GNUC_UNUSED ClassType * \ + OBJ_NAME##_GET_CLASS(void *obj) \ + { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \ + \ + static inline G_GNUC_UNUSED ClassType * \ + OBJ_NAME##_CLASS(void *klass) \ + { return OBJECT_CLASS_CHECK(ClassType, klass, TYPENAME); } + +/** +* DECLARE_OBJ_CHECKERS: +* @InstanceType: instance struct name +* @ClassType: class struct name +* @OBJ_NAME: the object name in uppercase with underscore separators +* @TYPENAME: type name +* +* Direct usage of this macro should be avoided, and the complete +* OBJECT_DECLARE_TYPE macro is recommended instead. +* +* This macro will provide the three standard type cast functions for a +* QOM type. +*/ +#define DECLARE_OBJ_CHECKERS (InstanceType, ClassType,OBJ_NAME ,TYPENAME ) \ + DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \ + \ + DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) +/** * OBJECT_DECLARE_TYPE: * @InstanceType: instance struct name
@@ -574,20 +630,8 @@ struct Object \ G_DEFINE_AUTOPTR_CLEANUP_FUNC(InstanceType, object_unref) \ \ - static inline G_GNUC_UNUSED ClassType * \ - MODULE_OBJ_NAME##_GET_CLASS(void *obj) \ - { return OBJECT_GET_CLASS(ClassType, obj, \ - TYPE_##MODULE_OBJ_NAME); } \ - \ - static inline G_GNUC_UNUSED ClassType * \ - MODULE_OBJ_NAME##_CLASS(void *klass) \ - { return OBJECT_CLASS_CHECK(ClassType, klass, \ - TYPE_##MODULE_OBJ_NAME); } \ - \ - static inline G_GNUC_UNUSED InstanceType * \ - MODULE_OBJ_NAME(void *obj) \ - { return OBJECT_CHECK(InstanceType, obj, \ - TYPE_##MODULE_OBJ_NAME); } +DECLARE_OBJ_CHECKERS (InstanceType, ClassType, \ + MODULE_OBJ_NAME, TYPE_##MODULE_OBJ_NAME)/** * OBJECT_DECLARE_SIMPLE_TYPE:
Signature · 1 line
2.26.2
PATCH v4 5/18 qom: Make type checker functions accept const pointers
In reply to Eduardo HabkostThe existing type check macros all unconditionally drop const qualifiers from their arguments. Keep this behavior in the macros generated by DECLARE_*CHECKER* by now.
---
Changes v3 -> v4: none
Changes v2 -> v3:
* Removed reference to _Generic on comment
Changes v1 -> v2:
* Removed note about _Generic from commit message, because it won't be possible to do what I was planning without manual #defines
--- include/qom/object.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/qom/object.h +3 -3
@@ -567,7 +567,7 @@ struct Object*/ #define DECLARE_INSTANCE_CHECKER (InstanceType,OBJ_NAME ,TYPENAME ) \ static inline G_GNUC_UNUSED InstanceType * \ - OBJ_NAME(void *obj) \ + OBJ_NAME(const void *obj) \ { return OBJECT_CHECK(InstanceType, obj, TYPENAME); }/**
@@ -584,11 +584,11 @@ struct Object*/ #define DECLARE_CLASS_CHECKERS (ClassType,OBJ_NAME ,TYPENAME ) \ static inline G_GNUC_UNUSED ClassType * \ - OBJ_NAME##_GET_CLASS(void *obj) \ + OBJ_NAME##_GET_CLASS(const void *obj) \ { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \ \ static inline G_GNUC_UNUSED ClassType * \ - OBJ_NAME##_CLASS(void *klass) \ + OBJ_NAME##_CLASS(const void *klass) \ { return OBJECT_CLASS_CHECK(ClassType, klass, TYPENAME); }/**
Signature · 1 line
2.26.2
PATCH v4 6/18 codeconverter: script for automating QOM code cleanups
In reply to Eduardo HabkostThis started as a simple script that scanned for regular expressions, but became more and more complex when exceptions to the rules were found.
I don't know if this should be maintained in the QEMU source tree long term (maybe it can be reused for other code transformations that Coccinelle can't handle). In either case, this is included as part of the patch series to document how exactly the automated code transformations in the next patches were done.
---
Changes v3 -> v4:
* Add copyright header to all modules
* Added entry to MAINTAINERS
Changes v2 -> v3:
* Too many, lost track of them
* Made code that replaces type_register* with TYPE_INFO more flexible
* New code for handling TypeInfo variables and checking instance/class sizes
Changes v1 -> v2:
* Don't warn/skip TypeCheckMacro conversion if typedefs are found in typedefs.h
* Convert type check macros that use "struct [...]" without --force
--- .../codeconverter/codeconverter/__init__.py | 0 .../codeconverter/codeconverter/patching.py | 397 +++++++++++ .../codeconverter/codeconverter/qom_macros.py | 652 ++++++++++++++++++ .../codeconverter/qom_type_info.py | 434 ++++++++++++ .../codeconverter/codeconverter/regexps.py | 118 ++++ .../codeconverter/test_patching.py | 105 +++ .../codeconverter/test_regexps.py | 282 ++++++++ scripts/codeconverter/codeconverter/utils.py | 72 ++ scripts/codeconverter/converter.py | 123 ++++ MAINTAINERS | 5 + 10 files changed, 2188 insertions(+) create mode 100644 scripts/codeconverter/codeconverter/__init__.py create mode 100644 scripts/codeconverter/codeconverter/patching.py create mode 100644 scripts/codeconverter/codeconverter/qom_macros.py create mode 100644 scripts/codeconverter/codeconverter/qom_type_info.py create mode 100644 scripts/codeconverter/codeconverter/regexps.py create mode 100644 scripts/codeconverter/codeconverter/test_patching.py create mode 100644 scripts/codeconverter/codeconverter/test_regexps.py create mode 100644 scripts/codeconverter/codeconverter/utils.py create mode 100755 scripts/codeconverter/converter.py
scripts/codeconverter/codeconverter/__init__.py new file +0 -0
scripts/codeconverter/codeconverter/patching.py new file +397 -0
398 lines not on this page · raw message
scripts/codeconverter/codeconverter/qom_macros.py new file +652 -0
652 lines not on this page · raw message
scripts/codeconverter/codeconverter/qom_type_info.py new file +434 -0
434 lines not on this page · raw message
scripts/codeconverter/codeconverter/regexps.py new file +118 -0
118 lines not on this page · raw message
scripts/codeconverter/codeconverter/test_patching.py new file +105 -0
105 lines not on this page · raw message
scripts/codeconverter/codeconverter/test_regexps.py new file +282 -0
282 lines not on this page · raw message
scripts/codeconverter/codeconverter/utils.py new file +72 -0
73 lines not on this page · raw message
scripts/codeconverter/converter.py new file +123 -0
124 lines not on this page · raw message
MAINTAINERS +5 -0
@@ -2420,6 +2420,11 @@ F: tests/check-qom-interface.c F: tests/check-qom-proplist.c F: tests/test-qdev-global-props.c +QOM boilerplate conversion script +M: Eduardo Habkost <[email protected]> +S: Maintained +F: scripts/codeconverter/ + QMP M: Markus Armbruster <[email protected]> S: Supported
Signature · 1 line
2.26.2
PATCH v4 7/18 Delete duplicate QOM typedefs
In reply to Eduardo HabkostGenerated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=QOMDuplicatedTypedefs $(git grep -l '' -- '*.[ch]')
---
Changes v3 -> v4: none
Changes v2 -> v3: none
Changes v1 -> v2: none
---
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: [email protected]
--- include/crypto/secret_keyring.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/crypto/secret_keyring.h +4 -4
@@ -39,14 +39,14 @@typedef struct QCryptoSecretKeyring QCryptoSecretKeyring ;typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass ; -typedef struct QCryptoSecretKeyring { +struct QCryptoSecretKeyring {QCryptoSecretCommon parent;int32_t serial; -}QCryptoSecretKeyring ; +}; -typedef struct QCryptoSecretKeyringClass { +struct QCryptoSecretKeyringClass {QCryptoSecretCommonClass parent; -}QCryptoSecretKeyringClass ; +};#endif /* QCRYPTO_SECRET_KEYRING_H */
Signature · 1 line
2.26.2
PATCH v4 8/18 Move QOM typedefs and add missing includes
In reply to Eduardo HabkostSome typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with OBJECT_DECLARE_TYPE.
Patch generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]')
which will split "typdef struct { ... } TypedefName" declarations.
Followed by:
$ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \
$(git grep -l '' -- '*.[ch]')which will:
- move the typedefs and #defines above the type check macros
- add missing #include "qom/object.h" lines if necessary
---
Changes v3 -> v4:
* Removed hunk due to rebase conflict:
hw/hppa/lasi.c include/hw/arm/armsse.h include/hw/virtio/vhost-user-blk.h
* Reviewed-by lines from v3 were kept, as no additional hunks are introduced in this version
Changes v2 -> v3:
* Removed hunks due to rebase conflicts: hw/arm/integratorcp.c hw/arm/versatilepb.c hw/arm/vexpress.c hw/sd/pl181.c include/hw/ppc/xive.h
* Removed hunks due to conflicts with other patches in this
series: include/hw/block/swim.h include/hw/display/macfb.h include/hw/rdma/rdma.h migration/migration.h target/rx/cpu-qom.h
* Reviewed-by line from Daniel was kept, as no additional hunks are introduced in this version
Changes v1 -> v2:
* Re-ran script after moving a few macros and typedefs. Now the patch also changes:
- SysbusAHCIState at hw/ide/ahci.h
- VhostUserGPU at hw/virtio/virtio-gpu.h
- I8257State at hw/dma/i8257.h
- AllwinnerAHCIState at hw/ide/ahci.h
- ISAKBDState at hw/input/i8042.h
- PIIXState at hw/southbridge/piix.h
- VFIOPCIDevice at hw/vfio/pci.h
- missing include at hw/net/rocker/rocker.h
- missing include at hw/scsi/mptsas.h
- missing include at include/hw/arm/pxa.h
- missing include at include/sysemu/kvm.h
---
Cc: Richard Henderson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Gonglei (Arei)" <[email protected]>
Cc: "Marc-André Lureau" <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: Igor Mammedov <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: Amit Shah <[email protected]>
Cc: Stefan Berger <[email protected]>
Cc: Samuel Thibault <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: Christian Schoenebeck <[email protected]>
Cc: Marcel Apfelbaum <[email protected]>
Cc: Aleksandar Markovic <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Aurelien Jarno <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Joel Stanley <[email protected]>
Cc: Jan Kiszka <[email protected]>
Cc: Andrzej Zaborowski <[email protected]>
Cc: Andrew Baumann <[email protected]>
Cc: Radoslaw Biernacki <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Michael Walle <[email protected]>
Cc: Sarah Harris <[email protected]>
Cc: Michael Rolnik <[email protected]>
Cc: John Snow <[email protected]>
Cc: Kevin Wolf <[email protected]>
Cc: Max Reitz <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Igor Mitsyanko <[email protected]>
Cc: Fabien Chouteau <[email protected]>
Cc: KONRAD Frederic <[email protected]>
Cc: Alberto Garcia <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Mark Cave-Ayland <[email protected]>
Cc: "Hervé Poussineau" <[email protected]>
Cc: Aleksandar Rikalo <[email protected]>
Cc: BALATON Zoltan <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Corey Minyard <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>
Cc: Paul Durrant <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Jiaxun Yang <[email protected]>
Cc: Chris Wulff <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Artyom Tarasenko <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Andrew Jeffery <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Dmitry Fleytman <[email protected]>
Cc: Max Filippov <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Sven Schnelle <[email protected]>
Cc: Yuval Shaia <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Matthew Rosato <[email protected]>
Cc: Fam Zheng <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: Beniamino Galvani <[email protected]>
Cc: Tony Krowiak <[email protected]>
Cc: Pierre Morel <[email protected]>
Cc: Alex Williamson <[email protected]>
Cc: Raphael Norwitz <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: Stefan Hajnoczi <[email protected]>
Cc: Eric Auger <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: Ben Warren <[email protected]>
Cc: Niek Linnenbank <[email protected]>
Cc: Antony Pavlov <[email protected]>
Cc: Jean-Christophe Dubois <[email protected]>
Cc: Peter Chubb <[email protected]>
Cc: Andrey Smirnov <[email protected]>
Cc: Subbaraya Sundeep <[email protected]>
Cc: Magnus Damm <[email protected]>
Cc: Peter Xu <[email protected]>
Cc: Sergio Lopez <[email protected]>
Cc: Xiao Guangrong <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Sagar Karandikar <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: Anup Patel <[email protected]>
Cc: Eric Farman <[email protected]>
Cc: Juan Quintela <[email protected]>
Cc: Cameron Esfahani <[email protected]>
Cc: Roman Bolshakov <[email protected]>
Cc: Zhang Chen <[email protected]>
Cc: Li Zhijian <[email protected]>
Cc: Pavel Dovgalyuk <[email protected]>
Cc: Anthony Green <[email protected]>
Cc: Stafford Horne <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- chardev/chardev-internal.h | 5 +- hw/9pfs/virtio-9p.h | 7 ++- hw/audio/intel-hda.h | 11 ++-- hw/avr/atmega.h | 6 +- hw/block/nvme.h | 6 +- hw/display/ati_int.h | 6 +- hw/display/qxl.h | 6 +- hw/display/virtio-vga.h | 11 ++-- hw/i386/amd_iommu.h | 6 +- hw/misc/tmp105.h | 6 +- hw/net/fsl_etsec/etsec.h | 6 +- hw/net/rocker/rocker.h | 1 + hw/net/tulip.h | 1 + hw/net/vmxnet3_defs.h | 6 +- hw/ppc/e500-ccsr.h | 6 +- hw/ppc/e500.h | 11 ++-- hw/ppc/mac.h | 11 ++-- hw/rdma/vmw/pvrdma.h | 6 +- hw/s390x/ccw-device.h | 10 ++-- hw/s390x/ipl.h | 3 +- hw/s390x/s390-pci-bus.h | 18 +++--- hw/s390x/virtio-ccw.h | 73 ++++++++++++++---------- hw/scsi/mptsas.h | 1 + hw/usb/ccid.h | 6 +- hw/usb/hcd-dwc2.h | 1 + hw/usb/hcd-ehci.h | 21 ++++--- hw/usb/hcd-ohci.h | 6 +- hw/usb/hcd-xhci.h | 3 +- hw/vfio/pci.h | 6 +- hw/virtio/virtio-mem-pci.h | 1 + hw/virtio/virtio-pci.h | 6 +- hw/virtio/virtio-pmem-pci.h | 1 + hw/xen/xen_pt.h | 1 + include/authz/base.h | 4 +- include/authz/list.h | 5 +- include/authz/listfile.h | 5 +- include/authz/pamacct.h | 5 +- include/authz/simple.h | 5 +- include/block/throttle-groups.h | 1 + include/chardev/char-fd.h | 6 +- include/chardev/char-win.h | 6 +- include/chardev/char.h | 5 +- include/chardev/spice.h | 6 +- include/crypto/secret.h | 2 +- include/crypto/secret_common.h | 4 +- include/crypto/secret_keyring.h | 4 +- include/crypto/tls-cipher-suites.h | 5 +- include/crypto/tlscreds.h | 2 +- include/crypto/tlscredsanon.h | 3 +- include/crypto/tlscredspsk.h | 3 +- include/crypto/tlscredsx509.h | 3 +- include/exec/memory.h | 5 +- include/hw/acpi/acpi_dev_interface.h | 5 +- include/hw/acpi/generic_event_device.h | 6 +- include/hw/acpi/vmgenid.h | 6 +- include/hw/adc/stm32f2xx_adc.h | 6 +- include/hw/arm/allwinner-a10.h | 6 +- include/hw/arm/allwinner-h3.h | 5 +- include/hw/arm/armv7m.h | 11 ++-- include/hw/arm/aspeed.h | 6 +- include/hw/arm/aspeed_soc.h | 11 ++-- include/hw/arm/bcm2835_peripherals.h | 6 +- include/hw/arm/bcm2836.h | 11 ++-- include/hw/arm/digic.h | 6 +- include/hw/arm/exynos4210.h | 6 +- include/hw/arm/fsl-imx25.h | 6 +- include/hw/arm/fsl-imx31.h | 6 +- include/hw/arm/fsl-imx6.h | 6 +- include/hw/arm/fsl-imx6ul.h | 6 +- include/hw/arm/fsl-imx7.h | 6 +- include/hw/arm/linux-boot-if.h | 5 +- include/hw/arm/msf2-soc.h | 6 +- include/hw/arm/nrf51_soc.h | 6 +- include/hw/arm/omap.h | 5 +- include/hw/arm/pxa.h | 1 + include/hw/arm/smmu-common.h | 11 ++-- include/hw/arm/smmuv3.h | 11 ++-- include/hw/arm/stm32f205_soc.h | 6 +- include/hw/arm/stm32f405_soc.h | 6 +- include/hw/arm/virt.h | 11 ++-- include/hw/arm/xlnx-versal.h | 6 +- include/hw/arm/xlnx-zynqmp.h | 6 +- include/hw/block/flash.h | 5 +- include/hw/char/avr_usart.h | 6 +- include/hw/char/bcm2835_aux.h | 6 +- include/hw/char/cadence_uart.h | 6 +- include/hw/char/cmsdk-apb-uart.h | 6 +- include/hw/char/digic-uart.h | 6 +- include/hw/char/escc.h | 6 +- include/hw/char/ibex_uart.h | 6 +- include/hw/char/imx_serial.h | 6 +- include/hw/char/nrf51_uart.h | 6 +- include/hw/char/pl011.h | 6 +- include/hw/char/renesas_sci.h | 6 +- include/hw/char/serial.h | 16 ++++-- include/hw/char/stm32f2xx_usart.h | 6 +- include/hw/clock.h | 2 +- include/hw/core/cpu.h | 6 +- include/hw/core/generic-loader.h | 6 +- include/hw/cpu/a15mpcore.h | 6 +- include/hw/cpu/a9mpcore.h | 6 +- include/hw/cpu/arm11mpcore.h | 6 +- include/hw/cpu/cluster.h | 6 +- include/hw/cpu/core.h | 6 +- include/hw/display/bcm2835_fb.h | 6 +- include/hw/display/dpcd.h | 1 + include/hw/display/i2c-ddc.h | 1 + include/hw/display/xlnx_dp.h | 6 +- include/hw/dma/bcm2835_dma.h | 6 +- include/hw/dma/i8257.h | 6 +- include/hw/dma/pl080.h | 6 +- include/hw/dma/xlnx-zdma.h | 6 +- include/hw/dma/xlnx-zynq-devcfg.h | 6 +- include/hw/dma/xlnx_dpdma.h | 1 + include/hw/fw-path-provider.h | 5 +- include/hw/gpio/aspeed_gpio.h | 11 ++-- include/hw/gpio/bcm2835_gpio.h | 6 +- include/hw/gpio/imx_gpio.h | 6 +- include/hw/gpio/nrf51_gpio.h | 6 +- include/hw/hotplug.h | 5 +- include/hw/hyperv/vmbus-bridge.h | 6 +- include/hw/hyperv/vmbus.h | 8 ++- include/hw/i2c/arm_sbcon_i2c.h | 6 +- include/hw/i2c/aspeed_i2c.h | 11 ++-- include/hw/i2c/i2c.h | 6 +- include/hw/i2c/imx_i2c.h | 6 +- include/hw/i2c/microbit_i2c.h | 6 +- include/hw/i2c/ppc4xx_i2c.h | 6 +- include/hw/i2c/smbus_slave.h | 9 +-- include/hw/i386/apic_internal.h | 7 ++- include/hw/i386/ich9.h | 6 +- include/hw/i386/intel_iommu.h | 3 +- include/hw/i386/ioapic_internal.h | 6 +- include/hw/i386/microvm.h | 11 ++-- include/hw/i386/pc.h | 6 +- include/hw/i386/x86-iommu.h | 5 +- include/hw/i386/x86.h | 11 ++-- include/hw/ide/ahci.h | 11 ++-- include/hw/ide/internal.h | 6 +- include/hw/ide/pci.h | 6 +- include/hw/input/adb.h | 6 +- include/hw/input/i8042.h | 3 +- include/hw/intc/allwinner-a10-pic.h | 6 +- include/hw/intc/arm_gic.h | 6 +- include/hw/intc/arm_gic_common.h | 11 ++-- include/hw/intc/arm_gicv3.h | 6 +- include/hw/intc/arm_gicv3_common.h | 6 +- include/hw/intc/arm_gicv3_its_common.h | 3 +- include/hw/intc/armv7m_nvic.h | 6 +- include/hw/intc/aspeed_vic.h | 6 +- include/hw/intc/bcm2835_ic.h | 6 +- include/hw/intc/bcm2836_control.h | 6 +- include/hw/intc/heathrow_pic.h | 6 +- include/hw/intc/ibex_plic.h | 6 +- include/hw/intc/imx_avic.h | 6 +- include/hw/intc/imx_gpcv2.h | 6 +- include/hw/intc/intc.h | 5 +- include/hw/intc/mips_gic.h | 3 +- include/hw/intc/realview_gic.h | 6 +- include/hw/intc/rx_icu.h | 1 + include/hw/intc/xlnx-pmu-iomod-intc.h | 6 +- include/hw/intc/xlnx-zynqmp-ipi.h | 6 +- include/hw/ipack/ipack.h | 1 + include/hw/ipmi/ipmi.h | 18 +++--- include/hw/isa/i8259_internal.h | 7 ++- include/hw/isa/isa.h | 11 ++-- include/hw/isa/pc87312.h | 6 +- include/hw/isa/superio.h | 11 ++-- include/hw/m68k/mcf_fec.h | 1 + include/hw/mem/memory-device.h | 5 +- include/hw/mem/nvdimm.h | 5 +- include/hw/mem/pc-dimm.h | 11 ++-- include/hw/mips/cps.h | 6 +- include/hw/misc/a9scu.h | 6 +- include/hw/misc/allwinner-cpucfg.h | 5 +- include/hw/misc/allwinner-h3-ccu.h | 5 +- include/hw/misc/allwinner-h3-dramc.h | 5 +- include/hw/misc/allwinner-h3-sysctrl.h | 5 +- include/hw/misc/allwinner-sid.h | 5 +- include/hw/misc/arm11scu.h | 6 +- include/hw/misc/armsse-cpuid.h | 6 +- include/hw/misc/armsse-mhu.h | 6 +- include/hw/misc/aspeed_scu.h | 11 ++-- include/hw/misc/aspeed_sdmc.h | 11 ++-- include/hw/misc/aspeed_xdma.h | 6 +- include/hw/misc/auxbus.h | 1 + include/hw/misc/avr_power.h | 6 +- include/hw/misc/bcm2835_mbox.h | 6 +- include/hw/misc/bcm2835_mphi.h | 1 + include/hw/misc/bcm2835_property.h | 6 +- include/hw/misc/bcm2835_rng.h | 6 +- include/hw/misc/bcm2835_thermal.h | 6 +- include/hw/misc/grlib_ahb_apb_pnp.h | 5 +- include/hw/misc/imx25_ccm.h | 6 +- include/hw/misc/imx31_ccm.h | 6 +- include/hw/misc/imx6_ccm.h | 6 +- include/hw/misc/imx6_src.h | 6 +- include/hw/misc/imx6ul_ccm.h | 6 +- include/hw/misc/imx7_ccm.h | 11 ++-- include/hw/misc/imx7_gpr.h | 6 +- include/hw/misc/imx7_snvs.h | 6 +- include/hw/misc/imx_ccm.h | 11 ++-- include/hw/misc/imx_rngc.h | 6 +- include/hw/misc/iotkit-secctl.h | 3 +- include/hw/misc/iotkit-sysctl.h | 6 +- include/hw/misc/iotkit-sysinfo.h | 6 +- include/hw/misc/mac_via.h | 16 ++++-- include/hw/misc/macio/cuda.h | 11 ++-- include/hw/misc/macio/gpio.h | 6 +- include/hw/misc/macio/macio.h | 26 +++++---- include/hw/misc/macio/pmu.h | 11 ++-- include/hw/misc/max111x.h | 6 +- include/hw/misc/mips_cmgcr.h | 3 +- include/hw/misc/mips_cpc.h | 6 +- include/hw/misc/mips_itu.h | 6 +- include/hw/misc/mos6522.h | 11 ++-- include/hw/misc/mps2-fpgaio.h | 6 +- include/hw/misc/mps2-scc.h | 6 +- include/hw/misc/msf2-sysreg.h | 6 +- include/hw/misc/nrf51_rng.h | 6 +- include/hw/misc/pca9552.h | 6 +- include/hw/misc/stm32f2xx_syscfg.h | 6 +- include/hw/misc/stm32f4xx_exti.h | 6 +- include/hw/misc/stm32f4xx_syscfg.h | 6 +- include/hw/misc/tz-mpc.h | 3 +- include/hw/misc/tz-msc.h | 6 +- include/hw/misc/tz-ppc.h | 3 +- include/hw/misc/unimp.h | 6 +- include/hw/misc/vmcoreinfo.h | 6 +- include/hw/misc/zynq-xadc.h | 6 +- include/hw/net/allwinner-sun8i-emac.h | 5 +- include/hw/net/allwinner_emac.h | 6 +- include/hw/net/cadence_gem.h | 6 +- include/hw/net/ftgmac100.h | 11 ++-- include/hw/net/imx_fec.h | 6 +- include/hw/net/lance.h | 6 +- include/hw/net/lasi_82596.h | 6 +- include/hw/net/msf2-emac.h | 6 +- include/hw/nmi.h | 5 +- include/hw/nubus/mac-nubus-bridge.h | 6 +- include/hw/nubus/nubus.h | 11 ++-- include/hw/nvram/fw_cfg.h | 6 +- include/hw/nvram/nrf51_nvm.h | 6 +- include/hw/pci-bridge/simba.h | 6 +- include/hw/pci-host/designware.h | 8 ++- include/hw/pci-host/gpex.h | 11 ++-- include/hw/pci-host/i440fx.h | 6 +- include/hw/pci-host/pnv_phb3.h | 11 ++-- include/hw/pci-host/pnv_phb4.h | 6 +- include/hw/pci-host/q35.h | 11 ++-- include/hw/pci-host/sabre.h | 11 ++-- include/hw/pci-host/spapr.h | 3 +- include/hw/pci-host/uninorth.h | 11 ++-- include/hw/pci-host/xilinx-pcie.h | 11 ++-- include/hw/pci/pci.h | 6 +- include/hw/pci/pci_bridge.h | 1 + include/hw/pci/pci_host.h | 6 +- include/hw/pci/pcie_host.h | 1 + include/hw/pci/pcie_port.h | 6 +- include/hw/pcmcia.h | 11 ++-- include/hw/platform-bus.h | 1 + include/hw/ppc/mac_dbdma.h | 6 +- include/hw/ppc/openpic.h | 6 +- include/hw/ppc/pnv.h | 33 ++++++----- include/hw/ppc/pnv_core.h | 16 ++++-- include/hw/ppc/pnv_homer.h | 11 ++-- include/hw/ppc/pnv_lpc.h | 11 ++-- include/hw/ppc/pnv_occ.h | 11 ++-- include/hw/ppc/pnv_pnor.h | 6 +- include/hw/ppc/pnv_psi.h | 21 ++++--- include/hw/ppc/pnv_xive.h | 11 ++-- include/hw/ppc/pnv_xscom.h | 5 +- include/hw/ppc/spapr.h | 3 +- include/hw/ppc/spapr_cpu_core.h | 11 ++-- include/hw/ppc/spapr_drc.h | 15 +++-- include/hw/ppc/spapr_irq.h | 6 +- include/hw/ppc/spapr_tpm_proxy.h | 5 +- include/hw/ppc/spapr_vio.h | 10 ++-- include/hw/ppc/spapr_xive.h | 11 ++-- include/hw/ppc/xics.h | 6 +- include/hw/ppc/xics_spapr.h | 1 + include/hw/qdev-core.h | 5 +- include/hw/register.h | 1 + include/hw/resettable.h | 5 +- include/hw/riscv/opentitan.h | 6 +- include/hw/riscv/riscv_hart.h | 6 +- include/hw/riscv/sifive_clint.h | 6 +- include/hw/riscv/sifive_e.h | 11 ++-- include/hw/riscv/sifive_e_prci.h | 6 +- include/hw/riscv/sifive_gpio.h | 6 +- include/hw/riscv/sifive_plic.h | 6 +- include/hw/riscv/sifive_test.h | 6 +- include/hw/riscv/sifive_u.h | 11 ++-- include/hw/riscv/sifive_u_otp.h | 6 +- include/hw/riscv/sifive_u_prci.h | 6 +- include/hw/riscv/sifive_uart.h | 6 +- include/hw/riscv/virt.h | 6 +- include/hw/rtc/allwinner-rtc.h | 10 ++-- include/hw/rtc/aspeed_rtc.h | 6 +- include/hw/rtc/goldfish_rtc.h | 6 +- include/hw/rtc/m48t59.h | 5 +- include/hw/rtc/mc146818rtc.h | 6 +- include/hw/rtc/pl031.h | 6 +- include/hw/rtc/xlnx-zynqmp-rtc.h | 6 +- include/hw/rx/rx62n.h | 6 +- include/hw/s390x/3270-ccw.h | 11 ++-- include/hw/s390x/ap-device.h | 6 +- include/hw/s390x/css-bridge.h | 10 ++-- include/hw/s390x/event-facility.h | 16 ++++-- include/hw/s390x/s390-ccw.h | 11 ++-- include/hw/s390x/s390-virtio-ccw.h | 11 ++-- include/hw/s390x/s390_flic.h | 16 ++++-- include/hw/s390x/sclp.h | 11 ++-- include/hw/s390x/storage-attributes.h | 21 ++++--- include/hw/s390x/storage-keys.h | 16 ++++-- include/hw/s390x/tod.h | 11 ++-- include/hw/s390x/vfio-ccw.h | 3 +- include/hw/scsi/esp.h | 6 +- include/hw/scsi/scsi.h | 6 +- include/hw/sd/allwinner-sdhost.h | 10 ++-- include/hw/sd/aspeed_sdhci.h | 6 +- include/hw/sd/bcm2835_sdhost.h | 6 +- include/hw/sd/sd.h | 11 ++-- include/hw/sd/sdhci.h | 6 +- include/hw/southbridge/piix.h | 6 +- include/hw/sparc/sparc32_dma.h | 18 +++--- include/hw/sparc/sun4m_iommu.h | 6 +- include/hw/sparc/sun4u_iommu.h | 6 +- include/hw/ssi/aspeed_smc.h | 11 ++-- include/hw/ssi/imx_spi.h | 6 +- include/hw/ssi/mss-spi.h | 6 +- include/hw/ssi/pl022.h | 6 +- include/hw/ssi/ssi.h | 1 + include/hw/ssi/stm32f2xx_spi.h | 6 +- include/hw/ssi/xilinx_spips.h | 16 ++++-- include/hw/stream.h | 5 +- include/hw/sysbus.h | 6 +- include/hw/timer/a9gtimer.h | 3 +- include/hw/timer/allwinner-a10-pit.h | 3 +- include/hw/timer/arm_mptimer.h | 6 +- include/hw/timer/armv7m_systick.h | 6 +- include/hw/timer/aspeed_timer.h | 13 +++-- include/hw/timer/avr_timer16.h | 6 +- include/hw/timer/bcm2835_systmr.h | 6 +- include/hw/timer/cmsdk-apb-dualtimer.h | 3 +- include/hw/timer/cmsdk-apb-timer.h | 6 +- include/hw/timer/digic-timer.h | 6 +- include/hw/timer/i8254.h | 1 + include/hw/timer/imx_epit.h | 6 +- include/hw/timer/imx_gpt.h | 6 +- include/hw/timer/mss-timer.h | 6 +- include/hw/timer/nrf51_timer.h | 6 +- include/hw/timer/renesas_cmt.h | 6 +- include/hw/timer/renesas_tmr.h | 6 +- include/hw/timer/stm32f2xx_timer.h | 6 +- include/hw/usb.h | 6 +- include/hw/usb/chipidea.h | 6 +- include/hw/usb/imx-usb-phy.h | 6 +- include/hw/vfio/vfio-amd-xgbe.h | 1 + include/hw/vfio/vfio-calxeda-xgmac.h | 11 ++-- include/hw/vfio/vfio-platform.h | 11 ++-- include/hw/virtio/vhost-scsi-common.h | 6 +- include/hw/virtio/vhost-scsi.h | 6 +- include/hw/virtio/vhost-user-fs.h | 6 +- include/hw/virtio/vhost-user-scsi.h | 6 +- include/hw/virtio/vhost-user-vsock.h | 6 +- include/hw/virtio/vhost-vsock-common.h | 6 +- include/hw/virtio/vhost-vsock.h | 6 +- include/hw/virtio/virtio-balloon.h | 6 +- include/hw/virtio/virtio-blk.h | 6 +- include/hw/virtio/virtio-bus.h | 8 ++- include/hw/virtio/virtio-crypto.h | 6 +- include/hw/virtio/virtio-gpu-pci.h | 1 + include/hw/virtio/virtio-gpu.h | 21 ++++--- include/hw/virtio/virtio-input.h | 11 ++-- include/hw/virtio/virtio-iommu.h | 6 +- include/hw/virtio/virtio-mem.h | 11 ++-- include/hw/virtio/virtio-mmio.h | 6 +- include/hw/virtio/virtio-net.h | 3 +- include/hw/virtio/virtio-pmem.h | 11 ++-- include/hw/virtio/virtio-rng.h | 6 +- include/hw/virtio/virtio-scsi.h | 11 ++-- include/hw/virtio/virtio-serial.h | 8 ++- include/hw/virtio/virtio.h | 6 +- include/hw/vmstate-if.h | 5 +- include/hw/watchdog/cmsdk-apb-watchdog.h | 6 +- include/hw/watchdog/wdt_aspeed.h | 11 ++-- include/hw/watchdog/wdt_diag288.h | 11 ++-- include/hw/watchdog/wdt_imx2.h | 6 +- include/hw/xen/xen-block.h | 21 ++++--- include/hw/xen/xen-bus.h | 21 ++++--- include/hw/xen/xen-legacy-backend.h | 1 + include/io/channel-buffer.h | 3 +- include/io/channel-command.h | 3 +- include/io/channel-file.h | 3 +- include/io/channel-socket.h | 3 +- include/io/channel-tls.h | 3 +- include/io/channel-websock.h | 3 +- include/io/channel.h | 4 +- include/io/dns-resolver.h | 4 +- include/io/net-listener.h | 5 +- include/net/can_host.h | 11 ++-- include/net/filter.h | 5 +- include/qom/object.h | 1 + include/qom/object_interfaces.h | 5 +- include/scsi/pr-manager.h | 10 ++-- include/sysemu/accel.h | 10 ++-- include/sysemu/cryptodev.h | 7 ++- include/sysemu/hostmem.h | 4 +- include/sysemu/hvf.h | 1 + include/sysemu/iothread.h | 5 +- include/sysemu/kvm.h | 1 + include/sysemu/rng-random.h | 2 +- include/sysemu/rng.h | 4 +- include/sysemu/tpm.h | 5 +- include/sysemu/tpm_backend.h | 4 +- include/sysemu/vhost-user-backend.h | 4 +- include/ui/console.h | 2 +- target/alpha/cpu-qom.h | 8 ++- target/arm/cpu-qom.h | 13 +++-- target/arm/idau.h | 5 +- target/avr/cpu-qom.h | 8 ++- target/cris/cpu-qom.h | 8 ++- target/hppa/cpu-qom.h | 8 ++- target/i386/cpu-qom.h | 8 ++- target/lm32/cpu-qom.h | 8 ++- target/m68k/cpu-qom.h | 8 ++- target/microblaze/cpu-qom.h | 8 ++- target/mips/cpu-qom.h | 8 ++- target/moxie/cpu.h | 11 ++-- target/nios2/cpu.h | 11 ++-- target/openrisc/cpu.h | 11 ++-- target/ppc/cpu-qom.h | 8 ++- target/ppc/cpu.h | 1 + target/riscv/cpu.h | 11 ++-- target/s390x/cpu-qom.h | 8 ++- target/sh4/cpu-qom.h | 8 ++- target/sparc/cpu-qom.h | 8 ++- target/tilegx/cpu.h | 11 ++-- target/tricore/cpu-qom.h | 8 ++- target/unicore32/cpu-qom.h | 8 ++- target/xtensa/cpu-qom.h | 8 ++- accel/tcg/tcg-all.c | 5 +- backends/cryptodev-builtin.c | 5 +- backends/cryptodev-vhost-user.c | 6 +- backends/dbus-vmstate.c | 1 + backends/hostmem-file.c | 3 +- backends/hostmem-memfd.c | 3 +- backends/rng-builtin.c | 6 +- backends/rng-egd.c | 7 ++- backends/tpm/tpm_emulator.c | 6 +- backends/tpm/tpm_passthrough.c | 3 +- chardev/baum.c | 6 +- chardev/char-parallel.c | 11 ++-- chardev/char-pty.c | 6 +- chardev/char-ringbuf.c | 6 +- chardev/char-socket.c | 6 +- chardev/char-udp.c | 6 +- chardev/char-win-stdio.c | 6 +- chardev/msmouse.c | 6 +- chardev/testdev.c | 6 +- chardev/wctablet.c | 6 +- hw/acpi/piix4.c | 6 +- hw/alpha/typhoon.c | 6 +- hw/arm/collie.c | 6 +- hw/arm/highbank.c | 6 +- hw/arm/microbit.c | 6 +- hw/arm/mps2-tz.c | 11 ++-- hw/arm/mps2.c | 11 ++-- hw/arm/musca.c | 11 ++-- hw/arm/musicpal.c | 41 +++++++------ hw/arm/palm.c | 6 +- hw/arm/pxa2xx.c | 16 ++++-- hw/arm/pxa2xx_gpio.c | 3 +- hw/arm/pxa2xx_pic.c | 6 +- hw/arm/raspi.c | 11 ++-- hw/arm/sbsa-ref.c | 6 +- hw/arm/spitz.c | 36 +++++++----- hw/arm/stellaris.c | 16 ++++-- hw/arm/strongarm.c | 25 ++++---- hw/arm/tosa.c | 11 ++-- hw/arm/xilinx_zynq.c | 6 +- hw/arm/xlnx-versal-virt.c | 6 +- hw/arm/xlnx-zcu102.c | 6 +- hw/arm/z2.c | 11 ++-- hw/audio/ac97.c | 6 +- hw/audio/adlib.c | 6 +- hw/audio/cs4231.c | 6 +- hw/audio/cs4231a.c | 6 +- hw/audio/es1370.c | 6 +- hw/audio/gus.c | 6 +- hw/audio/hda-codec.c | 1 + hw/audio/intel-hda.c | 1 + hw/audio/marvell_88w8618.c | 6 +- hw/audio/milkymist-ac97.c | 3 +- hw/audio/pcspk.c | 6 +- hw/audio/pl041.c | 6 +- hw/audio/sb16.c | 6 +- hw/audio/wm8750.c | 6 +- hw/avr/arduino.c | 11 ++-- hw/avr/atmega.c | 6 +- hw/block/fdc.c | 21 ++++--- hw/block/m25p80.c | 11 ++-- hw/block/nand.c | 1 + hw/block/onenand.c | 6 +- hw/char/debugcon.c | 6 +- hw/char/etraxfs_ser.c | 6 +- hw/char/exynos4210_uart.c | 6 +- hw/char/grlib_apbuart.c | 6 +- hw/char/ipoctal232.c | 1 + hw/char/lm32_juart.c | 3 +- hw/char/lm32_uart.c | 3 +- hw/char/mcf_uart.c | 6 +- hw/char/milkymist-uart.c | 3 +- hw/char/parallel.c | 6 +- hw/char/sclpconsole-lm.c | 6 +- hw/char/sclpconsole.c | 6 +- hw/char/serial-isa.c | 6 +- hw/char/serial-pci.c | 6 +- hw/char/spapr_vty.c | 6 +- hw/char/terminal3270.c | 6 +- hw/char/virtio-console.c | 6 +- hw/char/xilinx_uartlite.c | 6 +- hw/cpu/realview_mpcore.c | 6 +- hw/display/ads7846.c | 6 +- hw/display/artist.c | 6 +- hw/display/bochs-display.c | 6 +- hw/display/cg3.c | 6 +- hw/display/cirrus_vga.c | 6 +- hw/display/cirrus_vga_isa.c | 6 +- hw/display/exynos4210_fimd.c | 6 +- hw/display/g364fb.c | 6 +- hw/display/jazz_led.c | 6 +- hw/display/milkymist-tmu2.c | 3 +- hw/display/milkymist-vgafb.c | 3 +- hw/display/next-fb.c | 3 +- hw/display/pl110.c | 6 +- hw/display/ramfb-standalone.c | 6 +- hw/display/sii9022.c | 6 +- hw/display/sm501.c | 11 ++-- hw/display/ssd0303.c | 6 +- hw/display/ssd0323.c | 6 +- hw/display/tcx.c | 6 +- hw/display/vga-isa.c | 6 +- hw/display/vga-pci.c | 6 +- hw/display/vhost-user-gpu-pci.c | 6 +- hw/display/vhost-user-vga.c | 6 +- hw/display/virtio-gpu-pci.c | 6 +- hw/display/virtio-vga.c | 6 +- hw/display/vmware_vga.c | 1 + hw/dma/i82374.c | 6 +- hw/dma/pl330.c | 1 + hw/dma/puv3_dma.c | 6 +- hw/dma/pxa2xx_dma.c | 6 +- hw/dma/rc4030.c | 6 +- hw/dma/xilinx_axidma.c | 5 +- hw/gpio/gpio_key.c | 6 +- hw/gpio/max7310.c | 6 +- hw/gpio/mpc8xxx.c | 6 +- hw/gpio/pl061.c | 6 +- hw/gpio/puv3_gpio.c | 6 +- hw/gpio/zaurus.c | 3 +- hw/hppa/dino.c | 6 +- hw/hyperv/hyperv.c | 6 +- hw/hyperv/hyperv_testdev.c | 1 + hw/i2c/bitbang_i2c.c | 6 +- hw/i2c/exynos4210_i2c.c | 6 +- hw/i2c/mpc_i2c.c | 6 +- hw/i2c/smbus_eeprom.c | 6 +- hw/i2c/smbus_ich9.c | 6 +- hw/i2c/versatile_i2c.c | 3 +- hw/i386/kvm/clock.c | 6 +- hw/i386/kvm/i8254.c | 11 ++-- hw/i386/kvm/i8259.c | 6 +- hw/i386/kvmvapic.c | 6 +- hw/i386/port92.c | 6 +- hw/i386/vmmouse.c | 7 ++- hw/i386/vmport.c | 6 +- hw/i386/xen/xen_platform.c | 6 +- hw/i386/xen/xen_pvdevice.c | 6 +- hw/ide/isa.c | 6 +- hw/ide/microdrive.c | 6 +- hw/ide/mmio.c | 6 +- hw/ide/sii3112.c | 6 +- hw/input/adb-kbd.c | 11 ++-- hw/input/adb-mouse.c | 11 ++-- hw/input/lm832x.c | 6 +- hw/input/milkymist-softusb.c | 3 +- hw/input/pl050.c | 6 +- hw/intc/apic.c | 1 + hw/intc/arm_gic_kvm.c | 6 +- hw/intc/arm_gicv2m.c | 6 +- hw/intc/arm_gicv3_its_kvm.c | 6 +- hw/intc/arm_gicv3_kvm.c | 6 +- hw/intc/etraxfs_pic.c | 1 + hw/intc/exynos4210_combiner.c | 6 +- hw/intc/exynos4210_gic.c | 11 ++-- hw/intc/grlib_irqmp.c | 6 +- hw/intc/i8259.c | 6 +- hw/intc/lm32_pic.c | 3 +- hw/intc/loongson_liointc.c | 1 + hw/intc/nios2_iic.c | 6 +- hw/intc/ompic.c | 3 +- hw/intc/openpic_kvm.c | 6 +- hw/intc/pl190.c | 6 +- hw/intc/puv3_intc.c | 6 +- hw/intc/s390_flic_kvm.c | 6 +- hw/intc/slavio_intctl.c | 6 +- hw/intc/xilinx_intc.c | 1 + hw/ipack/tpci200.c | 6 +- hw/ipmi/ipmi_bmc_extern.c | 6 +- hw/ipmi/isa_ipmi_bt.c | 6 +- hw/ipmi/isa_ipmi_kcs.c | 6 +- hw/ipmi/pci_ipmi_bt.c | 6 +- hw/ipmi/pci_ipmi_kcs.c | 6 +- hw/ipmi/smbus_ipmi.c | 6 +- hw/isa/i82378.c | 6 +- hw/isa/piix4.c | 6 +- hw/isa/vt82c686.c | 21 ++++--- hw/m68k/mcf_intc.c | 6 +- hw/m68k/next-cube.c | 6 +- hw/m68k/next-kbd.c | 6 +- hw/microblaze/xlnx-zynqmp-pmu.c | 6 +- hw/mips/boston.c | 6 +- hw/mips/gt64xxx_pci.c | 6 +- hw/mips/malta.c | 6 +- hw/misc/applesmc.c | 3 +- hw/misc/arm_integrator_debug.c | 6 +- hw/misc/arm_l2x0.c | 6 +- hw/misc/arm_sysctl.c | 6 +- hw/misc/debugexit.c | 6 +- hw/misc/eccmemctl.c | 6 +- hw/misc/edu.c | 6 +- hw/misc/empty_slot.c | 6 +- hw/misc/exynos4210_clk.c | 6 +- hw/misc/exynos4210_pmu.c | 6 +- hw/misc/exynos4210_rng.c | 6 +- hw/misc/ivshmem.c | 6 +- hw/misc/milkymist-hpdmc.c | 3 +- hw/misc/milkymist-pfpu.c | 3 +- hw/misc/mst_fpga.c | 6 +- hw/misc/pc-testdev.c | 6 +- hw/misc/pca9552.c | 6 +- hw/misc/pci-testdev.c | 6 +- hw/misc/puv3_pm.c | 6 +- hw/misc/pvpanic.c | 6 +- hw/misc/sga.c | 6 +- hw/misc/slavio_misc.c | 11 ++-- hw/misc/tmp421.c | 11 ++-- hw/misc/zynq_slcr.c | 6 +- hw/net/can/can_kvaser_pci.c | 6 +- hw/net/can/can_mioe3680_pci.c | 6 +- hw/net/can/can_pcm3680_pci.c | 6 +- hw/net/dp8393x.c | 6 +- hw/net/e1000.c | 11 ++-- hw/net/e1000e.c | 6 +- hw/net/etraxfs_eth.c | 7 ++- hw/net/lan9118.c | 6 +- hw/net/milkymist-minimac2.c | 3 +- hw/net/mipsnet.c | 6 +- hw/net/ne2000-isa.c | 6 +- hw/net/opencores_eth.c | 6 +- hw/net/pcnet-pci.c | 6 +- hw/net/rtl8139.c | 6 +- hw/net/smc91c111.c | 6 +- hw/net/spapr_llan.c | 6 +- hw/net/stellaris_enet.c | 6 +- hw/net/sungem.c | 6 +- hw/net/sunhme.c | 6 +- hw/net/vmxnet3.c | 6 +- hw/net/xgmac.c | 6 +- hw/net/xilinx_axienet.c | 5 +- hw/net/xilinx_ethlite.c | 1 + hw/nvram/ds1225y.c | 6 +- hw/nvram/eeprom_at24c.c | 6 +- hw/nvram/spapr_nvram.c | 6 +- hw/pci-bridge/dec.c | 6 +- hw/pci-bridge/gen_pcie_root_port.c | 6 +- hw/pci-bridge/pci_bridge_dev.c | 3 +- hw/pci-bridge/pci_expander_bridge.c | 11 ++-- hw/pci-bridge/pcie_pci_bridge.c | 6 +- hw/pci-host/bonito.c | 6 +- hw/pci-host/grackle.c | 6 +- hw/pci-host/i440fx.c | 6 +- hw/pci-host/pnv_phb3.c | 1 + hw/pci-host/pnv_phb4.c | 1 + hw/pci-host/ppce500.c | 5 +- hw/pci-host/prep.c | 11 ++-- hw/pci-host/versatile.c | 6 +- hw/ppc/mpc8544_guts.c | 3 +- hw/ppc/ppc440_pcix.c | 6 +- hw/ppc/ppc440_uc.c | 6 +- hw/ppc/ppc4xx_pci.c | 3 +- hw/ppc/ppce500_spin.c | 6 +- hw/ppc/prep_systemio.c | 6 +- hw/ppc/rs6000_mc.c | 6 +- hw/ppc/spapr_rng.c | 3 +- hw/rtc/ds1338.c | 6 +- hw/rtc/exynos4210_rtc.c | 6 +- hw/rtc/m41t80.c | 6 +- hw/rtc/m48t59-isa.c | 11 ++-- hw/rtc/m48t59.c | 11 ++-- hw/rtc/sun4v-rtc.c | 6 +- hw/rtc/twl92230.c | 6 +- hw/rx/rx-gdbsim.c | 11 ++-- hw/rx/rx62n.c | 6 +- hw/scsi/esp-pci.c | 11 ++-- hw/scsi/lsi53c895a.c | 6 +- hw/scsi/megasas.c | 11 ++-- hw/scsi/scsi-disk.c | 12 ++-- hw/scsi/spapr_vscsi.c | 6 +- hw/scsi/vmw_pvscsi.c | 11 ++-- hw/sd/allwinner-sdhost.c | 1 + hw/sd/bcm2835_sdhost.c | 1 + hw/sd/milkymist-memcard.c | 3 +- hw/sd/pxa2xx_mmci.c | 1 + hw/sd/sdhci.c | 1 + hw/sd/ssi-sd.c | 6 +- hw/sh4/sh_pci.c | 6 +- hw/sparc/sun4m.c | 21 ++++--- hw/sparc64/sun4u.c | 21 ++++--- hw/ssi/ssi.c | 1 + hw/ssi/xilinx_spi.c | 6 +- hw/timer/altera_timer.c | 6 +- hw/timer/arm_timer.c | 11 ++-- hw/timer/cadence_ttc.c | 6 +- hw/timer/etraxfs_timer.c | 6 +- hw/timer/exynos4210_mct.c | 6 +- hw/timer/exynos4210_pwm.c | 6 +- hw/timer/grlib_gptimer.c | 3 +- hw/timer/hpet.c | 6 +- hw/timer/i8254.c | 6 +- hw/timer/lm32_timer.c | 3 +- hw/timer/milkymist-sysctl.c | 3 +- hw/timer/puv3_ost.c | 6 +- hw/timer/pxa2xx_timer.c | 3 +- hw/timer/slavio_timer.c | 6 +- hw/timer/xilinx_timer.c | 1 + hw/tpm/tpm_crb.c | 6 +- hw/tpm/tpm_spapr.c | 6 +- hw/tpm/tpm_tis_isa.c | 6 +- hw/tpm/tpm_tis_sysbus.c | 6 +- hw/usb/ccid-card-emulated.c | 3 +- hw/usb/ccid-card-passthru.c | 1 + hw/usb/dev-audio.c | 6 +- hw/usb/dev-hid.c | 6 +- hw/usb/dev-hub.c | 6 +- hw/usb/dev-mtp.c | 1 + hw/usb/dev-network.c | 6 +- hw/usb/dev-serial.c | 6 +- hw/usb/dev-smartcard-reader.c | 11 ++-- hw/usb/dev-storage.c | 6 +- hw/usb/dev-uas.c | 1 + hw/usb/dev-wacom.c | 6 +- hw/usb/hcd-ohci-pci.c | 6 +- hw/usb/hcd-uhci.c | 1 + hw/usb/host-libusb.c | 3 +- hw/usb/redirect.c | 1 + hw/usb/tusb6010.c | 6 +- hw/vfio/ap.c | 6 +- hw/virtio/vhost-scsi-pci.c | 1 + hw/virtio/vhost-user-blk-pci.c | 1 + hw/virtio/vhost-user-fs-pci.c | 1 + hw/virtio/vhost-user-input-pci.c | 1 + hw/virtio/vhost-user-scsi-pci.c | 1 + hw/virtio/vhost-user-vsock-pci.c | 1 + hw/virtio/vhost-vsock-pci.c | 1 + hw/virtio/virtio-9p-pci.c | 6 +- hw/virtio/virtio-balloon-pci.c | 1 + hw/virtio/virtio-blk-pci.c | 1 + hw/virtio/virtio-crypto-pci.c | 1 + hw/virtio/virtio-input-host-pci.c | 1 + hw/virtio/virtio-input-pci.c | 1 + hw/virtio/virtio-iommu-pci.c | 1 + hw/virtio/virtio-net-pci.c | 1 + hw/virtio/virtio-rng-pci.c | 1 + hw/virtio/virtio-scsi-pci.c | 1 + hw/virtio/virtio-serial-pci.c | 1 + hw/watchdog/wdt_i6300esb.c | 1 + hw/watchdog/wdt_ib700.c | 6 +- migration/rdma.c | 3 +- net/can/can_socketcan.c | 6 +- net/colo-compare.c | 5 +- net/dump.c | 3 +- net/filter-buffer.c | 5 +- net/filter-mirror.c | 9 +-- net/filter-replay.c | 3 +- net/filter-rewriter.c | 7 ++- scsi/pr-manager-helper.c | 6 +- target/i386/sev.c | 3 +- tests/check-qom-interface.c | 5 +- tests/test-qdev-global-props.c | 5 +- ui/console.c | 6 +- ui/gtk.c | 5 +- ui/input-barrier.c | 5 +- ui/input-linux.c | 5 +- ui/spice-app.c | 6 +- 797 files changed, 3362 insertions(+), 1812 deletions(-)
chardev/chardev-internal.h +3 -2
@@ -32,7 +32,7 @@#define MUX_BUFFER_SIZE 32/* Must be a power of 2. */ #define MUX_BUFFER_MASK (MUX_BUFFER_SIZE - 1) -typedef struct MuxChardev { +struct MuxChardev {Chardev parent;CharBackend *backends[MAX_MUX ];CharBackend chr;
@@ -51,7 +51,8 @@ typedef struct MuxChardev {/* Protected by the Chardev chr_write_lock. */ int linestart;int64_t timestamps_start; -} MuxChardev; +}; +typedef struct MuxChardev MuxChardev ;#define MUX_CHARDEV (obj) OBJECT_CHECK(MuxChardev, (obj), TYPE_CHARDEV_MUX)#define CHARDEV_IS_MUX (chr) \
hw/9pfs/virtio-9p.h +4 -3
@@ -4,15 +4,16 @@#include "standard-headers/linux/virtio_9p.h" #include "hw/virtio/virtio.h" #include "9p.h" +#include "qom/object.h" -typedef struct V9fsVirtioState -{ +struct V9fsVirtioState {VirtIODevice parent_obj;VirtQueue *vq;size_t config_size;VirtQueueElement *elems[MAX_REQ ];V9fsState state; -}V9fsVirtioState ; +}; +typedef struct V9fsVirtioState V9fsVirtioState ;#define TYPE_VIRTIO_9P "virtio-9p-device"#define VIRTIO_9P (obj) \
hw/audio/intel-hda.h +6 -5
@@ -2,11 +2,14 @@#define HW_INTEL_HDA_H #include "hw/qdev-core.h" +#include "qom/object.h" /* --------------------------------------------------------------------- */ /* hda bus */ #define TYPE_HDA_CODEC_DEVICE "hda-codec" +typedef struct HDACodecDevice HDACodecDevice ; +typedef struct HDACodecDeviceClass HDACodecDeviceClass ;#define HDA_CODEC_DEVICE (obj) \ OBJECT_CHECK(HDACodecDevice, (obj), TYPE_HDA_CODEC_DEVICE)#define HDA_CODEC_DEVICE_CLASS (klass) \
@@ -15,10 +18,9 @@ OBJECT_GET_CLASS(HDACodecDeviceClass, (obj), TYPE_HDA_CODEC_DEVICE)#define TYPE_HDA_BUS "HDA" +typedef struct HDACodecBus HDACodecBus ;#define HDA_BUS (obj) OBJECT_CHECK(HDACodecBus, (obj), TYPE_HDA_BUS) -typedef struct HDACodecBus HDACodecBus ; -typedef struct HDACodecDevice HDACodecDevice ;typedef void (*hda_codec_response_func )(HDACodecDevice *dev,bool solicited,uint32_t response);
@@ -33,15 +35,14 @@ struct HDACodecBus {hda_codec_xfer_func xfer; }; -typedef struct HDACodecDeviceClass -{ +struct HDACodecDeviceClass {DeviceClass parent_class;int (*init)(HDACodecDevice *dev);void (*exit)(HDACodecDevice *dev);void (*command)(HDACodecDevice *dev,uint32_t nid,uint32_t data);void (*stream)(HDACodecDevice *dev,uint32_t stnr,bool running,bool output); -}HDACodecDeviceClass ; +};struct HDACodecDevice {DeviceState qdev;
hw/avr/atmega.h +4 -2
@@ -15,6 +15,7 @@#include "hw/timer/avr_timer16.h" #include "hw/misc/avr_power.h" #include "target/avr/cpu.h" +#include "qom/object.h" #define TYPE_ATMEGA_MCU "ATmega"#define TYPE_ATMEGA168_MCU "ATmega168"
@@ -22,6 +23,7 @@#define TYPE_ATMEGA1280_MCU "ATmega1280"#define TYPE_ATMEGA2560_MCU "ATmega2560" +typedef struct AtmegaMcuState AtmegaMcuState ;#define ATMEGA_MCU (obj) OBJECT_CHECK(AtmegaMcuState, (obj), TYPE_ATMEGA_MCU)#define POWER_MAX 2
@@ -29,7 +31,7 @@#define TIMER_MAX 6#define GPIO_MAX 12 -typedef struct AtmegaMcuState { +struct AtmegaMcuState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -43,6 +45,6 @@ typedef struct AtmegaMcuState {AVRUsartState usart[USART_MAX ];AVRTimer16State timer[TIMER_MAX ]; uint64_t xtal_freq_hz; -} AtmegaMcuState; +};#endif /* HW_AVR_ATMEGA_H */
hw/block/nvme.h +4 -2
@@ -2,6 +2,7 @@#define HW_NVME_H #include "block/nvme.h" +#include "qom/object.h" typedef struct NvmeParams { char *serial;
@@ -74,10 +75,11 @@ static inline uint8_t nvme_ns_lbads(NvmeNamespace *ns) }#define TYPE_NVME "nvme" +typedef struct NvmeCtrl NvmeCtrl ;#define NVME (obj) \ OBJECT_CHECK(NvmeCtrl, (obj), TYPE_NVME) -typedef struct NvmeCtrl { +struct NvmeCtrl {PCIDevice parent_obj;MemoryRegion iomem;MemoryRegion ctrl_mem;
@@ -107,7 +109,7 @@ typedef struct NvmeCtrl {NvmeSQueue admin_sq;NvmeCQueue admin_cq;NvmeIdCtrl id_ctrl; -} NvmeCtrl; +};/* calculate the number of LBAs that the namespace can accomodate */ static inline uint64_t nvme_ns_nlbas (NvmeCtrl *n,NvmeNamespace *ns)
hw/display/ati_int.h +4 -2
@@ -13,6 +13,7 @@#include "hw/pci/pci.h" #include "hw/i2c/bitbang_i2c.h" #include "vga_int.h" +#include "qom/object.h" /*#define DEBUG_ATI*/
@@ -29,6 +30,7 @@#define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159#define TYPE_ATI_VGA "ati-vga" +typedef struct ATIVGAState ATIVGAState ;#define ATI_VGA (obj) OBJECT_CHECK(ATIVGAState, (obj), TYPE_ATI_VGA) typedef struct ATIVGARegs {
@@ -82,7 +84,7 @@ typedef struct ATIVGARegs {uint32_t default_sc_bottom_right; } ATIVGARegs; -typedef struct ATIVGAState { +struct ATIVGAState {PCIDevice dev;VGACommonState vga;char *model;
@@ -97,7 +99,7 @@ typedef struct ATIVGAState {MemoryRegion io;MemoryRegion mm;ATIVGARegs regs; -} ATIVGAState; +};const char *ati_reg_name (int num);
hw/display/qxl.h +4 -2
@@ -8,6 +8,7 @@#include "ui/qemu-spice.h" #include "ui/spice-display.h" +#include "qom/object.h" enum qxl_mode {QXL_MODE_UNDEFINED ,
@@ -27,7 +28,7 @@ enum qxl_mode {#define QXL_PAGE_BITS 12#define QXL_PAGE_SIZE (1 << QXL_PAGE_BITS); -typedef struct PCIQXLDevice { +struct PCIQXLDevice {PCIDevice pci;PortioList vga_port_list;SimpleSpiceDisplay ssd;
@@ -126,7 +127,8 @@ typedef struct PCIQXLDevice {int num_dirty_rects;QXLRect dirty[QXL_NUM_DIRTY_RECTS ];QEMUBH *update_area_bh; -} PCIQXLDevice; +}; +typedef struct PCIQXLDevice PCIQXLDevice ;#define TYPE_PCI_QXL "pci-qxl"#define PCI_QXL (obj) OBJECT_CHECK(PCIQXLDevice, (obj), TYPE_PCI_QXL)
hw/display/virtio-vga.h +7 -4
@@ -3,11 +3,14 @@#include "hw/virtio/virtio-gpu-pci.h" #include "vga_int.h" +#include "qom/object.h" /* * virtio-vga-base: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_VGA_BASE "virtio-vga-base" +typedef struct VirtIOVGABase VirtIOVGABase ; +typedef struct VirtIOVGABaseClass VirtIOVGABaseClass ;#define VIRTIO_VGA_BASE (obj) \ OBJECT_CHECK(VirtIOVGABase, (obj), TYPE_VIRTIO_VGA_BASE)#define VIRTIO_VGA_BASE_GET_CLASS (obj) \
@@ -15,18 +18,18 @@#define VIRTIO_VGA_BASE_CLASS (klass) \ OBJECT_CLASS_CHECK(VirtIOVGABaseClass, klass, TYPE_VIRTIO_VGA_BASE) -typedef struct VirtIOVGABase { +struct VirtIOVGABase {VirtIOPCIProxy parent_obj;VirtIOGPUBase *vgpu;VGACommonState vga;MemoryRegion vga_mrs[3 ]; -}VirtIOVGABase ; +}; -typedef struct VirtIOVGABaseClass { +struct VirtIOVGABaseClass {VirtioPCIClass parent_class;DeviceReset parent_reset; -}VirtIOVGABaseClass ; +};#endif /* VIRTIO_VGA_H */
hw/i386/amd_iommu.h +4 -2
@@ -23,6 +23,7 @@#include "hw/pci/pci.h" #include "hw/i386/x86-iommu.h" +#include "qom/object.h" /* Capability registers */ #define AMDVI_CAPAB_BAR_LOW 0x04
@@ -296,6 +297,7 @@ struct irte_ga { };#define TYPE_AMD_IOMMU_DEVICE "amd-iommu" +typedef struct AMDVIState AMDVIState ;#define AMD_IOMMU_DEVICE (obj)\ OBJECT_CHECK(AMDVIState, (obj), TYPE_AMD_IOMMU_DEVICE)
@@ -310,7 +312,7 @@ typedef struct AMDVIPCIState {PCIDevice dev;/* The PCI device itself */ } AMDVIPCIState; -typedef struct AMDVIState { +struct AMDVIState {X86IOMMUState iommu;/* IOMMU bus device */ AMDVIPCIState pci;/* IOMMU PCI device */
@@ -367,6 +369,6 @@ typedef struct AMDVIState {/* Interrupt remapping */ bool ga_enabled; -} AMDVIState; +};#endif
hw/misc/tmp105.h +4 -2
@@ -16,8 +16,10 @@#include "hw/i2c/i2c.h" #include "hw/misc/tmp105_regs.h" +#include "qom/object.h" #define TYPE_TMP105 "tmp105" +typedef struct TMP105State TMP105State ;#define TMP105 (obj) OBJECT_CHECK(TMP105State, (obj), TYPE_TMP105)/**
@@ -27,7 +29,7 @@* * @see_also: http://www.ti.com/lit/gpn/tmp105 */ -typedef struct TMP105State { +struct TMP105State {/*< private >*/ I2CSlave i2c;/*< public >*/
@@ -42,6 +44,6 @@ typedef struct TMP105State {int16_t limit[2 ];int faults; uint8_t alarm; -} TMP105State; +};#endif
hw/net/fsl_etsec/etsec.h +4 -2
@@ -28,6 +28,7 @@#include "hw/sysbus.h" #include "net/net.h" #include "hw/ptimer.h" +#include "qom/object.h" /* Buffer Descriptors */
@@ -104,7 +105,7 @@ typedef struct eTSEC_Register {uint32_t value; } eTSEC_Register; -typedef struct eTSEC { +struct eTSEC {SysBusDevice busdev;MemoryRegion io_area;
@@ -145,7 +146,8 @@ typedef struct eTSEC {/* Whether we should flush the rx queue when buffer becomes available. */ bool need_flush; -} eTSEC; +}; +typedef struct eTSEC eTSEC ;#define TYPE_ETSEC_COMMON "eTSEC"#define ETSEC_COMMON (obj) \
hw/net/rocker/rocker.h +1 -0
@@ -20,6 +20,7 @@#define ROCKER_H #include "qemu/sockets.h" +#include "qom/object.h" #if defined(DEBUG_ROCKER )# define DPRINTF (fmt, ...) \
hw/net/tulip.h +1 -0
@@ -3,6 +3,7 @@#include "qemu/units.h" #include "net/net.h" +#include "qom/object.h" #define TYPE_TULIP "tulip"typedef struct TULIPState TULIPState ;
hw/net/vmxnet3_defs.h +4 -2
@@ -19,8 +19,10 @@#include "net/net.h" #include "hw/net/vmxnet3.h" +#include "qom/object.h" #define TYPE_VMXNET3 "vmxnet3" +typedef struct VMXNET3State VMXNET3State ;#define VMXNET3 (obj) OBJECT_CHECK(VMXNET3State, (obj), TYPE_VMXNET3)/* Device state and helper functions */
@@ -58,7 +60,7 @@ typedef struct {bool is_asserted; } Vmxnet3IntState; -typedef struct { +struct VMXNET3State {PCIDevice parent_obj;NICState *nic;NICConf conf;
@@ -132,6 +134,6 @@ typedef struct {/* Compatibility flags for migration */ uint32_t compat_flags; -} VMXNET3State; +};#endif
hw/ppc/e500-ccsr.h +4 -2
@@ -2,14 +2,16 @@#define E500_CCSR_H #include "hw/sysbus.h" +#include "qom/object.h" -typedef struct PPCE500CCSRState { +struct PPCE500CCSRState {/*< private >*/ SysBusDevice parent;/*< public >*/ MemoryRegion ccsr_space; -}PPCE500CCSRState ; +}; +typedef struct PPCE500CCSRState PPCE500CCSRState ;#define TYPE_CCSR "e500-ccsr"#define CCSR (obj) OBJECT_CHECK(PPCE500CCSRState, (obj), TYPE_CCSR)
hw/ppc/e500.h +7 -4
@@ -3,8 +3,9 @@#include "hw/boards.h" #include "hw/platform-bus.h" +#include "qom/object.h" -typedef struct PPCE500MachineState { +struct PPCE500MachineState {/*< private >*/ MachineState parent_obj;
@@ -12,9 +13,10 @@ typedef struct PPCE500MachineState {* board supports dynamic sysbus devices */ PlatformBusDevice *pbus_dev; -} PPCE500MachineState; +}; +typedef struct PPCE500MachineState PPCE500MachineState ; -typedef struct PPCE500MachineClass { +struct PPCE500MachineClass {/*< private >*/ MachineClass parent_class;
@@ -36,7 +38,8 @@ typedef struct PPCE500MachineClass {hwaddr pci_mmio_base;hwaddr pci_mmio_bus_base;hwaddr spin_base; -} PPCE500MachineClass; +}; +typedef struct PPCE500MachineClass PPCE500MachineClass ;void ppce500_init (MachineState *machine);
hw/ppc/mac.h +7 -4
@@ -34,6 +34,7 @@#include "hw/misc/mos6522.h" #include "hw/pci/pci_host.h" #include "hw/pci-host/uninorth.h" +#include "qom/object.h" /* SMP is not enabled, for now */ #define MAX_CPUS 1
@@ -71,6 +72,7 @@/* Core99 machine */ #define TYPE_CORE99_MACHINE MACHINE_TYPE_NAME("mac99") +typedef struct Core99MachineState Core99MachineState ;#define CORE99_MACHINE (obj) OBJECT_CHECK(Core99MachineState, (obj), \ TYPE_CORE99_MACHINE)
@@ -78,22 +80,23 @@#define CORE99_VIA_CONFIG_PMU 0x1#define CORE99_VIA_CONFIG_PMU_ADB 0x2 -typedef struct Core99MachineState { +struct Core99MachineState {/*< private >*/ MachineState parent;uint8_t via_config; -}Core99MachineState ; +};/* Grackle PCI */ #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost"/* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" +typedef struct MacIONVRAMState MacIONVRAMState ;#define MACIO_NVRAM (obj) \ OBJECT_CHECK(MacIONVRAMState, (obj), TYPE_MACIO_NVRAM) -typedef struct MacIONVRAMState { +struct MacIONVRAMState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -103,7 +106,7 @@ typedef struct MacIONVRAMState {MemoryRegion mem; uint8_t *data; -} MacIONVRAMState; +};void pmac_format_nvram_partition (MacIONVRAMState *nvr,int len);#endif /* PPC_MAC_H */
hw/rdma/vmw/pvrdma.h +4 -2
@@ -29,6 +29,7 @@#include "standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h" #include "standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h" #include "pvrdma_dev_ring.h" +#include "qom/object.h" /* BARs */ #define RDMA_MSIX_BAR_IDX 0
@@ -78,7 +79,7 @@ typedef struct PVRDMADevStats {uint64_t interrupts; } PVRDMADevStats; -typedef struct PVRDMADev { +struct PVRDMADev {PCIDevice parent_obj;MemoryRegion msix;MemoryRegion regs;
@@ -98,7 +99,8 @@ typedef struct PVRDMADev {VMXNET3State *func0;Notifier shutdown_notifier;PVRDMADevStats stats; -} PVRDMADev; +}; +typedef struct PVRDMADev PVRDMADev ;#define PVRDMA_DEV (dev) OBJECT_CHECK(PVRDMADev, (dev), PVRDMA_HW_NAME)static inline int get_reg_val (PVRDMADev *dev,hwaddr addr,uint32_t *val)
hw/s390x/ccw-device.h +6 -4
@@ -15,7 +15,7 @@#include "hw/qdev-core.h" #include "hw/s390x/css.h" -typedef struct CcwDevice { +struct CcwDevice {DeviceState parent_obj;SubchDev *sch;/* <cssid>.<ssid>.<device number> */
@@ -25,18 +25,20 @@ typedef struct CcwDevice {CssDevId dev_id;/* The actual busid of the virtual subchannel. */ CssDevId subch_id; -} CcwDevice; +}; +typedef struct CcwDevice CcwDevice ;extern const VMStateDescription vmstate_ccw_dev;#define VMSTATE_CCW_DEVICE (_field, _state) \ VMSTATE_STRUCT(_field, _state, 1, vmstate_ccw_dev, CcwDevice) -typedef struct CCWDeviceClass { +struct CCWDeviceClass {DeviceClass parent_class;void (*unplug)(HotplugHandler *,DeviceState *,Error **);void (*realize)(CcwDevice *,Error **);void (*refill_ids)(CcwDevice *); -}CCWDeviceClass ; +}; +typedef struct CCWDeviceClass CCWDeviceClass ;static inline CcwDevice *to_ccw_dev_fast (DeviceState *d) {
hw/s390x/ipl.h +2 -1
@@ -16,6 +16,7 @@#include "cpu.h" #include "exec/address-spaces.h" #include "hw/qdev-core.h" +#include "qom/object.h" struct IPLBlockPVComp {uint64_t tweak_pref;
@@ -152,6 +153,7 @@ struct QemuIplParameters {typedef struct QemuIplParameters QemuIplParameters ;#define TYPE_S390_IPL "s390-ipl" +typedef struct S390IPLState S390IPLState ;#define S390_IPL (obj) OBJECT_CHECK(S390IPLState, (obj), TYPE_S390_IPL)struct S390IPLState {
@@ -183,7 +185,6 @@ struct S390IPLState {uint16_t devno;bool iplbext_migration; }; -typedef struct S390IPLState S390IPLState ;QEMU_BUILD_BUG_MSG (offsetof(S390IPLState , iplb) &3 ,"alignment of iplb wrong" );#define DIAG_308_RC_OK 0x0001
hw/s390x/s390-pci-bus.h +11 -7
@@ -19,6 +19,7 @@#include "hw/s390x/sclp.h" #include "hw/s390x/s390_flic.h" #include "hw/s390x/css.h" +#include "qom/object.h" #define TYPE_S390_PCI_HOST_BRIDGE "s390-pcihost"#define TYPE_S390_PCI_BUS "s390-pcibus"
@@ -36,12 +37,16 @@#define UID_UNDEFINED 0#define UID_CHECKING_ENABLED 0x01 +typedef struct S390pciState S390pciState ;#define S390_PCI_HOST_BRIDGE (obj) \ OBJECT_CHECK(S390pciState, (obj), TYPE_S390_PCI_HOST_BRIDGE) +typedef struct S390PCIBus S390PCIBus ;#define S390_PCI_BUS (obj) \ OBJECT_CHECK(S390PCIBus, (obj), TYPE_S390_PCI_BUS) +typedef struct S390PCIBusDevice S390PCIBusDevice ;#define S390_PCI_DEVICE (obj) \ OBJECT_CHECK(S390PCIBusDevice, (obj), TYPE_S390_PCI_DEVICE) +typedef struct S390PCIIOMMU S390PCIIOMMU ;#define S390_PCI_IOMMU (obj) \ OBJECT_CHECK(S390PCIIOMMU, (obj), TYPE_S390_PCI_IOMMU)
@@ -265,8 +270,7 @@ typedef struct S390IOTLBEntry {uint64_t perm; } S390IOTLBEntry; -typedef struct S390PCIBusDevice S390PCIBusDevice ; -typedef struct S390PCIIOMMU { +struct S390PCIIOMMU {Object parent_obj;S390PCIBusDevice *pbdev;AddressSpace as;
@@ -277,7 +281,7 @@ typedef struct S390PCIIOMMU {uint64_t pba;uint64_t pal;GHashTable *iotlb; -}S390PCIIOMMU ; +}; typedef struct S390PCIIOMMUTable { uint64_t key;
@@ -339,11 +343,11 @@ struct S390PCIBusDevice {QTAILQ_ENTRY (S390PCIBusDevice) link; }; -typedef struct S390PCIBus { +struct S390PCIBus {BusState qbus; -}S390PCIBus ; +}; -typedef struct S390pciState { +struct S390pciState {PCIHostState parent_obj;uint32_t next_idx;int bus_no;
@@ -352,7 +356,7 @@ typedef struct S390pciState {GHashTable *zpci_table; QTAILQ_HEAD(, SeiContainer) pending_sei; QTAILQ_HEAD(, S390PCIBusDevice) zpci_devs; -} S390pciState; +};S390pciState *s390_get_phb (void );int pci_chsc_sei_nt2_get_event (void *res);
hw/s390x/virtio-ccw.h +44 -29
218 lines not on this page · raw message
hw/scsi/mptsas.h +1 -0
@@ -2,6 +2,7 @@#define MPTSAS_H #include "mpi.h" +#include "qom/object.h" #define MPTSAS_NUM_PORTS 8#define MPTSAS_MAX_FRAMES 2048/* Firmware limit at 65535 */
hw/usb/ccid.h +4 -2
@@ -11,11 +11,13 @@#define CCID_H #include "hw/qdev-core.h" +#include "qom/object.h" typedef struct CCIDCardState CCIDCardState ;typedef struct CCIDCardInfo CCIDCardInfo ;#define TYPE_CCID_CARD "ccid-card" +typedef struct CCIDCardClass CCIDCardClass ;#define CCID_CARD (obj) \ OBJECT_CHECK(CCIDCardState, (obj), TYPE_CCID_CARD)#define CCID_CARD_CLASS (klass) \
@@ -27,7 +29,7 @@ typedef struct CCIDCardInfo CCIDCardInfo;* callbacks to be used by the CCID device (hw/usb-ccid.c) to call * into the smartcard device (hw/ccid-card-*.c) */ -typedef struct CCIDCardClass { +struct CCIDCardClass {/*< private >*/ DeviceClass parent_class;/*< public >*/
@@ -37,7 +39,7 @@ typedef struct CCIDCardClass { uint32_t len);void (*realize)(CCIDCardState *card,Error **errp);void (*unrealize)(CCIDCardState *card); -} CCIDCardClass; +};/* * state of the CCID Card device (i.e. hw/ccid-card-*.c)
hw/usb/hcd-dwc2.h +1 -0
@@ -24,6 +24,7 @@#include "hw/sysbus.h" #include "hw/usb.h" #include "sysemu/dma.h" +#include "qom/object.h" #define DWC2_MMIO_SIZE 0x11000
hw/usb/hcd-ehci.h +13 -8
@@ -23,6 +23,7 @@#include "sysemu/dma.h" #include "hw/pci/pci.h" #include "hw/sysbus.h" +#include "qom/object.h" #ifndef EHCI_DEBUG #define EHCI_DEBUG 0
@@ -328,15 +329,16 @@ void usb_ehci_unrealize(EHCIState *s, DeviceState *dev);void ehci_reset (void *opaque);#define TYPE_PCI_EHCI "pci-ehci-usb" +typedef struct EHCIPCIState EHCIPCIState ;#define PCI_EHCI (obj) OBJECT_CHECK(EHCIPCIState, (obj), TYPE_PCI_EHCI) -typedef struct EHCIPCIState { +struct EHCIPCIState {/*< private >*/ PCIDevice pcidev;/*< public >*/ EHCIState ehci; -}EHCIPCIState ; +};#define TYPE_SYS_BUS_EHCI "sysbus-ehci-usb"
@@ -347,6 +349,8 @@ typedef struct EHCIPCIState {#define TYPE_PPC4xx_EHCI "ppc4xx-ehci-usb"#define TYPE_FUSBH200_EHCI "fusbh200-ehci-usb" +typedef struct EHCISysBusState EHCISysBusState ; +typedef struct SysBusEHCIClass SysBusEHCIClass ;#define SYS_BUS_EHCI (obj) \ OBJECT_CHECK(EHCISysBusState, (obj), TYPE_SYS_BUS_EHCI)#define SYS_BUS_EHCI_CLASS (class) \
@@ -354,15 +358,15 @@ typedef struct EHCIPCIState {#define SYS_BUS_EHCI_GET_CLASS (obj) \ OBJECT_GET_CLASS(SysBusEHCIClass, (obj), TYPE_SYS_BUS_EHCI) -typedef struct EHCISysBusState { +struct EHCISysBusState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/ EHCIState ehci; -}EHCISysBusState ; +}; -typedef struct SysBusEHCIClass { +struct SysBusEHCIClass {/*< private >*/ SysBusDeviceClass parent_class;/*< public >*/
@@ -371,17 +375,18 @@ typedef struct SysBusEHCIClass {uint16_t opregbase;uint16_t portscbase; uint16_t portnr; -} SysBusEHCIClass; +}; +typedef struct FUSBH200EHCIState FUSBH200EHCIState ;#define FUSBH200_EHCI (obj) \ OBJECT_CHECK(FUSBH200EHCIState, (obj), TYPE_FUSBH200_EHCI) -typedef struct FUSBH200EHCIState { +struct FUSBH200EHCIState {/*< private >*/ EHCISysBusState parent_obj;/*< public >*/ MemoryRegion mem_vendor; -}FUSBH200EHCIState ; +};#endif
hw/usb/hcd-ohci.h +4 -2
@@ -23,6 +23,7 @@#include "sysemu/dma.h" #include "hw/usb.h" +#include "qom/object.h" /* Number of Downstream Ports on the root hub: */ #define OHCI_MAX_PORTS 15
@@ -92,9 +93,10 @@ typedef struct OHCIState { } OHCIState;#define TYPE_SYSBUS_OHCI "sysbus-ohci" +typedef struct OHCISysBusState OHCISysBusState ;#define SYSBUS_OHCI (obj) OBJECT_CHECK(OHCISysBusState, (obj), TYPE_SYSBUS_OHCI) -typedef struct { +struct OHCISysBusState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -104,7 +106,7 @@ typedef struct {uint32_t num_ports;uint32_t firstport;dma_addr_t dma_offset; -} OHCISysBusState; +};extern const VMStateDescription vmstate_ohci_state;
hw/usb/hcd-xhci.h +2 -1
@@ -21,11 +21,13 @@#ifndef HW_USB_HCD_XHCI_H #define HW_USB_HCD_XHCI_H +#include "qom/object.h" #define TYPE_XHCI "base-xhci"#define TYPE_NEC_XHCI "nec-usb-xhci"#define TYPE_QEMU_XHCI "qemu-xhci" +typedef struct XHCIState XHCIState ;#define XHCI (obj) \ OBJECT_CHECK(XHCIState, (obj), TYPE_XHCI)
@@ -39,7 +41,6 @@/* Very pessimistic, let's hope it's enough for all cases */ #define EV_QUEUE (((3 * 24) + 16) * MAXSLOTS) -typedef struct XHCIState XHCIState ;typedef struct XHCIStreamContext XHCIStreamContext ;typedef struct XHCIEPContext XHCIEPContext ;
hw/vfio/pci.h +4 -2
@@ -18,6 +18,7 @@#include "qemu/event_notifier.h" #include "qemu/queue.h" #include "qemu/timer.h" +#include "qom/object.h" #define PCI_ANY_ID (~0)
@@ -114,9 +115,10 @@ typedef struct VFIOMSIXInfo { } VFIOMSIXInfo;#define TYPE_VFIO_PCI "vfio-pci" +typedef struct VFIOPCIDevice VFIOPCIDevice ;#define PCI_VFIO (obj) OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI) -typedef struct VFIOPCIDevice { +struct VFIOPCIDevice {PCIDevice pdev;VFIODevice vbasedev;VFIOINTx intx;
@@ -173,7 +175,7 @@ typedef struct VFIOPCIDevice {VFIODisplay *dpy;Error *migration_blocker;Notifier irqchip_change_notifier; -} VFIOPCIDevice; +};/* Use uin32_t for vendor & device so PCI_ANY_ID expands and cannot match hw */ static inline bool vfio_pci_is (VFIOPCIDevice *vdev,uint32_t vendor,uint32_t device)
hw/virtio/virtio-mem-pci.h +1 -0
@@ -15,6 +15,7 @@#include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-mem.h" +#include "qom/object.h" typedef struct VirtIOMEMPCI VirtIOMEMPCI ;
hw/virtio/virtio-pci.h +4 -2
@@ -17,6 +17,7 @@#include "hw/pci/msi.h" #include "hw/virtio/virtio-bus.h" +#include "qom/object.h" typedef struct VirtIOPCIProxy VirtIOPCIProxy ;
@@ -94,6 +95,7 @@ typedef struct {* virtio-pci: This is the PCIDevice which has a virtio-pci-bus. */ #define TYPE_VIRTIO_PCI "virtio-pci" +typedef struct VirtioPCIClass VirtioPCIClass ;#define VIRTIO_PCI_GET_CLASS (obj) \ OBJECT_GET_CLASS(VirtioPCIClass, obj, TYPE_VIRTIO_PCI)#define VIRTIO_PCI_CLASS (klass) \
@@ -101,11 +103,11 @@ typedef struct {#define VIRTIO_PCI (obj) \ OBJECT_CHECK(VirtIOPCIProxy, (obj), TYPE_VIRTIO_PCI) -typedef struct VirtioPCIClass { +struct VirtioPCIClass {PCIDeviceClass parent_class;DeviceRealize parent_dc_realize;void (*realize)(VirtIOPCIProxy *vpci_dev,Error **errp); -}VirtioPCIClass ; +}; typedef struct VirtIOPCIRegion { MemoryRegion mr;
hw/virtio/virtio-pmem-pci.h +1 -0
@@ -16,6 +16,7 @@#include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-pmem.h" +#include "qom/object.h" typedef struct VirtIOPMEMPCI VirtIOPMEMPCI ;
hw/xen/xen_pt.h +1 -0
@@ -4,6 +4,7 @@#include "hw/xen/xen_common.h" #include "hw/pci/pci.h" #include "xen-host-pci-device.h" +#include "qom/object.h" bool xen_igd_gfx_pt_enabled (void );void xen_igd_gfx_pt_set (bool value,Error **errp);
include/authz/base.h +2 -2
@@ -27,6 +27,8 @@#define TYPE_QAUTHZ "authz" +typedef struct QAuthZ QAuthZ ; +typedef struct QAuthZClass QAuthZClass ;#define QAUTHZ_CLASS (klass) \ OBJECT_CLASS_CHECK(QAuthZClass, (klass), \ TYPE_QAUTHZ)
@@ -37,8 +39,6 @@OBJECT_CHECK (QAuthZ, (obj), \TYPE_QAUTHZ ) -typedef struct QAuthZ QAuthZ ; -typedef struct QAuthZClass QAuthZClass ;/** * QAuthZ:
include/authz/list.h +3 -2
@@ -23,9 +23,12 @@#include "authz/base.h" #include "qapi/qapi-types-authz.h" +#include "qom/object.h" #define TYPE_QAUTHZ_LIST "authz-list" +typedef struct QAuthZList QAuthZList ; +typedef struct QAuthZListClass QAuthZListClass ;#define QAUTHZ_LIST_CLASS (klass) \ OBJECT_CLASS_CHECK(QAuthZListClass, (klass), \ TYPE_QAUTHZ_LIST)
@@ -36,8 +39,6 @@OBJECT_CHECK (QAuthZList, (obj), \TYPE_QAUTHZ_LIST ) -typedef struct QAuthZList QAuthZList ; -typedef struct QAuthZListClass QAuthZListClass ;/**
include/authz/listfile.h +3 -2
@@ -23,9 +23,12 @@#include "authz/list.h" #include "qemu/filemonitor.h" +#include "qom/object.h" #define TYPE_QAUTHZ_LIST_FILE "authz-list-file" +typedef struct QAuthZListFile QAuthZListFile ; +typedef struct QAuthZListFileClass QAuthZListFileClass ;#define QAUTHZ_LIST_FILE_CLASS (klass) \ OBJECT_CLASS_CHECK(QAuthZListFileClass, (klass), \ TYPE_QAUTHZ_LIST_FILE)
@@ -36,8 +39,6 @@OBJECT_CHECK (QAuthZListFile, (obj), \TYPE_QAUTHZ_LIST_FILE ) -typedef struct QAuthZListFile QAuthZListFile ; -typedef struct QAuthZListFileClass QAuthZListFileClass ;/**
include/authz/pamacct.h +3 -2
@@ -22,10 +22,13 @@#define QAUTHZ_PAMACCT_H #include "authz/base.h" +#include "qom/object.h" #define TYPE_QAUTHZ_PAM "authz-pam" +typedef struct QAuthZPAM QAuthZPAM ; +typedef struct QAuthZPAMClass QAuthZPAMClass ;#define QAUTHZ_PAM_CLASS (klass) \ OBJECT_CLASS_CHECK(QAuthZPAMClass, (klass), \ TYPE_QAUTHZ_PAM)
@@ -36,8 +39,6 @@OBJECT_CHECK (QAuthZPAM, (obj), \TYPE_QAUTHZ_PAM ) -typedef struct QAuthZPAM QAuthZPAM ; -typedef struct QAuthZPAMClass QAuthZPAMClass ;/**
include/authz/simple.h +3 -2
@@ -22,9 +22,12 @@#define QAUTHZ_SIMPLE_H #include "authz/base.h" +#include "qom/object.h" #define TYPE_QAUTHZ_SIMPLE "authz-simple" +typedef struct QAuthZSimple QAuthZSimple ; +typedef struct QAuthZSimpleClass QAuthZSimpleClass ;#define QAUTHZ_SIMPLE_CLASS (klass) \ OBJECT_CLASS_CHECK(QAuthZSimpleClass, (klass), \ TYPE_QAUTHZ_SIMPLE)
@@ -35,8 +38,6 @@OBJECT_CHECK (QAuthZSimple, (obj), \TYPE_QAUTHZ_SIMPLE ) -typedef struct QAuthZSimple QAuthZSimple ; -typedef struct QAuthZSimpleClass QAuthZSimpleClass ;/**
include/block/throttle-groups.h +1 -0
@@ -27,6 +27,7 @@#include "qemu/throttle.h" #include "block/block_int.h" +#include "qom/object.h" /* The ThrottleGroupMember structure indicates membership in a ThrottleGroup * and holds related data.
include/chardev/char-fd.h +4 -2
@@ -26,13 +26,15 @@#include "io/channel.h" #include "chardev/char.h" +#include "qom/object.h" -typedef struct FDChardev { +struct FDChardev {Chardev parent;QIOChannel *ioc_in, *ioc_out;int max_size; -}FDChardev ; +}; +typedef struct FDChardev FDChardev ;#define TYPE_CHARDEV_FD "chardev-fd"
include/chardev/char-win.h +4 -2
@@ -25,8 +25,9 @@#define CHAR_WIN_H #include "chardev/char.h" +#include "qom/object.h" -typedef struct { +struct WinChardev {Chardev parent;bool keep_open;/* console do not close file */
@@ -36,7 +37,8 @@ typedef struct {/* Protected by the Chardev chr_write_lock. */ OVERLAPPED osend; -} WinChardev; +}; +typedef struct WinChardev WinChardev ;#define NSENDBUF 2048#define NRECVBUF 2048
include/chardev/char.h +3 -2
@@ -226,6 +226,7 @@ int qemu_chr_write(Chardev *s, const uint8_t *buf, int len, bool write_all);int qemu_chr_wait_connected (Chardev *chr,Error **errp);#define TYPE_CHARDEV "chardev" +typedef struct ChardevClass ChardevClass ;#define CHARDEV (obj) OBJECT_CHECK(Chardev, (obj), TYPE_CHARDEV)#define CHARDEV_CLASS (klass) \ OBJECT_CLASS_CHECK(ChardevClass, (klass), TYPE_CHARDEV)
@@ -251,7 +252,7 @@ int qemu_chr_wait_connected(Chardev *chr, Error **errp);#define CHARDEV_IS_PTY (chr) \ object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_PTY) -typedef struct ChardevClass { +struct ChardevClass {ObjectClass parent_class;bool internal;/* TODO: eventually use TYPE_USER_CREATABLE */
@@ -276,7 +277,7 @@ typedef struct ChardevClass {void (*chr_be_event)(Chardev *s,QEMUChrEvent event);/* Return 0 if succeeded, 1 if failed */ int (*chr_machine_done)(Chardev *chr); -} ChardevClass; +}; Chardev *qemu_chardev_new(const char *id, const char *typename, ChardevBackend *backend, GMainContext *context,
include/chardev/spice.h +4 -2
@@ -3,8 +3,9 @@#include <spice.h> #include "chardev/char-fe.h" +#include "qom/object.h" -typedef struct SpiceChardev { +struct SpiceChardev {Chardev parent;SpiceCharDeviceInstance sin;
@@ -13,7 +14,8 @@ typedef struct SpiceChardev {const uint8_t *datapos;int datalen;QLIST_ENTRY (SpiceChardev) next; -} SpiceChardev; +}; +typedef struct SpiceChardev SpiceChardev ;#define TYPE_CHARDEV_SPICE "chardev-spice"#define TYPE_CHARDEV_SPICEVMC "chardev-spicevmc"
include/crypto/secret.h +1 -1
@@ -26,10 +26,10 @@#include "crypto/secret_common.h" #define TYPE_QCRYPTO_SECRET "secret" +typedef struct QCryptoSecret QCryptoSecret ;#define QCRYPTO_SECRET (obj) \ OBJECT_CHECK(QCryptoSecret, (obj), TYPE_QCRYPTO_SECRET) -typedef struct QCryptoSecret QCryptoSecret ;typedef struct QCryptoSecretClass QCryptoSecretClass ;/**
include/crypto/secret_common.h +2 -2
@@ -25,6 +25,8 @@#include "qom/object.h" #define TYPE_QCRYPTO_SECRET_COMMON "secret_common" +typedef struct QCryptoSecretCommon QCryptoSecretCommon ; +typedef struct QCryptoSecretCommonClass QCryptoSecretCommonClass ;#define QCRYPTO_SECRET_COMMON (obj) \ OBJECT_CHECK(QCryptoSecretCommon, (obj), TYPE_QCRYPTO_SECRET_COMMON)#define QCRYPTO_SECRET_COMMON_CLASS (class) \
@@ -34,8 +36,6 @@OBJECT_GET_CLASS (QCryptoSecretCommonClass, \ (obj), TYPE_QCRYPTO_SECRET_COMMON) -typedef struct QCryptoSecretCommon QCryptoSecretCommon ; -typedef struct QCryptoSecretCommonClass QCryptoSecretCommonClass ;struct QCryptoSecretCommon {Object parent_obj;
include/crypto/secret_keyring.h +2 -2
@@ -26,6 +26,8 @@#include "crypto/secret_common.h" #define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring" +typedef struct QCryptoSecretKeyring QCryptoSecretKeyring ; +typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass ;#define QCRYPTO_SECRET_KEYRING (obj) \ OBJECT_CHECK(QCryptoSecretKeyring, (obj), \ TYPE_QCRYPTO_SECRET_KEYRING)
@@ -36,8 +38,6 @@OBJECT_GET_CLASS (QCryptoSecretKeyringClass, \ (class), TYPE_QCRYPTO_SECRET_KEYRING) -typedef struct QCryptoSecretKeyring QCryptoSecretKeyring ; -typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass ;struct QCryptoSecretKeyring {QCryptoSecretCommon parent;
include/crypto/tls-cipher-suites.h +3 -2
@@ -15,14 +15,15 @@#include "crypto/tlscreds.h" #define TYPE_QCRYPTO_TLS_CIPHER_SUITES "tls-cipher-suites" +typedef struct QCryptoTLSCipherSuites QCryptoTLSCipherSuites ;#define QCRYPTO_TLS_CIPHER_SUITES (obj) \ OBJECT_CHECK(QCryptoTLSCipherSuites, (obj), TYPE_QCRYPTO_TLS_CIPHER_SUITES) -typedef struct QCryptoTLSCipherSuites { +struct QCryptoTLSCipherSuites {/* <private> */ QCryptoTLSCreds parent_obj;/* <public> */ -}QCryptoTLSCipherSuites ; +};/** * qcrypto_tls_cipher_suites_get_data:
include/crypto/tlscreds.h +1 -1
@@ -29,10 +29,10 @@#endif #define TYPE_QCRYPTO_TLS_CREDS "tls-creds" +typedef struct QCryptoTLSCreds QCryptoTLSCreds ;#define QCRYPTO_TLS_CREDS (obj) \ OBJECT_CHECK(QCryptoTLSCreds, (obj), TYPE_QCRYPTO_TLS_CREDS) -typedef struct QCryptoTLSCreds QCryptoTLSCreds ;typedef struct QCryptoTLSCredsClass QCryptoTLSCredsClass ;#define QCRYPTO_TLS_CREDS_DH_PARAMS "dh-params.pem"
include/crypto/tlscredsanon.h +2 -1
@@ -22,13 +22,14 @@#define QCRYPTO_TLSCREDSANON_H #include "crypto/tlscreds.h" +#include "qom/object.h" #define TYPE_QCRYPTO_TLS_CREDS_ANON "tls-creds-anon" +typedef struct QCryptoTLSCredsAnon QCryptoTLSCredsAnon ;#define QCRYPTO_TLS_CREDS_ANON (obj) \ OBJECT_CHECK(QCryptoTLSCredsAnon, (obj), TYPE_QCRYPTO_TLS_CREDS_ANON) -typedef struct QCryptoTLSCredsAnon QCryptoTLSCredsAnon ;typedef struct QCryptoTLSCredsAnonClass QCryptoTLSCredsAnonClass ;/**
include/crypto/tlscredspsk.h +2 -1
@@ -22,12 +22,13 @@#define QCRYPTO_TLSCREDSPSK_H #include "crypto/tlscreds.h" +#include "qom/object.h" #define TYPE_QCRYPTO_TLS_CREDS_PSK "tls-creds-psk" +typedef struct QCryptoTLSCredsPSK QCryptoTLSCredsPSK ;#define QCRYPTO_TLS_CREDS_PSK (obj) \ OBJECT_CHECK(QCryptoTLSCredsPSK, (obj), TYPE_QCRYPTO_TLS_CREDS_PSK) -typedef struct QCryptoTLSCredsPSK QCryptoTLSCredsPSK ;typedef struct QCryptoTLSCredsPSKClass QCryptoTLSCredsPSKClass ;#define QCRYPTO_TLS_CREDS_PSKFILE "keys.psk"
include/crypto/tlscredsx509.h +2 -1
@@ -22,12 +22,13 @@#define QCRYPTO_TLSCREDSX509_H #include "crypto/tlscreds.h" +#include "qom/object.h" #define TYPE_QCRYPTO_TLS_CREDS_X509 "tls-creds-x509" +typedef struct QCryptoTLSCredsX509 QCryptoTLSCredsX509 ;#define QCRYPTO_TLS_CREDS_X509 (obj) \ OBJECT_CHECK(QCryptoTLSCredsX509, (obj), TYPE_QCRYPTO_TLS_CREDS_X509) -typedef struct QCryptoTLSCredsX509 QCryptoTLSCredsX509 ;typedef struct QCryptoTLSCredsX509Class QCryptoTLSCredsX509Class ;#define QCRYPTO_TLS_CREDS_X509_CA_CERT "ca-cert.pem"
include/exec/memory.h +3 -2
@@ -38,6 +38,7 @@ OBJECT_CHECK(MemoryRegion, (obj), TYPE_MEMORY_REGION)#define TYPE_IOMMU_MEMORY_REGION "qemu:iommu-memory-region" +typedef struct IOMMUMemoryRegionClass IOMMUMemoryRegionClass ;#define IOMMU_MEMORY_REGION (obj) \ OBJECT_CHECK(IOMMUMemoryRegion, (obj), TYPE_IOMMU_MEMORY_REGION)#define IOMMU_MEMORY_REGION_CLASS (klass) \
@@ -242,7 +243,7 @@ enum IOMMUMemoryRegionAttr {* only a single IOMMU index. A more complex IOMMU might have one index * for secure transactions and one for non-secure transactions. */ -typedef struct IOMMUMemoryRegionClass { +struct IOMMUMemoryRegionClass {/* private */ MemoryRegionClass parent_class;
@@ -355,7 +356,7 @@ typedef struct IOMMUMemoryRegionClass {* @iommu: the IOMMUMemoryRegion */ int (*num_indexes)(IOMMUMemoryRegion *iommu); -} IOMMUMemoryRegionClass; +};typedef struct CoalescedMemoryRange CoalescedMemoryRange ;typedef struct MemoryRegionIoeventfd MemoryRegionIoeventfd ;
include/hw/acpi/acpi_dev_interface.h +3 -2
@@ -18,6 +18,7 @@ typedef enum {#define TYPE_ACPI_DEVICE_IF "acpi-device-interface" +typedef struct AcpiDeviceIfClass AcpiDeviceIfClass ;#define ACPI_DEVICE_IF_CLASS (klass) \ OBJECT_CLASS_CHECK(AcpiDeviceIfClass, (klass), \ TYPE_ACPI_DEVICE_IF)
@@ -48,7 +49,7 @@ void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event);* knowledge about internals of actual device that implements * ACPI interface. */ -typedef struct AcpiDeviceIfClass { +struct AcpiDeviceIfClass {/* <private> */ InterfaceClass parent_class;
@@ -57,5 +58,5 @@ typedef struct AcpiDeviceIfClass {void (*send_event)(AcpiDeviceIf *adev,AcpiEventStatusBits ev);void (*madt_cpu)(AcpiDeviceIf *adev,int uid, const CPUArchIdList *apic_ids, GArray *entry); -} AcpiDeviceIfClass; +};#endif
include/hw/acpi/generic_event_device.h +4 -2
@@ -62,10 +62,12 @@#include "hw/sysbus.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/ghes.h" +#include "qom/object.h" #define ACPI_POWER_BUTTON_DEVICE "PWRB"#define TYPE_ACPI_GED "acpi-ged" +typedef struct AcpiGedState AcpiGedState ;#define ACPI_GED (obj) \ OBJECT_CHECK(AcpiGedState, (obj), TYPE_ACPI_GED)
@@ -90,7 +92,7 @@ typedef struct GEDState {uint32_t sel; } GEDState; -typedef struct AcpiGedState { +struct AcpiGedState {SysBusDevice parent_obj;MemHotplugState memhp_state;MemoryRegion container_memhp;
@@ -98,7 +100,7 @@ typedef struct AcpiGedState {uint32_t ged_event_bitmap;qemu_irq irq;AcpiGhesState ghes_state; -} AcpiGedState; +};void build_ged_aml (Aml *table,const char * name,HotplugHandler *hotplug_dev,uint32_t ged_irq,AmlRegionSpace rs,hwaddr ged_base);
include/hw/acpi/vmgenid.h +4 -2
@@ -4,6 +4,7 @@#include "hw/acpi/bios-linker-loader.h" #include "hw/qdev-core.h" #include "qemu/uuid.h" +#include "qom/object.h" #define VMGENID_DEVICE "vmgenid"#define VMGENID_GUID "guid"
@@ -15,13 +16,14 @@* OVMF SDT Header Probe Supressor */ +typedef struct VmGenIdState VmGenIdState ;#define VMGENID (obj) OBJECT_CHECK(VmGenIdState, (obj), VMGENID_DEVICE) -typedef struct VmGenIdState { +struct VmGenIdState {DeviceClass parent_obj;QemuUUID guid;/* The 128-bit GUID seen by the guest */ uint8_t vmgenid_addr_le[8 ];/* Address of the GUID (little-endian) */ -}VmGenIdState ; +};/* returns NULL unless there is exactly one device */ static inline Object *find_vmgenid_dev (void )
include/hw/adc/stm32f2xx_adc.h +4 -2
@@ -26,6 +26,7 @@#define HW_STM32F2XX_ADC_H #include "hw/sysbus.h" +#include "qom/object.h" #define ADC_SR 0x00#define ADC_CR1 0x04
@@ -58,10 +59,11 @@#define ADC_COMMON_ADDRESS 0x100#define TYPE_STM32F2XX_ADC "stm32f2xx-adc" +typedef struct STM32F2XXADCState STM32F2XXADCState ;#define STM32F2XX_ADC (obj) \ OBJECT_CHECK(STM32F2XXADCState, (obj), TYPE_STM32F2XX_ADC) -typedef struct { +struct STM32F2XXADCState {/* <private> */ SysBusDevice parent_obj;
@@ -84,6 +86,6 @@ typedef struct {uint32_t adc_dr; qemu_irq irq; -} STM32F2XXADCState; +};#endif /* HW_STM32F2XX_ADC_H */
include/hw/arm/allwinner-a10.h +4 -2
@@ -14,6 +14,7 @@#include "hw/rtc/allwinner-rtc.h" #include "target/arm/cpu.h" +#include "qom/object.h" #define AW_A10_SDRAM_BASE 0x40000000
@@ -21,9 +22,10 @@#define AW_A10_NUM_USB 2#define TYPE_AW_A10 "allwinner-a10" +typedef struct AwA10State AwA10State ;#define AW_A10 (obj) OBJECT_CHECK(AwA10State, (obj), TYPE_AW_A10) -typedef struct AwA10State { +struct AwA10State {/*< private >*/ DeviceState parent_obj;/*< public >*/
@@ -38,6 +40,6 @@ typedef struct AwA10State {MemoryRegion sram_a;EHCISysBusState ehci[AW_A10_NUM_USB ]; OHCISysBusState ohci[AW_A10_NUM_USB]; -} AwA10State; +};#endif
include/hw/arm/allwinner-h3.h +3 -2
@@ -106,6 +106,7 @@ enum {#define TYPE_AW_H3 "allwinner-h3"/** Convert input object to Allwinner H3 state object */ +typedef struct AwH3State AwH3State ;#define AW_H3 (obj) OBJECT_CHECK(AwH3State, (obj), TYPE_AW_H3)/** @} */
@@ -116,7 +117,7 @@ enum {* This struct contains the state of all the devices * which are currently emulated by the H3 SoC code. */ -typedef struct AwH3State { +struct AwH3State {/*< private >*/ DeviceState parent_obj;/*< public >*/
@@ -136,7 +137,7 @@ typedef struct AwH3State {MemoryRegion sram_a1;MemoryRegion sram_a2;MemoryRegion sram_c; -} AwH3State; +};/** * Emulate Boot ROM firmware setup functionality.
include/hw/arm/armv7m.h +7 -4
@@ -13,11 +13,13 @@#include "hw/sysbus.h" #include "hw/intc/armv7m_nvic.h" #include "target/arm/idau.h" +#include "qom/object.h" #define TYPE_BITBAND "ARM,bitband-memory" +typedef struct BitBandState BitBandState ;#define BITBAND (obj) OBJECT_CHECK(BitBandState, (obj), TYPE_BITBAND) -typedef struct { +struct BitBandState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -26,9 +28,10 @@ typedef struct {MemoryRegion iomem;uint32_t base;MemoryRegion *source_memory; -} BitBandState; +};#define TYPE_ARMV7M "armv7m" +typedef struct ARMv7MState ARMv7MState ;#define ARMV7M (obj) OBJECT_CHECK(ARMv7MState, (obj), TYPE_ARMV7M)#define ARMV7M_NUM_BITBANDS 2
@@ -49,7 +52,7 @@ typedef struct {* + Property "dsp": enable DSP (forwarded to CPU object) * + Property "enable-bitband": expose bitbanded IO */ -typedef struct ARMv7MState { +struct ARMv7MState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -72,6 +75,6 @@ typedef struct ARMv7MState {bool start_powered_off;bool vfp; bool dsp; -} ARMv7MState; +};#endif
include/hw/arm/aspeed.h +4 -2
@@ -10,10 +10,12 @@#define ARM_ASPEED_H #include "hw/boards.h" +#include "qom/object.h" typedef struct AspeedMachineState AspeedMachineState ;#define TYPE_ASPEED_MACHINE MACHINE_TYPE_NAME("aspeed") +typedef struct AspeedMachineClass AspeedMachineClass ;#define ASPEED_MACHINE (obj) \ OBJECT_CHECK(AspeedMachineState, (obj), TYPE_ASPEED_MACHINE)
@@ -27,7 +29,7 @@ typedef struct AspeedMachineState AspeedMachineState;#define ASPEED_MACHINE_GET_CLASS (obj) \ OBJECT_GET_CLASS(AspeedMachineClass, (obj), TYPE_ASPEED_MACHINE) -typedef struct AspeedMachineClass { +struct AspeedMachineClass {MachineClass parent_obj;const char *name;
@@ -40,7 +42,7 @@ typedef struct AspeedMachineClass {uint32_t num_cs;uint32_t macs_mask; void (*i2c_init)(AspeedMachineState *bmc); -} AspeedMachineClass; +};#endif
include/hw/arm/aspeed_soc.h +7 -4
@@ -27,6 +27,7 @@#include "hw/gpio/aspeed_gpio.h" #include "hw/sd/aspeed_sdhci.h" #include "hw/usb/hcd-ehci.h" +#include "qom/object.h" #define ASPEED_SPIS_NUM 2#define ASPEED_EHCIS_NUM 2
@@ -34,7 +35,7 @@#define ASPEED_CPUS_NUM 2#define ASPEED_MACS_NUM 4 -typedef struct AspeedSoCState { +struct AspeedSoCState {/*< private >*/ DeviceState parent;
@@ -60,12 +61,14 @@ typedef struct AspeedSoCState {AspeedGPIOState gpio_1_8v;AspeedSDHCIState sdhci;AspeedSDHCIState emmc; -} AspeedSoCState; +}; +typedef struct AspeedSoCState AspeedSoCState ;#define TYPE_ASPEED_SOC "aspeed-soc" +typedef struct AspeedSoCClass AspeedSoCClass ;#define ASPEED_SOC (obj) OBJECT_CHECK(AspeedSoCState, (obj), TYPE_ASPEED_SOC) -typedef struct AspeedSoCClass { +struct AspeedSoCClass {DeviceClass parent_class;const char *name;
@@ -79,7 +82,7 @@ typedef struct AspeedSoCClass {const int *irqmap;const hwaddr *memmap;uint32_t num_cpus; -} AspeedSoCClass; +};#define ASPEED_SOC_CLASS (klass) \ OBJECT_CLASS_CHECK(AspeedSoCClass, (klass), TYPE_ASPEED_SOC)
include/hw/arm/bcm2835_peripherals.h +4 -2
@@ -29,12 +29,14 @@#include "hw/timer/bcm2835_systmr.h" #include "hw/usb/hcd-dwc2.h" #include "hw/misc/unimp.h" +#include "qom/object.h" #define TYPE_BCM2835_PERIPHERALS "bcm2835-peripherals" +typedef struct BCM2835PeripheralState BCM2835PeripheralState ;#define BCM2835_PERIPHERALS (obj) \ OBJECT_CHECK(BCM2835PeripheralState, (obj), TYPE_BCM2835_PERIPHERALS) -typedef struct BCM2835PeripheralState { +struct BCM2835PeripheralState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -70,6 +72,6 @@ typedef struct BCM2835PeripheralState {UnimplementedDeviceState smi;DWC2State dwc2; UnimplementedDeviceState sdramc; -} BCM2835PeripheralState; +};#endif /* BCM2835_PERIPHERALS_H */
include/hw/arm/bcm2836.h +7 -4
@@ -15,8 +15,11 @@#include "hw/arm/bcm2835_peripherals.h" #include "hw/intc/bcm2836_control.h" #include "target/arm/cpu.h" +#include "qom/object.h" #define TYPE_BCM283X "bcm283x" +typedef struct BCM283XClass BCM283XClass ; +typedef struct BCM283XState BCM283XState ;#define BCM283X (obj) OBJECT_CHECK(BCM283XState, (obj), TYPE_BCM283X)#define BCM283X_NCPUS 4
@@ -28,7 +31,7 @@#define TYPE_BCM2836 "bcm2836"#define TYPE_BCM2837 "bcm2837" -typedef struct BCM283XState { +struct BCM283XState {/*< private >*/ DeviceState parent_obj;/*< public >*/
@@ -40,14 +43,14 @@ typedef struct BCM283XState { } cpu[BCM283X_NCPUS ];BCM2836ControlState control;BCM2835PeripheralState peripherals; -} BCM283XState; +};typedef struct BCM283XInfo BCM283XInfo ; -typedef struct BCM283XClass { +struct BCM283XClass {DeviceClass parent_class;const BCM283XInfo *info; -}BCM283XClass ; +};#define BCM283X_CLASS (klass) \ OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X)
include/hw/arm/digic.h +4 -2
@@ -21,14 +21,16 @@#include "cpu.h" #include "hw/timer/digic-timer.h" #include "hw/char/digic-uart.h" +#include "qom/object.h" #define TYPE_DIGIC "digic" +typedef struct DigicState DigicState ;#define DIGIC (obj) OBJECT_CHECK(DigicState, (obj), TYPE_DIGIC)#define DIGIC4_NB_TIMERS 3 -typedef struct DigicState { +struct DigicState {/*< private >*/ DeviceState parent_obj;/*< public >*/
@@ -37,6 +39,6 @@ typedef struct DigicState {DigicTimerState timer[DIGIC4_NB_TIMERS ]; DigicUartState uart; -} DigicState; +};#endif /* HW_ARM_DIGIC_H */
include/hw/arm/exynos4210.h +4 -2
@@ -27,6 +27,7 @@#include "hw/or-irq.h" #include "hw/sysbus.h" #include "target/arm/cpu-qom.h" +#include "qom/object.h" #define EXYNOS4210_NCPUS 2
@@ -85,7 +86,7 @@ typedef struct Exynos4210Irq {qemu_irq board_irqs[EXYNOS4210_MAX_INT_COMBINER_IN_IRQ ]; } Exynos4210Irq; -typedef struct Exynos4210State { +struct Exynos4210State {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -101,7 +102,8 @@ typedef struct Exynos4210State {MemoryRegion bootreg_mem;I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER ];qemu_or_irq pl330_irq_orgate[EXYNOS4210_NUM_DMA ]; -} Exynos4210State; +}; +typedef struct Exynos4210State Exynos4210State ;#define TYPE_EXYNOS4210_SOC "exynos4210"#define EXYNOS4210_SOC (obj) \
include/hw/arm/fsl-imx25.h +4 -2
@@ -32,8 +32,10 @@#include "hw/watchdog/wdt_imx2.h" #include "exec/memory.h" #include "target/arm/cpu.h" +#include "qom/object.h" #define TYPE_FSL_IMX25 "fsl,imx25" +typedef struct FslIMX25State FslIMX25State ;#define FSL_IMX25 (obj) OBJECT_CHECK(FslIMX25State, (obj), TYPE_FSL_IMX25)#define FSL_IMX25_NUM_UARTS 5
@@ -44,7 +46,7 @@#define FSL_IMX25_NUM_ESDHCS 2#define FSL_IMX25_NUM_USBS 2 -typedef struct FslIMX25State { +struct FslIMX25State {/*< private >*/ DeviceState parent_obj;
@@ -66,7 +68,7 @@ typedef struct FslIMX25State {MemoryRegion iram;MemoryRegion iram_alias;uint32_t phy_num; -} FslIMX25State; +};/** * i.MX25 memory map
include/hw/arm/fsl-imx31.h +4 -2
@@ -28,8 +28,10 @@#include "hw/watchdog/wdt_imx2.h" #include "exec/memory.h" #include "target/arm/cpu.h" +#include "qom/object.h" #define TYPE_FSL_IMX31 "fsl,imx31" +typedef struct FslIMX31State FslIMX31State ;#define FSL_IMX31 (obj) OBJECT_CHECK(FslIMX31State, (obj), TYPE_FSL_IMX31)#define FSL_IMX31_NUM_UARTS 2
@@ -37,7 +39,7 @@#define FSL_IMX31_NUM_I2CS 3#define FSL_IMX31_NUM_GPIOS 3 -typedef struct FslIMX31State { +struct FslIMX31State {/*< private >*/ DeviceState parent_obj;
@@ -55,7 +57,7 @@ typedef struct FslIMX31State {MemoryRegion rom;MemoryRegion iram;MemoryRegion iram_alias; -} FslIMX31State; +};#define FSL_IMX31_SECURE_ROM_ADDR 0x00000000#define FSL_IMX31_SECURE_ROM_SIZE 0x4000
include/hw/arm/fsl-imx6.h +4 -2
@@ -34,8 +34,10 @@#include "hw/usb/imx-usb-phy.h" #include "exec/memory.h" #include "cpu.h" +#include "qom/object.h" #define TYPE_FSL_IMX6 "fsl,imx6" +typedef struct FslIMX6State FslIMX6State ;#define FSL_IMX6 (obj) OBJECT_CHECK(FslIMX6State, (obj), TYPE_FSL_IMX6)#define FSL_IMX6_NUM_CPUS 4
@@ -49,7 +51,7 @@#define FSL_IMX6_NUM_USB_PHYS 2#define FSL_IMX6_NUM_USBS 4 -typedef struct FslIMX6State { +struct FslIMX6State {/*< private >*/ DeviceState parent_obj;
@@ -74,7 +76,7 @@ typedef struct FslIMX6State {MemoryRegion ocram;MemoryRegion ocram_alias;uint32_t phy_num; -} FslIMX6State; +};#define FSL_IMX6_MMDC_ADDR 0x10000000
include/hw/arm/fsl-imx6ul.h +4 -2
@@ -38,8 +38,10 @@#include "hw/usb/imx-usb-phy.h" #include "exec/memory.h" #include "cpu.h" +#include "qom/object.h" #define TYPE_FSL_IMX6UL "fsl,imx6ul" +typedef struct FslIMX6ULState FslIMX6ULState ;#define FSL_IMX6UL (obj) OBJECT_CHECK(FslIMX6ULState, (obj), TYPE_FSL_IMX6UL)enum FslIMX6ULConfiguration {
@@ -60,7 +62,7 @@ enum FslIMX6ULConfiguration { FSL_IMX6UL_NUM_USBS = 2, }; -typedef struct FslIMX6ULState { +struct FslIMX6ULState {/*< private >*/ DeviceState parent_obj;
@@ -89,7 +91,7 @@ typedef struct FslIMX6ULState {MemoryRegion ocram_alias;uint32_t phy_num[FSL_IMX6UL_NUM_ETHS ]; -} FslIMX6ULState; +};enum FslIMX6ULMemoryMap {FSL_IMX6UL_MMDC_ADDR =0x80000000 ,
include/hw/arm/fsl-imx7.h +4 -2
@@ -39,8 +39,10 @@#include "hw/pci-host/designware.h" #include "hw/usb/chipidea.h" #include "cpu.h" +#include "qom/object.h" #define TYPE_FSL_IMX7 "fsl,imx7" +typedef struct FslIMX7State FslIMX7State ;#define FSL_IMX7 (obj) OBJECT_CHECK(FslIMX7State, (obj), TYPE_FSL_IMX7)enum FslIMX7Configuration {
@@ -59,7 +61,7 @@ enum FslIMX7Configuration { FSL_IMX7_NUM_ADCS = 2, }; -typedef struct FslIMX7State { +struct FslIMX7State {/*< private >*/ DeviceState parent_obj;
@@ -82,7 +84,7 @@ typedef struct FslIMX7State {ChipideaState usb[FSL_IMX7_NUM_USBS ];DesignwarePCIEHost pcie;uint32_t phy_num[FSL_IMX7_NUM_ETHS ]; -} FslIMX7State; +};enum FslIMX7MemoryMap {FSL_IMX7_MMDC_ADDR =0x80000000 ,
include/hw/arm/linux-boot-if.h +3 -2
@@ -9,6 +9,7 @@#include "qom/object.h" #define TYPE_ARM_LINUX_BOOT_IF "arm-linux-boot-if" +typedef struct ARMLinuxBootIfClass ARMLinuxBootIfClass ;#define ARM_LINUX_BOOT_IF_CLASS (klass) \ OBJECT_CLASS_CHECK(ARMLinuxBootIfClass, (klass), TYPE_ARM_LINUX_BOOT_IF)#define ARM_LINUX_BOOT_IF_GET_CLASS (obj) \
@@ -18,7 +19,7 @@typedef struct ARMLinuxBootIf ARMLinuxBootIf ; -typedef struct ARMLinuxBootIfClass { +struct ARMLinuxBootIfClass {/*< private >*/ InterfaceClass parent_class;
@@ -35,6 +36,6 @@ typedef struct ARMLinuxBootIfClass {* (or for a CPU which doesn't support TrustZone) */ void (*arm_linux_init)(ARMLinuxBootIf *obj, bool secure_boot); -} ARMLinuxBootIfClass; +};#endif
include/hw/arm/msf2-soc.h +4 -2
@@ -30,8 +30,10 @@#include "hw/misc/msf2-sysreg.h" #include "hw/ssi/mss-spi.h" #include "hw/net/msf2-emac.h" +#include "qom/object.h" #define TYPE_MSF2_SOC "msf2-soc" +typedef struct MSF2State MSF2State ;#define MSF2_SOC (obj) OBJECT_CHECK(MSF2State, (obj), TYPE_MSF2_SOC)#define MSF2_NUM_SPIS 2
@@ -44,7 +46,7 @@*/ #define MSF2_NUM_TIMERS 2 -typedef struct MSF2State { +struct MSF2State {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -64,6 +66,6 @@ typedef struct MSF2State {MSSTimerState timer;MSSSpiState spi[MSF2_NUM_SPIS ]; MSF2EmacState emac; -} MSF2State; +};#endif
include/hw/arm/nrf51_soc.h +4 -2
@@ -17,14 +17,16 @@#include "hw/gpio/nrf51_gpio.h" #include "hw/nvram/nrf51_nvm.h" #include "hw/timer/nrf51_timer.h" +#include "qom/object.h" #define TYPE_NRF51_SOC "nrf51-soc" +typedef struct NRF51State NRF51State ;#define NRF51_SOC (obj) \ OBJECT_CHECK(NRF51State, (obj), TYPE_NRF51_SOC)#define NRF51_NUM_TIMERS 3 -typedef struct NRF51State { +struct NRF51State {/*< private >*/ SysBusDevice parent_obj;
@@ -50,6 +52,6 @@ typedef struct NRF51State { MemoryRegion container; -} NRF51State; +};#endif
include/hw/arm/omap.h +3 -2
@@ -24,6 +24,7 @@#include "hw/input/tsc2xxx.h" #include "target/arm/cpu-qom.h" #include "qemu/log.h" +#include "qom/object.h" # define OMAP_EMIFS_BASE 0x00000000# define OMAP2_Q0_BASE 0x00000000
@@ -69,10 +70,10 @@ void omap_clk_reparent(omap_clk clk, omap_clk parent);/* omap_intc.c */ #define TYPE_OMAP_INTC "common-omap-intc" +typedef struct omap_intr_handler_s omap_intr_handler ;#define OMAP_INTC (obj) \ OBJECT_CHECK(omap_intr_handler, (obj), TYPE_OMAP_INTC) -typedef struct omap_intr_handler_s omap_intr_handler ;/* * TODO: Ideally we should have a clock framework that
@@ -93,9 +94,9 @@ void omap_intc_set_fclk(omap_intr_handler *intc, omap_clk clk);/* omap_i2c.c */ #define TYPE_OMAP_I2C "omap_i2c" +typedef struct OMAPI2CState OMAPI2CState ;#define OMAP_I2C (obj) OBJECT_CHECK(OMAPI2CState, (obj), TYPE_OMAP_I2C) -typedef struct OMAPI2CState OMAPI2CState ;/* TODO: clock framework (see above) */ void omap_i2c_set_iclk (OMAPI2CState *i2c,omap_clk clk);
include/hw/arm/pxa.h +1 -0
@@ -13,6 +13,7 @@#include "exec/memory.h" #include "target/arm/cpu-qom.h" #include "hw/pcmcia.h" +#include "qom/object.h" /* Interrupt numbers */ # define PXA2XX_PIC_SSP3 0
include/hw/arm/smmu-common.h +7 -4
@@ -21,6 +21,7 @@#include "hw/sysbus.h" #include "hw/pci/pci.h" +#include "qom/object.h" #define SMMU_PCI_BUS_MAX 256#define SMMU_PCI_DEVFN_MAX 256
@@ -102,7 +103,7 @@ typedef struct SMMUIOTLBKey {uint8_t level; } SMMUIOTLBKey; -typedef struct SMMUState { +struct SMMUState {/* <private> */ SysBusDevice dev;const char *mrtypename;
@@ -116,9 +117,10 @@ typedef struct SMMUState { QLIST_HEAD(, SMMUDevice) devices_with_notifiers;uint8_t bus_num;PCIBus *primary_bus; -} SMMUState; +}; +typedef struct SMMUState SMMUState ; -typedef struct { +struct SMMUBaseClass {/* <private> */ SysBusDeviceClass parent_class;
@@ -126,7 +128,8 @@ typedef struct {DeviceRealize parent_realize; -} SMMUBaseClass; +}; +typedef struct SMMUBaseClass SMMUBaseClass ;#define TYPE_ARM_SMMU "arm-smmu"#define ARM_SMMU (obj) OBJECT_CHECK(SMMUState, (obj), TYPE_ARM_SMMU)
include/hw/arm/smmuv3.h +7 -4
@@ -21,6 +21,7 @@#include "hw/arm/smmu-common.h" #include "hw/registerfields.h" +#include "qom/object.h" #define TYPE_SMMUV3_IOMMU_MEMORY_REGION "smmuv3-iommu-memory-region"
@@ -32,7 +33,7 @@ typedef struct SMMUQueue {uint8_t log2size; } SMMUQueue; -typedef struct SMMUv3State { +struct SMMUv3State {SMMUState smmu_state;uint32_t features;
@@ -61,7 +62,8 @@ typedef struct SMMUv3State {qemu_irq irq[4 ];QemuMutex mutex; -} SMMUv3State; +}; +typedef struct SMMUv3State SMMUv3State ; typedef enum { SMMU_IRQ_EVTQ,
@@ -70,14 +72,15 @@ typedef enum {SMMU_IRQ_GERROR , } SMMUIrq; -typedef struct { +struct SMMUv3Class {/*< private >*/ SMMUBaseClass smmu_base_class;/*< public >*/ DeviceRealize parent_realize;DeviceReset parent_reset; -}SMMUv3Class ; +}; +typedef struct SMMUv3Class SMMUv3Class ;#define TYPE_ARM_SMMUV3 "arm-smmuv3"#define ARM_SMMUV3 (obj) OBJECT_CHECK(SMMUv3State, (obj), TYPE_ARM_SMMUV3)
include/hw/arm/stm32f205_soc.h +4 -2
@@ -32,8 +32,10 @@#include "hw/or-irq.h" #include "hw/ssi/stm32f2xx_spi.h" #include "hw/arm/armv7m.h" +#include "qom/object.h" #define TYPE_STM32F205_SOC "stm32f205-soc" +typedef struct STM32F205State STM32F205State ;#define STM32F205_SOC (obj) \ OBJECT_CHECK(STM32F205State, (obj), TYPE_STM32F205_SOC)
@@ -47,7 +49,7 @@#define SRAM_BASE_ADDRESS 0x20000000#define SRAM_SIZE (128 * 1024) -typedef struct STM32F205State { +struct STM32F205State {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -63,6 +65,6 @@ typedef struct STM32F205State {STM32F2XXSPIState spi[STM_NUM_SPIS ]; qemu_or_irq *adc_irqs; -} STM32F205State; +};#endif
include/hw/arm/stm32f405_soc.h +4 -2
@@ -33,8 +33,10 @@#include "hw/or-irq.h" #include "hw/ssi/stm32f2xx_spi.h" #include "hw/arm/armv7m.h" +#include "qom/object.h" #define TYPE_STM32F405_SOC "stm32f405-soc" +typedef struct STM32F405State STM32F405State ;#define STM32F405_SOC (obj) \ OBJECT_CHECK(STM32F405State, (obj), TYPE_STM32F405_SOC)
@@ -48,7 +50,7 @@#define SRAM_BASE_ADDRESS 0x20000000#define SRAM_SIZE (192 * 1024) -typedef struct STM32F405State { +struct STM32F405State {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -68,6 +70,6 @@ typedef struct STM32F405State {MemoryRegion sram;MemoryRegion flash; MemoryRegion flash_alias; -} STM32F405State; +};#endif
include/hw/arm/virt.h +7 -4
@@ -37,6 +37,7 @@#include "hw/block/flash.h" #include "sysemu/kvm.h" #include "hw/intc/arm_gicv3_common.h" +#include "qom/object.h" #define NUM_GICV2M_SPIS 64#define NUM_VIRTIO_TRANSPORTS 32
@@ -115,7 +116,7 @@ typedef struct MemMapEntry {hwaddr size; } MemMapEntry; -typedef struct { +struct VirtMachineClass {MachineClass parent;bool disallow_affinity_adjustment;bool no_its;
@@ -126,9 +127,10 @@ typedef struct {bool no_ged;/* Machines < 4.2 has no support for ACPI GED device */ bool kvm_no_adjvtime;bool acpi_expose_flash; -} VirtMachineClass; +}; +typedef struct VirtMachineClass VirtMachineClass ; -typedef struct { +struct VirtMachineState {MachineState parent;Notifier machine_done;DeviceState *platform_bus_dev;
@@ -162,7 +164,8 @@ typedef struct {DeviceState *gic;DeviceState *acpi_dev;Notifier powerdown_notifier; -} VirtMachineState; +}; +typedef struct VirtMachineState VirtMachineState ;#define VIRT_ECAM_ID (high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM)
include/hw/arm/xlnx-versal.h +4 -2
@@ -20,8 +20,10 @@#include "hw/dma/xlnx-zdma.h" #include "hw/net/cadence_gem.h" #include "hw/rtc/xlnx-zynqmp-rtc.h" +#include "qom/object.h" #define TYPE_XLNX_VERSAL "xlnx-versal" +typedef struct Versal Versal ;#define XLNX_VERSAL (obj) OBJECT_CHECK(Versal, (obj), TYPE_XLNX_VERSAL)#define XLNX_VERSAL_NR_ACPUS 2
@@ -31,7 +33,7 @@#define XLNX_VERSAL_NR_SDS 2#define XLNX_VERSAL_NR_IRQS 192 -typedef struct Versal { +struct Versal {/*< private >*/ SysBusDevice parent_obj;
@@ -74,7 +76,7 @@ typedef struct Versal {MemoryRegion *mr_ddr;uint32_t psci_conduit; } cfg; -} Versal; +};/* Memory-map and IRQ definitions. Copied a subset from * auto-generated files. */
include/hw/arm/xlnx-zynqmp.h +4 -2
@@ -32,8 +32,10 @@#include "hw/rtc/xlnx-zynqmp-rtc.h" #include "hw/cpu/cluster.h" #include "target/arm/cpu.h" +#include "qom/object.h" #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp" +typedef struct XlnxZynqMPState XlnxZynqMPState ;#define XLNX_ZYNQMP (obj) OBJECT_CHECK(XlnxZynqMPState, (obj), \ TYPE_XLNX_ZYNQMP)
@@ -73,7 +75,7 @@#define XLNX_ZYNQMP_MAX_RAM_SIZE (XLNX_ZYNQMP_MAX_LOW_RAM_SIZE + \ XLNX_ZYNQMP_MAX_HIGH_RAM_SIZE) -typedef struct XlnxZynqMPState { +struct XlnxZynqMPState {/*< private >*/ DeviceState parent_obj;
@@ -112,6 +114,6 @@ typedef struct XlnxZynqMPState {bool virt;/* Has the RPU subsystem? */ bool has_rpu; -} XlnxZynqMPState; +};#endif
include/hw/block/flash.h +3 -2
@@ -4,14 +4,15 @@/* NOR flash devices */ #include "exec/hwaddr.h" +#include "qom/object.h" /* pflash_cfi01.c */ #define TYPE_PFLASH_CFI01 "cfi.pflash01" +typedef struct PFlashCFI01 PFlashCFI01 ;#define PFLASH_CFI01 (obj) \ OBJECT_CHECK(PFlashCFI01, (obj), TYPE_PFLASH_CFI01) -typedef struct PFlashCFI01 PFlashCFI01 ; PFlashCFI01 *pflash_cfi01_register(hwaddr base, const char *name,
@@ -29,10 +30,10 @@ void pflash_cfi01_legacy_drive(PFlashCFI01 *dev, DriveInfo *dinfo);/* pflash_cfi02.c */ #define TYPE_PFLASH_CFI02 "cfi.pflash02" +typedef struct PFlashCFI02 PFlashCFI02 ;#define PFLASH_CFI02 (obj) \ OBJECT_CHECK(PFlashCFI02, (obj), TYPE_PFLASH_CFI02) -typedef struct PFlashCFI02 PFlashCFI02 ; PFlashCFI02 *pflash_cfi02_register(hwaddr base, const char *name,
include/hw/char/avr_usart.h +4 -2
@@ -25,6 +25,7 @@#include "hw/sysbus.h" #include "chardev/char-fe.h" #include "hw/hw.h" +#include "qom/object.h" /* Offsets of registers. */ #define USART_DR 0x06
@@ -57,10 +58,11 @@#define USART_CSRC_CSZ0 (1 << 1)#define TYPE_AVR_USART "avr-usart" +typedef struct AVRUsartState AVRUsartState ;#define AVR_USART (obj) \ OBJECT_CHECK(AVRUsartState, (obj), TYPE_AVR_USART) -typedef struct { +struct AVRUsartState {/* <private> */ SysBusDevice parent_obj;
@@ -88,6 +90,6 @@ typedef struct {qemu_irq txc_irq;/* Data Register Empty */ qemu_irq dre_irq; -} AVRUsartState; +};#endif /* HW_CHAR_AVR_USART_H */
include/hw/char/bcm2835_aux.h +4 -2
@@ -11,13 +11,15 @@#include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qom/object.h" #define TYPE_BCM2835_AUX "bcm2835-aux" +typedef struct BCM2835AuxState BCM2835AuxState ;#define BCM2835_AUX (obj) OBJECT_CHECK(BCM2835AuxState, (obj), TYPE_BCM2835_AUX)#define BCM2835_AUX_RX_FIFO_LEN 8 -typedef struct { +struct BCM2835AuxState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -29,6 +31,6 @@ typedef struct {uint8_t read_fifo[BCM2835_AUX_RX_FIFO_LEN ];uint8_t read_pos, read_count; uint8_t ier, iir; -} BCM2835AuxState; +};#endif
include/hw/char/cadence_uart.h +4 -2
@@ -24,6 +24,7 @@#include "chardev/char-fe.h" #include "qapi/error.h" #include "qemu/timer.h" +#include "qom/object.h" #define CADENCE_UART_RX_FIFO_SIZE 16#define CADENCE_UART_TX_FIFO_SIZE 16
@@ -31,10 +32,11 @@#define CADENCE_UART_R_MAX (0x48/4)#define TYPE_CADENCE_UART "cadence_uart" +typedef struct CadenceUARTState CadenceUARTState ;#define CADENCE_UART (obj) OBJECT_CHECK(CadenceUARTState, (obj), \ TYPE_CADENCE_UART) -typedef struct { +struct CadenceUARTState {/*< private >*/ SysBusDevice parent_obj;
@@ -51,6 +53,6 @@ typedef struct {qemu_irq irq;QEMUTimer *fifo_trigger_handle; Clock *refclk; -} CadenceUARTState; +};#endif
include/hw/char/cmsdk-apb-uart.h +4 -2
@@ -15,12 +15,14 @@#include "hw/qdev-properties.h" #include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qom/object.h" #define TYPE_CMSDK_APB_UART "cmsdk-apb-uart" +typedef struct CMSDKAPBUART CMSDKAPBUART ;#define CMSDK_APB_UART (obj) OBJECT_CHECK(CMSDKAPBUART, (obj), \ TYPE_CMSDK_APB_UART) -typedef struct { +struct CMSDKAPBUART {/*< private >*/ SysBusDevice parent_obj;
@@ -42,7 +44,7 @@ typedef struct {/* This UART has no FIFO, only a 1-character buffer for each of Tx and Rx */ uint8_t txbuf;uint8_t rxbuf; -}CMSDKAPBUART ; +};/** * cmsdk_apb_uart_create - convenience function to create TYPE_CMSDK_APB_UART
include/hw/char/digic-uart.h +4 -2
@@ -20,8 +20,10 @@#include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qom/object.h" #define TYPE_DIGIC_UART "digic-uart" +typedef struct DigicUartState DigicUartState ;#define DIGIC_UART (obj) \ OBJECT_CHECK(DigicUartState, (obj), TYPE_DIGIC_UART)
@@ -32,7 +34,7 @@ enum {R_MAX }; -typedef struct DigicUartState { +struct DigicUartState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -42,6 +44,6 @@ typedef struct DigicUartState {uint32_t reg_rx; uint32_t reg_st; -} DigicUartState; +};#endif /* HW_CHAR_DIGIC_UART_H */
include/hw/char/escc.h +4 -2
@@ -5,11 +5,13 @@#include "chardev/char-serial.h" #include "hw/sysbus.h" #include "ui/input.h" +#include "qom/object.h" /* escc.c */ #define TYPE_ESCC "escc"#define ESCC_SIZE 4 +typedef struct ESCCState ESCCState ;#define ESCC (obj) OBJECT_CHECK(ESCCState, (obj), TYPE_ESCC) typedef enum {
@@ -46,7 +48,7 @@ typedef struct ESCCChannelState {QemuInputHandlerState *hs; } ESCCChannelState; -typedef struct ESCCState { +struct ESCCState {SysBusDevice parent_obj;struct ESCCChannelState chn[2 ];
@@ -55,6 +57,6 @@ typedef struct ESCCState {MemoryRegion mmio;uint32_t disabled; uint32_t frequency; -} ESCCState; +};#endif
include/hw/char/ibex_uart.h +4 -2
@@ -29,6 +29,7 @@#include "hw/registerfields.h" #include "chardev/char-fe.h" #include "qemu/timer.h" +#include "qom/object.h" REG32(INTR_STATE, 0x00)FIELD (INTR_STATE ,TX_WATERMARK ,0 ,1 )
@@ -69,10 +70,11 @@ REG32(TIMEOUT_CTRL, 0x2c)#define IBEX_UART_CLOCK 50000000/* 50MHz clock */ #define TYPE_IBEX_UART "ibex-uart" +typedef struct IbexUartState IbexUartState ;#define IBEX_UART (obj) \ OBJECT_CHECK(IbexUartState, (obj), TYPE_IBEX_UART) -typedef struct { +struct IbexUartState {/* <private> */ SysBusDevice parent_obj;
@@ -103,5 +105,5 @@ typedef struct {qemu_irq rx_watermark;qemu_irq tx_empty; qemu_irq rx_overflow; -} IbexUartState; +};#endif /* HW_IBEX_UART_H */
include/hw/char/imx_serial.h +4 -2
@@ -20,8 +20,10 @@#include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qom/object.h" #define TYPE_IMX_SERIAL "imx.serial" +typedef struct IMXSerialState IMXSerialState ;#define IMX_SERIAL (obj) OBJECT_CHECK(IMXSerialState, (obj), TYPE_IMX_SERIAL)#define URXD_CHARRDY (1<<15)/* character read is valid */
@@ -76,7 +78,7 @@#define UTS1_TXFULL (1<<4)#define UTS1_RXFULL (1<<3) -typedef struct IMXSerialState { +struct IMXSerialState {/*< private >*/ SysBusDevice parent_obj;
@@ -103,6 +105,6 @@ typedef struct IMXSerialState {qemu_irq irq; CharBackend chr; -} IMXSerialState; +};#endif
include/hw/char/nrf51_uart.h +4 -2
@@ -14,11 +14,13 @@#include "hw/sysbus.h" #include "chardev/char-fe.h" #include "hw/registerfields.h" +#include "qom/object.h" #define UART_FIFO_LENGTH 6#define UART_SIZE 0x1000#define TYPE_NRF51_UART "nrf51_soc.uart" +typedef struct NRF51UARTState NRF51UARTState ;#define NRF51_UART (obj) OBJECT_CHECK(NRF51UARTState, (obj), TYPE_NRF51_UART)REG32 (UART_STARTRX ,0x000 )
@@ -54,7 +56,7 @@ REG32(UART_TXD, 0x51C) REG32(UART_BAUDRATE, 0x524) REG32(UART_CONFIG, 0x56C) -typedef struct NRF51UARTState { +struct NRF51UARTState {SysBusDevice parent_obj;MemoryRegion iomem;
@@ -72,6 +74,6 @@ typedef struct NRF51UARTState {bool tx_started;bool pending_tx_byte; bool enabled; -} NRF51UARTState; +};#endif
include/hw/char/pl011.h +4 -2
@@ -19,14 +19,16 @@#include "hw/sysbus.h" #include "chardev/char-fe.h" #include "qapi/error.h" +#include "qom/object.h" #define TYPE_PL011 "pl011" +typedef struct PL011State PL011State ;#define PL011 (obj) OBJECT_CHECK(PL011State, (obj), TYPE_PL011)/* This shares the same struct (and cast macro) as the base pl011 device */ #define TYPE_PL011_LUMINARY "pl011_luminary" -typedef struct PL011State { +struct PL011State {SysBusDevice parent_obj;MemoryRegion iomem;
@@ -49,7 +51,7 @@ typedef struct PL011State {CharBackend chr;qemu_irq irq[6 ];const unsigned char *id; -} PL011State; +}; static inline DeviceState *pl011_create(hwaddr addr, qemu_irq irq,
include/hw/char/renesas_sci.h +4 -2
@@ -11,8 +11,10 @@#include "chardev/char-fe.h" #include "hw/sysbus.h" +#include "qom/object.h" #define TYPE_RENESAS_SCI "renesas-sci" +typedef struct RSCIState RSCIState ;#define RSCI (obj) OBJECT_CHECK(RSCIState, (obj), TYPE_RENESAS_SCI)enum {
@@ -23,7 +25,7 @@ enum {SCI_NR_IRQ =4 }; -typedef struct { +struct RSCIState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -46,6 +48,6 @@ typedef struct {int64_t trtime;int64_t rx_next; uint64_t input_freq; -} RSCIState; +};#endif
include/hw/char/serial.h +10 -6
@@ -31,10 +31,11 @@#include "qemu/fifo8.h" #include "chardev/char.h" #include "hw/sysbus.h" +#include "qom/object.h" #define UART_FIFO_LENGTH 16/* 16550A Fifo Length */ -typedef struct SerialState { +struct SerialState {DeviceState parent;uint16_t divider;
@@ -77,22 +78,25 @@ typedef struct SerialState {QEMUTimer *modem_status_poll;MemoryRegion io; -} SerialState; +}; +typedef struct SerialState SerialState ; -typedef struct SerialMM { +struct SerialMM {SysBusDevice parent;SerialState serial;uint8_t regshift;uint8_t endianness; -}SerialMM ; +}; +typedef struct SerialMM SerialMM ; -typedef struct SerialIO { +struct SerialIO {SysBusDevice parent;SerialState serial; -}SerialIO ; +}; +typedef struct SerialIO SerialIO ;extern const VMStateDescription vmstate_serial;extern const MemoryRegionOps serial_io_ops;
include/hw/char/stm32f2xx_usart.h +4 -2
@@ -27,6 +27,7 @@#include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qom/object.h" #define USART_SR 0x00#define USART_DR 0x04
@@ -53,10 +54,11 @@#define USART_CR1_RE (1 << 2)#define TYPE_STM32F2XX_USART "stm32f2xx-usart" +typedef struct STM32F2XXUsartState STM32F2XXUsartState ;#define STM32F2XX_USART (obj) \ OBJECT_CHECK(STM32F2XXUsartState, (obj), TYPE_STM32F2XX_USART) -typedef struct { +struct STM32F2XXUsartState {/* <private> */ SysBusDevice parent_obj;
@@ -73,5 +75,5 @@ typedef struct {CharBackend chr; qemu_irq irq; -} STM32F2XXUsartState; +};#endif /* HW_STM32F2XX_USART_H */
include/hw/clock.h +1 -1
@@ -18,6 +18,7 @@#include "qemu/queue.h" #define TYPE_CLOCK "clock" +typedef struct Clock Clock ;#define CLOCK (obj) OBJECT_CHECK(Clock, (obj), TYPE_CLOCK)typedef void ClockCallback (void *opaque);
@@ -54,7 +55,6 @@ typedef void ClockCallback(void *opaque);* @sibling: structure used to form a clock list */ -typedef struct Clock Clock ;struct Clock {/*< private >*/
include/hw/core/cpu.h +4 -2
@@ -30,6 +30,7 @@#include "qemu/queue.h" #include "qemu/thread.h" #include "qemu/plugin.h" +#include "qom/object.h" typedef int (*WriteCoreDumpFunction )(const void *buf,size_t size,void *opaque);
@@ -61,6 +62,7 @@ typedef uint64_t vaddr;*/ #define CPU (obj) ((CPUState *)(obj)) +typedef struct CPUClass CPUClass ;#define CPU_CLASS (class) OBJECT_CLASS_CHECK(CPUClass, (class), TYPE_CPU)#define CPU_GET_CLASS (obj) OBJECT_GET_CLASS(CPUClass, (obj), TYPE_CPU)
@@ -156,7 +158,7 @@ struct TranslationBlock;* * Represents a CPU family or model. */ -typedef struct CPUClass { +struct CPUClass {/*< private >*/ DeviceClass parent_class;/*< public >*/
@@ -222,7 +224,7 @@ typedef struct CPUClass {/* Keep non-pointer data at the end to minimize holes. */ int gdb_num_core_regs;bool gdb_stop_before_watchpoint; -} CPUClass; +};/* * Low 16 bits: number of cycles left, used only in icount mode.
include/hw/core/generic-loader.h +4 -2
@@ -20,8 +20,9 @@#include "elf.h" #include "hw/qdev-core.h" +#include "qom/object.h" -typedef struct GenericLoaderState { +struct GenericLoaderState {/* <private> */ DeviceState parent_obj;
@@ -38,7 +39,8 @@ typedef struct GenericLoaderState {bool force_raw;bool data_be;bool set_pc; -} GenericLoaderState; +}; +typedef struct GenericLoaderState GenericLoaderState ;#define TYPE_GENERIC_LOADER "loader"#define GENERIC_LOADER (obj) OBJECT_CHECK(GenericLoaderState, (obj), \
include/hw/cpu/a15mpcore.h +4 -2
@@ -22,14 +22,16 @@#include "hw/sysbus.h" #include "hw/intc/arm_gic.h" +#include "qom/object.h" /* A15MP private memory region. */ #define TYPE_A15MPCORE_PRIV "a15mpcore_priv" +typedef struct A15MPPrivState A15MPPrivState ;#define A15MPCORE_PRIV (obj) \ OBJECT_CHECK(A15MPPrivState, (obj), TYPE_A15MPCORE_PRIV) -typedef struct A15MPPrivState { +struct A15MPPrivState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -39,6 +41,6 @@ typedef struct A15MPPrivState {MemoryRegion container; GICState gic; -} A15MPPrivState; +};#endif
include/hw/cpu/a9mpcore.h +4 -2
@@ -15,12 +15,14 @@#include "hw/misc/a9scu.h" #include "hw/timer/arm_mptimer.h" #include "hw/timer/a9gtimer.h" +#include "qom/object.h" #define TYPE_A9MPCORE_PRIV "a9mpcore_priv" +typedef struct A9MPPrivState A9MPPrivState ;#define A9MPCORE_PRIV (obj) \ OBJECT_CHECK(A9MPPrivState, (obj), TYPE_A9MPCORE_PRIV) -typedef struct A9MPPrivState { +struct A9MPPrivState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -34,6 +36,6 @@ typedef struct A9MPPrivState {A9GTimerState gtimer;ARMMPTimerState mptimer; ARMMPTimerState wdt; -} A9MPPrivState; +};#endif
include/hw/cpu/arm11mpcore.h +4 -2
@@ -14,12 +14,14 @@#include "hw/misc/arm11scu.h" #include "hw/intc/arm_gic.h" #include "hw/timer/arm_mptimer.h" +#include "qom/object.h" #define TYPE_ARM11MPCORE_PRIV "arm11mpcore_priv" +typedef struct ARM11MPCorePriveState ARM11MPCorePriveState ;#define ARM11MPCORE_PRIV (obj) \ OBJECT_CHECK(ARM11MPCorePriveState, (obj), TYPE_ARM11MPCORE_PRIV) -typedef struct ARM11MPCorePriveState { +struct ARM11MPCorePriveState {SysBusDevice parent_obj;uint32_t num_cpu;
@@ -30,6 +32,6 @@ typedef struct ARM11MPCorePriveState {GICState gic;ARMMPTimerState mptimer; ARMMPTimerState wdtimer; -} ARM11MPCorePriveState; +};#endif
include/hw/cpu/cluster.h +4 -2
@@ -21,6 +21,7 @@#define HW_CPU_CLUSTER_H #include "hw/qdev-core.h" +#include "qom/object.h" /* * CPU Cluster type
@@ -54,6 +55,7 @@*/ #define TYPE_CPU_CLUSTER "cpu-cluster" +typedef struct CPUClusterState CPUClusterState ;#define CPU_CLUSTER (obj) \ OBJECT_CHECK(CPUClusterState, (obj), TYPE_CPU_CLUSTER)
@@ -70,12 +72,12 @@* * State of a CPU cluster. */ -typedef struct CPUClusterState { +struct CPUClusterState {/*< private >*/ DeviceState parent_obj;/*< public >*/ uint32_t cluster_id; -}CPUClusterState ; +};#endif
include/hw/cpu/core.h +4 -2
@@ -10,20 +10,22 @@#define HW_CPU_CORE_H #include "hw/qdev-core.h" +#include "qom/object.h" #define TYPE_CPU_CORE "cpu-core" +typedef struct CPUCore CPUCore ;#define CPU_CORE (obj) \ OBJECT_CHECK(CPUCore, (obj), TYPE_CPU_CORE) -typedef struct CPUCore { +struct CPUCore {/*< private >*/ DeviceState parent_obj;/*< public >*/ int core_id;int nr_threads; -}CPUCore ; +};/* Note: topology field names need to be kept in sync with * 'CpuInstanceProperties' */
include/hw/display/bcm2835_fb.h +4 -2
@@ -14,8 +14,10 @@#include "hw/sysbus.h" #include "ui/console.h" +#include "qom/object.h" #define TYPE_BCM2835_FB "bcm2835-fb" +typedef struct BCM2835FBState BCM2835FBState ;#define BCM2835_FB (obj) OBJECT_CHECK(BCM2835FBState, (obj), TYPE_BCM2835_FB)/*
@@ -32,7 +34,7 @@ typedef struct {uint32_t alpha; } BCM2835FBConfig; -typedef struct { +struct BCM2835FBState {/*< private >*/ SysBusDevice busdev;/*< public >*/
@@ -49,7 +51,7 @@ typedef struct {BCM2835FBConfig config;BCM2835FBConfig initial_config; -} BCM2835FBState; +};void bcm2835_fb_reconfigure (BCM2835FBState *s,BCM2835FBConfig *newconfig);
include/hw/display/dpcd.h +1 -0
@@ -24,6 +24,7 @@#ifndef DPCD_H #define DPCD_H +#include "qom/object.h" typedef struct DPCDState DPCDState ;
include/hw/display/i2c-ddc.h +1 -0
@@ -21,6 +21,7 @@#include "hw/display/edid.h" #include "hw/i2c/i2c.h" +#include "qom/object.h" /* A simple I2C slave which just returns the contents of its EDID blob. */ struct I2CDDCState {
include/hw/display/xlnx_dp.h +4 -2
@@ -34,6 +34,7 @@#include "qemu/units.h" #include "hw/dma/xlnx_dpdma.h" #include "audio/audio.h" +#include "qom/object.h" #define AUD_CHBUF_MAX_DEPTH (32 * KiB)#define MAX_QEMU_BUFFER_SIZE (4 * KiB)
@@ -48,7 +49,7 @@ struct PixmanPlane {DisplaySurface *surface; }; -typedef struct XlnxDPState { +struct XlnxDPState {/*< private >*/ SysBusDevice parent_obj;
@@ -101,7 +102,8 @@ typedef struct XlnxDPState {*/ DPCDState *dpcd;I2CDDCState *edid; -} XlnxDPState; +}; +typedef struct XlnxDPState XlnxDPState ;#define TYPE_XLNX_DP "xlnx.v-dp"#define XLNX_DP (obj) OBJECT_CHECK(XlnxDPState, (obj), TYPE_XLNX_DP)
include/hw/dma/bcm2835_dma.h +4 -2
@@ -9,6 +9,7 @@#define BCM2835_DMA_H #include "hw/sysbus.h" +#include "qom/object.h" typedef struct { uint32_t cs;
@@ -25,12 +26,13 @@ typedef struct { } BCM2835DMAChan;#define TYPE_BCM2835_DMA "bcm2835-dma" +typedef struct BCM2835DMAState BCM2835DMAState ;#define BCM2835_DMA (obj) \ OBJECT_CHECK(BCM2835DMAState, (obj), TYPE_BCM2835_DMA)#define BCM2835_DMA_NCHANS 16 -typedef struct { +struct BCM2835DMAState {/*< private >*/ SysBusDevice busdev;/*< public >*/
@@ -42,6 +44,6 @@ typedef struct {BCM2835DMAChan chan[BCM2835_DMA_NCHANS ];uint32_t int_status; uint32_t enable; -} BCM2835DMAState; +};#endif
include/hw/dma/i8257.h +4 -2
@@ -3,8 +3,10 @@#include "hw/isa/isa.h" #include "exec/ioport.h" +#include "qom/object.h" #define TYPE_I8257 "i8257" +typedef struct I8257State I8257State ;#define I8257 (obj) \ OBJECT_CHECK(I8257State, (obj), TYPE_I8257)
@@ -20,7 +22,7 @@ typedef struct I8257Regs {void *opaque; } I8257Regs; -typedef struct I8257State { +struct I8257State {/* <private> */ ISADevice parent_obj;
@@ -43,7 +45,7 @@ typedef struct I8257State {int running;PortioList portio_page;PortioList portio_pageh; -} I8257State; +};void i8257_dma_init (ISABus *bus,bool high_page_enable);
include/hw/dma/pl080.h +4 -2
@@ -29,6 +29,7 @@#define HW_DMA_PL080_H #include "hw/sysbus.h" +#include "qom/object.h" #define PL080_MAX_CHANNELS 8
@@ -42,9 +43,10 @@ typedef struct {#define TYPE_PL080 "pl080"#define TYPE_PL081 "pl081" +typedef struct PL080State PL080State ;#define PL080 (obj) OBJECT_CHECK(PL080State, (obj), TYPE_PL080) -typedef struct PL080State { +struct PL080State {SysBusDevice parent_obj;MemoryRegion iomem;
@@ -66,6 +68,6 @@ typedef struct PL080State {MemoryRegion *downstream; AddressSpace downstream_as; -} PL080State; +};#endif
include/hw/dma/xlnx-zdma.h +4 -2
@@ -32,6 +32,7 @@#include "hw/sysbus.h" #include "hw/register.h" #include "sysemu/dma.h" +#include "qom/object.h" #define ZDMA_R_MAX (0x204 / 4)
@@ -50,7 +51,7 @@ typedef union {uint32_t words[4 ]; } XlnxZDMADescr; -typedef struct XlnxZDMA { +struct XlnxZDMA {SysBusDevice parent_obj;MemoryRegion iomem;MemTxAttrs attr;
@@ -74,7 +75,8 @@ typedef struct XlnxZDMA {/* We don't model the common bufs. Must be at least 16 bytes to model write only mode. */ uint8_t buf[2048 ]; -} XlnxZDMA; +}; +typedef struct XlnxZDMA XlnxZDMA ;#define TYPE_XLNX_ZDMA "xlnx.zdma"
include/hw/dma/xlnx-zynq-devcfg.h +4 -2
@@ -29,9 +29,11 @@#include "hw/register.h" #include "hw/sysbus.h" +#include "qom/object.h" #define TYPE_XLNX_ZYNQ_DEVCFG "xlnx.ps7-dev-cfg" +typedef struct XlnxZynqDevcfg XlnxZynqDevcfg ;#define XLNX_ZYNQ_DEVCFG (obj) \ OBJECT_CHECK(XlnxZynqDevcfg, (obj), TYPE_XLNX_ZYNQ_DEVCFG)
@@ -46,7 +48,7 @@ typedef struct XlnxZynqDevcfgDMACmd {uint32_t dest_len; } XlnxZynqDevcfgDMACmd; -typedef struct XlnxZynqDevcfg { +struct XlnxZynqDevcfg {SysBusDevice parent_obj;MemoryRegion iomem;
@@ -57,6 +59,6 @@ typedef struct XlnxZynqDevcfg {uint32_t regs[XLNX_ZYNQ_DEVCFG_R_MAX ]; RegisterInfo regs_info[XLNX_ZYNQ_DEVCFG_R_MAX]; -} XlnxZynqDevcfg; +};#endif
include/hw/dma/xlnx_dpdma.h +1 -0
@@ -28,6 +28,7 @@#include "hw/sysbus.h" #include "ui/console.h" #include "sysemu/dma.h" +#include "qom/object.h" #define XLNX_DPDMA_REG_ARRAY_SIZE (0x1000 >> 2)
include/hw/fw-path-provider.h +3 -2
@@ -22,6 +22,7 @@#define TYPE_FW_PATH_PROVIDER "fw-path-provider" +typedef struct FWPathProviderClass FWPathProviderClass ;#define FW_PATH_PROVIDER_CLASS (klass) \ OBJECT_CLASS_CHECK(FWPathProviderClass, (klass), TYPE_FW_PATH_PROVIDER)#define FW_PATH_PROVIDER_GET_CLASS (obj) \
@@ -31,11 +32,11 @@typedef struct FWPathProvider FWPathProvider ; -typedef struct FWPathProviderClass { +struct FWPathProviderClass {InterfaceClass parent_class;char *(*get_dev_path)(FWPathProvider *p,BusState *bus,DeviceState *dev); -}FWPathProviderClass ; +};char *fw_path_provider_get_dev_path (FWPathProvider *p,BusState *bus,DeviceState *dev);
include/hw/gpio/aspeed_gpio.h +7 -4
@@ -11,8 +11,11 @@#define ASPEED_GPIO_H #include "hw/sysbus.h" +#include "qom/object.h" #define TYPE_ASPEED_GPIO "aspeed.gpio" +typedef struct AspeedGPIOClass AspeedGPIOClass ; +typedef struct AspeedGPIOState AspeedGPIOState ;#define ASPEED_GPIO (obj) OBJECT_CHECK(AspeedGPIOState, (obj), TYPE_ASPEED_GPIO)#define ASPEED_GPIO_CLASS (klass) \ OBJECT_CLASS_CHECK(AspeedGPIOClass, (klass), TYPE_ASPEED_GPIO)
@@ -58,16 +61,16 @@ typedef struct AspeedGPIOReg {enum GPIORegType type; } AspeedGPIOReg; -typedef struct AspeedGPIOClass { +struct AspeedGPIOClass {SysBusDevice parent_obj;const GPIOSetProperties *props;uint32_t nr_gpio_pins;uint32_t nr_gpio_sets;uint32_t gap;const AspeedGPIOReg *reg_table; -}AspeedGPIOClass ; +}; -typedef struct AspeedGPIOState { +struct AspeedGPIOState {/* <private> */ SysBusDevice parent;
@@ -95,6 +98,6 @@ typedef struct AspeedGPIOState {uint32_t debounce_2; uint32_t input_mask; } sets[ASPEED_GPIO_MAX_NR_SETS ]; -} AspeedGPIOState; +};#endif /* _ASPEED_GPIO_H_ */
include/hw/gpio/bcm2835_gpio.h +4 -2
@@ -16,8 +16,9 @@#include "hw/sd/sd.h" #include "hw/sysbus.h" +#include "qom/object.h" -typedef struct BCM2835GpioState { +struct BCM2835GpioState {SysBusDevice parent_obj;MemoryRegion iomem;
@@ -31,7 +32,8 @@ typedef struct BCM2835GpioState {uint32_t lev0, lev1;uint8_t sd_fsel;qemu_irq out[54 ]; -} BCM2835GpioState; +}; +typedef struct BCM2835GpioState BCM2835GpioState ;#define TYPE_BCM2835_GPIO "bcm2835_gpio"#define BCM2835_GPIO (obj) \
include/hw/gpio/imx_gpio.h +4 -2
@@ -21,8 +21,10 @@#define IMX_GPIO_H #include "hw/sysbus.h" +#include "qom/object.h" #define TYPE_IMX_GPIO "imx.gpio" +typedef struct IMXGPIOState IMXGPIOState ;#define IMX_GPIO (obj) OBJECT_CHECK(IMXGPIOState, (obj), TYPE_IMX_GPIO)#define IMX_GPIO_MEM_SIZE 0x20
@@ -39,7 +41,7 @@
Lines of this file are not shown. View the raw message.
include/hw/watchdog/cmsdk-apb-watchdog.h +4 -2
Lines of this file are not shown. View the raw message.
hw/arm/musicpal.c +25 -16
41 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.26.2
Part of the diff is not shown here. View the raw message.
PATCH v4 9/18 Move QOM typedefs and add missing includes (pass 2)
In reply to Eduardo HabkostSome typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with OBJECT_DECLARE_TYPE.
Patch generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]')
which will split "typdef struct { ... } TypedefName" declarations.
Followed by:
$ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \
$(git grep -l '' -- '*.[ch]')which will:
- move the typedefs and #defines above the type check macros
- add missing #include "qom/object.h" lines if necessary
---
Changes v3 -> v4: none
Changes series v2 -> v3: this is a new patch added in series v3
The script was re-run after rebase and after additional patches were added to this series.
This is being submitted as a separate patch to make review easier, but it can be squashed into the previous patch once it gets reviewed.
---
Cc: Peter Maydell <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: David Gibson <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Juan Quintela <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- include/hw/block/swim.h | 6 ++++-- include/hw/display/macfb.h | 18 ++++++++++------- include/hw/ppc/xive.h | 41 +++++++++++++++++++++++--------------- include/hw/rdma/rdma.h | 5 +++-- migration/migration.h | 6 ++++-- target/rx/cpu-qom.h | 6 ++++-- hw/arm/integratorcp.c | 16 +++++++++------ hw/arm/versatilepb.c | 6 ++++-- hw/arm/vexpress.c | 11 ++++++---- hw/sd/pl181.c | 6 ++++-- 10 files changed, 76 insertions(+), 45 deletions(-)
include/hw/block/swim.h +4 -2
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include "hw/sysbus.h" +#include "qom/object.h" #define SWIM_MAX_FD 2
@@ -67,10 +68,11 @@ struct SWIMCtrl { };#define TYPE_SWIM "swim" +typedef struct Swim Swim ;#define SWIM (obj) OBJECT_CHECK(Swim, (obj), TYPE_SWIM) -typedef struct Swim { +struct Swim {SysBusDevice parent_obj;SWIMCtrl ctrl; -}Swim ; +};#endif
include/hw/display/macfb.h +11 -7
@@ -16,6 +16,7 @@#include "qemu/osdep.h" #include "exec/memory.h" #include "ui/console.h" +#include "qom/object.h" typedef struct MacfbState { MemoryRegion mem_vram;
@@ -31,34 +32,37 @@ typedef struct MacfbState { } MacfbState;#define TYPE_MACFB "sysbus-macfb" +typedef struct MacfbSysBusState MacfbSysBusState ;#define MACFB (obj) \ OBJECT_CHECK(MacfbSysBusState, (obj), TYPE_MACFB) -typedef struct { +struct MacfbSysBusState {SysBusDevice busdev;MacfbState macfb; -}MacfbSysBusState ; +}; +#define TYPE_NUBUS_MACFB "nubus-macfb" +typedef struct MacfbNubusDeviceClass MacfbNubusDeviceClass ; +typedef struct MacfbNubusState MacfbNubusState ;#define NUBUS_MACFB_CLASS (class) \ OBJECT_CLASS_CHECK(MacfbNubusDeviceClass, (class), TYPE_NUBUS_MACFB)#define NUBUS_MACFB_GET_CLASS (obj) \ OBJECT_GET_CLASS(MacfbNubusDeviceClass, (obj), TYPE_NUBUS_MACFB) -typedef struct MacfbNubusDeviceClass { +struct MacfbNubusDeviceClass {DeviceClass parent_class;DeviceRealize parent_realize; -}MacfbNubusDeviceClass ; +}; -#define TYPE_NUBUS_MACFB "nubus-macfb"#define NUBUS_MACFB (obj) \ OBJECT_CHECK(MacfbNubusState, (obj), TYPE_NUBUS_MACFB) -typedef struct { +struct MacfbNubusState {NubusDevice busdev;MacfbState macfb; -}MacfbNubusState ; +};#endif
include/hw/ppc/xive.h +25 -16
167 lines not on this page · raw message
include/hw/rdma/rdma.h +3 -2
@@ -19,6 +19,7 @@#define INTERFACE_RDMA_PROVIDER "rdma" +typedef struct RdmaProviderClass RdmaProviderClass ;#define RDMA_PROVIDER_CLASS (klass) \ OBJECT_CLASS_CHECK(RdmaProviderClass, (klass), \ INTERFACE_RDMA_PROVIDER)
@@ -31,10 +32,10 @@typedef struct RdmaProvider RdmaProvider ; -typedef struct RdmaProviderClass { +struct RdmaProviderClass {InterfaceClass parent;void (*print_statistics)(Monitor *mon,RdmaProvider *obj); -}RdmaProviderClass ; +};#endif
migration/migration.h +4 -2
@@ -21,6 +21,7 @@#include "qemu/coroutine_int.h" #include "io/channel.h" #include "net/announce.h" +#include "qom/object.h" struct PostcopyBlocktimeContext ;
@@ -114,6 +115,7 @@ void fill_destination_postcopy_migration_info(MigrationInfo *info);#define TYPE_MIGRATION "migration" +typedef struct MigrationClass MigrationClass ;#define MIGRATION_OBJ_CLASS (klass) \ OBJECT_CLASS_CHECK(MigrationClass, (klass), TYPE_MIGRATION)#define MIGRATION_OBJ (obj) \
@@ -121,10 +123,10 @@ void fill_destination_postcopy_migration_info(MigrationInfo *info);#define MIGRATION_OBJ_GET_CLASS (obj) \ OBJECT_GET_CLASS(MigrationClass, (obj), TYPE_MIGRATION) -typedef struct MigrationClass { +struct MigrationClass {/*< private >*/ DeviceClass parent_class; -}MigrationClass ; +};struct MigrationState {
target/rx/cpu-qom.h +4 -2
@@ -20,12 +20,14 @@#define RX_CPU_QOM_H #include "hw/core/cpu.h" +#include "qom/object.h" #define TYPE_RX_CPU "rx-cpu"#define TYPE_RX62N_CPU RX_CPU_TYPE_NAME("rx62n")typedef struct RXCPU RXCPU ; +typedef struct RXCPUClass RXCPUClass ;#define RX_CPU_CLASS (klass) \ OBJECT_CLASS_CHECK(RXCPUClass, (klass), TYPE_RX_CPU)#define RX_CPU (obj) \
@@ -40,14 +42,14 @@ typedef struct RXCPU RXCPU;* * A RX CPU model. */ -typedef struct RXCPUClass { +struct RXCPUClass {/*< private >*/ CPUClass parent_class;/*< public >*/ DeviceRealize parent_realize;DeviceReset parent_reset; -}RXCPUClass ; +};#define CPUArchState struct CPURXState
hw/arm/integratorcp.c +10 -6
@@ -26,12 +26,14 @@#include "hw/hw.h" #include "hw/irq.h" #include "hw/sd/sd.h" +#include "qom/object.h" #define TYPE_INTEGRATOR_CM "integrator_core" +typedef struct IntegratorCMState IntegratorCMState ;#define INTEGRATOR_CM (obj) \ OBJECT_CHECK(IntegratorCMState, (obj), TYPE_INTEGRATOR_CM) -typedef struct IntegratorCMState { +struct IntegratorCMState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -51,7 +53,7 @@ typedef struct IntegratorCMState {uint32_t int_level;uint32_t irq_enabled;uint32_t fiq_enabled; -} IntegratorCMState; +};static uint8_t integrator_spd[128 ] = {128 ,8 ,4 ,11 ,9 ,1 ,64 ,0 ,2 ,0xa0 ,0xa0 ,0 ,0 ,8 ,0 ,1 ,
@@ -326,10 +328,11 @@ static void integratorcm_realize(DeviceState *d, Error **errp)/* Primary interrupt controller. */ #define TYPE_INTEGRATOR_PIC "integrator_pic" +typedef struct icp_pic_state icp_pic_state ;#define INTEGRATOR_PIC (obj) \ OBJECT_CHECK(icp_pic_state, (obj), TYPE_INTEGRATOR_PIC) -typedef struct icp_pic_state { +struct icp_pic_state {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -340,7 +343,7 @@ typedef struct icp_pic_state {uint32_t fiq_enabled;qemu_irq parent_irq;qemu_irq parent_fiq; -} icp_pic_state; +};static const VMStateDescription vmstate_icp_pic = { .name ="icp_pic" ,
@@ -465,10 +468,11 @@ static void icp_pic_init(Object *obj)/* CP control registers. */ #define TYPE_ICP_CONTROL_REGS "icp-ctrl-regs" +typedef struct ICPCtrlRegsState ICPCtrlRegsState ;#define ICP_CONTROL_REGS (obj) \ OBJECT_CHECK(ICPCtrlRegsState, (obj), TYPE_ICP_CONTROL_REGS) -typedef struct ICPCtrlRegsState { +struct ICPCtrlRegsState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/
@@ -477,7 +481,7 @@ typedef struct ICPCtrlRegsState {qemu_irq mmc_irq;uint32_t intreg_state; -} ICPCtrlRegsState; +};#define ICP_GPIO_MMC_WPROT "mmc-wprot"#define ICP_GPIO_MMC_CARDIN "mmc-cardin"
hw/arm/versatilepb.c +4 -2
@@ -26,6 +26,7 @@#include "qemu/error-report.h" #include "hw/char/pl011.h" #include "hw/sd/sd.h" +#include "qom/object.h" #define VERSATILE_FLASH_ADDR 0x34000000#define VERSATILE_FLASH_SIZE (64 * 1024 * 1024)
@@ -34,10 +35,11 @@/* Primary interrupt controller. */ #define TYPE_VERSATILE_PB_SIC "versatilepb_sic" +typedef struct vpb_sic_state vpb_sic_state ;#define VERSATILE_PB_SIC (obj) \ OBJECT_CHECK(vpb_sic_state, (obj), TYPE_VERSATILE_PB_SIC) -typedef struct vpb_sic_state { +struct vpb_sic_state {SysBusDevice parent_obj;MemoryRegion iomem;
@@ -46,7 +48,7 @@ typedef struct vpb_sic_state {uint32_t pic_enable;qemu_irq parent[32 ];int irq; -} vpb_sic_state; +};static const VMStateDescription vmstate_vpb_sic = { .name ="versatilepb_sic" ,
hw/arm/vexpress.c +7 -4
@@ -44,6 +44,7 @@#include "hw/cpu/a15mpcore.h" #include "hw/i2c/arm_sbcon_i2c.h" #include "hw/sd/sd.h" +#include "qom/object.h" #define VEXPRESS_BOARD_ID 0x8e0#define VEXPRESS_FLASH_SIZE (64 * 1024 * 1024)
@@ -166,16 +167,18 @@ static hwaddr motherboard_aseries_map[] = {typedef struct VEDBoardInfo VEDBoardInfo ; -typedef struct { +struct VexpressMachineClass {MachineClass parent;VEDBoardInfo *daughterboard; -}VexpressMachineClass ; +}; +typedef struct VexpressMachineClass VexpressMachineClass ; -typedef struct { +struct VexpressMachineState {MachineState parent;bool secure;bool virt; -}VexpressMachineState ; +}; +typedef struct VexpressMachineState VexpressMachineState ;#define TYPE_VEXPRESS_MACHINE "vexpress"#define TYPE_VEXPRESS_A9_MACHINE MACHINE_TYPE_NAME("vexpress-a9")
hw/sd/pl181.c +4 -2
@@ -18,15 +18,17 @@#include "qemu/error-report.h" #include "qapi/error.h" #include "trace.h" +#include "qom/object.h" #define PL181_FIFO_LEN 16#define TYPE_PL181 "pl181" +typedef struct PL181State PL181State ;#define PL181 (obj) OBJECT_CHECK(PL181State, (obj), TYPE_PL181)#define TYPE_PL181_BUS "pl181-bus" -typedef struct PL181State { +struct PL181State {SysBusDevice parent_obj;MemoryRegion iomem;
@@ -56,7 +58,7 @@ typedef struct PL181State {/* GPIO outputs for 'card is readonly' and 'card inserted' */ qemu_irq card_readonly;qemu_irq card_inserted; -} PL181State; +};static const VMStateDescription vmstate_pl181 = { .name ="pl181" ,
Signature · 1 line
2.26.2
PATCH v4 10/18 Move QOM typedefs and add missing includes (pass 3)
In reply to Eduardo HabkostSome typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with OBJECT_DECLARE_TYPE.
Patch generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]')
which will split "typdef struct { ... } TypedefName" declarations.
Followed by:
$ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \
$(git grep -l '' -- '*.[ch]')which will:
- move the typedefs and #defines above the type check macros
- add missing #include "qom/object.h" lines if necessary
---
Changes series v3 -> v4: this is a new patch added in series v4
The script was re-run after series rebase.
This is being submitted as a separate patch to make review easier, but it can be squashed into the previous patch once it gets reviewed.
---
Cc: Richard Henderson <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Sagar Karandikar <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: Raphael Norwitz <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- include/hw/arm/armsse.h | 11 +++++++---- include/hw/riscv/spike.h | 6 ++++-- include/hw/virtio/vhost-user-blk.h | 6 ++++-- hw/hppa/lasi.c | 6 ++++-- 4 files changed, 19 insertions(+), 10 deletions(-)
include/hw/arm/armsse.h +7 -4
@@ -105,8 +105,11 @@#include "hw/or-irq.h" #include "hw/core/split-irq.h" #include "hw/cpu/cluster.h" +#include "qom/object.h" #define TYPE_ARM_SSE "arm-sse" +typedef struct ARMSSE ARMSSE ; +typedef struct ARMSSEClass ARMSSEClass ;#define ARM_SSE (obj) OBJECT_CHECK(ARMSSE, (obj), TYPE_ARM_SSE)/*
@@ -140,7 +143,7 @@#define RAM3_PPU 6#define NUM_PPUS 7 -typedef struct ARMSSE { +struct ARMSSE {/*< private >*/ SysBusDevice parent_obj;
@@ -215,14 +218,14 @@ typedef struct ARMSSE {uint32_t init_svtor;bool cpu_fpu[SSE_MAX_CPUS ];bool cpu_dsp[SSE_MAX_CPUS ]; -}ARMSSE ; +};typedef struct ARMSSEInfo ARMSSEInfo ; -typedef struct ARMSSEClass { +struct ARMSSEClass {SysBusDeviceClass parent_class;const ARMSSEInfo *info; -}ARMSSEClass ; +};#define ARM_SSE_CLASS (klass) \ OBJECT_CLASS_CHECK(ARMSSEClass, (klass), TYPE_ARM_SSE)
include/hw/riscv/spike.h +4 -2
@@ -21,15 +21,17 @@#include "hw/riscv/riscv_hart.h" #include "hw/sysbus.h" +#include "qom/object.h" #define SPIKE_CPUS_MAX 8#define SPIKE_SOCKETS_MAX 8#define TYPE_SPIKE_MACHINE MACHINE_TYPE_NAME("spike") +typedef struct SpikeState SpikeState ;#define SPIKE_MACHINE (obj) \ OBJECT_CHECK(SpikeState, (obj), TYPE_SPIKE_MACHINE) -typedef struct { +struct SpikeState {/*< private >*/ MachineState parent;
@@ -37,7 +39,7 @@ typedef struct {RISCVHartArrayState soc[SPIKE_SOCKETS_MAX ];void *fdt;int fdt_size; -} SpikeState; +};enum {SPIKE_MROM ,
include/hw/virtio/vhost-user-blk.h +4 -2
@@ -20,14 +20,16 @@#include "chardev/char-fe.h" #include "hw/virtio/vhost.h" #include "hw/virtio/vhost-user.h" +#include "qom/object.h" #define TYPE_VHOST_USER_BLK "vhost-user-blk" +typedef struct VHostUserBlk VHostUserBlk ;#define VHOST_USER_BLK (obj) \ OBJECT_CHECK(VHostUserBlk, (obj), TYPE_VHOST_USER_BLK)#define VHOST_USER_BLK_AUTO_NUM_QUEUES UINT16_MAX -typedef struct VHostUserBlk { +struct VHostUserBlk {VirtIODevice parent_obj;CharBackend chardev;int32_t bootindex;
@@ -41,6 +43,6 @@ typedef struct VHostUserBlk {struct vhost_virtqueue *vhost_vqs;VirtQueue **virtqs; bool connected; -} VHostUserBlk; +};#endif
hw/hppa/lasi.c +4 -2
@@ -26,6 +26,7 @@#include "hw/input/lasips2.h" #include "exec/address-spaces.h" #include "migration/vmstate.h" +#include "qom/object.h" #define TYPE_LASI_CHIP "lasi-chip"
@@ -52,10 +53,11 @@#define ICR_BUS_ERROR_BIT LASI_BIT(8)/* bit 8 in ICR */ #define ICR_TOC_BIT LASI_BIT(1)/* bit 1 in ICR */ +typedef struct LasiState LasiState ;#define LASI_CHIP (obj) \ OBJECT_CHECK(LasiState, (obj), TYPE_LASI_CHIP) -typedef struct LasiState { +struct LasiState {PCIHostState parent_obj;uint32_t irr;
@@ -70,7 +72,7 @@ typedef struct LasiState {time_t rtc_ref;MemoryRegion this_mem; -} LasiState; +}; static bool lasi_chip_mem_valid(void *opaque, hwaddr addr, unsigned size, bool is_write,
Signature · 1 line
2.26.2