From 8063396bf3459a810d24e3efd6110b8480f0de5b Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Wed, 16 Sep 2020 14:25:19 -0400 Subject: Use OBJECT_DECLARE_SIMPLE_TYPE when possible This converts existing DECLARE_INSTANCE_CHECKER usage to OBJECT_DECLARE_SIMPLE_TYPE when possible. $ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]') Signed-off-by: Eduardo Habkost Acked-by: Paul Durrant Message-Id: <20200916182519.415636-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/acpi/generic_event_device.h | 4 +--- include/hw/acpi/vmgenid.h | 4 +--- include/hw/adc/stm32f2xx_adc.h | 4 +--- include/hw/arm/allwinner-a10.h | 4 +--- include/hw/arm/allwinner-h3.h | 4 +--- include/hw/arm/armv7m.h | 8 ++------ include/hw/arm/bcm2835_peripherals.h | 4 +--- include/hw/arm/digic.h | 4 +--- include/hw/arm/exynos4210.h | 4 +--- include/hw/arm/fsl-imx25.h | 4 +--- include/hw/arm/fsl-imx31.h | 4 +--- include/hw/arm/fsl-imx6.h | 4 +--- include/hw/arm/fsl-imx6ul.h | 4 +--- include/hw/arm/fsl-imx7.h | 4 +--- include/hw/arm/msf2-soc.h | 4 +--- include/hw/arm/nrf51_soc.h | 4 +--- include/hw/arm/omap.h | 4 +--- include/hw/arm/pxa.h | 15 ++++----------- include/hw/arm/stm32f205_soc.h | 4 +--- include/hw/arm/stm32f405_soc.h | 4 +--- include/hw/arm/xlnx-versal.h | 4 +--- include/hw/arm/xlnx-zynqmp.h | 4 +--- include/hw/block/flash.h | 8 ++------ include/hw/block/swim.h | 12 +++--------- include/hw/char/avr_usart.h | 4 +--- include/hw/char/bcm2835_aux.h | 4 +--- include/hw/char/cadence_uart.h | 4 +--- include/hw/char/cmsdk-apb-uart.h | 4 +--- include/hw/char/digic-uart.h | 4 +--- include/hw/char/escc.h | 4 +--- include/hw/char/ibex_uart.h | 4 +--- include/hw/char/imx_serial.h | 4 +--- include/hw/char/nrf51_uart.h | 4 +--- include/hw/char/pl011.h | 4 +--- include/hw/char/serial.h | 11 +++-------- include/hw/char/stm32f2xx_usart.h | 4 +--- include/hw/clock.h | 4 +--- include/hw/core/generic-loader.h | 4 +--- include/hw/core/split-irq.h | 4 +--- include/hw/cpu/a15mpcore.h | 4 +--- include/hw/cpu/a9mpcore.h | 4 +--- include/hw/cpu/arm11mpcore.h | 4 +--- include/hw/cpu/cluster.h | 4 +--- include/hw/cpu/core.h | 4 +--- include/hw/display/bcm2835_fb.h | 4 +--- include/hw/display/dpcd.h | 4 +--- include/hw/display/i2c-ddc.h | 4 +--- include/hw/display/macfb.h | 4 +--- include/hw/display/xlnx_dp.h | 4 +--- include/hw/dma/bcm2835_dma.h | 4 +--- include/hw/dma/i8257.h | 4 +--- include/hw/dma/pl080.h | 4 +--- include/hw/dma/xlnx-zdma.h | 4 +--- include/hw/dma/xlnx-zynq-devcfg.h | 4 +--- include/hw/dma/xlnx_dpdma.h | 4 +--- include/hw/gpio/bcm2835_gpio.h | 4 +--- include/hw/gpio/imx_gpio.h | 4 +--- include/hw/gpio/nrf51_gpio.h | 4 +--- include/hw/hyperv/vmbus-bridge.h | 4 +--- include/hw/hyperv/vmbus.h | 4 +--- include/hw/i2c/i2c.h | 3 +-- include/hw/i2c/imx_i2c.h | 4 +--- include/hw/i2c/microbit_i2c.h | 4 +--- include/hw/i2c/ppc4xx_i2c.h | 4 +--- include/hw/i386/ich9.h | 4 +--- include/hw/i386/intel_iommu.h | 4 +--- include/hw/ide/ahci.h | 12 +++--------- include/hw/ide/internal.h | 4 +--- include/hw/ide/pci.h | 4 +--- include/hw/input/adb.h | 4 +--- include/hw/input/i8042.h | 4 +--- include/hw/intc/allwinner-a10-pic.h | 4 +--- include/hw/intc/aspeed_vic.h | 4 +--- include/hw/intc/bcm2835_ic.h | 4 +--- include/hw/intc/bcm2836_control.h | 4 +--- include/hw/intc/heathrow_pic.h | 4 +--- include/hw/intc/ibex_plic.h | 4 +--- include/hw/intc/imx_avic.h | 4 +--- include/hw/intc/imx_gpcv2.h | 4 +--- include/hw/intc/mips_gic.h | 4 +--- include/hw/intc/realview_gic.h | 4 +--- include/hw/intc/rx_icu.h | 4 +--- include/hw/intc/xlnx-pmu-iomod-intc.h | 4 +--- include/hw/intc/xlnx-zynqmp-ipi.h | 4 +--- include/hw/ipack/ipack.h | 4 +--- include/hw/ipmi/ipmi.h | 4 +--- include/hw/isa/isa.h | 3 +-- include/hw/isa/pc87312.h | 4 +--- include/hw/m68k/mcf_fec.h | 4 +--- include/hw/mips/cps.h | 4 +--- include/hw/misc/a9scu.h | 4 +--- include/hw/misc/allwinner-cpucfg.h | 4 +--- include/hw/misc/allwinner-h3-ccu.h | 4 +--- include/hw/misc/allwinner-h3-dramc.h | 4 +--- include/hw/misc/allwinner-h3-sysctrl.h | 4 +--- include/hw/misc/allwinner-sid.h | 4 +--- include/hw/misc/arm11scu.h | 4 +--- include/hw/misc/armsse-cpuid.h | 4 +--- include/hw/misc/armsse-mhu.h | 4 +--- include/hw/misc/aspeed_xdma.h | 4 +--- include/hw/misc/auxbus.h | 11 +++-------- include/hw/misc/avr_power.h | 4 +--- include/hw/misc/bcm2835_mbox.h | 4 +--- include/hw/misc/bcm2835_mphi.h | 3 +-- include/hw/misc/bcm2835_property.h | 4 +--- include/hw/misc/bcm2835_rng.h | 4 +--- include/hw/misc/bcm2835_thermal.h | 4 +--- include/hw/misc/grlib_ahb_apb_pnp.h | 8 ++------ include/hw/misc/imx25_ccm.h | 4 +--- include/hw/misc/imx31_ccm.h | 4 +--- include/hw/misc/imx6_ccm.h | 4 +--- include/hw/misc/imx6_src.h | 4 +--- include/hw/misc/imx6ul_ccm.h | 4 +--- include/hw/misc/imx7_ccm.h | 8 ++------ include/hw/misc/imx7_gpr.h | 4 +--- include/hw/misc/imx7_snvs.h | 4 +--- include/hw/misc/imx_rngc.h | 4 +--- include/hw/misc/iotkit-secctl.h | 4 +--- include/hw/misc/iotkit-sysctl.h | 4 +--- include/hw/misc/iotkit-sysinfo.h | 4 +--- include/hw/misc/mac_via.h | 12 +++--------- include/hw/misc/macio/cuda.h | 8 ++------ include/hw/misc/macio/gpio.h | 4 +--- include/hw/misc/macio/macio.h | 20 +++++--------------- include/hw/misc/macio/pmu.h | 8 ++------ include/hw/misc/max111x.h | 4 +--- include/hw/misc/mips_cmgcr.h | 4 +--- include/hw/misc/mips_cpc.h | 4 +--- include/hw/misc/mips_itu.h | 4 +--- include/hw/misc/mps2-fpgaio.h | 4 +--- include/hw/misc/mps2-scc.h | 4 +--- include/hw/misc/msf2-sysreg.h | 4 +--- include/hw/misc/nrf51_rng.h | 4 +--- include/hw/misc/stm32f2xx_syscfg.h | 4 +--- include/hw/misc/stm32f4xx_exti.h | 4 +--- include/hw/misc/stm32f4xx_syscfg.h | 4 +--- include/hw/misc/tz-mpc.h | 4 +--- include/hw/misc/tz-msc.h | 4 +--- include/hw/misc/tz-ppc.h | 4 +--- include/hw/misc/unimp.h | 4 +--- include/hw/misc/zynq-xadc.h | 4 +--- include/hw/net/allwinner-sun8i-emac.h | 4 +--- include/hw/net/allwinner_emac.h | 4 +--- include/hw/net/cadence_gem.h | 4 +--- include/hw/net/ftgmac100.h | 8 ++------ include/hw/net/imx_fec.h | 4 +--- include/hw/net/msf2-emac.h | 4 +--- include/hw/nubus/mac-nubus-bridge.h | 4 +--- include/hw/nubus/nubus.h | 8 ++------ include/hw/nvram/fw_cfg.h | 9 +++------ include/hw/nvram/nrf51_nvm.h | 4 +--- include/hw/pci-bridge/simba.h | 4 +--- include/hw/pci-host/designware.h | 8 ++------ include/hw/pci-host/gpex.h | 8 ++------ include/hw/pci-host/i440fx.h | 4 +--- include/hw/pci-host/pnv_phb3.h | 7 ++----- include/hw/pci-host/pnv_phb4.h | 6 ++---- include/hw/pci-host/q35.h | 8 ++------ include/hw/pci-host/sabre.h | 8 ++------ include/hw/pci-host/spapr.h | 4 +--- include/hw/pci-host/uninorth.h | 4 +--- include/hw/pci-host/xilinx-pcie.h | 8 ++------ include/hw/pci/pci_bridge.h | 3 +-- include/hw/pci/pcie_host.h | 3 +-- include/hw/pci/pcie_port.h | 6 ++---- include/hw/platform-bus.h | 4 +--- include/hw/ppc/mac_dbdma.h | 3 +-- include/hw/ppc/openpic.h | 4 +--- include/hw/ppc/pnv_core.h | 4 +--- include/hw/ppc/pnv_pnor.h | 4 +--- include/hw/ppc/pnv_psi.h | 8 ++------ include/hw/ppc/spapr.h | 8 ++------ include/hw/ppc/spapr_tpm_proxy.h | 4 +--- include/hw/ppc/spapr_vio.h | 4 +--- include/hw/ppc/xive.h | 12 +++--------- include/hw/riscv/opentitan.h | 4 +--- include/hw/riscv/riscv_hart.h | 4 +--- include/hw/rtc/aspeed_rtc.h | 4 +--- include/hw/rtc/goldfish_rtc.h | 4 +--- include/hw/rtc/mc146818rtc.h | 4 +--- include/hw/rtc/pl031.h | 4 +--- include/hw/rtc/xlnx-zynqmp-rtc.h | 4 +--- include/hw/s390x/css-bridge.h | 8 ++------ include/hw/s390x/s390_flic.h | 4 +--- include/hw/s390x/vfio-ccw.h | 4 +--- include/hw/scsi/esp.h | 4 +--- include/hw/scsi/scsi.h | 3 +-- include/hw/sd/aspeed_sdhci.h | 4 +--- include/hw/sd/bcm2835_sdhost.h | 4 +--- include/hw/sparc/sparc32_dma.h | 16 ++++------------ include/hw/ssi/imx_spi.h | 4 +--- include/hw/ssi/mss-spi.h | 4 +--- include/hw/ssi/pl022.h | 4 +--- include/hw/ssi/stm32f2xx_spi.h | 4 +--- include/hw/ssi/xilinx_spips.h | 7 ++----- include/hw/timer/a9gtimer.h | 4 +--- include/hw/timer/allwinner-a10-pit.h | 4 +--- include/hw/timer/arm_mptimer.h | 4 +--- include/hw/timer/armv7m_systick.h | 4 +--- include/hw/timer/avr_timer16.h | 4 +--- include/hw/timer/bcm2835_systmr.h | 4 +--- include/hw/timer/cmsdk-apb-dualtimer.h | 4 +--- include/hw/timer/cmsdk-apb-timer.h | 4 +--- include/hw/timer/digic-timer.h | 4 +--- include/hw/timer/imx_epit.h | 4 +--- include/hw/timer/mss-timer.h | 4 +--- include/hw/timer/nrf51_timer.h | 4 +--- include/hw/usb.h | 4 +--- include/hw/usb/chipidea.h | 4 +--- include/hw/usb/imx-usb-phy.h | 4 +--- include/hw/virtio/vhost-scsi-common.h | 4 +--- include/hw/virtio/vhost-scsi.h | 4 +--- include/hw/virtio/vhost-user-blk.h | 4 +--- include/hw/virtio/vhost-user-fs.h | 4 +--- include/hw/virtio/vhost-user-scsi.h | 4 +--- include/hw/virtio/vhost-user-vsock.h | 4 +--- include/hw/virtio/vhost-vsock-common.h | 4 +--- include/hw/virtio/vhost-vsock.h | 4 +--- include/hw/virtio/virtio-balloon.h | 4 +--- include/hw/virtio/virtio-blk.h | 4 +--- include/hw/virtio/virtio-crypto.h | 4 +--- include/hw/virtio/virtio-gpu-pci.h | 4 +--- include/hw/virtio/virtio-gpu.h | 8 ++------ include/hw/virtio/virtio-input.h | 12 +++--------- include/hw/virtio/virtio-iommu.h | 4 +--- include/hw/virtio/virtio-mmio.h | 4 +--- include/hw/virtio/virtio-net.h | 4 +--- include/hw/virtio/virtio-rng.h | 4 +--- include/hw/virtio/virtio-scsi.h | 8 ++------ include/hw/virtio/virtio-serial.h | 7 ++----- include/hw/watchdog/cmsdk-apb-watchdog.h | 4 +--- include/hw/watchdog/wdt_imx2.h | 4 +--- include/hw/xen/xen-block.h | 8 ++------ 233 files changed, 283 insertions(+), 829 deletions(-) (limited to 'include/hw') diff --git a/include/hw/acpi/generic_event_device.h b/include/hw/acpi/generic_event_device.h index ac921e9f0c..6bed92e8fc 100644 --- a/include/hw/acpi/generic_event_device.h +++ b/include/hw/acpi/generic_event_device.h @@ -67,9 +67,7 @@ #define ACPI_POWER_BUTTON_DEVICE "PWRB" #define TYPE_ACPI_GED "acpi-ged" -typedef struct AcpiGedState AcpiGedState; -DECLARE_INSTANCE_CHECKER(AcpiGedState, ACPI_GED, - TYPE_ACPI_GED) +OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED) #define TYPE_ACPI_GED_X86 "acpi-ged-x86" #define ACPI_GED_X86(obj) \ diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h index aff574df5f..d50fbacb8e 100644 --- a/include/hw/acpi/vmgenid.h +++ b/include/hw/acpi/vmgenid.h @@ -16,9 +16,7 @@ * OVMF SDT Header Probe Supressor */ -typedef struct VmGenIdState VmGenIdState; -DECLARE_INSTANCE_CHECKER(VmGenIdState, VMGENID, - TYPE_VMGENID) +OBJECT_DECLARE_SIMPLE_TYPE(VmGenIdState, VMGENID) struct VmGenIdState { DeviceClass parent_obj; diff --git a/include/hw/adc/stm32f2xx_adc.h b/include/hw/adc/stm32f2xx_adc.h index 6a4f8e955b..42b48981f2 100644 --- a/include/hw/adc/stm32f2xx_adc.h +++ b/include/hw/adc/stm32f2xx_adc.h @@ -59,9 +59,7 @@ #define ADC_COMMON_ADDRESS 0x100 #define TYPE_STM32F2XX_ADC "stm32f2xx-adc" -typedef struct STM32F2XXADCState STM32F2XXADCState; -DECLARE_INSTANCE_CHECKER(STM32F2XXADCState, STM32F2XX_ADC, - TYPE_STM32F2XX_ADC) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F2XXADCState, STM32F2XX_ADC) struct STM32F2XXADCState { /* */ diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h index d13b6cf50f..a76dc7b84d 100644 --- a/include/hw/arm/allwinner-a10.h +++ b/include/hw/arm/allwinner-a10.h @@ -22,9 +22,7 @@ #define AW_A10_NUM_USB 2 #define TYPE_AW_A10 "allwinner-a10" -typedef struct AwA10State AwA10State; -DECLARE_INSTANCE_CHECKER(AwA10State, AW_A10, - TYPE_AW_A10) +OBJECT_DECLARE_SIMPLE_TYPE(AwA10State, AW_A10) struct AwA10State { /*< private >*/ diff --git a/include/hw/arm/allwinner-h3.h b/include/hw/arm/allwinner-h3.h index a93e019521..cc308a5d2c 100644 --- a/include/hw/arm/allwinner-h3.h +++ b/include/hw/arm/allwinner-h3.h @@ -106,9 +106,7 @@ enum { #define TYPE_AW_H3 "allwinner-h3" /** Convert input object to Allwinner H3 state object */ -typedef struct AwH3State AwH3State; -DECLARE_INSTANCE_CHECKER(AwH3State, AW_H3, - TYPE_AW_H3) +OBJECT_DECLARE_SIMPLE_TYPE(AwH3State, AW_H3) /** @} */ diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h index dcb891d9cc..0791dcb68a 100644 --- a/include/hw/arm/armv7m.h +++ b/include/hw/arm/armv7m.h @@ -16,9 +16,7 @@ #include "qom/object.h" #define TYPE_BITBAND "ARM,bitband-memory" -typedef struct BitBandState BitBandState; -DECLARE_INSTANCE_CHECKER(BitBandState, BITBAND, - TYPE_BITBAND) +OBJECT_DECLARE_SIMPLE_TYPE(BitBandState, BITBAND) struct BitBandState { /*< private >*/ @@ -32,9 +30,7 @@ struct BitBandState { }; #define TYPE_ARMV7M "armv7m" -typedef struct ARMv7MState ARMv7MState; -DECLARE_INSTANCE_CHECKER(ARMv7MState, ARMV7M, - TYPE_ARMV7M) +OBJECT_DECLARE_SIMPLE_TYPE(ARMv7MState, ARMV7M) #define ARMV7M_NUM_BITBANDS 2 diff --git a/include/hw/arm/bcm2835_peripherals.h b/include/hw/arm/bcm2835_peripherals.h index b4d3ae121a..13d7c4c553 100644 --- a/include/hw/arm/bcm2835_peripherals.h +++ b/include/hw/arm/bcm2835_peripherals.h @@ -32,9 +32,7 @@ #include "qom/object.h" #define TYPE_BCM2835_PERIPHERALS "bcm2835-peripherals" -typedef struct BCM2835PeripheralState BCM2835PeripheralState; -DECLARE_INSTANCE_CHECKER(BCM2835PeripheralState, BCM2835_PERIPHERALS, - TYPE_BCM2835_PERIPHERALS) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835PeripheralState, BCM2835_PERIPHERALS) struct BCM2835PeripheralState { /*< private >*/ diff --git a/include/hw/arm/digic.h b/include/hw/arm/digic.h index f3ba398914..8f2735c284 100644 --- a/include/hw/arm/digic.h +++ b/include/hw/arm/digic.h @@ -25,9 +25,7 @@ #define TYPE_DIGIC "digic" -typedef struct DigicState DigicState; -DECLARE_INSTANCE_CHECKER(DigicState, DIGIC, - TYPE_DIGIC) +OBJECT_DECLARE_SIMPLE_TYPE(DigicState, DIGIC) #define DIGIC4_NB_TIMERS 3 diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h index c2de1dc102..60b9e126f5 100644 --- a/include/hw/arm/exynos4210.h +++ b/include/hw/arm/exynos4210.h @@ -103,11 +103,9 @@ struct Exynos4210State { I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER]; qemu_or_irq pl330_irq_orgate[EXYNOS4210_NUM_DMA]; }; -typedef struct Exynos4210State Exynos4210State; #define TYPE_EXYNOS4210_SOC "exynos4210" -DECLARE_INSTANCE_CHECKER(Exynos4210State, EXYNOS4210_SOC, - TYPE_EXYNOS4210_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210State, EXYNOS4210_SOC) void exynos4210_write_secondary(ARMCPU *cpu, const struct arm_boot_info *info); diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h index e239505724..971f35dd16 100644 --- a/include/hw/arm/fsl-imx25.h +++ b/include/hw/arm/fsl-imx25.h @@ -35,9 +35,7 @@ #include "qom/object.h" #define TYPE_FSL_IMX25 "fsl,imx25" -typedef struct FslIMX25State FslIMX25State; -DECLARE_INSTANCE_CHECKER(FslIMX25State, FSL_IMX25, - TYPE_FSL_IMX25) +OBJECT_DECLARE_SIMPLE_TYPE(FslIMX25State, FSL_IMX25) #define FSL_IMX25_NUM_UARTS 5 #define FSL_IMX25_NUM_GPTS 4 diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h index 64b4ca07b7..b9792d58ae 100644 --- a/include/hw/arm/fsl-imx31.h +++ b/include/hw/arm/fsl-imx31.h @@ -31,9 +31,7 @@ #include "qom/object.h" #define TYPE_FSL_IMX31 "fsl,imx31" -typedef struct FslIMX31State FslIMX31State; -DECLARE_INSTANCE_CHECKER(FslIMX31State, FSL_IMX31, - TYPE_FSL_IMX31) +OBJECT_DECLARE_SIMPLE_TYPE(FslIMX31State, FSL_IMX31) #define FSL_IMX31_NUM_UARTS 2 #define FSL_IMX31_NUM_EPITS 2 diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h index 602b9aff36..29cc425acc 100644 --- a/include/hw/arm/fsl-imx6.h +++ b/include/hw/arm/fsl-imx6.h @@ -37,9 +37,7 @@ #include "qom/object.h" #define TYPE_FSL_IMX6 "fsl,imx6" -typedef struct FslIMX6State FslIMX6State; -DECLARE_INSTANCE_CHECKER(FslIMX6State, FSL_IMX6, - TYPE_FSL_IMX6) +OBJECT_DECLARE_SIMPLE_TYPE(FslIMX6State, FSL_IMX6) #define FSL_IMX6_NUM_CPUS 4 #define FSL_IMX6_NUM_UARTS 5 diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h index e4862fdb2c..f8ebfba4f9 100644 --- a/include/hw/arm/fsl-imx6ul.h +++ b/include/hw/arm/fsl-imx6ul.h @@ -41,9 +41,7 @@ #include "qom/object.h" #define TYPE_FSL_IMX6UL "fsl,imx6ul" -typedef struct FslIMX6ULState FslIMX6ULState; -DECLARE_INSTANCE_CHECKER(FslIMX6ULState, FSL_IMX6UL, - TYPE_FSL_IMX6UL) +OBJECT_DECLARE_SIMPLE_TYPE(FslIMX6ULState, FSL_IMX6UL) enum FslIMX6ULConfiguration { FSL_IMX6UL_NUM_CPUS = 1, diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index 434d1d0641..161fdc36da 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -42,9 +42,7 @@ #include "qom/object.h" #define TYPE_FSL_IMX7 "fsl,imx7" -typedef struct FslIMX7State FslIMX7State; -DECLARE_INSTANCE_CHECKER(FslIMX7State, FSL_IMX7, - TYPE_FSL_IMX7) +OBJECT_DECLARE_SIMPLE_TYPE(FslIMX7State, FSL_IMX7) enum FslIMX7Configuration { FSL_IMX7_NUM_CPUS = 2, diff --git a/include/hw/arm/msf2-soc.h b/include/hw/arm/msf2-soc.h index 9b93d0d64e..d406184685 100644 --- a/include/hw/arm/msf2-soc.h +++ b/include/hw/arm/msf2-soc.h @@ -33,9 +33,7 @@ #include "qom/object.h" #define TYPE_MSF2_SOC "msf2-soc" -typedef struct MSF2State MSF2State; -DECLARE_INSTANCE_CHECKER(MSF2State, MSF2_SOC, - TYPE_MSF2_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(MSF2State, MSF2_SOC) #define MSF2_NUM_SPIS 2 #define MSF2_NUM_UARTS 2 diff --git a/include/hw/arm/nrf51_soc.h b/include/hw/arm/nrf51_soc.h index b69492b29d..f8a6725b77 100644 --- a/include/hw/arm/nrf51_soc.h +++ b/include/hw/arm/nrf51_soc.h @@ -20,9 +20,7 @@ #include "qom/object.h" #define TYPE_NRF51_SOC "nrf51-soc" -typedef struct NRF51State NRF51State; -DECLARE_INSTANCE_CHECKER(NRF51State, NRF51_SOC, - TYPE_NRF51_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51State, NRF51_SOC) #define NRF51_NUM_TIMERS 3 diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 0dbf1712f4..ff6a173f8a 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -94,9 +94,7 @@ 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; -DECLARE_INSTANCE_CHECKER(OMAPI2CState, OMAP_I2C, - TYPE_OMAP_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(OMAPI2CState, OMAP_I2C) /* TODO: clock framework (see above) */ diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index 9046876134..1095504b86 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -88,9 +88,7 @@ void pxa2xx_lcd_vsync_notifier(PXA2xxLCDState *s, qemu_irq handler); /* pxa2xx_mmci.c */ #define TYPE_PXA2XX_MMCI "pxa2xx-mmci" -typedef struct PXA2xxMMCIState PXA2xxMMCIState; -DECLARE_INSTANCE_CHECKER(PXA2xxMMCIState, PXA2XX_MMCI, - TYPE_PXA2XX_MMCI) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxMMCIState, PXA2XX_MMCI) PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, hwaddr base, @@ -100,9 +98,7 @@ void pxa2xx_mmci_handlers(PXA2xxMMCIState *s, qemu_irq readonly, /* pxa2xx_pcmcia.c */ #define TYPE_PXA2XX_PCMCIA "pxa2xx-pcmcia" -typedef struct PXA2xxPCMCIAState PXA2xxPCMCIAState; -DECLARE_INSTANCE_CHECKER(PXA2xxPCMCIAState, PXA2XX_PCMCIA, - TYPE_PXA2XX_PCMCIA) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxPCMCIAState, PXA2XX_PCMCIA) PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, hwaddr base); @@ -130,13 +126,10 @@ I2CBus *pxa2xx_i2c_bus(PXA2xxI2CState *s); #define TYPE_PXA2XX_I2C "pxa2xx_i2c" typedef struct PXA2xxI2SState PXA2xxI2SState; -DECLARE_INSTANCE_CHECKER(PXA2xxI2CState, PXA2XX_I2C, - TYPE_PXA2XX_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxI2CState, PXA2XX_I2C) #define TYPE_PXA2XX_FIR "pxa2xx-fir" -typedef struct PXA2xxFIrState PXA2xxFIrState; -DECLARE_INSTANCE_CHECKER(PXA2xxFIrState, PXA2XX_FIR, - TYPE_PXA2XX_FIR) +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxFIrState, PXA2XX_FIR) typedef struct { ARMCPU *cpu; diff --git a/include/hw/arm/stm32f205_soc.h b/include/hw/arm/stm32f205_soc.h index 9c2f4818a6..985ff63aa9 100644 --- a/include/hw/arm/stm32f205_soc.h +++ b/include/hw/arm/stm32f205_soc.h @@ -35,9 +35,7 @@ #include "qom/object.h" #define TYPE_STM32F205_SOC "stm32f205-soc" -typedef struct STM32F205State STM32F205State; -DECLARE_INSTANCE_CHECKER(STM32F205State, STM32F205_SOC, - TYPE_STM32F205_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F205State, STM32F205_SOC) #define STM_NUM_USARTS 6 #define STM_NUM_TIMERS 4 diff --git a/include/hw/arm/stm32f405_soc.h b/include/hw/arm/stm32f405_soc.h index f1a22763f4..347105e709 100644 --- a/include/hw/arm/stm32f405_soc.h +++ b/include/hw/arm/stm32f405_soc.h @@ -36,9 +36,7 @@ #include "qom/object.h" #define TYPE_STM32F405_SOC "stm32f405-soc" -typedef struct STM32F405State STM32F405State; -DECLARE_INSTANCE_CHECKER(STM32F405State, STM32F405_SOC, - TYPE_STM32F405_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F405State, STM32F405_SOC) #define STM_NUM_USARTS 7 #define STM_NUM_TIMERS 4 diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h index eaa9023fd6..8ce8e63b56 100644 --- a/include/hw/arm/xlnx-versal.h +++ b/include/hw/arm/xlnx-versal.h @@ -23,9 +23,7 @@ #include "qom/object.h" #define TYPE_XLNX_VERSAL "xlnx-versal" -typedef struct Versal Versal; -DECLARE_INSTANCE_CHECKER(Versal, XLNX_VERSAL, - TYPE_XLNX_VERSAL) +OBJECT_DECLARE_SIMPLE_TYPE(Versal, XLNX_VERSAL) #define XLNX_VERSAL_NR_ACPUS 2 #define XLNX_VERSAL_NR_UARTS 2 diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h index 4cc97b4610..567d0dba09 100644 --- a/include/hw/arm/xlnx-zynqmp.h +++ b/include/hw/arm/xlnx-zynqmp.h @@ -35,9 +35,7 @@ #include "qom/object.h" #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp" -typedef struct XlnxZynqMPState XlnxZynqMPState; -DECLARE_INSTANCE_CHECKER(XlnxZynqMPState, XLNX_ZYNQMP, - TYPE_XLNX_ZYNQMP) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPState, XLNX_ZYNQMP) #define XLNX_ZYNQMP_NUM_APU_CPUS 4 #define XLNX_ZYNQMP_NUM_RPU_CPUS 2 diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h index 3e26303705..7dde0adcee 100644 --- a/include/hw/block/flash.h +++ b/include/hw/block/flash.h @@ -9,9 +9,7 @@ /* pflash_cfi01.c */ #define TYPE_PFLASH_CFI01 "cfi.pflash01" -typedef struct PFlashCFI01 PFlashCFI01; -DECLARE_INSTANCE_CHECKER(PFlashCFI01, PFLASH_CFI01, - TYPE_PFLASH_CFI01) +OBJECT_DECLARE_SIMPLE_TYPE(PFlashCFI01, PFLASH_CFI01) PFlashCFI01 *pflash_cfi01_register(hwaddr base, @@ -30,9 +28,7 @@ void pflash_cfi01_legacy_drive(PFlashCFI01 *dev, DriveInfo *dinfo); /* pflash_cfi02.c */ #define TYPE_PFLASH_CFI02 "cfi.pflash02" -typedef struct PFlashCFI02 PFlashCFI02; -DECLARE_INSTANCE_CHECKER(PFlashCFI02, PFLASH_CFI02, - TYPE_PFLASH_CFI02) +OBJECT_DECLARE_SIMPLE_TYPE(PFlashCFI02, PFLASH_CFI02) PFlashCFI02 *pflash_cfi02_register(hwaddr base, diff --git a/include/hw/block/swim.h b/include/hw/block/swim.h index 8287da7c30..5a49029543 100644 --- a/include/hw/block/swim.h +++ b/include/hw/block/swim.h @@ -17,13 +17,10 @@ #define SWIM_MAX_FD 2 -typedef struct SWIMDrive SWIMDrive; -typedef struct SWIMBus SWIMBus; typedef struct SWIMCtrl SWIMCtrl; #define TYPE_SWIM_DRIVE "swim-drive" -DECLARE_INSTANCE_CHECKER(SWIMDrive, SWIM_DRIVE, - TYPE_SWIM_DRIVE) +OBJECT_DECLARE_SIMPLE_TYPE(SWIMDrive, SWIM_DRIVE) struct SWIMDrive { DeviceState qdev; @@ -32,8 +29,7 @@ struct SWIMDrive { }; #define TYPE_SWIM_BUS "swim-bus" -DECLARE_INSTANCE_CHECKER(SWIMBus, SWIM_BUS, - TYPE_SWIM_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(SWIMBus, SWIM_BUS) struct SWIMBus { BusState bus; @@ -70,9 +66,7 @@ struct SWIMCtrl { }; #define TYPE_SWIM "swim" -typedef struct Swim Swim; -DECLARE_INSTANCE_CHECKER(Swim, SWIM, - TYPE_SWIM) +OBJECT_DECLARE_SIMPLE_TYPE(Swim, SWIM) struct Swim { SysBusDevice parent_obj; diff --git a/include/hw/char/avr_usart.h b/include/hw/char/avr_usart.h index 5202f152b0..bb57532403 100644 --- a/include/hw/char/avr_usart.h +++ b/include/hw/char/avr_usart.h @@ -58,9 +58,7 @@ #define USART_CSRC_CSZ0 (1 << 1) #define TYPE_AVR_USART "avr-usart" -typedef struct AVRUsartState AVRUsartState; -DECLARE_INSTANCE_CHECKER(AVRUsartState, AVR_USART, - TYPE_AVR_USART) +OBJECT_DECLARE_SIMPLE_TYPE(AVRUsartState, AVR_USART) struct AVRUsartState { /* */ diff --git a/include/hw/char/bcm2835_aux.h b/include/hw/char/bcm2835_aux.h index a08795c47f..9e081793a0 100644 --- a/include/hw/char/bcm2835_aux.h +++ b/include/hw/char/bcm2835_aux.h @@ -14,9 +14,7 @@ #include "qom/object.h" #define TYPE_BCM2835_AUX "bcm2835-aux" -typedef struct BCM2835AuxState BCM2835AuxState; -DECLARE_INSTANCE_CHECKER(BCM2835AuxState, BCM2835_AUX, - TYPE_BCM2835_AUX) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835AuxState, BCM2835_AUX) #define BCM2835_AUX_RX_FIFO_LEN 8 diff --git a/include/hw/char/cadence_uart.h b/include/hw/char/cadence_uart.h index 1734f53541..e7f7cd8468 100644 --- a/include/hw/char/cadence_uart.h +++ b/include/hw/char/cadence_uart.h @@ -32,9 +32,7 @@ #define CADENCE_UART_R_MAX (0x48/4) #define TYPE_CADENCE_UART "cadence_uart" -typedef struct CadenceUARTState CadenceUARTState; -DECLARE_INSTANCE_CHECKER(CadenceUARTState, CADENCE_UART, - TYPE_CADENCE_UART) +OBJECT_DECLARE_SIMPLE_TYPE(CadenceUARTState, CADENCE_UART) struct CadenceUARTState { /*< private >*/ diff --git a/include/hw/char/cmsdk-apb-uart.h b/include/hw/char/cmsdk-apb-uart.h index 2c3869aa16..9daff0eeee 100644 --- a/include/hw/char/cmsdk-apb-uart.h +++ b/include/hw/char/cmsdk-apb-uart.h @@ -18,9 +18,7 @@ #include "qom/object.h" #define TYPE_CMSDK_APB_UART "cmsdk-apb-uart" -typedef struct CMSDKAPBUART CMSDKAPBUART; -DECLARE_INSTANCE_CHECKER(CMSDKAPBUART, CMSDK_APB_UART, - TYPE_CMSDK_APB_UART) +OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBUART, CMSDK_APB_UART) struct CMSDKAPBUART { /*< private >*/ diff --git a/include/hw/char/digic-uart.h b/include/hw/char/digic-uart.h index 01d406833d..f710a1a099 100644 --- a/include/hw/char/digic-uart.h +++ b/include/hw/char/digic-uart.h @@ -23,9 +23,7 @@ #include "qom/object.h" #define TYPE_DIGIC_UART "digic-uart" -typedef struct DigicUartState DigicUartState; -DECLARE_INSTANCE_CHECKER(DigicUartState, DIGIC_UART, - TYPE_DIGIC_UART) +OBJECT_DECLARE_SIMPLE_TYPE(DigicUartState, DIGIC_UART) enum { R_TX = 0x00, diff --git a/include/hw/char/escc.h b/include/hw/char/escc.h index 5eaec507da..7e9482dee2 100644 --- a/include/hw/char/escc.h +++ b/include/hw/char/escc.h @@ -11,9 +11,7 @@ #define TYPE_ESCC "escc" #define ESCC_SIZE 4 -typedef struct ESCCState ESCCState; -DECLARE_INSTANCE_CHECKER(ESCCState, ESCC, - TYPE_ESCC) +OBJECT_DECLARE_SIMPLE_TYPE(ESCCState, ESCC) typedef enum { escc_chn_a, escc_chn_b, diff --git a/include/hw/char/ibex_uart.h b/include/hw/char/ibex_uart.h index 36eb75fc4c..03d19e3f6f 100644 --- a/include/hw/char/ibex_uart.h +++ b/include/hw/char/ibex_uart.h @@ -70,9 +70,7 @@ REG32(TIMEOUT_CTRL, 0x2c) #define IBEX_UART_CLOCK 50000000 /* 50MHz clock */ #define TYPE_IBEX_UART "ibex-uart" -typedef struct IbexUartState IbexUartState; -DECLARE_INSTANCE_CHECKER(IbexUartState, IBEX_UART, - TYPE_IBEX_UART) +OBJECT_DECLARE_SIMPLE_TYPE(IbexUartState, IBEX_UART) struct IbexUartState { /* */ diff --git a/include/hw/char/imx_serial.h b/include/hw/char/imx_serial.h index 200f1ec33a..91c9894ad5 100644 --- a/include/hw/char/imx_serial.h +++ b/include/hw/char/imx_serial.h @@ -23,9 +23,7 @@ #include "qom/object.h" #define TYPE_IMX_SERIAL "imx.serial" -typedef struct IMXSerialState IMXSerialState; -DECLARE_INSTANCE_CHECKER(IMXSerialState, IMX_SERIAL, - TYPE_IMX_SERIAL) +OBJECT_DECLARE_SIMPLE_TYPE(IMXSerialState, IMX_SERIAL) #define URXD_CHARRDY (1<<15) /* character read is valid */ #define URXD_ERR (1<<14) /* Character has error */ diff --git a/include/hw/char/nrf51_uart.h b/include/hw/char/nrf51_uart.h index 0cf3c4e328..561b6383c4 100644 --- a/include/hw/char/nrf51_uart.h +++ b/include/hw/char/nrf51_uart.h @@ -20,9 +20,7 @@ #define UART_SIZE 0x1000 #define TYPE_NRF51_UART "nrf51_soc.uart" -typedef struct NRF51UARTState NRF51UARTState; -DECLARE_INSTANCE_CHECKER(NRF51UARTState, NRF51_UART, - TYPE_NRF51_UART) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51UARTState, NRF51_UART) REG32(UART_STARTRX, 0x000) REG32(UART_STOPRX, 0x004) diff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h index 80de4ecde6..a91ea50e11 100644 --- a/include/hw/char/pl011.h +++ b/include/hw/char/pl011.h @@ -22,9 +22,7 @@ #include "qom/object.h" #define TYPE_PL011 "pl011" -typedef struct PL011State PL011State; -DECLARE_INSTANCE_CHECKER(PL011State, PL011, - TYPE_PL011) +OBJECT_DECLARE_SIMPLE_TYPE(PL011State, PL011) /* This shares the same struct (and cast macro) as the base pl011 device */ #define TYPE_PL011_LUMINARY "pl011_luminary" diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index 264f529a7f..db4f9af18c 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -89,14 +89,12 @@ struct SerialMM { uint8_t regshift; uint8_t endianness; }; -typedef struct SerialMM SerialMM; struct SerialIO { SysBusDevice parent; SerialState serial; }; -typedef struct SerialIO SerialIO; extern const VMStateDescription vmstate_serial; extern const MemoryRegionOps serial_io_ops; @@ -104,16 +102,13 @@ extern const MemoryRegionOps serial_io_ops; void serial_set_frequency(SerialState *s, uint32_t frequency); #define TYPE_SERIAL "serial" -DECLARE_INSTANCE_CHECKER(SerialState, SERIAL, - TYPE_SERIAL) +OBJECT_DECLARE_SIMPLE_TYPE(SerialState, SERIAL) #define TYPE_SERIAL_MM "serial-mm" -DECLARE_INSTANCE_CHECKER(SerialMM, SERIAL_MM, - TYPE_SERIAL_MM) +OBJECT_DECLARE_SIMPLE_TYPE(SerialMM, SERIAL_MM) #define TYPE_SERIAL_IO "serial-io" -DECLARE_INSTANCE_CHECKER(SerialIO, SERIAL_IO, - TYPE_SERIAL_IO) +OBJECT_DECLARE_SIMPLE_TYPE(SerialIO, SERIAL_IO) SerialMM *serial_mm_init(MemoryRegion *address_space, hwaddr base, int regshift, diff --git a/include/hw/char/stm32f2xx_usart.h b/include/hw/char/stm32f2xx_usart.h index 1670c076d4..65bcc85470 100644 --- a/include/hw/char/stm32f2xx_usart.h +++ b/include/hw/char/stm32f2xx_usart.h @@ -54,9 +54,7 @@ #define USART_CR1_RE (1 << 2) #define TYPE_STM32F2XX_USART "stm32f2xx-usart" -typedef struct STM32F2XXUsartState STM32F2XXUsartState; -DECLARE_INSTANCE_CHECKER(STM32F2XXUsartState, STM32F2XX_USART, - TYPE_STM32F2XX_USART) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F2XXUsartState, STM32F2XX_USART) struct STM32F2XXUsartState { /* */ diff --git a/include/hw/clock.h b/include/hw/clock.h index b524509b47..d357594df9 100644 --- a/include/hw/clock.h +++ b/include/hw/clock.h @@ -18,9 +18,7 @@ #include "qemu/queue.h" #define TYPE_CLOCK "clock" -typedef struct Clock Clock; -DECLARE_INSTANCE_CHECKER(Clock, CLOCK, - TYPE_CLOCK) +OBJECT_DECLARE_SIMPLE_TYPE(Clock, CLOCK) typedef void ClockCallback(void *opaque); diff --git a/include/hw/core/generic-loader.h b/include/hw/core/generic-loader.h index 8e86532df6..19d87b39c8 100644 --- a/include/hw/core/generic-loader.h +++ b/include/hw/core/generic-loader.h @@ -40,10 +40,8 @@ struct GenericLoaderState { bool data_be; bool set_pc; }; -typedef struct GenericLoaderState GenericLoaderState; #define TYPE_GENERIC_LOADER "loader" -DECLARE_INSTANCE_CHECKER(GenericLoaderState, GENERIC_LOADER, - TYPE_GENERIC_LOADER) +OBJECT_DECLARE_SIMPLE_TYPE(GenericLoaderState, GENERIC_LOADER) #endif diff --git a/include/hw/core/split-irq.h b/include/hw/core/split-irq.h index 76d42b29aa..ff8852f407 100644 --- a/include/hw/core/split-irq.h +++ b/include/hw/core/split-irq.h @@ -42,10 +42,8 @@ #define MAX_SPLIT_LINES 16 -typedef struct SplitIRQ SplitIRQ; -DECLARE_INSTANCE_CHECKER(SplitIRQ, SPLIT_IRQ, - TYPE_SPLIT_IRQ) +OBJECT_DECLARE_SIMPLE_TYPE(SplitIRQ, SPLIT_IRQ) struct SplitIRQ { DeviceState parent_obj; diff --git a/include/hw/cpu/a15mpcore.h b/include/hw/cpu/a15mpcore.h index 58d8ac7415..75d39e5458 100644 --- a/include/hw/cpu/a15mpcore.h +++ b/include/hw/cpu/a15mpcore.h @@ -27,9 +27,7 @@ /* A15MP private memory region. */ #define TYPE_A15MPCORE_PRIV "a15mpcore_priv" -typedef struct A15MPPrivState A15MPPrivState; -DECLARE_INSTANCE_CHECKER(A15MPPrivState, A15MPCORE_PRIV, - TYPE_A15MPCORE_PRIV) +OBJECT_DECLARE_SIMPLE_TYPE(A15MPPrivState, A15MPCORE_PRIV) struct A15MPPrivState { /*< private >*/ diff --git a/include/hw/cpu/a9mpcore.h b/include/hw/cpu/a9mpcore.h index 37e5cfce08..e0396ab6af 100644 --- a/include/hw/cpu/a9mpcore.h +++ b/include/hw/cpu/a9mpcore.h @@ -18,9 +18,7 @@ #include "qom/object.h" #define TYPE_A9MPCORE_PRIV "a9mpcore_priv" -typedef struct A9MPPrivState A9MPPrivState; -DECLARE_INSTANCE_CHECKER(A9MPPrivState, A9MPCORE_PRIV, - TYPE_A9MPCORE_PRIV) +OBJECT_DECLARE_SIMPLE_TYPE(A9MPPrivState, A9MPCORE_PRIV) struct A9MPPrivState { /*< private >*/ diff --git a/include/hw/cpu/arm11mpcore.h b/include/hw/cpu/arm11mpcore.h index 411d7e6659..2cac8c1232 100644 --- a/include/hw/cpu/arm11mpcore.h +++ b/include/hw/cpu/arm11mpcore.h @@ -17,9 +17,7 @@ #include "qom/object.h" #define TYPE_ARM11MPCORE_PRIV "arm11mpcore_priv" -typedef struct ARM11MPCorePriveState ARM11MPCorePriveState; -DECLARE_INSTANCE_CHECKER(ARM11MPCorePriveState, ARM11MPCORE_PRIV, - TYPE_ARM11MPCORE_PRIV) +OBJECT_DECLARE_SIMPLE_TYPE(ARM11MPCorePriveState, ARM11MPCORE_PRIV) struct ARM11MPCorePriveState { SysBusDevice parent_obj; diff --git a/include/hw/cpu/cluster.h b/include/hw/cpu/cluster.h index 1c807c5902..53fbf36af5 100644 --- a/include/hw/cpu/cluster.h +++ b/include/hw/cpu/cluster.h @@ -55,9 +55,7 @@ */ #define TYPE_CPU_CLUSTER "cpu-cluster" -typedef struct CPUClusterState CPUClusterState; -DECLARE_INSTANCE_CHECKER(CPUClusterState, CPU_CLUSTER, - TYPE_CPU_CLUSTER) +OBJECT_DECLARE_SIMPLE_TYPE(CPUClusterState, CPU_CLUSTER) /* * This limit is imposed by TCG, which puts the cluster ID into an diff --git a/include/hw/cpu/core.h b/include/hw/cpu/core.h index 61ea3481f8..98ab91647e 100644 --- a/include/hw/cpu/core.h +++ b/include/hw/cpu/core.h @@ -14,9 +14,7 @@ #define TYPE_CPU_CORE "cpu-core" -typedef struct CPUCore CPUCore; -DECLARE_INSTANCE_CHECKER(CPUCore, CPU_CORE, - TYPE_CPU_CORE) +OBJECT_DECLARE_SIMPLE_TYPE(CPUCore, CPU_CORE) struct CPUCore { /*< private >*/ diff --git a/include/hw/display/bcm2835_fb.h b/include/hw/display/bcm2835_fb.h index 226d77a264..38671afffd 100644 --- a/include/hw/display/bcm2835_fb.h +++ b/include/hw/display/bcm2835_fb.h @@ -17,9 +17,7 @@ #include "qom/object.h" #define TYPE_BCM2835_FB "bcm2835-fb" -typedef struct BCM2835FBState BCM2835FBState; -DECLARE_INSTANCE_CHECKER(BCM2835FBState, BCM2835_FB, - TYPE_BCM2835_FB) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835FBState, BCM2835_FB) /* * Configuration information about the fb which the guest can program diff --git a/include/hw/display/dpcd.h b/include/hw/display/dpcd.h index 09304dd1f6..a4e37abf6f 100644 --- a/include/hw/display/dpcd.h +++ b/include/hw/display/dpcd.h @@ -26,11 +26,9 @@ #define DPCD_H #include "qom/object.h" -typedef struct DPCDState DPCDState; #define TYPE_DPCD "dpcd" -DECLARE_INSTANCE_CHECKER(DPCDState, DPCD, - TYPE_DPCD) +OBJECT_DECLARE_SIMPLE_TYPE(DPCDState, DPCD) /* DCPD Revision. */ #define DPCD_REVISION 0x00 diff --git a/include/hw/display/i2c-ddc.h b/include/hw/display/i2c-ddc.h index fbabfea5a9..94b5880587 100644 --- a/include/hw/display/i2c-ddc.h +++ b/include/hw/display/i2c-ddc.h @@ -34,10 +34,8 @@ struct I2CDDCState { uint8_t edid_blob[128]; }; -typedef struct I2CDDCState I2CDDCState; #define TYPE_I2CDDC "i2c-ddc" -DECLARE_INSTANCE_CHECKER(I2CDDCState, I2CDDC, - TYPE_I2CDDC) +OBJECT_DECLARE_SIMPLE_TYPE(I2CDDCState, I2CDDC) #endif /* I2C_DDC_H */ diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h index 4adfaa725a..c133fa271e 100644 --- a/include/hw/display/macfb.h +++ b/include/hw/display/macfb.h @@ -32,9 +32,7 @@ typedef struct MacfbState { } MacfbState; #define TYPE_MACFB "sysbus-macfb" -typedef struct MacfbSysBusState MacfbSysBusState; -DECLARE_INSTANCE_CHECKER(MacfbSysBusState, MACFB, - TYPE_MACFB) +OBJECT_DECLARE_SIMPLE_TYPE(MacfbSysBusState, MACFB) struct MacfbSysBusState { SysBusDevice busdev; diff --git a/include/hw/display/xlnx_dp.h b/include/hw/display/xlnx_dp.h index 3b7d9e5a2a..8ab4733bb8 100644 --- a/include/hw/display/xlnx_dp.h +++ b/include/hw/display/xlnx_dp.h @@ -103,10 +103,8 @@ struct XlnxDPState { DPCDState *dpcd; I2CDDCState *edid; }; -typedef struct XlnxDPState XlnxDPState; #define TYPE_XLNX_DP "xlnx.v-dp" -DECLARE_INSTANCE_CHECKER(XlnxDPState, XLNX_DP, - TYPE_XLNX_DP) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxDPState, XLNX_DP) #endif diff --git a/include/hw/dma/bcm2835_dma.h b/include/hw/dma/bcm2835_dma.h index b94dae779a..1d26b1d8d0 100644 --- a/include/hw/dma/bcm2835_dma.h +++ b/include/hw/dma/bcm2835_dma.h @@ -26,9 +26,7 @@ typedef struct { } BCM2835DMAChan; #define TYPE_BCM2835_DMA "bcm2835-dma" -typedef struct BCM2835DMAState BCM2835DMAState; -DECLARE_INSTANCE_CHECKER(BCM2835DMAState, BCM2835_DMA, - TYPE_BCM2835_DMA) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835DMAState, BCM2835_DMA) #define BCM2835_DMA_NCHANS 16 diff --git a/include/hw/dma/i8257.h b/include/hw/dma/i8257.h index 362ce7b8dc..f652345d65 100644 --- a/include/hw/dma/i8257.h +++ b/include/hw/dma/i8257.h @@ -6,9 +6,7 @@ #include "qom/object.h" #define TYPE_I8257 "i8257" -typedef struct I8257State I8257State; -DECLARE_INSTANCE_CHECKER(I8257State, I8257, - TYPE_I8257) +OBJECT_DECLARE_SIMPLE_TYPE(I8257State, I8257) typedef struct I8257Regs { int now[2]; diff --git a/include/hw/dma/pl080.h b/include/hw/dma/pl080.h index e9669bf5ae..1883f04270 100644 --- a/include/hw/dma/pl080.h +++ b/include/hw/dma/pl080.h @@ -43,9 +43,7 @@ typedef struct { #define TYPE_PL080 "pl080" #define TYPE_PL081 "pl081" -typedef struct PL080State PL080State; -DECLARE_INSTANCE_CHECKER(PL080State, PL080, - TYPE_PL080) +OBJECT_DECLARE_SIMPLE_TYPE(PL080State, PL080) struct PL080State { SysBusDevice parent_obj; diff --git a/include/hw/dma/xlnx-zdma.h b/include/hw/dma/xlnx-zdma.h index f638abe568..6602e7ffa7 100644 --- a/include/hw/dma/xlnx-zdma.h +++ b/include/hw/dma/xlnx-zdma.h @@ -76,11 +76,9 @@ struct XlnxZDMA { to model write only mode. */ uint8_t buf[2048]; }; -typedef struct XlnxZDMA XlnxZDMA; #define TYPE_XLNX_ZDMA "xlnx.zdma" -DECLARE_INSTANCE_CHECKER(XlnxZDMA, XLNX_ZDMA, - TYPE_XLNX_ZDMA) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZDMA, XLNX_ZDMA) #endif /* XLNX_ZDMA_H */ diff --git a/include/hw/dma/xlnx-zynq-devcfg.h b/include/hw/dma/xlnx-zynq-devcfg.h index e16b08f9c5..e4cf085d70 100644 --- a/include/hw/dma/xlnx-zynq-devcfg.h +++ b/include/hw/dma/xlnx-zynq-devcfg.h @@ -33,9 +33,7 @@ #define TYPE_XLNX_ZYNQ_DEVCFG "xlnx.ps7-dev-cfg" -typedef struct XlnxZynqDevcfg XlnxZynqDevcfg; -DECLARE_INSTANCE_CHECKER(XlnxZynqDevcfg, XLNX_ZYNQ_DEVCFG, - TYPE_XLNX_ZYNQ_DEVCFG) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqDevcfg, XLNX_ZYNQ_DEVCFG) #define XLNX_ZYNQ_DEVCFG_R_MAX (0x100 / 4) diff --git a/include/hw/dma/xlnx_dpdma.h b/include/hw/dma/xlnx_dpdma.h index 94b01cad0a..40537a848b 100644 --- a/include/hw/dma/xlnx_dpdma.h +++ b/include/hw/dma/xlnx_dpdma.h @@ -43,11 +43,9 @@ struct XlnxDPDMAState { qemu_irq irq; }; -typedef struct XlnxDPDMAState XlnxDPDMAState; #define TYPE_XLNX_DPDMA "xlnx.dpdma" -DECLARE_INSTANCE_CHECKER(XlnxDPDMAState, XLNX_DPDMA, - TYPE_XLNX_DPDMA) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxDPDMAState, XLNX_DPDMA) /* * xlnx_dpdma_start_operation: Start the operation on the specified channel. The diff --git a/include/hw/gpio/bcm2835_gpio.h b/include/hw/gpio/bcm2835_gpio.h index e06e08a0fe..1c53a05090 100644 --- a/include/hw/gpio/bcm2835_gpio.h +++ b/include/hw/gpio/bcm2835_gpio.h @@ -33,10 +33,8 @@ struct BCM2835GpioState { uint8_t sd_fsel; qemu_irq out[54]; }; -typedef struct BCM2835GpioState BCM2835GpioState; #define TYPE_BCM2835_GPIO "bcm2835_gpio" -DECLARE_INSTANCE_CHECKER(BCM2835GpioState, BCM2835_GPIO, - TYPE_BCM2835_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835GpioState, BCM2835_GPIO) #endif diff --git a/include/hw/gpio/imx_gpio.h b/include/hw/gpio/imx_gpio.h index a72b272ace..227860b9f0 100644 --- a/include/hw/gpio/imx_gpio.h +++ b/include/hw/gpio/imx_gpio.h @@ -24,9 +24,7 @@ #include "qom/object.h" #define TYPE_IMX_GPIO "imx.gpio" -typedef struct IMXGPIOState IMXGPIOState; -DECLARE_INSTANCE_CHECKER(IMXGPIOState, IMX_GPIO, - TYPE_IMX_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(IMXGPIOState, IMX_GPIO) #define IMX_GPIO_MEM_SIZE 0x20 diff --git a/include/hw/gpio/nrf51_gpio.h b/include/hw/gpio/nrf51_gpio.h index 55d7d24a52..8f9c2f86da 100644 --- a/include/hw/gpio/nrf51_gpio.h +++ b/include/hw/gpio/nrf51_gpio.h @@ -29,9 +29,7 @@ #include "hw/sysbus.h" #include "qom/object.h" #define TYPE_NRF51_GPIO "nrf51_soc.gpio" -typedef struct NRF51GPIOState NRF51GPIOState; -DECLARE_INSTANCE_CHECKER(NRF51GPIOState, NRF51_GPIO, - TYPE_NRF51_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51GPIOState, NRF51_GPIO) #define NRF51_GPIO_PINS 32 diff --git a/include/hw/hyperv/vmbus-bridge.h b/include/hw/hyperv/vmbus-bridge.h index 1324873775..1e5419574e 100644 --- a/include/hw/hyperv/vmbus-bridge.h +++ b/include/hw/hyperv/vmbus-bridge.h @@ -23,10 +23,8 @@ struct VMBusBridge { VMBus *bus; }; -typedef struct VMBusBridge VMBusBridge; -DECLARE_INSTANCE_CHECKER(VMBusBridge, VMBUS_BRIDGE, - TYPE_VMBUS_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(VMBusBridge, VMBUS_BRIDGE) static inline VMBusBridge *vmbus_bridge_find(void) { diff --git a/include/hw/hyperv/vmbus.h b/include/hw/hyperv/vmbus.h index 6e9d1c16be..f98bea3888 100644 --- a/include/hw/hyperv/vmbus.h +++ b/include/hw/hyperv/vmbus.h @@ -24,9 +24,7 @@ OBJECT_DECLARE_TYPE(VMBusDevice, VMBusDeviceClass, VMBUS_DEVICE) #define TYPE_VMBUS "vmbus" -typedef struct VMBus VMBus; -DECLARE_INSTANCE_CHECKER(VMBus, VMBUS, - TYPE_VMBUS) +OBJECT_DECLARE_SIMPLE_TYPE(VMBus, VMBUS) /* * Object wrapping a GPADL -- GPA Descriptor List -- an array of guest physical diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h index 17e57436ce..277dd9f2d6 100644 --- a/include/hw/i2c/i2c.h +++ b/include/hw/i2c/i2c.h @@ -49,8 +49,7 @@ struct I2CSlave { }; #define TYPE_I2C_BUS "i2c-bus" -DECLARE_INSTANCE_CHECKER(I2CBus, I2C_BUS, - TYPE_I2C_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(I2CBus, I2C_BUS) typedef struct I2CNode I2CNode; diff --git a/include/hw/i2c/imx_i2c.h b/include/hw/i2c/imx_i2c.h index e7f09104cf..e4f91339f5 100644 --- a/include/hw/i2c/imx_i2c.h +++ b/include/hw/i2c/imx_i2c.h @@ -25,9 +25,7 @@ #include "qom/object.h" #define TYPE_IMX_I2C "imx.i2c" -typedef struct IMXI2CState IMXI2CState; -DECLARE_INSTANCE_CHECKER(IMXI2CState, IMX_I2C, - TYPE_IMX_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(IMXI2CState, IMX_I2C) #define IMX_I2C_MEM_SIZE 0x14 diff --git a/include/hw/i2c/microbit_i2c.h b/include/hw/i2c/microbit_i2c.h index 69d70287d7..3c29e09bf3 100644 --- a/include/hw/i2c/microbit_i2c.h +++ b/include/hw/i2c/microbit_i2c.h @@ -27,9 +27,7 @@ #define NRF51_TWI_REG_ADDRESS 0x588 #define TYPE_MICROBIT_I2C "microbit.i2c" -typedef struct MicrobitI2CState MicrobitI2CState; -DECLARE_INSTANCE_CHECKER(MicrobitI2CState, MICROBIT_I2C, - TYPE_MICROBIT_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(MicrobitI2CState, MICROBIT_I2C) #define MICROBIT_I2C_NREGS (NRF51_PERIPHERAL_SIZE / sizeof(uint32_t)) diff --git a/include/hw/i2c/ppc4xx_i2c.h b/include/hw/i2c/ppc4xx_i2c.h index 7cbcdaf12f..4e882fa3c8 100644 --- a/include/hw/i2c/ppc4xx_i2c.h +++ b/include/hw/i2c/ppc4xx_i2c.h @@ -32,9 +32,7 @@ #include "qom/object.h" #define TYPE_PPC4xx_I2C "ppc4xx-i2c" -typedef struct PPC4xxI2CState PPC4xxI2CState; -DECLARE_INSTANCE_CHECKER(PPC4xxI2CState, PPC4xx_I2C, - TYPE_PPC4xx_I2C) +OBJECT_DECLARE_SIMPLE_TYPE(PPC4xxI2CState, PPC4xx_I2C) struct PPC4xxI2CState { /*< private >*/ diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index e750d67975..48b442bc0b 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -24,9 +24,7 @@ void ich9_generate_smi(void); #define ICH9_CC_SIZE (16 * 1024) /* 16KB. Chipset configuration registers */ #define TYPE_ICH9_LPC_DEVICE "ICH9-LPC" -typedef struct ICH9LPCState ICH9LPCState; -DECLARE_INSTANCE_CHECKER(ICH9LPCState, ICH9_LPC_DEVICE, - TYPE_ICH9_LPC_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(ICH9LPCState, ICH9_LPC_DEVICE) struct ICH9LPCState { /* ICH9 LPC PCI to ISA bridge */ diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h index 98cfc77723..41783ee46d 100644 --- a/include/hw/i386/intel_iommu.h +++ b/include/hw/i386/intel_iommu.h @@ -27,9 +27,7 @@ #include "qom/object.h" #define TYPE_INTEL_IOMMU_DEVICE "intel-iommu" -typedef struct IntelIOMMUState IntelIOMMUState; -DECLARE_INSTANCE_CHECKER(IntelIOMMUState, INTEL_IOMMU_DEVICE, - TYPE_INTEL_IOMMU_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(IntelIOMMUState, INTEL_IOMMU_DEVICE) #define TYPE_INTEL_IOMMU_MEMORY_REGION "intel-iommu-iommu-memory-region" diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h index da3cddcc65..b1bdf648f8 100644 --- a/include/hw/ide/ahci.h +++ b/include/hw/ide/ahci.h @@ -51,19 +51,15 @@ typedef struct AHCIState { AddressSpace *as; } AHCIState; -typedef struct AHCIPCIState AHCIPCIState; #define TYPE_ICH9_AHCI "ich9-ahci" -DECLARE_INSTANCE_CHECKER(AHCIPCIState, ICH9_AHCI, - TYPE_ICH9_AHCI) +OBJECT_DECLARE_SIMPLE_TYPE(AHCIPCIState, ICH9_AHCI) int32_t ahci_get_num_ports(PCIDevice *dev); void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd); #define TYPE_SYSBUS_AHCI "sysbus-ahci" -typedef struct SysbusAHCIState SysbusAHCIState; -DECLARE_INSTANCE_CHECKER(SysbusAHCIState, SYSBUS_AHCI, - TYPE_SYSBUS_AHCI) +OBJECT_DECLARE_SIMPLE_TYPE(SysbusAHCIState, SYSBUS_AHCI) struct SysbusAHCIState { /*< private >*/ @@ -75,9 +71,7 @@ struct SysbusAHCIState { }; #define TYPE_ALLWINNER_AHCI "allwinner-ahci" -typedef struct AllwinnerAHCIState AllwinnerAHCIState; -DECLARE_INSTANCE_CHECKER(AllwinnerAHCIState, ALLWINNER_AHCI, - TYPE_ALLWINNER_AHCI) +OBJECT_DECLARE_SIMPLE_TYPE(AllwinnerAHCIState, ALLWINNER_AHCI) #define ALLWINNER_AHCI_MMIO_OFF 0x80 #define ALLWINNER_AHCI_MMIO_SIZE 0x80 diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index 77c9372c27..8a95ad8c4d 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -19,15 +19,13 @@ #define USE_DMA_CDROM #include "qom/object.h" -typedef struct IDEBus IDEBus; typedef struct IDEDevice IDEDevice; typedef struct IDEState IDEState; typedef struct IDEDMA IDEDMA; typedef struct IDEDMAOps IDEDMAOps; #define TYPE_IDE_BUS "IDE" -DECLARE_INSTANCE_CHECKER(IDEBus, IDE_BUS, - TYPE_IDE_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(IDEBus, IDE_BUS) #define MAX_IDE_DEVS 2 diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index b8d7270ec8..d8384e1c42 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -40,9 +40,7 @@ typedef struct BMDMAState { } BMDMAState; #define TYPE_PCI_IDE "pci-ide" -typedef struct PCIIDEState PCIIDEState; -DECLARE_INSTANCE_CHECKER(PCIIDEState, PCI_IDE, - TYPE_PCI_IDE) +OBJECT_DECLARE_SIMPLE_TYPE(PCIIDEState, PCI_IDE) struct PCIIDEState { /*< private >*/ diff --git a/include/hw/input/adb.h b/include/hw/input/adb.h index 3d1c2f4b10..20fced15f7 100644 --- a/include/hw/input/adb.h +++ b/include/hw/input/adb.h @@ -33,7 +33,6 @@ #define ADB_MAX_OUT_LEN 16 -typedef struct ADBBusState ADBBusState; typedef struct ADBDevice ADBDevice; /* buf = NULL means polling */ @@ -65,8 +64,7 @@ struct ADBDeviceClass { }; #define TYPE_ADB_BUS "apple-desktop-bus" -DECLARE_INSTANCE_CHECKER(ADBBusState, ADB_BUS, - TYPE_ADB_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(ADBBusState, ADB_BUS) #define ADB_STATUS_BUSTIMEOUT 0x1 #define ADB_STATUS_POLLREPLY 0x2 diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h index f8a3bf88ac..1d90432dae 100644 --- a/include/hw/input/i8042.h +++ b/include/hw/input/i8042.h @@ -12,9 +12,7 @@ #include "qom/object.h" #define TYPE_I8042 "i8042" -typedef struct ISAKBDState ISAKBDState; -DECLARE_INSTANCE_CHECKER(ISAKBDState, I8042, - TYPE_I8042) +OBJECT_DECLARE_SIMPLE_TYPE(ISAKBDState, I8042) #define I8042_A20_LINE "a20" diff --git a/include/hw/intc/allwinner-a10-pic.h b/include/hw/intc/allwinner-a10-pic.h index 4d7199480a..b8364d3ed4 100644 --- a/include/hw/intc/allwinner-a10-pic.h +++ b/include/hw/intc/allwinner-a10-pic.h @@ -5,9 +5,7 @@ #include "qom/object.h" #define TYPE_AW_A10_PIC "allwinner-a10-pic" -typedef struct AwA10PICState AwA10PICState; -DECLARE_INSTANCE_CHECKER(AwA10PICState, AW_A10_PIC, - TYPE_AW_A10_PIC) +OBJECT_DECLARE_SIMPLE_TYPE(AwA10PICState, AW_A10_PIC) #define AW_A10_PIC_VECTOR 0 #define AW_A10_PIC_BASE_ADDR 4 diff --git a/include/hw/intc/aspeed_vic.h b/include/hw/intc/aspeed_vic.h index 8f2e67db5a..68d6ab997a 100644 --- a/include/hw/intc/aspeed_vic.h +++ b/include/hw/intc/aspeed_vic.h @@ -17,9 +17,7 @@ #include "qom/object.h" #define TYPE_ASPEED_VIC "aspeed.vic" -typedef struct AspeedVICState AspeedVICState; -DECLARE_INSTANCE_CHECKER(AspeedVICState, ASPEED_VIC, - TYPE_ASPEED_VIC) +OBJECT_DECLARE_SIMPLE_TYPE(AspeedVICState, ASPEED_VIC) #define ASPEED_VIC_NR_IRQS 51 diff --git a/include/hw/intc/bcm2835_ic.h b/include/hw/intc/bcm2835_ic.h index fd4a767845..588eb76c5c 100644 --- a/include/hw/intc/bcm2835_ic.h +++ b/include/hw/intc/bcm2835_ic.h @@ -12,9 +12,7 @@ #include "qom/object.h" #define TYPE_BCM2835_IC "bcm2835-ic" -typedef struct BCM2835ICState BCM2835ICState; -DECLARE_INSTANCE_CHECKER(BCM2835ICState, BCM2835_IC, - TYPE_BCM2835_IC) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835ICState, BCM2835_IC) #define BCM2835_IC_GPU_IRQ "gpu-irq" #define BCM2835_IC_ARM_IRQ "arm-irq" diff --git a/include/hw/intc/bcm2836_control.h b/include/hw/intc/bcm2836_control.h index f23292776e..a410c817e8 100644 --- a/include/hw/intc/bcm2836_control.h +++ b/include/hw/intc/bcm2836_control.h @@ -24,9 +24,7 @@ #define BCM2836_MBPERCORE 4 #define TYPE_BCM2836_CONTROL "bcm2836-control" -typedef struct BCM2836ControlState BCM2836ControlState; -DECLARE_INSTANCE_CHECKER(BCM2836ControlState, BCM2836_CONTROL, - TYPE_BCM2836_CONTROL) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2836ControlState, BCM2836_CONTROL) struct BCM2836ControlState { /*< private >*/ diff --git a/include/hw/intc/heathrow_pic.h b/include/hw/intc/heathrow_pic.h index f8c9bc20ab..c0a7f6f546 100644 --- a/include/hw/intc/heathrow_pic.h +++ b/include/hw/intc/heathrow_pic.h @@ -30,9 +30,7 @@ #include "qom/object.h" #define TYPE_HEATHROW "heathrow" -typedef struct HeathrowState HeathrowState; -DECLARE_INSTANCE_CHECKER(HeathrowState, HEATHROW, - TYPE_HEATHROW) +OBJECT_DECLARE_SIMPLE_TYPE(HeathrowState, HEATHROW) typedef struct HeathrowPICState { uint32_t events; diff --git a/include/hw/intc/ibex_plic.h b/include/hw/intc/ibex_plic.h index 8da6b03805..37f03356b3 100644 --- a/include/hw/intc/ibex_plic.h +++ b/include/hw/intc/ibex_plic.h @@ -23,9 +23,7 @@ #include "qom/object.h" #define TYPE_IBEX_PLIC "ibex-plic" -typedef struct IbexPlicState IbexPlicState; -DECLARE_INSTANCE_CHECKER(IbexPlicState, IBEX_PLIC, - TYPE_IBEX_PLIC) +OBJECT_DECLARE_SIMPLE_TYPE(IbexPlicState, IBEX_PLIC) struct IbexPlicState { /*< private >*/ diff --git a/include/hw/intc/imx_avic.h b/include/hw/intc/imx_avic.h index 621742533c..75fbd1a89c 100644 --- a/include/hw/intc/imx_avic.h +++ b/include/hw/intc/imx_avic.h @@ -21,9 +21,7 @@ #include "qom/object.h" #define TYPE_IMX_AVIC "imx.avic" -typedef struct IMXAVICState IMXAVICState; -DECLARE_INSTANCE_CHECKER(IMXAVICState, IMX_AVIC, - TYPE_IMX_AVIC) +OBJECT_DECLARE_SIMPLE_TYPE(IMXAVICState, IMX_AVIC) #define IMX_AVIC_NUM_IRQS 64 diff --git a/include/hw/intc/imx_gpcv2.h b/include/hw/intc/imx_gpcv2.h index 2d8075e527..7bdee7e80a 100644 --- a/include/hw/intc/imx_gpcv2.h +++ b/include/hw/intc/imx_gpcv2.h @@ -16,10 +16,8 @@ struct IMXGPCv2State { MemoryRegion iomem; uint32_t regs[GPC_NUM]; }; -typedef struct IMXGPCv2State IMXGPCv2State; #define TYPE_IMX_GPCV2 "imx-gpcv2" -DECLARE_INSTANCE_CHECKER(IMXGPCv2State, IMX_GPCV2, - TYPE_IMX_GPCV2) +OBJECT_DECLARE_SIMPLE_TYPE(IMXGPCv2State, IMX_GPCV2) #endif /* IMX_GPCV2_H */ diff --git a/include/hw/intc/mips_gic.h b/include/hw/intc/mips_gic.h index 65aa3a9a5e..eeb136e261 100644 --- a/include/hw/intc/mips_gic.h +++ b/include/hw/intc/mips_gic.h @@ -171,9 +171,7 @@ #define GIC_LOCAL_INT_WD 0 /* GIC watchdog */ #define TYPE_MIPS_GIC "mips-gic" -typedef struct MIPSGICState MIPSGICState; -DECLARE_INSTANCE_CHECKER(MIPSGICState, MIPS_GIC, - TYPE_MIPS_GIC) +OBJECT_DECLARE_SIMPLE_TYPE(MIPSGICState, MIPS_GIC) /* Support up to 32 VPs and 256 IRQs */ #define GIC_MAX_VPS 32 diff --git a/include/hw/intc/realview_gic.h b/include/hw/intc/realview_gic.h index a93ace87c8..f37339dc0b 100644 --- a/include/hw/intc/realview_gic.h +++ b/include/hw/intc/realview_gic.h @@ -15,9 +15,7 @@ #include "qom/object.h" #define TYPE_REALVIEW_GIC "realview_gic" -typedef struct RealViewGICState RealViewGICState; -DECLARE_INSTANCE_CHECKER(RealViewGICState, REALVIEW_GIC, - TYPE_REALVIEW_GIC) +OBJECT_DECLARE_SIMPLE_TYPE(RealViewGICState, REALVIEW_GIC) struct RealViewGICState { SysBusDevice parent_obj; diff --git a/include/hw/intc/rx_icu.h b/include/hw/intc/rx_icu.h index ec02df35e3..7f5889b36f 100644 --- a/include/hw/intc/rx_icu.h +++ b/include/hw/intc/rx_icu.h @@ -69,10 +69,8 @@ struct RXICUState { qemu_irq _fir; qemu_irq _swi; }; -typedef struct RXICUState RXICUState; #define TYPE_RX_ICU "rx-icu" -DECLARE_INSTANCE_CHECKER(RXICUState, RX_ICU, - TYPE_RX_ICU) +OBJECT_DECLARE_SIMPLE_TYPE(RXICUState, RX_ICU) #endif /* RX_ICU_H */ diff --git a/include/hw/intc/xlnx-pmu-iomod-intc.h b/include/hw/intc/xlnx-pmu-iomod-intc.h index 7a560e97af..ccc8bd272a 100644 --- a/include/hw/intc/xlnx-pmu-iomod-intc.h +++ b/include/hw/intc/xlnx-pmu-iomod-intc.h @@ -31,9 +31,7 @@ #define TYPE_XLNX_PMU_IO_INTC "xlnx.pmu_io_intc" -typedef struct XlnxPMUIOIntc XlnxPMUIOIntc; -DECLARE_INSTANCE_CHECKER(XlnxPMUIOIntc, XLNX_PMU_IO_INTC, - TYPE_XLNX_PMU_IO_INTC) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxPMUIOIntc, XLNX_PMU_IO_INTC) /* This is R_PIT3_CONTROL + 1 */ #define XLNXPMUIOINTC_R_MAX (0x78 + 1) diff --git a/include/hw/intc/xlnx-zynqmp-ipi.h b/include/hw/intc/xlnx-zynqmp-ipi.h index 29c48db307..33eff1d4f6 100644 --- a/include/hw/intc/xlnx-zynqmp-ipi.h +++ b/include/hw/intc/xlnx-zynqmp-ipi.h @@ -31,9 +31,7 @@ #define TYPE_XLNX_ZYNQMP_IPI "xlnx.zynqmp_ipi" -typedef struct XlnxZynqMPIPI XlnxZynqMPIPI; -DECLARE_INSTANCE_CHECKER(XlnxZynqMPIPI, XLNX_ZYNQMP_IPI, - TYPE_XLNX_ZYNQMP_IPI) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPIPI, XLNX_ZYNQMP_IPI) /* This is R_IPI_IDR + 1 */ #define R_XLNX_ZYNQMP_IPI_MAX ((0x1c / 4) + 1) diff --git a/include/hw/ipack/ipack.h b/include/hw/ipack/ipack.h index 58c611af25..75014e74ae 100644 --- a/include/hw/ipack/ipack.h +++ b/include/hw/ipack/ipack.h @@ -14,11 +14,9 @@ #include "hw/qdev-core.h" #include "qom/object.h" -typedef struct IPackBus IPackBus; #define TYPE_IPACK_BUS "IndustryPack" -DECLARE_INSTANCE_CHECKER(IPackBus, IPACK_BUS, - TYPE_IPACK_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(IPackBus, IPACK_BUS) struct IPackBus { /*< private >*/ diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h index 5290dab1d6..77a7213ed9 100644 --- a/include/hw/ipmi/ipmi.h +++ b/include/hw/ipmi/ipmi.h @@ -264,9 +264,7 @@ int ipmi_bmc_sdr_find(IPMIBmc *b, uint16_t recid, void ipmi_bmc_gen_event(IPMIBmc *b, uint8_t *evt, bool log); #define TYPE_IPMI_BMC_SIMULATOR "ipmi-bmc-sim" -typedef struct IPMIBmcSim IPMIBmcSim; -DECLARE_INSTANCE_CHECKER(IPMIBmcSim, IPMI_BMC_SIMULATOR, - TYPE_IPMI_BMC_SIMULATOR) +OBJECT_DECLARE_SIMPLE_TYPE(IPMIBmcSim, IPMI_BMC_SIMULATOR) typedef struct RspBuffer { diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 5f7943fa67..ddaae89a85 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -14,8 +14,7 @@ OBJECT_DECLARE_TYPE(ISADevice, ISADeviceClass, ISA_DEVICE) #define TYPE_ISA_BUS "ISA" -DECLARE_INSTANCE_CHECKER(ISABus, ISA_BUS, - TYPE_ISA_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(ISABus, ISA_BUS) #define TYPE_APPLE_SMC "isa-applesmc" #define APPLESMC_MAX_DATA_LENGTH 32 diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index da8dc5ddf5..edaf723f4d 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -30,9 +30,7 @@ #define TYPE_PC87312 "pc87312" -typedef struct PC87312State PC87312State; -DECLARE_INSTANCE_CHECKER(PC87312State, PC87312, - TYPE_PC87312) +OBJECT_DECLARE_SIMPLE_TYPE(PC87312State, PC87312) struct PC87312State { /*< private >*/ diff --git a/include/hw/m68k/mcf_fec.h b/include/hw/m68k/mcf_fec.h index 840c5bbf53..80d4f651ba 100644 --- a/include/hw/m68k/mcf_fec.h +++ b/include/hw/m68k/mcf_fec.h @@ -12,9 +12,7 @@ #include "qom/object.h" #define TYPE_MCF_FEC_NET "mcf-fec" -typedef struct mcf_fec_state mcf_fec_state; -DECLARE_INSTANCE_CHECKER(mcf_fec_state, MCF_FEC_NET, - TYPE_MCF_FEC_NET) +OBJECT_DECLARE_SIMPLE_TYPE(mcf_fec_state, MCF_FEC_NET) #define FEC_NUM_IRQ 13 diff --git a/include/hw/mips/cps.h b/include/hw/mips/cps.h index 849e640570..9e35a88136 100644 --- a/include/hw/mips/cps.h +++ b/include/hw/mips/cps.h @@ -29,9 +29,7 @@ #include "qom/object.h" #define TYPE_MIPS_CPS "mips-cps" -typedef struct MIPSCPSState MIPSCPSState; -DECLARE_INSTANCE_CHECKER(MIPSCPSState, MIPS_CPS, - TYPE_MIPS_CPS) +OBJECT_DECLARE_SIMPLE_TYPE(MIPSCPSState, MIPS_CPS) struct MIPSCPSState { SysBusDevice parent_obj; diff --git a/include/hw/misc/a9scu.h b/include/hw/misc/a9scu.h index fd1b92e923..c3759fb8c8 100644 --- a/include/hw/misc/a9scu.h +++ b/include/hw/misc/a9scu.h @@ -25,10 +25,8 @@ struct A9SCUState { uint32_t status; uint32_t num_cpu; }; -typedef struct A9SCUState A9SCUState; #define TYPE_A9_SCU "a9-scu" -DECLARE_INSTANCE_CHECKER(A9SCUState, A9_SCU, - TYPE_A9_SCU) +OBJECT_DECLARE_SIMPLE_TYPE(A9SCUState, A9_SCU) #endif diff --git a/include/hw/misc/allwinner-cpucfg.h b/include/hw/misc/allwinner-cpucfg.h index 058514de15..a717b47299 100644 --- a/include/hw/misc/allwinner-cpucfg.h +++ b/include/hw/misc/allwinner-cpucfg.h @@ -29,9 +29,7 @@ */ #define TYPE_AW_CPUCFG "allwinner-cpucfg" -typedef struct AwCpuCfgState AwCpuCfgState; -DECLARE_INSTANCE_CHECKER(AwCpuCfgState, AW_CPUCFG, - TYPE_AW_CPUCFG) +OBJECT_DECLARE_SIMPLE_TYPE(AwCpuCfgState, AW_CPUCFG) /** @} */ diff --git a/include/hw/misc/allwinner-h3-ccu.h b/include/hw/misc/allwinner-h3-ccu.h index 05f5c7bd8e..a04875bfca 100644 --- a/include/hw/misc/allwinner-h3-ccu.h +++ b/include/hw/misc/allwinner-h3-ccu.h @@ -42,9 +42,7 @@ */ #define TYPE_AW_H3_CCU "allwinner-h3-ccu" -typedef struct AwH3ClockCtlState AwH3ClockCtlState; -DECLARE_INSTANCE_CHECKER(AwH3ClockCtlState, AW_H3_CCU, - TYPE_AW_H3_CCU) +OBJECT_DECLARE_SIMPLE_TYPE(AwH3ClockCtlState, AW_H3_CCU) /** @} */ diff --git a/include/hw/misc/allwinner-h3-dramc.h b/include/hw/misc/allwinner-h3-dramc.h index 60a13a6958..0b6c877ef7 100644 --- a/include/hw/misc/allwinner-h3-dramc.h +++ b/include/hw/misc/allwinner-h3-dramc.h @@ -58,9 +58,7 @@ */ #define TYPE_AW_H3_DRAMC "allwinner-h3-dramc" -typedef struct AwH3DramCtlState AwH3DramCtlState; -DECLARE_INSTANCE_CHECKER(AwH3DramCtlState, AW_H3_DRAMC, - TYPE_AW_H3_DRAMC) +OBJECT_DECLARE_SIMPLE_TYPE(AwH3DramCtlState, AW_H3_DRAMC) /** @} */ diff --git a/include/hw/misc/allwinner-h3-sysctrl.h b/include/hw/misc/allwinner-h3-sysctrl.h index 50baa8eb07..ec1c220535 100644 --- a/include/hw/misc/allwinner-h3-sysctrl.h +++ b/include/hw/misc/allwinner-h3-sysctrl.h @@ -43,9 +43,7 @@ */ #define TYPE_AW_H3_SYSCTRL "allwinner-h3-sysctrl" -typedef struct AwH3SysCtrlState AwH3SysCtrlState; -DECLARE_INSTANCE_CHECKER(AwH3SysCtrlState, AW_H3_SYSCTRL, - TYPE_AW_H3_SYSCTRL) +OBJECT_DECLARE_SIMPLE_TYPE(AwH3SysCtrlState, AW_H3_SYSCTRL) /** @} */ diff --git a/include/hw/misc/allwinner-sid.h b/include/hw/misc/allwinner-sid.h index b8e83bb7ce..3bfa887a96 100644 --- a/include/hw/misc/allwinner-sid.h +++ b/include/hw/misc/allwinner-sid.h @@ -30,9 +30,7 @@ */ #define TYPE_AW_SID "allwinner-sid" -typedef struct AwSidState AwSidState; -DECLARE_INSTANCE_CHECKER(AwSidState, AW_SID, - TYPE_AW_SID) +OBJECT_DECLARE_SIMPLE_TYPE(AwSidState, AW_SID) /** @} */ diff --git a/include/hw/misc/arm11scu.h b/include/hw/misc/arm11scu.h index 71b4bc9a22..e5c0282aec 100644 --- a/include/hw/misc/arm11scu.h +++ b/include/hw/misc/arm11scu.h @@ -15,9 +15,7 @@ #include "qom/object.h" #define TYPE_ARM11_SCU "arm11-scu" -typedef struct ARM11SCUState ARM11SCUState; -DECLARE_INSTANCE_CHECKER(ARM11SCUState, ARM11_SCU, - TYPE_ARM11_SCU) +OBJECT_DECLARE_SIMPLE_TYPE(ARM11SCUState, ARM11_SCU) struct ARM11SCUState { /*< private >*/ diff --git a/include/hw/misc/armsse-cpuid.h b/include/hw/misc/armsse-cpuid.h index 80691c7180..a61355e516 100644 --- a/include/hw/misc/armsse-cpuid.h +++ b/include/hw/misc/armsse-cpuid.h @@ -26,9 +26,7 @@ #include "qom/object.h" #define TYPE_ARMSSE_CPUID "armsse-cpuid" -typedef struct ARMSSECPUID ARMSSECPUID; -DECLARE_INSTANCE_CHECKER(ARMSSECPUID, ARMSSE_CPUID, - TYPE_ARMSSE_CPUID) +OBJECT_DECLARE_SIMPLE_TYPE(ARMSSECPUID, ARMSSE_CPUID) struct ARMSSECPUID { /*< private >*/ diff --git a/include/hw/misc/armsse-mhu.h b/include/hw/misc/armsse-mhu.h index 310643a022..2671b5b978 100644 --- a/include/hw/misc/armsse-mhu.h +++ b/include/hw/misc/armsse-mhu.h @@ -27,9 +27,7 @@ #include "qom/object.h" #define TYPE_ARMSSE_MHU "armsse-mhu" -typedef struct ARMSSEMHU ARMSSEMHU; -DECLARE_INSTANCE_CHECKER(ARMSSEMHU, ARMSSE_MHU, - TYPE_ARMSSE_MHU) +OBJECT_DECLARE_SIMPLE_TYPE(ARMSSEMHU, ARMSSE_MHU) struct ARMSSEMHU { /*< private >*/ diff --git a/include/hw/misc/aspeed_xdma.h b/include/hw/misc/aspeed_xdma.h index 0e62c04520..9869ef4728 100644 --- a/include/hw/misc/aspeed_xdma.h +++ b/include/hw/misc/aspeed_xdma.h @@ -13,9 +13,7 @@ #include "qom/object.h" #define TYPE_ASPEED_XDMA "aspeed.xdma" -typedef struct AspeedXDMAState AspeedXDMAState; -DECLARE_INSTANCE_CHECKER(AspeedXDMAState, ASPEED_XDMA, - TYPE_ASPEED_XDMA) +OBJECT_DECLARE_SIMPLE_TYPE(AspeedXDMAState, ASPEED_XDMA) #define ASPEED_XDMA_NUM_REGS (ASPEED_XDMA_REG_SIZE / sizeof(uint32_t)) #define ASPEED_XDMA_REG_SIZE 0x7C diff --git a/include/hw/misc/auxbus.h b/include/hw/misc/auxbus.h index f910d94118..b05799d2f7 100644 --- a/include/hw/misc/auxbus.h +++ b/include/hw/misc/auxbus.h @@ -29,15 +29,12 @@ #include "hw/qdev-core.h" #include "qom/object.h" -typedef struct AUXBus AUXBus; typedef struct AUXSlave AUXSlave; typedef enum AUXCommand AUXCommand; typedef enum AUXReply AUXReply; #define TYPE_AUXTOI2C "aux-to-i2c-bridge" -typedef struct AUXTOI2CState AUXTOI2CState; -DECLARE_INSTANCE_CHECKER(AUXTOI2CState, AUXTOI2C, - TYPE_AUXTOI2C) +OBJECT_DECLARE_SIMPLE_TYPE(AUXTOI2CState, AUXTOI2C) enum AUXCommand { WRITE_I2C = 0, @@ -58,8 +55,7 @@ enum AUXReply { }; #define TYPE_AUX_BUS "aux-bus" -DECLARE_INSTANCE_CHECKER(AUXBus, AUX_BUS, - TYPE_AUX_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(AUXBus, AUX_BUS) struct AUXBus { /* < private > */ @@ -78,8 +74,7 @@ struct AUXBus { }; #define TYPE_AUX_SLAVE "aux-slave" -DECLARE_INSTANCE_CHECKER(AUXSlave, AUX_SLAVE, - TYPE_AUX_SLAVE) +OBJECT_DECLARE_SIMPLE_TYPE(AUXSlave, AUX_SLAVE) struct AUXSlave { /* < private > */ diff --git a/include/hw/misc/avr_power.h b/include/hw/misc/avr_power.h index 938ab3e21b..707df030b1 100644 --- a/include/hw/misc/avr_power.h +++ b/include/hw/misc/avr_power.h @@ -31,9 +31,7 @@ #define TYPE_AVR_MASK "avr-power" -typedef struct AVRMaskState AVRMaskState; -DECLARE_INSTANCE_CHECKER(AVRMaskState, AVR_MASK, - TYPE_AVR_MASK) +OBJECT_DECLARE_SIMPLE_TYPE(AVRMaskState, AVR_MASK) struct AVRMaskState { /* */ diff --git a/include/hw/misc/bcm2835_mbox.h b/include/hw/misc/bcm2835_mbox.h index d8c8017f4e..ade27af25d 100644 --- a/include/hw/misc/bcm2835_mbox.h +++ b/include/hw/misc/bcm2835_mbox.h @@ -13,9 +13,7 @@ #include "qom/object.h" #define TYPE_BCM2835_MBOX "bcm2835-mbox" -typedef struct BCM2835MboxState BCM2835MboxState; -DECLARE_INSTANCE_CHECKER(BCM2835MboxState, BCM2835_MBOX, - TYPE_BCM2835_MBOX) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835MboxState, BCM2835_MBOX) typedef struct { uint32_t reg[MBOX_SIZE]; diff --git a/include/hw/misc/bcm2835_mphi.h b/include/hw/misc/bcm2835_mphi.h index 249511182e..751363f496 100644 --- a/include/hw/misc/bcm2835_mphi.h +++ b/include/hw/misc/bcm2835_mphi.h @@ -39,7 +39,6 @@ struct BCM2835MphiState { #define TYPE_BCM2835_MPHI "bcm2835-mphi" -DECLARE_INSTANCE_CHECKER(BCM2835MphiState, BCM2835_MPHI, - TYPE_BCM2835_MPHI) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835MphiState, BCM2835_MPHI) #endif diff --git a/include/hw/misc/bcm2835_property.h b/include/hw/misc/bcm2835_property.h index 5c827a1900..712b76b7a3 100644 --- a/include/hw/misc/bcm2835_property.h +++ b/include/hw/misc/bcm2835_property.h @@ -14,9 +14,7 @@ #include "qom/object.h" #define TYPE_BCM2835_PROPERTY "bcm2835-property" -typedef struct BCM2835PropertyState BCM2835PropertyState; -DECLARE_INSTANCE_CHECKER(BCM2835PropertyState, BCM2835_PROPERTY, - TYPE_BCM2835_PROPERTY) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835PropertyState, BCM2835_PROPERTY) struct BCM2835PropertyState { /*< private >*/ diff --git a/include/hw/misc/bcm2835_rng.h b/include/hw/misc/bcm2835_rng.h index fec76eef8e..7c1fb3ef40 100644 --- a/include/hw/misc/bcm2835_rng.h +++ b/include/hw/misc/bcm2835_rng.h @@ -14,9 +14,7 @@ #include "qom/object.h" #define TYPE_BCM2835_RNG "bcm2835-rng" -typedef struct BCM2835RngState BCM2835RngState; -DECLARE_INSTANCE_CHECKER(BCM2835RngState, BCM2835_RNG, - TYPE_BCM2835_RNG) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835RngState, BCM2835_RNG) struct BCM2835RngState { SysBusDevice busdev; diff --git a/include/hw/misc/bcm2835_thermal.h b/include/hw/misc/bcm2835_thermal.h index 5b827c970e..f90f9e487c 100644 --- a/include/hw/misc/bcm2835_thermal.h +++ b/include/hw/misc/bcm2835_thermal.h @@ -14,9 +14,7 @@ #define TYPE_BCM2835_THERMAL "bcm2835-thermal" -typedef struct Bcm2835ThermalState Bcm2835ThermalState; -DECLARE_INSTANCE_CHECKER(Bcm2835ThermalState, BCM2835_THERMAL, - TYPE_BCM2835_THERMAL) +OBJECT_DECLARE_SIMPLE_TYPE(Bcm2835ThermalState, BCM2835_THERMAL) struct Bcm2835ThermalState { /*< private >*/ diff --git a/include/hw/misc/grlib_ahb_apb_pnp.h b/include/hw/misc/grlib_ahb_apb_pnp.h index 34b18e3193..341451bff6 100644 --- a/include/hw/misc/grlib_ahb_apb_pnp.h +++ b/include/hw/misc/grlib_ahb_apb_pnp.h @@ -26,14 +26,10 @@ #include "qom/object.h" #define TYPE_GRLIB_AHB_PNP "grlib,ahbpnp" -typedef struct AHBPnp AHBPnp; -DECLARE_INSTANCE_CHECKER(AHBPnp, GRLIB_AHB_PNP, - TYPE_GRLIB_AHB_PNP) +OBJECT_DECLARE_SIMPLE_TYPE(AHBPnp, GRLIB_AHB_PNP) #define TYPE_GRLIB_APB_PNP "grlib,apbpnp" -typedef struct APBPnp APBPnp; -DECLARE_INSTANCE_CHECKER(APBPnp, GRLIB_APB_PNP, - TYPE_GRLIB_APB_PNP) +OBJECT_DECLARE_SIMPLE_TYPE(APBPnp, GRLIB_APB_PNP) void grlib_ahb_pnp_add_entry(AHBPnp *dev, uint32_t address, uint32_t mask, uint8_t vendor, uint16_t device, int slave, diff --git a/include/hw/misc/imx25_ccm.h b/include/hw/misc/imx25_ccm.h index 55c5db8815..c3b89018c6 100644 --- a/include/hw/misc/imx25_ccm.h +++ b/include/hw/misc/imx25_ccm.h @@ -64,9 +64,7 @@ CCTL_##name##_SHIFT) #define TYPE_IMX25_CCM "imx25.ccm" -typedef struct IMX25CCMState IMX25CCMState; -DECLARE_INSTANCE_CHECKER(IMX25CCMState, IMX25_CCM, - TYPE_IMX25_CCM) +OBJECT_DECLARE_SIMPLE_TYPE(IMX25CCMState, IMX25_CCM) struct IMX25CCMState { /* */ diff --git a/include/hw/misc/imx31_ccm.h b/include/hw/misc/imx31_ccm.h index 25e280e976..18e08ee84f 100644 --- a/include/hw/misc/imx31_ccm.h +++ b/include/hw/misc/imx31_ccm.h @@ -73,9 +73,7 @@ PDR0_##name##_PODF_SHIFT) #define TYPE_IMX31_CCM "imx31.ccm" -typedef struct IMX31CCMState IMX31CCMState; -DECLARE_INSTANCE_CHECKER(IMX31CCMState, IMX31_CCM, - TYPE_IMX31_CCM) +OBJECT_DECLARE_SIMPLE_TYPE(IMX31CCMState, IMX31_CCM) struct IMX31CCMState { /* */ diff --git a/include/hw/misc/imx6_ccm.h b/include/hw/misc/imx6_ccm.h index 85f32417d6..ccf46d7353 100644 --- a/include/hw/misc/imx6_ccm.h +++ b/include/hw/misc/imx6_ccm.h @@ -179,9 +179,7 @@ #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH) #define TYPE_IMX6_CCM "imx6.ccm" -typedef struct IMX6CCMState IMX6CCMState; -DECLARE_INSTANCE_CHECKER(IMX6CCMState, IMX6_CCM, - TYPE_IMX6_CCM) +OBJECT_DECLARE_SIMPLE_TYPE(IMX6CCMState, IMX6_CCM) struct IMX6CCMState { /* */ diff --git a/include/hw/misc/imx6_src.h b/include/hw/misc/imx6_src.h index 15b51757ba..f380da3810 100644 --- a/include/hw/misc/imx6_src.h +++ b/include/hw/misc/imx6_src.h @@ -58,9 +58,7 @@ #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH) #define TYPE_IMX6_SRC "imx6.src" -typedef struct IMX6SRCState IMX6SRCState; -DECLARE_INSTANCE_CHECKER(IMX6SRCState, IMX6_SRC, - TYPE_IMX6_SRC) +OBJECT_DECLARE_SIMPLE_TYPE(IMX6SRCState, IMX6_SRC) struct IMX6SRCState { /* */ diff --git a/include/hw/misc/imx6ul_ccm.h b/include/hw/misc/imx6ul_ccm.h index d614de0edd..edb5f784d5 100644 --- a/include/hw/misc/imx6ul_ccm.h +++ b/include/hw/misc/imx6ul_ccm.h @@ -208,9 +208,7 @@ #define CCM_ANALOG_PLL_LOCK (1 << 31); #define TYPE_IMX6UL_CCM "imx6ul.ccm" -typedef struct IMX6ULCCMState IMX6ULCCMState; -DECLARE_INSTANCE_CHECKER(IMX6ULCCMState, IMX6UL_CCM, - TYPE_IMX6UL_CCM) +OBJECT_DECLARE_SIMPLE_TYPE(IMX6ULCCMState, IMX6UL_CCM) struct IMX6ULCCMState { /* */ diff --git a/include/hw/misc/imx7_ccm.h b/include/hw/misc/imx7_ccm.h index e2757622d0..dcaebfb4ef 100644 --- a/include/hw/misc/imx7_ccm.h +++ b/include/hw/misc/imx7_ccm.h @@ -105,9 +105,7 @@ enum IMX7PMURegisters { }; #define TYPE_IMX7_CCM "imx7.ccm" -typedef struct IMX7CCMState IMX7CCMState; -DECLARE_INSTANCE_CHECKER(IMX7CCMState, IMX7_CCM, - TYPE_IMX7_CCM) +OBJECT_DECLARE_SIMPLE_TYPE(IMX7CCMState, IMX7_CCM) struct IMX7CCMState { /* */ @@ -121,9 +119,7 @@ struct IMX7CCMState { #define TYPE_IMX7_ANALOG "imx7.analog" -typedef struct IMX7AnalogState IMX7AnalogState; -DECLARE_INSTANCE_CHECKER(IMX7AnalogState, IMX7_ANALOG, - TYPE_IMX7_ANALOG) +OBJECT_DECLARE_SIMPLE_TYPE(IMX7AnalogState, IMX7_ANALOG) struct IMX7AnalogState { /* */ diff --git a/include/hw/misc/imx7_gpr.h b/include/hw/misc/imx7_gpr.h index f80b3ed28c..df364bd8f0 100644 --- a/include/hw/misc/imx7_gpr.h +++ b/include/hw/misc/imx7_gpr.h @@ -17,9 +17,7 @@ #include "qom/object.h" #define TYPE_IMX7_GPR "imx7.gpr" -typedef struct IMX7GPRState IMX7GPRState; -DECLARE_INSTANCE_CHECKER(IMX7GPRState, IMX7_GPR, - TYPE_IMX7_GPR) +OBJECT_DECLARE_SIMPLE_TYPE(IMX7GPRState, IMX7_GPR) struct IMX7GPRState { /* */ diff --git a/include/hw/misc/imx7_snvs.h b/include/hw/misc/imx7_snvs.h index ea5395c107..14a1d6fe6b 100644 --- a/include/hw/misc/imx7_snvs.h +++ b/include/hw/misc/imx7_snvs.h @@ -24,9 +24,7 @@ enum IMX7SNVSRegisters { }; #define TYPE_IMX7_SNVS "imx7.snvs" -typedef struct IMX7SNVSState IMX7SNVSState; -DECLARE_INSTANCE_CHECKER(IMX7SNVSState, IMX7_SNVS, - TYPE_IMX7_SNVS) +OBJECT_DECLARE_SIMPLE_TYPE(IMX7SNVSState, IMX7_SNVS) struct IMX7SNVSState { /* */ diff --git a/include/hw/misc/imx_rngc.h b/include/hw/misc/imx_rngc.h index f7b569cac5..34ad699225 100644 --- a/include/hw/misc/imx_rngc.h +++ b/include/hw/misc/imx_rngc.h @@ -14,9 +14,7 @@ #include "qom/object.h" #define TYPE_IMX_RNGC "imx.rngc" -typedef struct IMXRNGCState IMXRNGCState; -DECLARE_INSTANCE_CHECKER(IMXRNGCState, IMX_RNGC, - TYPE_IMX_RNGC) +OBJECT_DECLARE_SIMPLE_TYPE(IMXRNGCState, IMX_RNGC) struct IMXRNGCState { /*< private >*/ diff --git a/include/hw/misc/iotkit-secctl.h b/include/hw/misc/iotkit-secctl.h index d062ed43e7..54c212b515 100644 --- a/include/hw/misc/iotkit-secctl.h +++ b/include/hw/misc/iotkit-secctl.h @@ -59,9 +59,7 @@ #include "qom/object.h" #define TYPE_IOTKIT_SECCTL "iotkit-secctl" -typedef struct IoTKitSecCtl IoTKitSecCtl; -DECLARE_INSTANCE_CHECKER(IoTKitSecCtl, IOTKIT_SECCTL, - TYPE_IOTKIT_SECCTL) +OBJECT_DECLARE_SIMPLE_TYPE(IoTKitSecCtl, IOTKIT_SECCTL) #define IOTS_APB_PPC0_NUM_PORTS 3 #define IOTS_APB_PPC1_NUM_PORTS 1 diff --git a/include/hw/misc/iotkit-sysctl.h b/include/hw/misc/iotkit-sysctl.h index 22ceb5d76d..2b5636b218 100644 --- a/include/hw/misc/iotkit-sysctl.h +++ b/include/hw/misc/iotkit-sysctl.h @@ -31,9 +31,7 @@ #include "qom/object.h" #define TYPE_IOTKIT_SYSCTL "iotkit-sysctl" -typedef struct IoTKitSysCtl IoTKitSysCtl; -DECLARE_INSTANCE_CHECKER(IoTKitSysCtl, IOTKIT_SYSCTL, - TYPE_IOTKIT_SYSCTL) +OBJECT_DECLARE_SIMPLE_TYPE(IoTKitSysCtl, IOTKIT_SYSCTL) struct IoTKitSysCtl { /*< private >*/ diff --git a/include/hw/misc/iotkit-sysinfo.h b/include/hw/misc/iotkit-sysinfo.h index 23ae43e549..7e620e2eaf 100644 --- a/include/hw/misc/iotkit-sysinfo.h +++ b/include/hw/misc/iotkit-sysinfo.h @@ -26,9 +26,7 @@ #include "qom/object.h" #define TYPE_IOTKIT_SYSINFO "iotkit-sysinfo" -typedef struct IoTKitSysInfo IoTKitSysInfo; -DECLARE_INSTANCE_CHECKER(IoTKitSysInfo, IOTKIT_SYSINFO, - TYPE_IOTKIT_SYSINFO) +OBJECT_DECLARE_SIMPLE_TYPE(IoTKitSysInfo, IOTKIT_SYSINFO) struct IoTKitSysInfo { /*< private >*/ diff --git a/include/hw/misc/mac_via.h b/include/hw/misc/mac_via.h index 862cbba3ab..a59f0bd422 100644 --- a/include/hw/misc/mac_via.h +++ b/include/hw/misc/mac_via.h @@ -32,9 +32,7 @@ #define TYPE_MOS6522_Q800_VIA1 "mos6522-q800-via1" -typedef struct MOS6522Q800VIA1State MOS6522Q800VIA1State; -DECLARE_INSTANCE_CHECKER(MOS6522Q800VIA1State, MOS6522_Q800_VIA1, - TYPE_MOS6522_Q800_VIA1) +OBJECT_DECLARE_SIMPLE_TYPE(MOS6522Q800VIA1State, MOS6522_Q800_VIA1) struct MOS6522Q800VIA1State { /*< private >*/ @@ -68,9 +66,7 @@ struct MOS6522Q800VIA1State { #define VIA2_IRQ_ASC (1 << VIA2_IRQ_ASC_BIT) #define TYPE_MOS6522_Q800_VIA2 "mos6522-q800-via2" -typedef struct MOS6522Q800VIA2State MOS6522Q800VIA2State; -DECLARE_INSTANCE_CHECKER(MOS6522Q800VIA2State, MOS6522_Q800_VIA2, - TYPE_MOS6522_Q800_VIA2) +OBJECT_DECLARE_SIMPLE_TYPE(MOS6522Q800VIA2State, MOS6522_Q800_VIA2) struct MOS6522Q800VIA2State { /*< private >*/ @@ -79,9 +75,7 @@ struct MOS6522Q800VIA2State { #define TYPE_MAC_VIA "mac_via" -typedef struct MacVIAState MacVIAState; -DECLARE_INSTANCE_CHECKER(MacVIAState, MAC_VIA, - TYPE_MAC_VIA) +OBJECT_DECLARE_SIMPLE_TYPE(MacVIAState, MAC_VIA) struct MacVIAState { SysBusDevice busdev; diff --git a/include/hw/misc/macio/cuda.h b/include/hw/misc/macio/cuda.h index e738b6376f..a71deec968 100644 --- a/include/hw/misc/macio/cuda.h +++ b/include/hw/misc/macio/cuda.h @@ -63,17 +63,13 @@ struct MOS6522CUDAState { /*< private >*/ MOS6522State parent_obj; }; -typedef struct MOS6522CUDAState MOS6522CUDAState; #define TYPE_MOS6522_CUDA "mos6522-cuda" -DECLARE_INSTANCE_CHECKER(MOS6522CUDAState, MOS6522_CUDA, - TYPE_MOS6522_CUDA) +OBJECT_DECLARE_SIMPLE_TYPE(MOS6522CUDAState, MOS6522_CUDA) /* Cuda */ #define TYPE_CUDA "cuda" -typedef struct CUDAState CUDAState; -DECLARE_INSTANCE_CHECKER(CUDAState, CUDA, - TYPE_CUDA) +OBJECT_DECLARE_SIMPLE_TYPE(CUDAState, CUDA) struct CUDAState { /*< private >*/ diff --git a/include/hw/misc/macio/gpio.h b/include/hw/misc/macio/gpio.h index 1d0c8434ae..4dee09a9dd 100644 --- a/include/hw/misc/macio/gpio.h +++ b/include/hw/misc/macio/gpio.h @@ -31,9 +31,7 @@ #include "qom/object.h" #define TYPE_MACIO_GPIO "macio-gpio" -typedef struct MacIOGPIOState MacIOGPIOState; -DECLARE_INSTANCE_CHECKER(MacIOGPIOState, MACIO_GPIO, - TYPE_MACIO_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(MacIOGPIOState, MACIO_GPIO) struct MacIOGPIOState { /*< private >*/ diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h index 02dbf37630..22b4e64b2c 100644 --- a/include/hw/misc/macio/macio.h +++ b/include/hw/misc/macio/macio.h @@ -40,9 +40,7 @@ /* MacIO virtual bus */ #define TYPE_MACIO_BUS "macio-bus" -typedef struct MacIOBusState MacIOBusState; -DECLARE_INSTANCE_CHECKER(MacIOBusState, MACIO_BUS, - TYPE_MACIO_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(MacIOBusState, MACIO_BUS) struct MacIOBusState { /*< private >*/ @@ -51,9 +49,7 @@ struct MacIOBusState { /* MacIO IDE */ #define TYPE_MACIO_IDE "macio-ide" -typedef struct MACIOIDEState MACIOIDEState; -DECLARE_INSTANCE_CHECKER(MACIOIDEState, MACIO_IDE, - TYPE_MACIO_IDE) +OBJECT_DECLARE_SIMPLE_TYPE(MACIOIDEState, MACIO_IDE) struct MACIOIDEState { /*< private >*/ @@ -79,9 +75,7 @@ void macio_ide_init_drives(MACIOIDEState *ide, DriveInfo **hd_table); void macio_ide_register_dma(MACIOIDEState *ide); #define TYPE_MACIO "macio" -typedef struct MacIOState MacIOState; -DECLARE_INSTANCE_CHECKER(MacIOState, MACIO, - TYPE_MACIO) +OBJECT_DECLARE_SIMPLE_TYPE(MacIOState, MACIO) struct MacIOState { /*< private >*/ @@ -98,9 +92,7 @@ struct MacIOState { }; #define TYPE_OLDWORLD_MACIO "macio-oldworld" -typedef struct OldWorldMacIOState OldWorldMacIOState; -DECLARE_INSTANCE_CHECKER(OldWorldMacIOState, OLDWORLD_MACIO, - TYPE_OLDWORLD_MACIO) +OBJECT_DECLARE_SIMPLE_TYPE(OldWorldMacIOState, OLDWORLD_MACIO) struct OldWorldMacIOState { /*< private >*/ @@ -114,9 +106,7 @@ struct OldWorldMacIOState { }; #define TYPE_NEWWORLD_MACIO "macio-newworld" -typedef struct NewWorldMacIOState NewWorldMacIOState; -DECLARE_INSTANCE_CHECKER(NewWorldMacIOState, NEWWORLD_MACIO, - TYPE_NEWWORLD_MACIO) +OBJECT_DECLARE_SIMPLE_TYPE(NewWorldMacIOState, NEWWORLD_MACIO) struct NewWorldMacIOState { /*< private >*/ diff --git a/include/hw/misc/macio/pmu.h b/include/hw/misc/macio/pmu.h index 0d1a5c1406..78237d99a2 100644 --- a/include/hw/misc/macio/pmu.h +++ b/include/hw/misc/macio/pmu.h @@ -178,11 +178,9 @@ struct MOS6522PMUState { /*< private >*/ MOS6522State parent_obj; }; -typedef struct MOS6522PMUState MOS6522PMUState; #define TYPE_MOS6522_PMU "mos6522-pmu" -DECLARE_INSTANCE_CHECKER(MOS6522PMUState, MOS6522_PMU, - TYPE_MOS6522_PMU) +OBJECT_DECLARE_SIMPLE_TYPE(MOS6522PMUState, MOS6522_PMU) /** * PMUState: * @last_b: last value of B register @@ -231,10 +229,8 @@ struct PMUState { /* GPIO */ MacIOGPIOState *gpio; }; -typedef struct PMUState PMUState; #define TYPE_VIA_PMU "via-pmu" -DECLARE_INSTANCE_CHECKER(PMUState, VIA_PMU, - TYPE_VIA_PMU) +OBJECT_DECLARE_SIMPLE_TYPE(PMUState, VIA_PMU) #endif /* PMU_H */ diff --git a/include/hw/misc/max111x.h b/include/hw/misc/max111x.h index 6350a3f7c0..606cf1e0a2 100644 --- a/include/hw/misc/max111x.h +++ b/include/hw/misc/max111x.h @@ -45,12 +45,10 @@ struct MAX111xState { uint8_t input[8]; int inputs, com; }; -typedef struct MAX111xState MAX111xState; #define TYPE_MAX_111X "max111x" -DECLARE_INSTANCE_CHECKER(MAX111xState, MAX_111X, - TYPE_MAX_111X) +OBJECT_DECLARE_SIMPLE_TYPE(MAX111xState, MAX_111X) #define TYPE_MAX_1110 "max1110" #define TYPE_MAX_1111 "max1111" diff --git a/include/hw/misc/mips_cmgcr.h b/include/hw/misc/mips_cmgcr.h index 923df4f112..9fa58942d7 100644 --- a/include/hw/misc/mips_cmgcr.h +++ b/include/hw/misc/mips_cmgcr.h @@ -14,9 +14,7 @@ #include "qom/object.h" #define TYPE_MIPS_GCR "mips-gcr" -typedef struct MIPSGCRState MIPSGCRState; -DECLARE_INSTANCE_CHECKER(MIPSGCRState, MIPS_GCR, - TYPE_MIPS_GCR) +OBJECT_DECLARE_SIMPLE_TYPE(MIPSGCRState, MIPS_GCR) #define GCR_BASE_ADDR 0x1fbf8000ULL #define GCR_ADDRSPACE_SZ 0x8000 diff --git a/include/hw/misc/mips_cpc.h b/include/hw/misc/mips_cpc.h index 7dc188e8a2..e5dccea151 100644 --- a/include/hw/misc/mips_cpc.h +++ b/include/hw/misc/mips_cpc.h @@ -35,9 +35,7 @@ #define CPC_VP_RUNNING_OFS 0x30 #define TYPE_MIPS_CPC "mips-cpc" -typedef struct MIPSCPCState MIPSCPCState; -DECLARE_INSTANCE_CHECKER(MIPSCPCState, MIPS_CPC, - TYPE_MIPS_CPC) +OBJECT_DECLARE_SIMPLE_TYPE(MIPSCPCState, MIPS_CPC) struct MIPSCPCState { SysBusDevice parent_obj; diff --git a/include/hw/misc/mips_itu.h b/include/hw/misc/mips_itu.h index 7c19f61fbb..96347dbf65 100644 --- a/include/hw/misc/mips_itu.h +++ b/include/hw/misc/mips_itu.h @@ -24,9 +24,7 @@ #include "qom/object.h" #define TYPE_MIPS_ITU "mips-itu" -typedef struct MIPSITUState MIPSITUState; -DECLARE_INSTANCE_CHECKER(MIPSITUState, MIPS_ITU, - TYPE_MIPS_ITU) +OBJECT_DECLARE_SIMPLE_TYPE(MIPSITUState, MIPS_ITU) #define ITC_CELL_DEPTH_SHIFT 2 #define ITC_CELL_DEPTH (1u << ITC_CELL_DEPTH_SHIFT) diff --git a/include/hw/misc/mps2-fpgaio.h b/include/hw/misc/mps2-fpgaio.h index 991f5b731e..80f9227aa6 100644 --- a/include/hw/misc/mps2-fpgaio.h +++ b/include/hw/misc/mps2-fpgaio.h @@ -25,9 +25,7 @@ #include "qom/object.h" #define TYPE_MPS2_FPGAIO "mps2-fpgaio" -typedef struct MPS2FPGAIO MPS2FPGAIO; -DECLARE_INSTANCE_CHECKER(MPS2FPGAIO, MPS2_FPGAIO, - TYPE_MPS2_FPGAIO) +OBJECT_DECLARE_SIMPLE_TYPE(MPS2FPGAIO, MPS2_FPGAIO) struct MPS2FPGAIO { /*< private >*/ diff --git a/include/hw/misc/mps2-scc.h b/include/hw/misc/mps2-scc.h index 445e268b1f..e922b3c8e0 100644 --- a/include/hw/misc/mps2-scc.h +++ b/include/hw/misc/mps2-scc.h @@ -16,9 +16,7 @@ #include "qom/object.h" #define TYPE_MPS2_SCC "mps2-scc" -typedef struct MPS2SCC MPS2SCC; -DECLARE_INSTANCE_CHECKER(MPS2SCC, MPS2_SCC, - TYPE_MPS2_SCC) +OBJECT_DECLARE_SIMPLE_TYPE(MPS2SCC, MPS2_SCC) #define NUM_OSCCLK 3 diff --git a/include/hw/misc/msf2-sysreg.h b/include/hw/misc/msf2-sysreg.h index 625932354a..fc1890e710 100644 --- a/include/hw/misc/msf2-sysreg.h +++ b/include/hw/misc/msf2-sysreg.h @@ -62,9 +62,7 @@ enum { #define MSF2_SYSREG_MMIO_SIZE 0x300 #define TYPE_MSF2_SYSREG "msf2-sysreg" -typedef struct MSF2SysregState MSF2SysregState; -DECLARE_INSTANCE_CHECKER(MSF2SysregState, MSF2_SYSREG, - TYPE_MSF2_SYSREG) +OBJECT_DECLARE_SIMPLE_TYPE(MSF2SysregState, MSF2_SYSREG) struct MSF2SysregState { SysBusDevice parent_obj; diff --git a/include/hw/misc/nrf51_rng.h b/include/hw/misc/nrf51_rng.h index 7f2263a906..9aff9a76f8 100644 --- a/include/hw/misc/nrf51_rng.h +++ b/include/hw/misc/nrf51_rng.h @@ -38,9 +38,7 @@ #include "qemu/timer.h" #include "qom/object.h" #define TYPE_NRF51_RNG "nrf51_soc.rng" -typedef struct NRF51RNGState NRF51RNGState; -DECLARE_INSTANCE_CHECKER(NRF51RNGState, NRF51_RNG, - TYPE_NRF51_RNG) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51RNGState, NRF51_RNG) #define NRF51_RNG_SIZE 0x1000 diff --git a/include/hw/misc/stm32f2xx_syscfg.h b/include/hw/misc/stm32f2xx_syscfg.h index 82ccd7cc24..57a98c533d 100644 --- a/include/hw/misc/stm32f2xx_syscfg.h +++ b/include/hw/misc/stm32f2xx_syscfg.h @@ -37,9 +37,7 @@ #define SYSCFG_CMPCR 0x20 #define TYPE_STM32F2XX_SYSCFG "stm32f2xx-syscfg" -typedef struct STM32F2XXSyscfgState STM32F2XXSyscfgState; -DECLARE_INSTANCE_CHECKER(STM32F2XXSyscfgState, STM32F2XX_SYSCFG, - TYPE_STM32F2XX_SYSCFG) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F2XXSyscfgState, STM32F2XX_SYSCFG) struct STM32F2XXSyscfgState { /* */ diff --git a/include/hw/misc/stm32f4xx_exti.h b/include/hw/misc/stm32f4xx_exti.h index 4987c286ed..24b6fa7724 100644 --- a/include/hw/misc/stm32f4xx_exti.h +++ b/include/hw/misc/stm32f4xx_exti.h @@ -37,9 +37,7 @@ #define EXTI_PR 0x14 #define TYPE_STM32F4XX_EXTI "stm32f4xx-exti" -typedef struct STM32F4xxExtiState STM32F4xxExtiState; -DECLARE_INSTANCE_CHECKER(STM32F4xxExtiState, STM32F4XX_EXTI, - TYPE_STM32F4XX_EXTI) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F4xxExtiState, STM32F4XX_EXTI) #define NUM_GPIO_EVENT_IN_LINES 16 #define NUM_INTERRUPT_OUT_LINES 16 diff --git a/include/hw/misc/stm32f4xx_syscfg.h b/include/hw/misc/stm32f4xx_syscfg.h index c3d89d4536..8c31feccd3 100644 --- a/include/hw/misc/stm32f4xx_syscfg.h +++ b/include/hw/misc/stm32f4xx_syscfg.h @@ -38,9 +38,7 @@ #define SYSCFG_CMPCR 0x20 #define TYPE_STM32F4XX_SYSCFG "stm32f4xx-syscfg" -typedef struct STM32F4xxSyscfgState STM32F4xxSyscfgState; -DECLARE_INSTANCE_CHECKER(STM32F4xxSyscfgState, STM32F4XX_SYSCFG, - TYPE_STM32F4XX_SYSCFG) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F4xxSyscfgState, STM32F4XX_SYSCFG) #define SYSCFG_NUM_EXTICR 4 diff --git a/include/hw/misc/tz-mpc.h b/include/hw/misc/tz-mpc.h index 34e45fdb97..74d5d822cf 100644 --- a/include/hw/misc/tz-mpc.h +++ b/include/hw/misc/tz-mpc.h @@ -35,9 +35,7 @@ #include "qom/object.h" #define TYPE_TZ_MPC "tz-mpc" -typedef struct TZMPC TZMPC; -DECLARE_INSTANCE_CHECKER(TZMPC, TZ_MPC, - TYPE_TZ_MPC) +OBJECT_DECLARE_SIMPLE_TYPE(TZMPC, TZ_MPC) #define TZ_NUM_PORTS 16 diff --git a/include/hw/misc/tz-msc.h b/include/hw/misc/tz-msc.h index 7169f330ff..77cc7f2404 100644 --- a/include/hw/misc/tz-msc.h +++ b/include/hw/misc/tz-msc.h @@ -55,9 +55,7 @@ #include "qom/object.h" #define TYPE_TZ_MSC "tz-msc" -typedef struct TZMSC TZMSC; -DECLARE_INSTANCE_CHECKER(TZMSC, TZ_MSC, - TYPE_TZ_MSC) +OBJECT_DECLARE_SIMPLE_TYPE(TZMSC, TZ_MSC) struct TZMSC { /*< private >*/ diff --git a/include/hw/misc/tz-ppc.h b/include/hw/misc/tz-ppc.h index b5251b715e..021d671b29 100644 --- a/include/hw/misc/tz-ppc.h +++ b/include/hw/misc/tz-ppc.h @@ -69,9 +69,7 @@ #include "qom/object.h" #define TYPE_TZ_PPC "tz-ppc" -typedef struct TZPPC TZPPC; -DECLARE_INSTANCE_CHECKER(TZPPC, TZ_PPC, - TYPE_TZ_PPC) +OBJECT_DECLARE_SIMPLE_TYPE(TZPPC, TZ_PPC) #define TZ_NUM_PORTS 16 diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h index 7c724bab94..518d627dc5 100644 --- a/include/hw/misc/unimp.h +++ b/include/hw/misc/unimp.h @@ -15,9 +15,7 @@ #define TYPE_UNIMPLEMENTED_DEVICE "unimplemented-device" -typedef struct UnimplementedDeviceState UnimplementedDeviceState; -DECLARE_INSTANCE_CHECKER(UnimplementedDeviceState, UNIMPLEMENTED_DEVICE, - TYPE_UNIMPLEMENTED_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(UnimplementedDeviceState, UNIMPLEMENTED_DEVICE) struct UnimplementedDeviceState { SysBusDevice parent_obj; diff --git a/include/hw/misc/zynq-xadc.h b/include/hw/misc/zynq-xadc.h index 052f47954f..602bfb4ab1 100644 --- a/include/hw/misc/zynq-xadc.h +++ b/include/hw/misc/zynq-xadc.h @@ -24,9 +24,7 @@ #define ZYNQ_XADC_FIFO_DEPTH 15 #define TYPE_ZYNQ_XADC "xlnx,zynq-xadc" -typedef struct ZynqXADCState ZynqXADCState; -DECLARE_INSTANCE_CHECKER(ZynqXADCState, ZYNQ_XADC, - TYPE_ZYNQ_XADC) +OBJECT_DECLARE_SIMPLE_TYPE(ZynqXADCState, ZYNQ_XADC) struct ZynqXADCState { /*< private >*/ diff --git a/include/hw/net/allwinner-sun8i-emac.h b/include/hw/net/allwinner-sun8i-emac.h index 89e56b815b..460a58f1ca 100644 --- a/include/hw/net/allwinner-sun8i-emac.h +++ b/include/hw/net/allwinner-sun8i-emac.h @@ -30,9 +30,7 @@ */ #define TYPE_AW_SUN8I_EMAC "allwinner-sun8i-emac" -typedef struct AwSun8iEmacState AwSun8iEmacState; -DECLARE_INSTANCE_CHECKER(AwSun8iEmacState, AW_SUN8I_EMAC, - TYPE_AW_SUN8I_EMAC) +OBJECT_DECLARE_SIMPLE_TYPE(AwSun8iEmacState, AW_SUN8I_EMAC) /** @} */ diff --git a/include/hw/net/allwinner_emac.h b/include/hw/net/allwinner_emac.h index f5f5b67939..534e748982 100644 --- a/include/hw/net/allwinner_emac.h +++ b/include/hw/net/allwinner_emac.h @@ -31,9 +31,7 @@ #include "qom/object.h" #define TYPE_AW_EMAC "allwinner-emac" -typedef struct AwEmacState AwEmacState; -DECLARE_INSTANCE_CHECKER(AwEmacState, AW_EMAC, - TYPE_AW_EMAC) +OBJECT_DECLARE_SIMPLE_TYPE(AwEmacState, AW_EMAC) /* * Allwinner EMAC register list diff --git a/include/hw/net/cadence_gem.h b/include/hw/net/cadence_gem.h index 89d2dab513..91ebb5c8ae 100644 --- a/include/hw/net/cadence_gem.h +++ b/include/hw/net/cadence_gem.h @@ -27,9 +27,7 @@ #include "qom/object.h" #define TYPE_CADENCE_GEM "cadence_gem" -typedef struct CadenceGEMState CadenceGEMState; -DECLARE_INSTANCE_CHECKER(CadenceGEMState, CADENCE_GEM, - TYPE_CADENCE_GEM) +OBJECT_DECLARE_SIMPLE_TYPE(CadenceGEMState, CADENCE_GEM) #include "net/net.h" #include "hw/sysbus.h" diff --git a/include/hw/net/ftgmac100.h b/include/hw/net/ftgmac100.h index c6b1c11fca..765d1538a4 100644 --- a/include/hw/net/ftgmac100.h +++ b/include/hw/net/ftgmac100.h @@ -12,9 +12,7 @@ #include "qom/object.h" #define TYPE_FTGMAC100 "ftgmac100" -typedef struct FTGMAC100State FTGMAC100State; -DECLARE_INSTANCE_CHECKER(FTGMAC100State, FTGMAC100, - TYPE_FTGMAC100) +OBJECT_DECLARE_SIMPLE_TYPE(FTGMAC100State, FTGMAC100) #include "hw/sysbus.h" #include "net/net.h" @@ -70,9 +68,7 @@ struct FTGMAC100State { }; #define TYPE_ASPEED_MII "aspeed-mmi" -typedef struct AspeedMiiState AspeedMiiState; -DECLARE_INSTANCE_CHECKER(AspeedMiiState, ASPEED_MII, - TYPE_ASPEED_MII) +OBJECT_DECLARE_SIMPLE_TYPE(AspeedMiiState, ASPEED_MII) /* * AST2600 MII controller diff --git a/include/hw/net/imx_fec.h b/include/hw/net/imx_fec.h index ffdbc304b6..e3a8755db9 100644 --- a/include/hw/net/imx_fec.h +++ b/include/hw/net/imx_fec.h @@ -26,9 +26,7 @@ #include "qom/object.h" #define TYPE_IMX_FEC "imx.fec" -typedef struct IMXFECState IMXFECState; -DECLARE_INSTANCE_CHECKER(IMXFECState, IMX_FEC, - TYPE_IMX_FEC) +OBJECT_DECLARE_SIMPLE_TYPE(IMXFECState, IMX_FEC) #define TYPE_IMX_ENET "imx.enet" diff --git a/include/hw/net/msf2-emac.h b/include/hw/net/msf2-emac.h index 68194d798c..846ba6e6dc 100644 --- a/include/hw/net/msf2-emac.h +++ b/include/hw/net/msf2-emac.h @@ -29,9 +29,7 @@ #include "qom/object.h" #define TYPE_MSS_EMAC "msf2-emac" -typedef struct MSF2EmacState MSF2EmacState; -DECLARE_INSTANCE_CHECKER(MSF2EmacState, MSS_EMAC, - TYPE_MSS_EMAC) +OBJECT_DECLARE_SIMPLE_TYPE(MSF2EmacState, MSS_EMAC) #define R_MAX (0x1a0 / 4) #define PHY_MAX_REGS 32 diff --git a/include/hw/nubus/mac-nubus-bridge.h b/include/hw/nubus/mac-nubus-bridge.h index 6856d7e095..36aa098dd4 100644 --- a/include/hw/nubus/mac-nubus-bridge.h +++ b/include/hw/nubus/mac-nubus-bridge.h @@ -13,9 +13,7 @@ #include "qom/object.h" #define TYPE_MAC_NUBUS_BRIDGE "mac-nubus-bridge" -typedef struct MacNubusState MacNubusState; -DECLARE_INSTANCE_CHECKER(MacNubusState, MAC_NUBUS_BRIDGE, - TYPE_MAC_NUBUS_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(MacNubusState, MAC_NUBUS_BRIDGE) struct MacNubusState { SysBusDevice sysbus_dev; diff --git a/include/hw/nubus/nubus.h b/include/hw/nubus/nubus.h index 9370f0d8f0..e2b5cf260b 100644 --- a/include/hw/nubus/nubus.h +++ b/include/hw/nubus/nubus.h @@ -23,14 +23,10 @@ #define NUBUS_LAST_SLOT 0xF #define TYPE_NUBUS_DEVICE "nubus-device" -typedef struct NubusDevice NubusDevice; -DECLARE_INSTANCE_CHECKER(NubusDevice, NUBUS_DEVICE, - TYPE_NUBUS_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(NubusDevice, NUBUS_DEVICE) #define TYPE_NUBUS_BUS "nubus-bus" -typedef struct NubusBus NubusBus; -DECLARE_INSTANCE_CHECKER(NubusBus, NUBUS_BUS, - TYPE_NUBUS_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(NubusBus, NUBUS_BUS) #define TYPE_NUBUS_BRIDGE "nubus-bridge" diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index f85393400c..8a9f5738bf 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -12,12 +12,9 @@ #define TYPE_FW_CFG_MEM "fw_cfg_mem" #define TYPE_FW_CFG_DATA_GENERATOR_INTERFACE "fw_cfg-data-generator" -DECLARE_INSTANCE_CHECKER(FWCfgState, FW_CFG, - TYPE_FW_CFG) -DECLARE_INSTANCE_CHECKER(FWCfgIoState, FW_CFG_IO, - TYPE_FW_CFG_IO) -DECLARE_INSTANCE_CHECKER(FWCfgMemState, FW_CFG_MEM, - TYPE_FW_CFG_MEM) +OBJECT_DECLARE_SIMPLE_TYPE(FWCfgState, FW_CFG) +OBJECT_DECLARE_SIMPLE_TYPE(FWCfgIoState, FW_CFG_IO) +OBJECT_DECLARE_SIMPLE_TYPE(FWCfgMemState, FW_CFG_MEM) typedef struct FWCfgDataGeneratorClass FWCfgDataGeneratorClass; DECLARE_CLASS_CHECKERS(FWCfgDataGeneratorClass, FW_CFG_DATA_GENERATOR, diff --git a/include/hw/nvram/nrf51_nvm.h b/include/hw/nvram/nrf51_nvm.h index ab99b09206..d85e788df5 100644 --- a/include/hw/nvram/nrf51_nvm.h +++ b/include/hw/nvram/nrf51_nvm.h @@ -25,9 +25,7 @@ #include "hw/sysbus.h" #include "qom/object.h" #define TYPE_NRF51_NVM "nrf51_soc.nvm" -typedef struct NRF51NVMState NRF51NVMState; -DECLARE_INSTANCE_CHECKER(NRF51NVMState, NRF51_NVM, - TYPE_NRF51_NVM) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51NVMState, NRF51_NVM) #define NRF51_UICR_FIXTURE_SIZE 64 diff --git a/include/hw/pci-bridge/simba.h b/include/hw/pci-bridge/simba.h index 675aa5a990..979cb17435 100644 --- a/include/hw/pci-bridge/simba.h +++ b/include/hw/pci-bridge/simba.h @@ -35,10 +35,8 @@ struct SimbaPCIBridge { /*< private >*/ PCIBridge parent_obj; }; -typedef struct SimbaPCIBridge SimbaPCIBridge; #define TYPE_SIMBA_PCI_BRIDGE "pbm-bridge" -DECLARE_INSTANCE_CHECKER(SimbaPCIBridge, SIMBA_PCI_BRIDGE, - TYPE_SIMBA_PCI_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(SimbaPCIBridge, SIMBA_PCI_BRIDGE) #endif diff --git a/include/hw/pci-host/designware.h b/include/hw/pci-host/designware.h index 551eec3107..79869c7066 100644 --- a/include/hw/pci-host/designware.h +++ b/include/hw/pci-host/designware.h @@ -29,14 +29,10 @@ #include "qom/object.h" #define TYPE_DESIGNWARE_PCIE_HOST "designware-pcie-host" -typedef struct DesignwarePCIEHost DesignwarePCIEHost; -DECLARE_INSTANCE_CHECKER(DesignwarePCIEHost, DESIGNWARE_PCIE_HOST, - TYPE_DESIGNWARE_PCIE_HOST) +OBJECT_DECLARE_SIMPLE_TYPE(DesignwarePCIEHost, DESIGNWARE_PCIE_HOST) #define TYPE_DESIGNWARE_PCIE_ROOT "designware-pcie-root" -typedef struct DesignwarePCIERoot DesignwarePCIERoot; -DECLARE_INSTANCE_CHECKER(DesignwarePCIERoot, DESIGNWARE_PCIE_ROOT, - TYPE_DESIGNWARE_PCIE_ROOT) +OBJECT_DECLARE_SIMPLE_TYPE(DesignwarePCIERoot, DESIGNWARE_PCIE_ROOT) struct DesignwarePCIERoot; diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h index 2f4e852eee..7abdb8b406 100644 --- a/include/hw/pci-host/gpex.h +++ b/include/hw/pci-host/gpex.h @@ -26,14 +26,10 @@ #include "qom/object.h" #define TYPE_GPEX_HOST "gpex-pcihost" -typedef struct GPEXHost GPEXHost; -DECLARE_INSTANCE_CHECKER(GPEXHost, GPEX_HOST, - TYPE_GPEX_HOST) +OBJECT_DECLARE_SIMPLE_TYPE(GPEXHost, GPEX_HOST) #define TYPE_GPEX_ROOT_DEVICE "gpex-root" -typedef struct GPEXRootState GPEXRootState; -DECLARE_INSTANCE_CHECKER(GPEXRootState, GPEX_ROOT_DEVICE, - TYPE_GPEX_ROOT_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(GPEXRootState, GPEX_ROOT_DEVICE) #define GPEX_NUM_IRQS 4 diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h index 046c64576d..6c16eaf876 100644 --- a/include/hw/pci-host/i440fx.h +++ b/include/hw/pci-host/i440fx.h @@ -19,9 +19,7 @@ #define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost" #define TYPE_I440FX_PCI_DEVICE "i440FX" -typedef struct PCII440FXState PCII440FXState; -DECLARE_INSTANCE_CHECKER(PCII440FXState, I440FX_PCI_DEVICE, - TYPE_I440FX_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(PCII440FXState, I440FX_PCI_DEVICE) struct PCII440FXState { /*< private >*/ diff --git a/include/hw/pci-host/pnv_phb3.h b/include/hw/pci-host/pnv_phb3.h index 182f29d681..e2a2e36245 100644 --- a/include/hw/pci-host/pnv_phb3.h +++ b/include/hw/pci-host/pnv_phb3.h @@ -72,9 +72,7 @@ typedef struct PnvPhb3DMASpace { * PHB3 Power Bus Common Queue */ #define TYPE_PNV_PBCQ "pnv-pbcq" -typedef struct PnvPBCQState PnvPBCQState; -DECLARE_INSTANCE_CHECKER(PnvPBCQState, PNV_PBCQ, - TYPE_PNV_PBCQ) +OBJECT_DECLARE_SIMPLE_TYPE(PnvPBCQState, PNV_PBCQ) struct PnvPBCQState { DeviceState parent; @@ -118,8 +116,7 @@ typedef struct PnvPHB3RootPort { * PHB3 PCIe Host Bridge for PowerNV machines (POWER8) */ #define TYPE_PNV_PHB3 "pnv-phb3" -DECLARE_INSTANCE_CHECKER(PnvPHB3, PNV_PHB3, - TYPE_PNV_PHB3) +OBJECT_DECLARE_SIMPLE_TYPE(PnvPHB3, PNV_PHB3) #define PNV_PHB3_NUM_M64 16 #define PNV_PHB3_NUM_REGS (0x1000 >> 3) diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index 05efb4e6b9..27556ae534 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -57,8 +57,7 @@ typedef struct PnvPHB4RootPort { * PHB4 PCIe Host Bridge for PowerNV machines (POWER9) */ #define TYPE_PNV_PHB4 "pnv-phb4" -DECLARE_INSTANCE_CHECKER(PnvPHB4, PNV_PHB4, - TYPE_PNV_PHB4) +OBJECT_DECLARE_SIMPLE_TYPE(PnvPHB4, PNV_PHB4) #define PNV_PHB4_MAX_LSIs 8 #define PNV_PHB4_MAX_INTs 4096 @@ -144,8 +143,7 @@ extern const MemoryRegionOps pnv_phb4_xscom_ops; OBJECT_DECLARE_TYPE(PnvPhb4PecState, PnvPhb4PecClass, PNV_PHB4_PEC) #define TYPE_PNV_PHB4_PEC_STACK "pnv-phb4-pec-stack" -DECLARE_INSTANCE_CHECKER(PnvPhb4PecStack, PNV_PHB4_PEC_STACK, - TYPE_PNV_PHB4_PEC_STACK) +OBJECT_DECLARE_SIMPLE_TYPE(PnvPhb4PecStack, PNV_PHB4_PEC_STACK) /* Per-stack data */ struct PnvPhb4PecStack { diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h index 0f5a534f77..bbb9581765 100644 --- a/include/hw/pci-host/q35.h +++ b/include/hw/pci-host/q35.h @@ -30,14 +30,10 @@ #include "qom/object.h" #define TYPE_Q35_HOST_DEVICE "q35-pcihost" -typedef struct Q35PCIHost Q35PCIHost; -DECLARE_INSTANCE_CHECKER(Q35PCIHost, Q35_HOST_DEVICE, - TYPE_Q35_HOST_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(Q35PCIHost, Q35_HOST_DEVICE) #define TYPE_MCH_PCI_DEVICE "mch" -typedef struct MCHPCIState MCHPCIState; -DECLARE_INSTANCE_CHECKER(MCHPCIState, MCH_PCI_DEVICE, - TYPE_MCH_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(MCHPCIState, MCH_PCI_DEVICE) struct MCHPCIState { /*< private >*/ diff --git a/include/hw/pci-host/sabre.h b/include/hw/pci-host/sabre.h index 7a76de4b9e..01190241bb 100644 --- a/include/hw/pci-host/sabre.h +++ b/include/hw/pci-host/sabre.h @@ -20,11 +20,9 @@ struct SabrePCIState { PCIDevice parent_obj; }; -typedef struct SabrePCIState SabrePCIState; #define TYPE_SABRE_PCI_DEVICE "sabre-pci" -DECLARE_INSTANCE_CHECKER(SabrePCIState, SABRE_PCI_DEVICE, - TYPE_SABRE_PCI_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(SabrePCIState, SABRE_PCI_DEVICE) struct SabreState { PCIHostState parent_obj; @@ -48,10 +46,8 @@ struct SabreState { uint32_t reset_control; unsigned int nr_resets; }; -typedef struct SabreState SabreState; #define TYPE_SABRE "sabre" -DECLARE_INSTANCE_CHECKER(SabreState, SABRE, - TYPE_SABRE) +OBJECT_DECLARE_SIMPLE_TYPE(SabreState, SABRE) #endif diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 0431ce1048..04917f31ef 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -28,9 +28,7 @@ #define TYPE_SPAPR_PCI_HOST_BRIDGE "spapr-pci-host-bridge" -typedef struct SpaprPhbState SpaprPhbState; -DECLARE_INSTANCE_CHECKER(SpaprPhbState, SPAPR_PCI_HOST_BRIDGE, - TYPE_SPAPR_PCI_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprPhbState, SPAPR_PCI_HOST_BRIDGE) #define SPAPR_PCI_DMA_MAX_WINDOWS 2 diff --git a/include/hw/pci-host/uninorth.h b/include/hw/pci-host/uninorth.h index d10c598298..a6ba5f21a8 100644 --- a/include/hw/pci-host/uninorth.h +++ b/include/hw/pci-host/uninorth.h @@ -63,10 +63,8 @@ struct UNINState { MemoryRegion mem; }; -typedef struct UNINState UNINState; #define TYPE_UNI_NORTH "uni-north" -DECLARE_INSTANCE_CHECKER(UNINState, UNI_NORTH, - TYPE_UNI_NORTH) +OBJECT_DECLARE_SIMPLE_TYPE(UNINState, UNI_NORTH) #endif /* UNINORTH_H */ diff --git a/include/hw/pci-host/xilinx-pcie.h b/include/hw/pci-host/xilinx-pcie.h index 6058c8c9e2..f079e50db4 100644 --- a/include/hw/pci-host/xilinx-pcie.h +++ b/include/hw/pci-host/xilinx-pcie.h @@ -27,14 +27,10 @@ #include "qom/object.h" #define TYPE_XILINX_PCIE_HOST "xilinx-pcie-host" -typedef struct XilinxPCIEHost XilinxPCIEHost; -DECLARE_INSTANCE_CHECKER(XilinxPCIEHost, XILINX_PCIE_HOST, - TYPE_XILINX_PCIE_HOST) +OBJECT_DECLARE_SIMPLE_TYPE(XilinxPCIEHost, XILINX_PCIE_HOST) #define TYPE_XILINX_PCIE_ROOT "xilinx-pcie-root" -typedef struct XilinxPCIERoot XilinxPCIERoot; -DECLARE_INSTANCE_CHECKER(XilinxPCIERoot, XILINX_PCIE_ROOT, - TYPE_XILINX_PCIE_ROOT) +OBJECT_DECLARE_SIMPLE_TYPE(XilinxPCIERoot, XILINX_PCIE_ROOT) struct XilinxPCIERoot { PCIBridge parent_obj; diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h index 7ab145955a..a94d350034 100644 --- a/include/hw/pci/pci_bridge.h +++ b/include/hw/pci/pci_bridge.h @@ -51,8 +51,7 @@ struct PCIBridgeWindows { }; #define TYPE_PCI_BRIDGE "base-pci-bridge" -DECLARE_INSTANCE_CHECKER(PCIBridge, PCI_BRIDGE, - TYPE_PCI_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(PCIBridge, PCI_BRIDGE) struct PCIBridge { /*< private >*/ diff --git a/include/hw/pci/pcie_host.h b/include/hw/pci/pcie_host.h index f512646c0c..076457b270 100644 --- a/include/hw/pci/pcie_host.h +++ b/include/hw/pci/pcie_host.h @@ -26,8 +26,7 @@ #include "qom/object.h" #define TYPE_PCIE_HOST_BRIDGE "pcie-host-bridge" -DECLARE_INSTANCE_CHECKER(PCIExpressHost, PCIE_HOST_BRIDGE, - TYPE_PCIE_HOST_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(PCIExpressHost, PCIE_HOST_BRIDGE) #define PCIE_HOST_MCFG_BASE "MCFG" #define PCIE_HOST_MCFG_SIZE "mcfg_size" diff --git a/include/hw/pci/pcie_port.h b/include/hw/pci/pcie_port.h index 2463c07fa7..bea8ecad0f 100644 --- a/include/hw/pci/pcie_port.h +++ b/include/hw/pci/pcie_port.h @@ -26,8 +26,7 @@ #include "qom/object.h" #define TYPE_PCIE_PORT "pcie-port" -DECLARE_INSTANCE_CHECKER(PCIEPort, PCIE_PORT, - TYPE_PCIE_PORT) +OBJECT_DECLARE_SIMPLE_TYPE(PCIEPort, PCIE_PORT) struct PCIEPort { /*< private >*/ @@ -41,8 +40,7 @@ struct PCIEPort { void pcie_port_init_reg(PCIDevice *d); #define TYPE_PCIE_SLOT "pcie-slot" -DECLARE_INSTANCE_CHECKER(PCIESlot, PCIE_SLOT, - TYPE_PCIE_SLOT) +OBJECT_DECLARE_SIMPLE_TYPE(PCIESlot, PCIE_SLOT) struct PCIESlot { /*< private >*/ diff --git a/include/hw/platform-bus.h b/include/hw/platform-bus.h index 0d035e1b71..1f3d1ce869 100644 --- a/include/hw/platform-bus.h +++ b/include/hw/platform-bus.h @@ -25,11 +25,9 @@ #include "hw/sysbus.h" #include "qom/object.h" -typedef struct PlatformBusDevice PlatformBusDevice; #define TYPE_PLATFORM_BUS_DEVICE "platform-bus-device" -DECLARE_INSTANCE_CHECKER(PlatformBusDevice, PLATFORM_BUS_DEVICE, - TYPE_PLATFORM_BUS_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(PlatformBusDevice, PLATFORM_BUS_DEVICE) struct PlatformBusDevice { /*< private >*/ diff --git a/include/hw/ppc/mac_dbdma.h b/include/hw/ppc/mac_dbdma.h index 9166d5f758..4a3f644516 100644 --- a/include/hw/ppc/mac_dbdma.h +++ b/include/hw/ppc/mac_dbdma.h @@ -178,7 +178,6 @@ void DBDMA_register_channel(void *dbdma, int nchan, qemu_irq irq, void DBDMA_kick(DBDMAState *dbdma); #define TYPE_MAC_DBDMA "mac-dbdma" -DECLARE_INSTANCE_CHECKER(DBDMAState, MAC_DBDMA, - TYPE_MAC_DBDMA) +OBJECT_DECLARE_SIMPLE_TYPE(DBDMAState, MAC_DBDMA) #endif diff --git a/include/hw/ppc/openpic.h b/include/hw/ppc/openpic.h index 61908c7858..74ff44bff0 100644 --- a/include/hw/ppc/openpic.h +++ b/include/hw/ppc/openpic.h @@ -137,9 +137,7 @@ typedef struct IRQDest { } IRQDest; #define TYPE_OPENPIC "openpic" -typedef struct OpenPICState OpenPICState; -DECLARE_INSTANCE_CHECKER(OpenPICState, OPENPIC, - TYPE_OPENPIC) +OBJECT_DECLARE_SIMPLE_TYPE(OpenPICState, OPENPIC) struct OpenPICState { /*< private >*/ diff --git a/include/hw/ppc/pnv_core.h b/include/hw/ppc/pnv_core.h index fc11edee28..f15829dfae 100644 --- a/include/hw/ppc/pnv_core.h +++ b/include/hw/ppc/pnv_core.h @@ -62,9 +62,7 @@ static inline PnvCPUState *pnv_cpu_state(PowerPCCPU *cpu) } #define TYPE_PNV_QUAD "powernv-cpu-quad" -typedef struct PnvQuad PnvQuad; -DECLARE_INSTANCE_CHECKER(PnvQuad, PNV_QUAD, - TYPE_PNV_QUAD) +OBJECT_DECLARE_SIMPLE_TYPE(PnvQuad, PNV_QUAD) struct PnvQuad { DeviceState parent_obj; diff --git a/include/hw/ppc/pnv_pnor.h b/include/hw/ppc/pnv_pnor.h index 1ec4098bb9..99f9a3adfb 100644 --- a/include/hw/ppc/pnv_pnor.h +++ b/include/hw/ppc/pnv_pnor.h @@ -16,9 +16,7 @@ #define PNOR_SPI_OFFSET 0x0c000000UL #define TYPE_PNV_PNOR "pnv-pnor" -typedef struct PnvPnor PnvPnor; -DECLARE_INSTANCE_CHECKER(PnvPnor, PNV_PNOR, - TYPE_PNV_PNOR) +OBJECT_DECLARE_SIMPLE_TYPE(PnvPnor, PNV_PNOR) struct PnvPnor { SysBusDevice parent_obj; diff --git a/include/hw/ppc/pnv_psi.h b/include/hw/ppc/pnv_psi.h index a1fe25b3eb..682b09f874 100644 --- a/include/hw/ppc/pnv_psi.h +++ b/include/hw/ppc/pnv_psi.h @@ -51,9 +51,7 @@ struct PnvPsi { }; #define TYPE_PNV8_PSI TYPE_PNV_PSI "-POWER8" -typedef struct Pnv8Psi Pnv8Psi; -DECLARE_INSTANCE_CHECKER(Pnv8Psi, PNV8_PSI, - TYPE_PNV8_PSI) +OBJECT_DECLARE_SIMPLE_TYPE(Pnv8Psi, PNV8_PSI) struct Pnv8Psi { PnvPsi parent; @@ -62,9 +60,7 @@ struct Pnv8Psi { }; #define TYPE_PNV9_PSI TYPE_PNV_PSI "-POWER9" -typedef struct Pnv9Psi Pnv9Psi; -DECLARE_INSTANCE_CHECKER(Pnv9Psi, PNV9_PSI, - TYPE_PNV9_PSI) +OBJECT_DECLARE_SIMPLE_TYPE(Pnv9Psi, PNV9_PSI) struct Pnv9Psi { PnvPsi parent; diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index eea7ac8624..194f3b9d07 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -28,9 +28,7 @@ typedef struct SpaprPendingHpt SpaprPendingHpt; #define TYPE_SPAPR_RTC "spapr-rtc" -typedef struct SpaprRtcState SpaprRtcState; -DECLARE_INSTANCE_CHECKER(SpaprRtcState, SPAPR_RTC, - TYPE_SPAPR_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprRtcState, SPAPR_RTC) struct SpaprRtcState { /*< private >*/ @@ -781,11 +779,9 @@ static inline void spapr_dt_irq(uint32_t *intspec, int irq, bool is_lsi) intspec[1] = is_lsi ? cpu_to_be32(1) : 0; } -typedef struct SpaprTceTable SpaprTceTable; #define TYPE_SPAPR_TCE_TABLE "spapr-tce-table" -DECLARE_INSTANCE_CHECKER(SpaprTceTable, SPAPR_TCE_TABLE, - TYPE_SPAPR_TCE_TABLE) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprTceTable, SPAPR_TCE_TABLE) #define TYPE_SPAPR_IOMMU_MEMORY_REGION "spapr-iommu-memory-region" DECLARE_INSTANCE_CHECKER(IOMMUMemoryRegion, SPAPR_IOMMU_MEMORY_REGION, diff --git a/include/hw/ppc/spapr_tpm_proxy.h b/include/hw/ppc/spapr_tpm_proxy.h index 300c81b1f0..96d2a9697e 100644 --- a/include/hw/ppc/spapr_tpm_proxy.h +++ b/include/hw/ppc/spapr_tpm_proxy.h @@ -17,9 +17,7 @@ #include "hw/qdev-core.h" #define TYPE_SPAPR_TPM_PROXY "spapr-tpm-proxy" -typedef struct SpaprTpmProxy SpaprTpmProxy; -DECLARE_INSTANCE_CHECKER(SpaprTpmProxy, SPAPR_TPM_PROXY, - TYPE_SPAPR_TPM_PROXY) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprTpmProxy, SPAPR_TPM_PROXY) struct SpaprTpmProxy { /*< private >*/ diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h index aae03ea6ab..356751e2d7 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -32,9 +32,7 @@ OBJECT_DECLARE_TYPE(SpaprVioDevice, SpaprVioDeviceClass, VIO_SPAPR_DEVICE) #define TYPE_SPAPR_VIO_BUS "spapr-vio-bus" -typedef struct SpaprVioBus SpaprVioBus; -DECLARE_INSTANCE_CHECKER(SpaprVioBus, SPAPR_VIO_BUS, - TYPE_SPAPR_VIO_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprVioBus, SPAPR_VIO_BUS) #define TYPE_SPAPR_VIO_BRIDGE "spapr-vio-bridge" diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index 26771bb2b3..445eccfe6b 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -168,9 +168,7 @@ struct XiveNotifierClass { */ #define TYPE_XIVE_SOURCE "xive-source" -typedef struct XiveSource XiveSource; -DECLARE_INSTANCE_CHECKER(XiveSource, XIVE_SOURCE, - TYPE_XIVE_SOURCE) +OBJECT_DECLARE_SIMPLE_TYPE(XiveSource, XIVE_SOURCE) /* * XIVE Interrupt Source characteristics, which define how the ESB are @@ -306,9 +304,7 @@ void xive_source_set_irq(void *opaque, int srcno, int val); */ #define TYPE_XIVE_TCTX "xive-tctx" -typedef struct XiveTCTX XiveTCTX; -DECLARE_INSTANCE_CHECKER(XiveTCTX, XIVE_TCTX, - TYPE_XIVE_TCTX) +OBJECT_DECLARE_SIMPLE_TYPE(XiveTCTX, XIVE_TCTX) /* * XIVE Thread interrupt Management register rings : @@ -433,9 +429,7 @@ struct XiveFabricClass { */ #define TYPE_XIVE_END_SOURCE "xive-end-source" -typedef struct XiveENDSource XiveENDSource; -DECLARE_INSTANCE_CHECKER(XiveENDSource, XIVE_END_SOURCE, - TYPE_XIVE_END_SOURCE) +OBJECT_DECLARE_SIMPLE_TYPE(XiveENDSource, XIVE_END_SOURCE) struct XiveENDSource { DeviceState parent; diff --git a/include/hw/riscv/opentitan.h b/include/hw/riscv/opentitan.h index 8c15b6325f..5ff0c0f85e 100644 --- a/include/hw/riscv/opentitan.h +++ b/include/hw/riscv/opentitan.h @@ -25,9 +25,7 @@ #include "qom/object.h" #define TYPE_RISCV_IBEX_SOC "riscv.lowrisc.ibex.soc" -typedef struct LowRISCIbexSoCState LowRISCIbexSoCState; -DECLARE_INSTANCE_CHECKER(LowRISCIbexSoCState, RISCV_IBEX_SOC, - TYPE_RISCV_IBEX_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(LowRISCIbexSoCState, RISCV_IBEX_SOC) struct LowRISCIbexSoCState { /*< private >*/ diff --git a/include/hw/riscv/riscv_hart.h b/include/hw/riscv/riscv_hart.h index ac2cb62e1b..bbc21cdc9a 100644 --- a/include/hw/riscv/riscv_hart.h +++ b/include/hw/riscv/riscv_hart.h @@ -27,9 +27,7 @@ #define TYPE_RISCV_HART_ARRAY "riscv.hart_array" -typedef struct RISCVHartArrayState RISCVHartArrayState; -DECLARE_INSTANCE_CHECKER(RISCVHartArrayState, RISCV_HART_ARRAY, - TYPE_RISCV_HART_ARRAY) +OBJECT_DECLARE_SIMPLE_TYPE(RISCVHartArrayState, RISCV_HART_ARRAY) struct RISCVHartArrayState { /*< private >*/ diff --git a/include/hw/rtc/aspeed_rtc.h b/include/hw/rtc/aspeed_rtc.h index d7691ab88f..df61e46059 100644 --- a/include/hw/rtc/aspeed_rtc.h +++ b/include/hw/rtc/aspeed_rtc.h @@ -21,10 +21,8 @@ struct AspeedRtcState { int offset; }; -typedef struct AspeedRtcState AspeedRtcState; #define TYPE_ASPEED_RTC "aspeed.rtc" -DECLARE_INSTANCE_CHECKER(AspeedRtcState, ASPEED_RTC, - TYPE_ASPEED_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(AspeedRtcState, ASPEED_RTC) #endif /* HW_RTC_ASPEED_RTC_H */ diff --git a/include/hw/rtc/goldfish_rtc.h b/include/hw/rtc/goldfish_rtc.h index b710c21c94..79ca7daf5d 100644 --- a/include/hw/rtc/goldfish_rtc.h +++ b/include/hw/rtc/goldfish_rtc.h @@ -26,9 +26,7 @@ #include "qom/object.h" #define TYPE_GOLDFISH_RTC "goldfish_rtc" -typedef struct GoldfishRTCState GoldfishRTCState; -DECLARE_INSTANCE_CHECKER(GoldfishRTCState, GOLDFISH_RTC, - TYPE_GOLDFISH_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(GoldfishRTCState, GOLDFISH_RTC) struct GoldfishRTCState { SysBusDevice parent_obj; diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h index e58e006d0d..6224b5276a 100644 --- a/include/hw/rtc/mc146818rtc.h +++ b/include/hw/rtc/mc146818rtc.h @@ -16,9 +16,7 @@ #include "qom/object.h" #define TYPE_MC146818_RTC "mc146818rtc" -typedef struct RTCState RTCState; -DECLARE_INSTANCE_CHECKER(RTCState, MC146818_RTC, - TYPE_MC146818_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(RTCState, MC146818_RTC) struct RTCState { ISADevice parent_obj; diff --git a/include/hw/rtc/pl031.h b/include/hw/rtc/pl031.h index 3897b424d4..9fd4be1abb 100644 --- a/include/hw/rtc/pl031.h +++ b/include/hw/rtc/pl031.h @@ -19,9 +19,7 @@ #include "qom/object.h" #define TYPE_PL031 "pl031" -typedef struct PL031State PL031State; -DECLARE_INSTANCE_CHECKER(PL031State, PL031, - TYPE_PL031) +OBJECT_DECLARE_SIMPLE_TYPE(PL031State, PL031) struct PL031State { SysBusDevice parent_obj; diff --git a/include/hw/rtc/xlnx-zynqmp-rtc.h b/include/hw/rtc/xlnx-zynqmp-rtc.h index 209de85ae6..5f1ad0a946 100644 --- a/include/hw/rtc/xlnx-zynqmp-rtc.h +++ b/include/hw/rtc/xlnx-zynqmp-rtc.h @@ -33,9 +33,7 @@ #define TYPE_XLNX_ZYNQMP_RTC "xlnx-zynmp.rtc" -typedef struct XlnxZynqMPRTC XlnxZynqMPRTC; -DECLARE_INSTANCE_CHECKER(XlnxZynqMPRTC, XLNX_ZYNQMP_RTC, - TYPE_XLNX_ZYNQMP_RTC) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPRTC, XLNX_ZYNQMP_RTC) REG32(SET_TIME_WRITE, 0x0) REG32(SET_TIME_READ, 0x4) diff --git a/include/hw/s390x/css-bridge.h b/include/hw/s390x/css-bridge.h index 9fd4484204..deb606d71f 100644 --- a/include/hw/s390x/css-bridge.h +++ b/include/hw/s390x/css-bridge.h @@ -21,21 +21,17 @@ struct VirtualCssBridge { SysBusDevice sysbus_dev; bool css_dev_path; }; -typedef struct VirtualCssBridge VirtualCssBridge; #define TYPE_VIRTUAL_CSS_BRIDGE "virtual-css-bridge" -DECLARE_INSTANCE_CHECKER(VirtualCssBridge, VIRTUAL_CSS_BRIDGE, - TYPE_VIRTUAL_CSS_BRIDGE) +OBJECT_DECLARE_SIMPLE_TYPE(VirtualCssBridge, VIRTUAL_CSS_BRIDGE) /* virtual css bus type */ struct VirtualCssBus { BusState parent_obj; }; -typedef struct VirtualCssBus VirtualCssBus; #define TYPE_VIRTUAL_CSS_BUS "virtual-css-bus" -DECLARE_INSTANCE_CHECKER(VirtualCssBus, VIRTUAL_CSS_BUS, - TYPE_VIRTUAL_CSS_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(VirtualCssBus, VIRTUAL_CSS_BUS) VirtualCssBus *virtual_css_bus_init(void); #endif diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h index 648ae793a1..e91b15d2d6 100644 --- a/include/hw/s390x/s390_flic.h +++ b/include/hw/s390x/s390_flic.h @@ -77,9 +77,7 @@ DECLARE_INSTANCE_CHECKER(KVMS390FLICState, KVM_S390_FLIC, TYPE_KVM_S390_FLIC) #define TYPE_QEMU_S390_FLIC "s390-flic-qemu" -typedef struct QEMUS390FLICState QEMUS390FLICState; -DECLARE_INSTANCE_CHECKER(QEMUS390FLICState, QEMU_S390_FLIC, - TYPE_QEMU_S390_FLIC) +OBJECT_DECLARE_SIMPLE_TYPE(QEMUS390FLICState, QEMU_S390_FLIC) #define SIC_IRQ_MODE_ALL 0 #define SIC_IRQ_MODE_SINGLE 1 diff --git a/include/hw/s390x/vfio-ccw.h b/include/hw/s390x/vfio-ccw.h index 9c9c8944ad..63a909eb7e 100644 --- a/include/hw/s390x/vfio-ccw.h +++ b/include/hw/s390x/vfio-ccw.h @@ -20,9 +20,7 @@ #include "qom/object.h" #define TYPE_VFIO_CCW "vfio-ccw" -typedef struct VFIOCCWDevice VFIOCCWDevice; -DECLARE_INSTANCE_CHECKER(VFIOCCWDevice, VFIO_CCW, - TYPE_VFIO_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VFIOCCWDevice, VFIO_CCW) #define TYPE_VFIO_CCW "vfio-ccw" diff --git a/include/hw/scsi/esp.h b/include/hw/scsi/esp.h index 20800dbf5b..60cc3047a5 100644 --- a/include/hw/scsi/esp.h +++ b/include/hw/scsi/esp.h @@ -66,9 +66,7 @@ struct ESPState { }; #define TYPE_ESP "esp" -typedef struct SysBusESPState SysBusESPState; -DECLARE_INSTANCE_CHECKER(SysBusESPState, ESP, - TYPE_ESP) +OBJECT_DECLARE_SIMPLE_TYPE(SysBusESPState, ESP) struct SysBusESPState { /*< private >*/ diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index b1e2ed7c35..7a55cdbd74 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -132,8 +132,7 @@ struct SCSIBusInfo { }; #define TYPE_SCSI_BUS "SCSI" -DECLARE_INSTANCE_CHECKER(SCSIBus, SCSI_BUS, - TYPE_SCSI_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(SCSIBus, SCSI_BUS) struct SCSIBus { BusState qbus; diff --git a/include/hw/sd/aspeed_sdhci.h b/include/hw/sd/aspeed_sdhci.h index 783ccc2956..b093d1b861 100644 --- a/include/hw/sd/aspeed_sdhci.h +++ b/include/hw/sd/aspeed_sdhci.h @@ -13,9 +13,7 @@ #include "qom/object.h" #define TYPE_ASPEED_SDHCI "aspeed.sdhci" -typedef struct AspeedSDHCIState AspeedSDHCIState; -DECLARE_INSTANCE_CHECKER(AspeedSDHCIState, ASPEED_SDHCI, - TYPE_ASPEED_SDHCI) +OBJECT_DECLARE_SIMPLE_TYPE(AspeedSDHCIState, ASPEED_SDHCI) #define ASPEED_SDHCI_CAPABILITIES 0x01E80080 #define ASPEED_SDHCI_NUM_SLOTS 2 diff --git a/include/hw/sd/bcm2835_sdhost.h b/include/hw/sd/bcm2835_sdhost.h index 751ba531d6..f6bca5c397 100644 --- a/include/hw/sd/bcm2835_sdhost.h +++ b/include/hw/sd/bcm2835_sdhost.h @@ -19,9 +19,7 @@ #include "qom/object.h" #define TYPE_BCM2835_SDHOST "bcm2835-sdhost" -typedef struct BCM2835SDHostState BCM2835SDHostState; -DECLARE_INSTANCE_CHECKER(BCM2835SDHostState, BCM2835_SDHOST, - TYPE_BCM2835_SDHOST) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835SDHostState, BCM2835_SDHOST) #define BCM2835_SDHOST_FIFO_LEN 16 diff --git a/include/hw/sparc/sparc32_dma.h b/include/hw/sparc/sparc32_dma.h index a402665a9c..e650489414 100644 --- a/include/hw/sparc/sparc32_dma.h +++ b/include/hw/sparc/sparc32_dma.h @@ -9,9 +9,7 @@ #define DMA_REGS 4 #define TYPE_SPARC32_DMA_DEVICE "sparc32-dma-device" -typedef struct DMADeviceState DMADeviceState; -DECLARE_INSTANCE_CHECKER(DMADeviceState, SPARC32_DMA_DEVICE, - TYPE_SPARC32_DMA_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(DMADeviceState, SPARC32_DMA_DEVICE) struct DMADeviceState { @@ -25,9 +23,7 @@ struct DMADeviceState { }; #define TYPE_SPARC32_ESPDMA_DEVICE "sparc32-espdma" -typedef struct ESPDMADeviceState ESPDMADeviceState; -DECLARE_INSTANCE_CHECKER(ESPDMADeviceState, SPARC32_ESPDMA_DEVICE, - TYPE_SPARC32_ESPDMA_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(ESPDMADeviceState, SPARC32_ESPDMA_DEVICE) struct ESPDMADeviceState { DMADeviceState parent_obj; @@ -36,9 +32,7 @@ struct ESPDMADeviceState { }; #define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma" -typedef struct LEDMADeviceState LEDMADeviceState; -DECLARE_INSTANCE_CHECKER(LEDMADeviceState, SPARC32_LEDMA_DEVICE, - TYPE_SPARC32_LEDMA_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(LEDMADeviceState, SPARC32_LEDMA_DEVICE) struct LEDMADeviceState { DMADeviceState parent_obj; @@ -47,9 +41,7 @@ struct LEDMADeviceState { }; #define TYPE_SPARC32_DMA "sparc32-dma" -typedef struct SPARC32DMAState SPARC32DMAState; -DECLARE_INSTANCE_CHECKER(SPARC32DMAState, SPARC32_DMA, - TYPE_SPARC32_DMA) +OBJECT_DECLARE_SIMPLE_TYPE(SPARC32DMAState, SPARC32_DMA) struct SPARC32DMAState { SysBusDevice parent_obj; diff --git a/include/hw/ssi/imx_spi.h b/include/hw/ssi/imx_spi.h index 874fea492d..b82b17f364 100644 --- a/include/hw/ssi/imx_spi.h +++ b/include/hw/ssi/imx_spi.h @@ -78,9 +78,7 @@ #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH) #define TYPE_IMX_SPI "imx.spi" -typedef struct IMXSPIState IMXSPIState; -DECLARE_INSTANCE_CHECKER(IMXSPIState, IMX_SPI, - TYPE_IMX_SPI) +OBJECT_DECLARE_SIMPLE_TYPE(IMXSPIState, IMX_SPI) struct IMXSPIState { /* */ diff --git a/include/hw/ssi/mss-spi.h b/include/hw/ssi/mss-spi.h index 7c16cf6b49..ce6279c431 100644 --- a/include/hw/ssi/mss-spi.h +++ b/include/hw/ssi/mss-spi.h @@ -31,9 +31,7 @@ #include "qom/object.h" #define TYPE_MSS_SPI "mss-spi" -typedef struct MSSSpiState MSSSpiState; -DECLARE_INSTANCE_CHECKER(MSSSpiState, MSS_SPI, - TYPE_MSS_SPI) +OBJECT_DECLARE_SIMPLE_TYPE(MSSSpiState, MSS_SPI) #define R_SPI_MAX 16 diff --git a/include/hw/ssi/pl022.h b/include/hw/ssi/pl022.h index 1f5da7cc44..545b52689c 100644 --- a/include/hw/ssi/pl022.h +++ b/include/hw/ssi/pl022.h @@ -25,9 +25,7 @@ #include "qom/object.h" #define TYPE_PL022 "pl022" -typedef struct PL022State PL022State; -DECLARE_INSTANCE_CHECKER(PL022State, PL022, - TYPE_PL022) +OBJECT_DECLARE_SIMPLE_TYPE(PL022State, PL022) struct PL022State { SysBusDevice parent_obj; diff --git a/include/hw/ssi/stm32f2xx_spi.h b/include/hw/ssi/stm32f2xx_spi.h index 4bb36d04ed..3683b4ad32 100644 --- a/include/hw/ssi/stm32f2xx_spi.h +++ b/include/hw/ssi/stm32f2xx_spi.h @@ -45,9 +45,7 @@ #define STM_SPI_SR_RXNE 1 #define TYPE_STM32F2XX_SPI "stm32f2xx-spi" -typedef struct STM32F2XXSPIState STM32F2XXSPIState; -DECLARE_INSTANCE_CHECKER(STM32F2XXSPIState, STM32F2XX_SPI, - TYPE_STM32F2XX_SPI) +OBJECT_DECLARE_SIMPLE_TYPE(STM32F2XXSPIState, STM32F2XX_SPI) struct STM32F2XXSPIState { /* */ diff --git a/include/hw/ssi/xilinx_spips.h b/include/hw/ssi/xilinx_spips.h index a2bf2cf3c7..b96de21b34 100644 --- a/include/hw/ssi/xilinx_spips.h +++ b/include/hw/ssi/xilinx_spips.h @@ -120,7 +120,6 @@ struct XlnxZynqMPQSPIPS { uint32_t dma_burst_size; uint8_t dma_buf[QSPI_DMA_MAX_BURST_SIZE]; }; -typedef struct XlnxZynqMPQSPIPS XlnxZynqMPQSPIPS; struct XilinxSPIPSClass { SysBusDeviceClass parent_class; @@ -137,10 +136,8 @@ struct XilinxSPIPSClass { OBJECT_DECLARE_TYPE(XilinxSPIPS, XilinxSPIPSClass, XILINX_SPIPS) -DECLARE_INSTANCE_CHECKER(XilinxQSPIPS, XILINX_QSPIPS, - TYPE_XILINX_QSPIPS) +OBJECT_DECLARE_SIMPLE_TYPE(XilinxQSPIPS, XILINX_QSPIPS) -DECLARE_INSTANCE_CHECKER(XlnxZynqMPQSPIPS, XLNX_ZYNQMP_QSPIPS, - TYPE_XLNX_ZYNQMP_QSPIPS) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPQSPIPS, XLNX_ZYNQMP_QSPIPS) #endif /* XILINX_SPIPS_H */ diff --git a/include/hw/timer/a9gtimer.h b/include/hw/timer/a9gtimer.h index f6fcc4bfc6..6ae9122e4b 100644 --- a/include/hw/timer/a9gtimer.h +++ b/include/hw/timer/a9gtimer.h @@ -29,9 +29,7 @@ #define A9_GTIMER_MAX_CPUS 4 #define TYPE_A9_GTIMER "arm.cortex-a9-global-timer" -typedef struct A9GTimerState A9GTimerState; -DECLARE_INSTANCE_CHECKER(A9GTimerState, A9_GTIMER, - TYPE_A9_GTIMER) +OBJECT_DECLARE_SIMPLE_TYPE(A9GTimerState, A9_GTIMER) #define R_COUNTER_LO 0x00 #define R_COUNTER_HI 0x04 diff --git a/include/hw/timer/allwinner-a10-pit.h b/include/hw/timer/allwinner-a10-pit.h index 9638e3c84c..8435758ad6 100644 --- a/include/hw/timer/allwinner-a10-pit.h +++ b/include/hw/timer/allwinner-a10-pit.h @@ -6,9 +6,7 @@ #include "qom/object.h" #define TYPE_AW_A10_PIT "allwinner-A10-timer" -typedef struct AwA10PITState AwA10PITState; -DECLARE_INSTANCE_CHECKER(AwA10PITState, AW_A10_PIT, - TYPE_AW_A10_PIT) +OBJECT_DECLARE_SIMPLE_TYPE(AwA10PITState, AW_A10_PIT) #define AW_A10_PIT_TIMER_NR 6 #define AW_A10_PIT_TIMER_IRQ 0x1 diff --git a/include/hw/timer/arm_mptimer.h b/include/hw/timer/arm_mptimer.h index 47d5e51686..65a96e2a0d 100644 --- a/include/hw/timer/arm_mptimer.h +++ b/include/hw/timer/arm_mptimer.h @@ -36,9 +36,7 @@ typedef struct { } TimerBlock; #define TYPE_ARM_MPTIMER "arm_mptimer" -typedef struct ARMMPTimerState ARMMPTimerState; -DECLARE_INSTANCE_CHECKER(ARMMPTimerState, ARM_MPTIMER, - TYPE_ARM_MPTIMER) +OBJECT_DECLARE_SIMPLE_TYPE(ARMMPTimerState, ARM_MPTIMER) struct ARMMPTimerState { /*< private >*/ diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_systick.h index b605688fee..97cb345ddb 100644 --- a/include/hw/timer/armv7m_systick.h +++ b/include/hw/timer/armv7m_systick.h @@ -17,9 +17,7 @@ #define TYPE_SYSTICK "armv7m_systick" -typedef struct SysTickState SysTickState; -DECLARE_INSTANCE_CHECKER(SysTickState, SYSTICK, - TYPE_SYSTICK) +OBJECT_DECLARE_SIMPLE_TYPE(SysTickState, SYSTICK) struct SysTickState { /*< private >*/ diff --git a/include/hw/timer/avr_timer16.h b/include/hw/timer/avr_timer16.h index d454bb31cb..0536254337 100644 --- a/include/hw/timer/avr_timer16.h +++ b/include/hw/timer/avr_timer16.h @@ -42,9 +42,7 @@ enum NextInterrupt { }; #define TYPE_AVR_TIMER16 "avr-timer16" -typedef struct AVRTimer16State AVRTimer16State; -DECLARE_INSTANCE_CHECKER(AVRTimer16State, AVR_TIMER16, - TYPE_AVR_TIMER16) +OBJECT_DECLARE_SIMPLE_TYPE(AVRTimer16State, AVR_TIMER16) struct AVRTimer16State { /* */ diff --git a/include/hw/timer/bcm2835_systmr.h b/include/hw/timer/bcm2835_systmr.h index 64166bd712..7ce8f6ef4d 100644 --- a/include/hw/timer/bcm2835_systmr.h +++ b/include/hw/timer/bcm2835_systmr.h @@ -14,9 +14,7 @@ #include "qom/object.h" #define TYPE_BCM2835_SYSTIMER "bcm2835-sys-timer" -typedef struct BCM2835SystemTimerState BCM2835SystemTimerState; -DECLARE_INSTANCE_CHECKER(BCM2835SystemTimerState, BCM2835_SYSTIMER, - TYPE_BCM2835_SYSTIMER) +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835SystemTimerState, BCM2835_SYSTIMER) struct BCM2835SystemTimerState { /*< private >*/ diff --git a/include/hw/timer/cmsdk-apb-dualtimer.h b/include/hw/timer/cmsdk-apb-dualtimer.h index 7a5b9df5e5..08d9e6fa3d 100644 --- a/include/hw/timer/cmsdk-apb-dualtimer.h +++ b/include/hw/timer/cmsdk-apb-dualtimer.h @@ -31,9 +31,7 @@ #include "qom/object.h" #define TYPE_CMSDK_APB_DUALTIMER "cmsdk-apb-dualtimer" -typedef struct CMSDKAPBDualTimer CMSDKAPBDualTimer; -DECLARE_INSTANCE_CHECKER(CMSDKAPBDualTimer, CMSDK_APB_DUALTIMER, - TYPE_CMSDK_APB_DUALTIMER) +OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBDualTimer, CMSDK_APB_DUALTIMER) /* One of the two identical timer modules in the dual-timer module */ diff --git a/include/hw/timer/cmsdk-apb-timer.h b/include/hw/timer/cmsdk-apb-timer.h index 0912bc0f3c..0d80b2a48c 100644 --- a/include/hw/timer/cmsdk-apb-timer.h +++ b/include/hw/timer/cmsdk-apb-timer.h @@ -18,9 +18,7 @@ #include "qom/object.h" #define TYPE_CMSDK_APB_TIMER "cmsdk-apb-timer" -typedef struct CMSDKAPBTIMER CMSDKAPBTIMER; -DECLARE_INSTANCE_CHECKER(CMSDKAPBTIMER, CMSDK_APB_TIMER, - TYPE_CMSDK_APB_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBTIMER, CMSDK_APB_TIMER) struct CMSDKAPBTIMER { /*< private >*/ diff --git a/include/hw/timer/digic-timer.h b/include/hw/timer/digic-timer.h index 84a0ef473a..da82fb4663 100644 --- a/include/hw/timer/digic-timer.h +++ b/include/hw/timer/digic-timer.h @@ -23,9 +23,7 @@ #include "qom/object.h" #define TYPE_DIGIC_TIMER "digic-timer" -typedef struct DigicTimerState DigicTimerState; -DECLARE_INSTANCE_CHECKER(DigicTimerState, DIGIC_TIMER, - TYPE_DIGIC_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(DigicTimerState, DIGIC_TIMER) #define DIGIC_TIMER_CONTROL 0x00 #define DIGIC_TIMER_CONTROL_RST 0x80000000 diff --git a/include/hw/timer/imx_epit.h b/include/hw/timer/imx_epit.h index 39bcf81331..2acc41e982 100644 --- a/include/hw/timer/imx_epit.h +++ b/include/hw/timer/imx_epit.h @@ -56,9 +56,7 @@ #define EPIT_TIMER_MAX 0XFFFFFFFFUL #define TYPE_IMX_EPIT "imx.epit" -typedef struct IMXEPITState IMXEPITState; -DECLARE_INSTANCE_CHECKER(IMXEPITState, IMX_EPIT, - TYPE_IMX_EPIT) +OBJECT_DECLARE_SIMPLE_TYPE(IMXEPITState, IMX_EPIT) struct IMXEPITState { /*< private >*/ diff --git a/include/hw/timer/mss-timer.h b/include/hw/timer/mss-timer.h index d207bae2c0..da38512904 100644 --- a/include/hw/timer/mss-timer.h +++ b/include/hw/timer/mss-timer.h @@ -30,9 +30,7 @@ #include "qom/object.h" #define TYPE_MSS_TIMER "mss-timer" -typedef struct MSSTimerState MSSTimerState; -DECLARE_INSTANCE_CHECKER(MSSTimerState, MSS_TIMER, - TYPE_MSS_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(MSSTimerState, MSS_TIMER) /* * There are two 32-bit down counting timers. diff --git a/include/hw/timer/nrf51_timer.h b/include/hw/timer/nrf51_timer.h index 4261a03b95..76827c11dc 100644 --- a/include/hw/timer/nrf51_timer.h +++ b/include/hw/timer/nrf51_timer.h @@ -17,9 +17,7 @@ #include "qemu/timer.h" #include "qom/object.h" #define TYPE_NRF51_TIMER "nrf51_soc.timer" -typedef struct NRF51TimerState NRF51TimerState; -DECLARE_INSTANCE_CHECKER(NRF51TimerState, NRF51_TIMER, - TYPE_NRF51_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(NRF51TimerState, NRF51_TIMER) #define NRF51_TIMER_REG_COUNT 4 diff --git a/include/hw/usb.h b/include/hw/usb.h index 355745c23a..a70a72e917 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -175,7 +175,6 @@ #define USB_INTERFACE_INVALID 255 -typedef struct USBBus USBBus; typedef struct USBBusOps USBBusOps; typedef struct USBPort USBPort; typedef struct USBDevice USBDevice; @@ -473,8 +472,7 @@ bool usb_host_dev_is_scsi_storage(USBDevice *usbdev); /* usb-bus.c */ #define TYPE_USB_BUS "usb-bus" -DECLARE_INSTANCE_CHECKER(USBBus, USB_BUS, - TYPE_USB_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(USBBus, USB_BUS) struct USBBus { BusState qbus; diff --git a/include/hw/usb/chipidea.h b/include/hw/usb/chipidea.h index f0303b8721..fe4113ee01 100644 --- a/include/hw/usb/chipidea.h +++ b/include/hw/usb/chipidea.h @@ -10,10 +10,8 @@ struct ChipideaState { MemoryRegion iomem[3]; }; -typedef struct ChipideaState ChipideaState; #define TYPE_CHIPIDEA "usb-chipidea" -DECLARE_INSTANCE_CHECKER(ChipideaState, CHIPIDEA, - TYPE_CHIPIDEA) +OBJECT_DECLARE_SIMPLE_TYPE(ChipideaState, CHIPIDEA) #endif /* CHIPIDEA_H */ diff --git a/include/hw/usb/imx-usb-phy.h b/include/hw/usb/imx-usb-phy.h index f7f92fc462..d1e867b77a 100644 --- a/include/hw/usb/imx-usb-phy.h +++ b/include/hw/usb/imx-usb-phy.h @@ -39,9 +39,7 @@ enum IMXUsbPhyRegisters { #define USBPHY_CTRL_SFTRST BIT(31) #define TYPE_IMX_USBPHY "imx.usbphy" -typedef struct IMXUSBPHYState IMXUSBPHYState; -DECLARE_INSTANCE_CHECKER(IMXUSBPHYState, IMX_USBPHY, - TYPE_IMX_USBPHY) +OBJECT_DECLARE_SIMPLE_TYPE(IMXUSBPHYState, IMX_USBPHY) struct IMXUSBPHYState { /* */ diff --git a/include/hw/virtio/vhost-scsi-common.h b/include/hw/virtio/vhost-scsi-common.h index 5f0bf73d9d..0c8909d12a 100644 --- a/include/hw/virtio/vhost-scsi-common.h +++ b/include/hw/virtio/vhost-scsi-common.h @@ -20,9 +20,7 @@ #include "qom/object.h" #define TYPE_VHOST_SCSI_COMMON "vhost-scsi-common" -typedef struct VHostSCSICommon VHostSCSICommon; -DECLARE_INSTANCE_CHECKER(VHostSCSICommon, VHOST_SCSI_COMMON, - TYPE_VHOST_SCSI_COMMON) +OBJECT_DECLARE_SIMPLE_TYPE(VHostSCSICommon, VHOST_SCSI_COMMON) struct VHostSCSICommon { VirtIOSCSICommon parent_obj; diff --git a/include/hw/virtio/vhost-scsi.h b/include/hw/virtio/vhost-scsi.h index 7a77644150..7dc2bdd69d 100644 --- a/include/hw/virtio/vhost-scsi.h +++ b/include/hw/virtio/vhost-scsi.h @@ -26,9 +26,7 @@ enum vhost_scsi_vq_list { }; #define TYPE_VHOST_SCSI "vhost-scsi" -typedef struct VHostSCSI VHostSCSI; -DECLARE_INSTANCE_CHECKER(VHostSCSI, VHOST_SCSI, - TYPE_VHOST_SCSI) +OBJECT_DECLARE_SIMPLE_TYPE(VHostSCSI, VHOST_SCSI) struct VHostSCSI { VHostSCSICommon parent_obj; diff --git a/include/hw/virtio/vhost-user-blk.h b/include/hw/virtio/vhost-user-blk.h index dc40ab6f11..f536576d20 100644 --- a/include/hw/virtio/vhost-user-blk.h +++ b/include/hw/virtio/vhost-user-blk.h @@ -23,9 +23,7 @@ #include "qom/object.h" #define TYPE_VHOST_USER_BLK "vhost-user-blk" -typedef struct VHostUserBlk VHostUserBlk; -DECLARE_INSTANCE_CHECKER(VHostUserBlk, VHOST_USER_BLK, - TYPE_VHOST_USER_BLK) +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserBlk, VHOST_USER_BLK) #define VHOST_USER_BLK_AUTO_NUM_QUEUES UINT16_MAX diff --git a/include/hw/virtio/vhost-user-fs.h b/include/hw/virtio/vhost-user-fs.h index 9033e6f902..6985752771 100644 --- a/include/hw/virtio/vhost-user-fs.h +++ b/include/hw/virtio/vhost-user-fs.h @@ -21,9 +21,7 @@ #include "qom/object.h" #define TYPE_VHOST_USER_FS "vhost-user-fs-device" -typedef struct VHostUserFS VHostUserFS; -DECLARE_INSTANCE_CHECKER(VHostUserFS, VHOST_USER_FS, - TYPE_VHOST_USER_FS) +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserFS, VHOST_USER_FS) typedef struct { CharBackend chardev; diff --git a/include/hw/virtio/vhost-user-scsi.h b/include/hw/virtio/vhost-user-scsi.h index 342d67ee9e..521b08e559 100644 --- a/include/hw/virtio/vhost-user-scsi.h +++ b/include/hw/virtio/vhost-user-scsi.h @@ -24,9 +24,7 @@ #include "qom/object.h" #define TYPE_VHOST_USER_SCSI "vhost-user-scsi" -typedef struct VHostUserSCSI VHostUserSCSI; -DECLARE_INSTANCE_CHECKER(VHostUserSCSI, VHOST_USER_SCSI, - TYPE_VHOST_USER_SCSI) +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserSCSI, VHOST_USER_SCSI) struct VHostUserSCSI { VHostSCSICommon parent_obj; diff --git a/include/hw/virtio/vhost-user-vsock.h b/include/hw/virtio/vhost-user-vsock.h index b3c40c16a3..4cfd558245 100644 --- a/include/hw/virtio/vhost-user-vsock.h +++ b/include/hw/virtio/vhost-user-vsock.h @@ -17,9 +17,7 @@ #include "qom/object.h" #define TYPE_VHOST_USER_VSOCK "vhost-user-vsock-device" -typedef struct VHostUserVSock VHostUserVSock; -DECLARE_INSTANCE_CHECKER(VHostUserVSock, VHOST_USER_VSOCK, - TYPE_VHOST_USER_VSOCK) +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserVSock, VHOST_USER_VSOCK) typedef struct { CharBackend chardev; diff --git a/include/hw/virtio/vhost-vsock-common.h b/include/hw/virtio/vhost-vsock-common.h index 60bfb68db1..e412b5ee98 100644 --- a/include/hw/virtio/vhost-vsock-common.h +++ b/include/hw/virtio/vhost-vsock-common.h @@ -16,9 +16,7 @@ #include "qom/object.h" #define TYPE_VHOST_VSOCK_COMMON "vhost-vsock-common" -typedef struct VHostVSockCommon VHostVSockCommon; -DECLARE_INSTANCE_CHECKER(VHostVSockCommon, VHOST_VSOCK_COMMON, - TYPE_VHOST_VSOCK_COMMON) +OBJECT_DECLARE_SIMPLE_TYPE(VHostVSockCommon, VHOST_VSOCK_COMMON) enum { VHOST_VSOCK_SAVEVM_VERSION = 0, diff --git a/include/hw/virtio/vhost-vsock.h b/include/hw/virtio/vhost-vsock.h index c561cc427a..84f4e727c7 100644 --- a/include/hw/virtio/vhost-vsock.h +++ b/include/hw/virtio/vhost-vsock.h @@ -18,9 +18,7 @@ #include "qom/object.h" #define TYPE_VHOST_VSOCK "vhost-vsock-device" -typedef struct VHostVSock VHostVSock; -DECLARE_INSTANCE_CHECKER(VHostVSock, VHOST_VSOCK, - TYPE_VHOST_VSOCK) +OBJECT_DECLARE_SIMPLE_TYPE(VHostVSock, VHOST_VSOCK) typedef struct { uint64_t guest_cid; diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h index 0d08f496d9..5139cf8ab6 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -21,9 +21,7 @@ #include "qom/object.h" #define TYPE_VIRTIO_BALLOON "virtio-balloon-device" -typedef struct VirtIOBalloon VirtIOBalloon; -DECLARE_INSTANCE_CHECKER(VirtIOBalloon, VIRTIO_BALLOON, - TYPE_VIRTIO_BALLOON) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOBalloon, VIRTIO_BALLOON) #define VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN 0x80000000 diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h index 29c9f32353..5953cf8961 100644 --- a/include/hw/virtio/virtio-blk.h +++ b/include/hw/virtio/virtio-blk.h @@ -22,9 +22,7 @@ #include "qom/object.h" #define TYPE_VIRTIO_BLK "virtio-blk-device" -typedef struct VirtIOBlock VirtIOBlock; -DECLARE_INSTANCE_CHECKER(VirtIOBlock, VIRTIO_BLK, - TYPE_VIRTIO_BLK) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOBlock, VIRTIO_BLK) /* This is the last element of the write scatter-gather list */ struct virtio_blk_inhdr diff --git a/include/hw/virtio/virtio-crypto.h b/include/hw/virtio/virtio-crypto.h index 7969695983..a2228d7b2e 100644 --- a/include/hw/virtio/virtio-crypto.h +++ b/include/hw/virtio/virtio-crypto.h @@ -32,9 +32,7 @@ do { \ #define TYPE_VIRTIO_CRYPTO "virtio-crypto-device" -typedef struct VirtIOCrypto VirtIOCrypto; -DECLARE_INSTANCE_CHECKER(VirtIOCrypto, VIRTIO_CRYPTO, - TYPE_VIRTIO_CRYPTO) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOCrypto, VIRTIO_CRYPTO) #define VIRTIO_CRYPTO_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_CRYPTO) diff --git a/include/hw/virtio/virtio-gpu-pci.h b/include/hw/virtio/virtio-gpu-pci.h index 5201792ede..225cbbc2e4 100644 --- a/include/hw/virtio/virtio-gpu-pci.h +++ b/include/hw/virtio/virtio-gpu-pci.h @@ -18,14 +18,12 @@ #include "hw/virtio/virtio-gpu.h" #include "qom/object.h" -typedef struct VirtIOGPUPCIBase VirtIOGPUPCIBase; /* * virtio-gpu-pci-base: This extends VirtioPCIProxy. */ #define TYPE_VIRTIO_GPU_PCI_BASE "virtio-gpu-pci-base" -DECLARE_INSTANCE_CHECKER(VirtIOGPUPCIBase, VIRTIO_GPU_PCI_BASE, - TYPE_VIRTIO_GPU_PCI_BASE) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPUPCIBase, VIRTIO_GPU_PCI_BASE) struct VirtIOGPUPCIBase { VirtIOPCIProxy parent_obj; diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 7ef405975a..455e0a7433 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -29,14 +29,10 @@ OBJECT_DECLARE_TYPE(VirtIOGPUBase, VirtIOGPUBaseClass, VIRTIO_GPU_BASE) #define TYPE_VIRTIO_GPU "virtio-gpu-device" -typedef struct VirtIOGPU VirtIOGPU; -DECLARE_INSTANCE_CHECKER(VirtIOGPU, VIRTIO_GPU, - TYPE_VIRTIO_GPU) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPU, VIRTIO_GPU) #define TYPE_VHOST_USER_GPU "vhost-user-gpu" -typedef struct VhostUserGPU VhostUserGPU; -DECLARE_INSTANCE_CHECKER(VhostUserGPU, VHOST_USER_GPU, - TYPE_VHOST_USER_GPU) +OBJECT_DECLARE_SIMPLE_TYPE(VhostUserGPU, VHOST_USER_GPU) #define VIRTIO_ID_GPU 16 diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h index 91df34b534..f2da63d309 100644 --- a/include/hw/virtio/virtio-input.h +++ b/include/hw/virtio/virtio-input.h @@ -29,23 +29,17 @@ OBJECT_DECLARE_TYPE(VirtIOInput, VirtIOInputClass, #define TYPE_VIRTIO_MOUSE "virtio-mouse-device" #define TYPE_VIRTIO_TABLET "virtio-tablet-device" -typedef struct VirtIOInputHID VirtIOInputHID; -DECLARE_INSTANCE_CHECKER(VirtIOInputHID, VIRTIO_INPUT_HID, - TYPE_VIRTIO_INPUT_HID) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOInputHID, VIRTIO_INPUT_HID) #define VIRTIO_INPUT_HID_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT_HID) #define TYPE_VIRTIO_INPUT_HOST "virtio-input-host-device" -typedef struct VirtIOInputHost VirtIOInputHost; -DECLARE_INSTANCE_CHECKER(VirtIOInputHost, VIRTIO_INPUT_HOST, - TYPE_VIRTIO_INPUT_HOST) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOInputHost, VIRTIO_INPUT_HOST) #define VIRTIO_INPUT_HOST_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT_HOST) #define TYPE_VHOST_USER_INPUT "vhost-user-input" -typedef struct VHostUserInput VHostUserInput; -DECLARE_INSTANCE_CHECKER(VHostUserInput, VHOST_USER_INPUT, - TYPE_VHOST_USER_INPUT) +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserInput, VHOST_USER_INPUT) #define VHOST_USER_INPUT_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VHOST_USER_INPUT) diff --git a/include/hw/virtio/virtio-iommu.h b/include/hw/virtio/virtio-iommu.h index ae9dc566c7..273e35c04b 100644 --- a/include/hw/virtio/virtio-iommu.h +++ b/include/hw/virtio/virtio-iommu.h @@ -27,9 +27,7 @@ #define TYPE_VIRTIO_IOMMU "virtio-iommu-device" #define TYPE_VIRTIO_IOMMU_PCI "virtio-iommu-device-base" -typedef struct VirtIOIOMMU VirtIOIOMMU; -DECLARE_INSTANCE_CHECKER(VirtIOIOMMU, VIRTIO_IOMMU, - TYPE_VIRTIO_IOMMU) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOIOMMU, VIRTIO_IOMMU) #define TYPE_VIRTIO_IOMMU_MEMORY_REGION "virtio-iommu-memory-region" diff --git a/include/hw/virtio/virtio-mmio.h b/include/hw/virtio/virtio-mmio.h index 6a1c2c20d4..d4c4c386ab 100644 --- a/include/hw/virtio/virtio-mmio.h +++ b/include/hw/virtio/virtio-mmio.h @@ -34,9 +34,7 @@ DECLARE_OBJ_CHECKERS(VirtioBusState, VirtioBusClass, /* virtio-mmio */ #define TYPE_VIRTIO_MMIO "virtio-mmio" -typedef struct VirtIOMMIOProxy VirtIOMMIOProxy; -DECLARE_INSTANCE_CHECKER(VirtIOMMIOProxy, VIRTIO_MMIO, - TYPE_VIRTIO_MMIO) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOMMIOProxy, VIRTIO_MMIO) #define VIRT_MAGIC 0x74726976 /* 'virt' */ #define VIRT_VERSION 2 diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index 929ed232dd..f4852ac27b 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -22,9 +22,7 @@ #include "qom/object.h" #define TYPE_VIRTIO_NET "virtio-net-device" -typedef struct VirtIONet VirtIONet; -DECLARE_INSTANCE_CHECKER(VirtIONet, VIRTIO_NET, - TYPE_VIRTIO_NET) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIONet, VIRTIO_NET) #define TX_TIMER_INTERVAL 150000 /* 150 us */ diff --git a/include/hw/virtio/virtio-rng.h b/include/hw/virtio/virtio-rng.h index 3671c9ba19..82734255d9 100644 --- a/include/hw/virtio/virtio-rng.h +++ b/include/hw/virtio/virtio-rng.h @@ -18,9 +18,7 @@ #include "qom/object.h" #define TYPE_VIRTIO_RNG "virtio-rng-device" -typedef struct VirtIORNG VirtIORNG; -DECLARE_INSTANCE_CHECKER(VirtIORNG, VIRTIO_RNG, - TYPE_VIRTIO_RNG) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIORNG, VIRTIO_RNG) #define VIRTIO_RNG_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_RNG) diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h index 9a8a06fdd1..543681bc18 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -26,14 +26,10 @@ #include "sysemu/iothread.h" #define TYPE_VIRTIO_SCSI_COMMON "virtio-scsi-common" -typedef struct VirtIOSCSICommon VirtIOSCSICommon; -DECLARE_INSTANCE_CHECKER(VirtIOSCSICommon, VIRTIO_SCSI_COMMON, - TYPE_VIRTIO_SCSI_COMMON) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOSCSICommon, VIRTIO_SCSI_COMMON) #define TYPE_VIRTIO_SCSI "virtio-scsi-device" -typedef struct VirtIOSCSI VirtIOSCSI; -DECLARE_INSTANCE_CHECKER(VirtIOSCSI, VIRTIO_SCSI, - TYPE_VIRTIO_SCSI) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOSCSI, VIRTIO_SCSI) #define VIRTIO_SCSI_MAX_CHANNEL 0 #define VIRTIO_SCSI_MAX_TARGET 255 diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-serial.h index 17359918f7..d87c62eab7 100644 --- a/include/hw/virtio/virtio-serial.h +++ b/include/hw/virtio/virtio-serial.h @@ -32,9 +32,7 @@ OBJECT_DECLARE_TYPE(VirtIOSerialPort, VirtIOSerialPortClass, typedef struct VirtIOSerial VirtIOSerial; #define TYPE_VIRTIO_SERIAL_BUS "virtio-serial-bus" -typedef struct VirtIOSerialBus VirtIOSerialBus; -DECLARE_INSTANCE_CHECKER(VirtIOSerialBus, VIRTIO_SERIAL_BUS, - TYPE_VIRTIO_SERIAL_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOSerialBus, VIRTIO_SERIAL_BUS) struct VirtIOSerialPortClass { @@ -224,7 +222,6 @@ size_t virtio_serial_guest_ready(VirtIOSerialPort *port); void virtio_serial_throttle_port(VirtIOSerialPort *port, bool throttle); #define TYPE_VIRTIO_SERIAL "virtio-serial-device" -DECLARE_INSTANCE_CHECKER(VirtIOSerial, VIRTIO_SERIAL, - TYPE_VIRTIO_SERIAL) +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOSerial, VIRTIO_SERIAL) #endif diff --git a/include/hw/watchdog/cmsdk-apb-watchdog.h b/include/hw/watchdog/cmsdk-apb-watchdog.h index 63f4becf86..3da0d43e35 100644 --- a/include/hw/watchdog/cmsdk-apb-watchdog.h +++ b/include/hw/watchdog/cmsdk-apb-watchdog.h @@ -36,9 +36,7 @@ #include "qom/object.h" #define TYPE_CMSDK_APB_WATCHDOG "cmsdk-apb-watchdog" -typedef struct CMSDKAPBWatchdog CMSDKAPBWatchdog; -DECLARE_INSTANCE_CHECKER(CMSDKAPBWatchdog, CMSDK_APB_WATCHDOG, - TYPE_CMSDK_APB_WATCHDOG) +OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBWatchdog, CMSDK_APB_WATCHDOG) /* * This shares the same struct (and cast macro) as the base diff --git a/include/hw/watchdog/wdt_imx2.h b/include/hw/watchdog/wdt_imx2.h index 7665d93640..023d83f48f 100644 --- a/include/hw/watchdog/wdt_imx2.h +++ b/include/hw/watchdog/wdt_imx2.h @@ -19,9 +19,7 @@ #include "qom/object.h" #define TYPE_IMX2_WDT "imx2.wdt" -typedef struct IMX2WdtState IMX2WdtState; -DECLARE_INSTANCE_CHECKER(IMX2WdtState, IMX2_WDT, - TYPE_IMX2_WDT) +OBJECT_DECLARE_SIMPLE_TYPE(IMX2WdtState, IMX2_WDT) enum IMX2WdtRegisters { IMX2_WDT_WCR = 0x0000, /* Control Register */ diff --git a/include/hw/xen/xen-block.h b/include/hw/xen/xen-block.h index a74fd9384f..d692ea7580 100644 --- a/include/hw/xen/xen-block.h +++ b/include/hw/xen/xen-block.h @@ -75,19 +75,15 @@ OBJECT_DECLARE_TYPE(XenBlockDevice, XenBlockDeviceClass, XEN_BLOCK_DEVICE) struct XenDiskDevice { XenBlockDevice blockdev; }; -typedef struct XenDiskDevice XenDiskDevice; #define TYPE_XEN_DISK_DEVICE "xen-disk" -DECLARE_INSTANCE_CHECKER(XenDiskDevice, XEN_DISK_DEVICE, - TYPE_XEN_DISK_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(XenDiskDevice, XEN_DISK_DEVICE) struct XenCDRomDevice { XenBlockDevice blockdev; }; -typedef struct XenCDRomDevice XenCDRomDevice; #define TYPE_XEN_CDROM_DEVICE "xen-cdrom" -DECLARE_INSTANCE_CHECKER(XenCDRomDevice, XEN_CDROM_DEVICE, - TYPE_XEN_CDROM_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(XenCDRomDevice, XEN_CDROM_DEVICE) #endif /* HW_XEN_BLOCK_H */ -- cgit v1.2.3-55-g7522