summaryrefslogtreecommitdiff
path: root/include/hw/misc
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-08-31 17:07:33 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-09 09:27:09 -0400
commit8110fa1d94f2997badc2af39231a1d279c5bb1ee (patch)
tree6bff28c7907dfb0cbb367ca113f4d02ea03f3a51 /include/hw/misc
parentdb1015e92e04835c9eb50c29625fe566d1202dbd (diff)
downloadqemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.zip
Use DECLARE_*CHECKER* macros
Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-12-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-13-ehabkost@redhat.com> Message-Id: <20200831210740.126168-14-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/hw/misc')
-rw-r--r--include/hw/misc/a9scu.h3
-rw-r--r--include/hw/misc/allwinner-cpucfg.h4
-rw-r--r--include/hw/misc/allwinner-h3-ccu.h4
-rw-r--r--include/hw/misc/allwinner-h3-dramc.h4
-rw-r--r--include/hw/misc/allwinner-h3-sysctrl.h4
-rw-r--r--include/hw/misc/allwinner-sid.h4
-rw-r--r--include/hw/misc/arm11scu.h3
-rw-r--r--include/hw/misc/armsse-cpuid.h3
-rw-r--r--include/hw/misc/armsse-mhu.h3
-rw-r--r--include/hw/misc/aspeed_scu.h7
-rw-r--r--include/hw/misc/aspeed_sdmc.h7
-rw-r--r--include/hw/misc/aspeed_xdma.h3
-rw-r--r--include/hw/misc/auxbus.h10
-rw-r--r--include/hw/misc/avr_power.h3
-rw-r--r--include/hw/misc/bcm2835_mbox.h4
-rw-r--r--include/hw/misc/bcm2835_mphi.h4
-rw-r--r--include/hw/misc/bcm2835_property.h4
-rw-r--r--include/hw/misc/bcm2835_rng.h4
-rw-r--r--include/hw/misc/bcm2835_thermal.h4
-rw-r--r--include/hw/misc/grlib_ahb_apb_pnp.h8
-rw-r--r--include/hw/misc/imx25_ccm.h3
-rw-r--r--include/hw/misc/imx31_ccm.h3
-rw-r--r--include/hw/misc/imx6_ccm.h3
-rw-r--r--include/hw/misc/imx6_src.h3
-rw-r--r--include/hw/misc/imx6ul_ccm.h3
-rw-r--r--include/hw/misc/imx7_ccm.h6
-rw-r--r--include/hw/misc/imx7_gpr.h3
-rw-r--r--include/hw/misc/imx7_snvs.h3
-rw-r--r--include/hw/misc/imx_ccm.h8
-rw-r--r--include/hw/misc/imx_rngc.h3
-rw-r--r--include/hw/misc/iotkit-secctl.h3
-rw-r--r--include/hw/misc/iotkit-sysctl.h4
-rw-r--r--include/hw/misc/iotkit-sysinfo.h4
-rw-r--r--include/hw/misc/mac_via.h11
-rw-r--r--include/hw/misc/macio/cuda.h7
-rw-r--r--include/hw/misc/macio/gpio.h3
-rw-r--r--include/hw/misc/macio/macio.h17
-rw-r--r--include/hw/misc/macio/pmu.h7
-rw-r--r--include/hw/misc/max111x.h4
-rw-r--r--include/hw/misc/mips_cmgcr.h3
-rw-r--r--include/hw/misc/mips_cpc.h3
-rw-r--r--include/hw/misc/mips_itu.h3
-rw-r--r--include/hw/misc/mos6522.h7
-rw-r--r--include/hw/misc/mps2-fpgaio.h3
-rw-r--r--include/hw/misc/mps2-scc.h3
-rw-r--r--include/hw/misc/msf2-sysreg.h3
-rw-r--r--include/hw/misc/nrf51_rng.h3
-rw-r--r--include/hw/misc/pca9552.h3
-rw-r--r--include/hw/misc/stm32f2xx_syscfg.h4
-rw-r--r--include/hw/misc/stm32f4xx_exti.h4
-rw-r--r--include/hw/misc/stm32f4xx_syscfg.h4
-rw-r--r--include/hw/misc/tz-mpc.h3
-rw-r--r--include/hw/misc/tz-msc.h3
-rw-r--r--include/hw/misc/tz-ppc.h3
-rw-r--r--include/hw/misc/unimp.h4
-rw-r--r--include/hw/misc/vmcoreinfo.h3
-rw-r--r--include/hw/misc/zynq-xadc.h4
57 files changed, 138 insertions, 113 deletions
diff --git a/include/hw/misc/a9scu.h b/include/hw/misc/a9scu.h
index c5481f4dbb..fd1b92e923 100644
--- a/include/hw/misc/a9scu.h
+++ b/include/hw/misc/a9scu.h
@@ -28,6 +28,7 @@ struct A9SCUState {
typedef struct A9SCUState A9SCUState;
#define TYPE_A9_SCU "a9-scu"
-#define A9_SCU(obj) OBJECT_CHECK(A9SCUState, (obj), TYPE_A9_SCU)
+DECLARE_INSTANCE_CHECKER(A9SCUState, A9_SCU,
+ TYPE_A9_SCU)
#endif
diff --git a/include/hw/misc/allwinner-cpucfg.h b/include/hw/misc/allwinner-cpucfg.h
index f5420b11d5..058514de15 100644
--- a/include/hw/misc/allwinner-cpucfg.h
+++ b/include/hw/misc/allwinner-cpucfg.h
@@ -30,8 +30,8 @@
#define TYPE_AW_CPUCFG "allwinner-cpucfg"
typedef struct AwCpuCfgState AwCpuCfgState;
-#define AW_CPUCFG(obj) \
- OBJECT_CHECK(AwCpuCfgState, (obj), TYPE_AW_CPUCFG)
+DECLARE_INSTANCE_CHECKER(AwCpuCfgState, AW_CPUCFG,
+ TYPE_AW_CPUCFG)
/** @} */
diff --git a/include/hw/misc/allwinner-h3-ccu.h b/include/hw/misc/allwinner-h3-ccu.h
index 60f0c56cd9..05f5c7bd8e 100644
--- a/include/hw/misc/allwinner-h3-ccu.h
+++ b/include/hw/misc/allwinner-h3-ccu.h
@@ -43,8 +43,8 @@
#define TYPE_AW_H3_CCU "allwinner-h3-ccu"
typedef struct AwH3ClockCtlState AwH3ClockCtlState;
-#define AW_H3_CCU(obj) \
- OBJECT_CHECK(AwH3ClockCtlState, (obj), TYPE_AW_H3_CCU)
+DECLARE_INSTANCE_CHECKER(AwH3ClockCtlState, AW_H3_CCU,
+ TYPE_AW_H3_CCU)
/** @} */
diff --git a/include/hw/misc/allwinner-h3-dramc.h b/include/hw/misc/allwinner-h3-dramc.h
index 0538e598b0..60a13a6958 100644
--- a/include/hw/misc/allwinner-h3-dramc.h
+++ b/include/hw/misc/allwinner-h3-dramc.h
@@ -59,8 +59,8 @@
#define TYPE_AW_H3_DRAMC "allwinner-h3-dramc"
typedef struct AwH3DramCtlState AwH3DramCtlState;
-#define AW_H3_DRAMC(obj) \
- OBJECT_CHECK(AwH3DramCtlState, (obj), TYPE_AW_H3_DRAMC)
+DECLARE_INSTANCE_CHECKER(AwH3DramCtlState, AW_H3_DRAMC,
+ TYPE_AW_H3_DRAMC)
/** @} */
diff --git a/include/hw/misc/allwinner-h3-sysctrl.h b/include/hw/misc/allwinner-h3-sysctrl.h
index 7360698f8f..50baa8eb07 100644
--- a/include/hw/misc/allwinner-h3-sysctrl.h
+++ b/include/hw/misc/allwinner-h3-sysctrl.h
@@ -44,8 +44,8 @@
#define TYPE_AW_H3_SYSCTRL "allwinner-h3-sysctrl"
typedef struct AwH3SysCtrlState AwH3SysCtrlState;
-#define AW_H3_SYSCTRL(obj) \
- OBJECT_CHECK(AwH3SysCtrlState, (obj), TYPE_AW_H3_SYSCTRL)
+DECLARE_INSTANCE_CHECKER(AwH3SysCtrlState, AW_H3_SYSCTRL,
+ TYPE_AW_H3_SYSCTRL)
/** @} */
diff --git a/include/hw/misc/allwinner-sid.h b/include/hw/misc/allwinner-sid.h
index 70cd7cc7c0..b8e83bb7ce 100644
--- a/include/hw/misc/allwinner-sid.h
+++ b/include/hw/misc/allwinner-sid.h
@@ -31,8 +31,8 @@
#define TYPE_AW_SID "allwinner-sid"
typedef struct AwSidState AwSidState;
-#define AW_SID(obj) \
- OBJECT_CHECK(AwSidState, (obj), TYPE_AW_SID)
+DECLARE_INSTANCE_CHECKER(AwSidState, AW_SID,
+ TYPE_AW_SID)
/** @} */
diff --git a/include/hw/misc/arm11scu.h b/include/hw/misc/arm11scu.h
index 7e2e6d2b44..71b4bc9a22 100644
--- a/include/hw/misc/arm11scu.h
+++ b/include/hw/misc/arm11scu.h
@@ -16,7 +16,8 @@
#define TYPE_ARM11_SCU "arm11-scu"
typedef struct ARM11SCUState ARM11SCUState;
-#define ARM11_SCU(obj) OBJECT_CHECK(ARM11SCUState, (obj), TYPE_ARM11_SCU)
+DECLARE_INSTANCE_CHECKER(ARM11SCUState, ARM11_SCU,
+ TYPE_ARM11_SCU)
struct ARM11SCUState {
/*< private >*/
diff --git a/include/hw/misc/armsse-cpuid.h b/include/hw/misc/armsse-cpuid.h
index 290a52cf10..80691c7180 100644
--- a/include/hw/misc/armsse-cpuid.h
+++ b/include/hw/misc/armsse-cpuid.h
@@ -27,7 +27,8 @@
#define TYPE_ARMSSE_CPUID "armsse-cpuid"
typedef struct ARMSSECPUID ARMSSECPUID;
-#define ARMSSE_CPUID(obj) OBJECT_CHECK(ARMSSECPUID, (obj), TYPE_ARMSSE_CPUID)
+DECLARE_INSTANCE_CHECKER(ARMSSECPUID, ARMSSE_CPUID,
+ TYPE_ARMSSE_CPUID)
struct ARMSSECPUID {
/*< private >*/
diff --git a/include/hw/misc/armsse-mhu.h b/include/hw/misc/armsse-mhu.h
index d1ae4a463a..310643a022 100644
--- a/include/hw/misc/armsse-mhu.h
+++ b/include/hw/misc/armsse-mhu.h
@@ -28,7 +28,8 @@
#define TYPE_ARMSSE_MHU "armsse-mhu"
typedef struct ARMSSEMHU ARMSSEMHU;
-#define ARMSSE_MHU(obj) OBJECT_CHECK(ARMSSEMHU, (obj), TYPE_ARMSSE_MHU)
+DECLARE_INSTANCE_CHECKER(ARMSSEMHU, ARMSSE_MHU,
+ TYPE_ARMSSE_MHU)
struct ARMSSEMHU {
/*< private >*/
diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h
index feebb1baf6..8d3b14acd4 100644
--- a/include/hw/misc/aspeed_scu.h
+++ b/include/hw/misc/aspeed_scu.h
@@ -17,7 +17,8 @@
#define TYPE_ASPEED_SCU "aspeed.scu"
typedef struct AspeedSCUClass AspeedSCUClass;
typedef struct AspeedSCUState AspeedSCUState;
-#define ASPEED_SCU(obj) OBJECT_CHECK(AspeedSCUState, (obj), TYPE_ASPEED_SCU)
+DECLARE_OBJ_CHECKERS(AspeedSCUState, AspeedSCUClass,
+ ASPEED_SCU, TYPE_ASPEED_SCU)
#define TYPE_ASPEED_2400_SCU TYPE_ASPEED_SCU "-ast2400"
#define TYPE_ASPEED_2500_SCU TYPE_ASPEED_SCU "-ast2500"
#define TYPE_ASPEED_2600_SCU TYPE_ASPEED_SCU "-ast2600"
@@ -50,10 +51,6 @@ struct AspeedSCUState {
extern bool is_supported_silicon_rev(uint32_t silicon_rev);
-#define ASPEED_SCU_CLASS(klass) \
- OBJECT_CLASS_CHECK(AspeedSCUClass, (klass), TYPE_ASPEED_SCU)
-#define ASPEED_SCU_GET_CLASS(obj) \
- OBJECT_GET_CLASS(AspeedSCUClass, (obj), TYPE_ASPEED_SCU)
struct AspeedSCUClass {
SysBusDeviceClass parent_class;
diff --git a/include/hw/misc/aspeed_sdmc.h b/include/hw/misc/aspeed_sdmc.h
index 3d98817715..3375afc89b 100644
--- a/include/hw/misc/aspeed_sdmc.h
+++ b/include/hw/misc/aspeed_sdmc.h
@@ -15,7 +15,8 @@
#define TYPE_ASPEED_SDMC "aspeed.sdmc"
typedef struct AspeedSDMCClass AspeedSDMCClass;
typedef struct AspeedSDMCState AspeedSDMCState;
-#define ASPEED_SDMC(obj) OBJECT_CHECK(AspeedSDMCState, (obj), TYPE_ASPEED_SDMC)
+DECLARE_OBJ_CHECKERS(AspeedSDMCState, AspeedSDMCClass,
+ ASPEED_SDMC, TYPE_ASPEED_SDMC)
#define TYPE_ASPEED_2400_SDMC TYPE_ASPEED_SDMC "-ast2400"
#define TYPE_ASPEED_2500_SDMC TYPE_ASPEED_SDMC "-ast2500"
#define TYPE_ASPEED_2600_SDMC TYPE_ASPEED_SDMC "-ast2600"
@@ -45,10 +46,6 @@ struct AspeedSDMCState {
uint64_t max_ram_size;
};
-#define ASPEED_SDMC_CLASS(klass) \
- OBJECT_CLASS_CHECK(AspeedSDMCClass, (klass), TYPE_ASPEED_SDMC)
-#define ASPEED_SDMC_GET_CLASS(obj) \
- OBJECT_GET_CLASS(AspeedSDMCClass, (obj), TYPE_ASPEED_SDMC)
struct AspeedSDMCClass {
SysBusDeviceClass parent_class;
diff --git a/include/hw/misc/aspeed_xdma.h b/include/hw/misc/aspeed_xdma.h
index e5177e2c02..0e62c04520 100644
--- a/include/hw/misc/aspeed_xdma.h
+++ b/include/hw/misc/aspeed_xdma.h
@@ -14,7 +14,8 @@
#define TYPE_ASPEED_XDMA "aspeed.xdma"
typedef struct AspeedXDMAState AspeedXDMAState;
-#define ASPEED_XDMA(obj) OBJECT_CHECK(AspeedXDMAState, (obj), TYPE_ASPEED_XDMA)
+DECLARE_INSTANCE_CHECKER(AspeedXDMAState, ASPEED_XDMA,
+ TYPE_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 f24f2fd789..f910d94118 100644
--- a/include/hw/misc/auxbus.h
+++ b/include/hw/misc/auxbus.h
@@ -36,7 +36,8 @@ typedef enum AUXReply AUXReply;
#define TYPE_AUXTOI2C "aux-to-i2c-bridge"
typedef struct AUXTOI2CState AUXTOI2CState;
-#define AUXTOI2C(obj) OBJECT_CHECK(AUXTOI2CState, (obj), TYPE_AUXTOI2C)
+DECLARE_INSTANCE_CHECKER(AUXTOI2CState, AUXTOI2C,
+ TYPE_AUXTOI2C)
enum AUXCommand {
WRITE_I2C = 0,
@@ -57,7 +58,8 @@ enum AUXReply {
};
#define TYPE_AUX_BUS "aux-bus"
-#define AUX_BUS(obj) OBJECT_CHECK(AUXBus, (obj), TYPE_AUX_BUS)
+DECLARE_INSTANCE_CHECKER(AUXBus, AUX_BUS,
+ TYPE_AUX_BUS)
struct AUXBus {
/* < private > */
@@ -76,8 +78,8 @@ struct AUXBus {
};
#define TYPE_AUX_SLAVE "aux-slave"
-#define AUX_SLAVE(obj) \
- OBJECT_CHECK(AUXSlave, (obj), TYPE_AUX_SLAVE)
+DECLARE_INSTANCE_CHECKER(AUXSlave, AUX_SLAVE,
+ TYPE_AUX_SLAVE)
struct AUXSlave {
/* < private > */
diff --git a/include/hw/misc/avr_power.h b/include/hw/misc/avr_power.h
index c230a2655c..938ab3e21b 100644
--- a/include/hw/misc/avr_power.h
+++ b/include/hw/misc/avr_power.h
@@ -32,7 +32,8 @@
#define TYPE_AVR_MASK "avr-power"
typedef struct AVRMaskState AVRMaskState;
-#define AVR_MASK(obj) OBJECT_CHECK(AVRMaskState, (obj), TYPE_AVR_MASK)
+DECLARE_INSTANCE_CHECKER(AVRMaskState, AVR_MASK,
+ TYPE_AVR_MASK)
struct AVRMaskState {
/* <private> */
diff --git a/include/hw/misc/bcm2835_mbox.h b/include/hw/misc/bcm2835_mbox.h
index 3ec6a2f0e8..d8c8017f4e 100644
--- a/include/hw/misc/bcm2835_mbox.h
+++ b/include/hw/misc/bcm2835_mbox.h
@@ -14,8 +14,8 @@
#define TYPE_BCM2835_MBOX "bcm2835-mbox"
typedef struct BCM2835MboxState BCM2835MboxState;
-#define BCM2835_MBOX(obj) \
- OBJECT_CHECK(BCM2835MboxState, (obj), TYPE_BCM2835_MBOX)
+DECLARE_INSTANCE_CHECKER(BCM2835MboxState, BCM2835_MBOX,
+ TYPE_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 ce1c273cfb..249511182e 100644
--- a/include/hw/misc/bcm2835_mphi.h
+++ b/include/hw/misc/bcm2835_mphi.h
@@ -39,7 +39,7 @@ struct BCM2835MphiState {
#define TYPE_BCM2835_MPHI "bcm2835-mphi"
-#define BCM2835_MPHI(obj) \
- OBJECT_CHECK(BCM2835MphiState, (obj), TYPE_BCM2835_MPHI)
+DECLARE_INSTANCE_CHECKER(BCM2835MphiState, BCM2835_MPHI,
+ TYPE_BCM2835_MPHI)
#endif
diff --git a/include/hw/misc/bcm2835_property.h b/include/hw/misc/bcm2835_property.h
index 28bf2b49b6..5c827a1900 100644
--- a/include/hw/misc/bcm2835_property.h
+++ b/include/hw/misc/bcm2835_property.h
@@ -15,8 +15,8 @@
#define TYPE_BCM2835_PROPERTY "bcm2835-property"
typedef struct BCM2835PropertyState BCM2835PropertyState;
-#define BCM2835_PROPERTY(obj) \
- OBJECT_CHECK(BCM2835PropertyState, (obj), TYPE_BCM2835_PROPERTY)
+DECLARE_INSTANCE_CHECKER(BCM2835PropertyState, BCM2835_PROPERTY,
+ TYPE_BCM2835_PROPERTY)
struct BCM2835PropertyState {
/*< private >*/
diff --git a/include/hw/misc/bcm2835_rng.h b/include/hw/misc/bcm2835_rng.h
index 0921d9b3f1..fec76eef8e 100644
--- a/include/hw/misc/bcm2835_rng.h
+++ b/include/hw/misc/bcm2835_rng.h
@@ -15,8 +15,8 @@
#define TYPE_BCM2835_RNG "bcm2835-rng"
typedef struct BCM2835RngState BCM2835RngState;
-#define BCM2835_RNG(obj) \
- OBJECT_CHECK(BCM2835RngState, (obj), TYPE_BCM2835_RNG)
+DECLARE_INSTANCE_CHECKER(BCM2835RngState, BCM2835_RNG,
+ TYPE_BCM2835_RNG)
struct BCM2835RngState {
SysBusDevice busdev;
diff --git a/include/hw/misc/bcm2835_thermal.h b/include/hw/misc/bcm2835_thermal.h
index 2b937527eb..5b827c970e 100644
--- a/include/hw/misc/bcm2835_thermal.h
+++ b/include/hw/misc/bcm2835_thermal.h
@@ -15,8 +15,8 @@
#define TYPE_BCM2835_THERMAL "bcm2835-thermal"
typedef struct Bcm2835ThermalState Bcm2835ThermalState;
-#define BCM2835_THERMAL(obj) \
- OBJECT_CHECK(Bcm2835ThermalState, (obj), TYPE_BCM2835_THERMAL)
+DECLARE_INSTANCE_CHECKER(Bcm2835ThermalState, BCM2835_THERMAL,
+ TYPE_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 427606fd6b..34b18e3193 100644
--- a/include/hw/misc/grlib_ahb_apb_pnp.h
+++ b/include/hw/misc/grlib_ahb_apb_pnp.h
@@ -27,13 +27,13 @@
#define TYPE_GRLIB_AHB_PNP "grlib,ahbpnp"
typedef struct AHBPnp AHBPnp;
-#define GRLIB_AHB_PNP(obj) \
- OBJECT_CHECK(AHBPnp, (obj), TYPE_GRLIB_AHB_PNP)
+DECLARE_INSTANCE_CHECKER(AHBPnp, GRLIB_AHB_PNP,
+ TYPE_GRLIB_AHB_PNP)
#define TYPE_GRLIB_APB_PNP "grlib,apbpnp"
typedef struct APBPnp APBPnp;
-#define GRLIB_APB_PNP(obj) \
- OBJECT_CHECK(APBPnp, (obj), TYPE_GRLIB_APB_PNP)
+DECLARE_INSTANCE_CHECKER(APBPnp, GRLIB_APB_PNP,
+ TYPE_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 8a7a9b675f..55c5db8815 100644
--- a/include/hw/misc/imx25_ccm.h
+++ b/include/hw/misc/imx25_ccm.h
@@ -65,7 +65,8 @@
#define TYPE_IMX25_CCM "imx25.ccm"
typedef struct IMX25CCMState IMX25CCMState;
-#define IMX25_CCM(obj) OBJECT_CHECK(IMX25CCMState, (obj), TYPE_IMX25_CCM)
+DECLARE_INSTANCE_CHECKER(IMX25CCMState, IMX25_CCM,
+ TYPE_IMX25_CCM)
struct IMX25CCMState {
/* <private> */
diff --git a/include/hw/misc/imx31_ccm.h b/include/hw/misc/imx31_ccm.h
index a56ee992af..25e280e976 100644
--- a/include/hw/misc/imx31_ccm.h
+++ b/include/hw/misc/imx31_ccm.h
@@ -74,7 +74,8 @@
#define TYPE_IMX31_CCM "imx31.ccm"
typedef struct IMX31CCMState IMX31CCMState;
-#define IMX31_CCM(obj) OBJECT_CHECK(IMX31CCMState, (obj), TYPE_IMX31_CCM)
+DECLARE_INSTANCE_CHECKER(IMX31CCMState, IMX31_CCM,
+ TYPE_IMX31_CCM)
struct IMX31CCMState {
/* <private> */
diff --git a/include/hw/misc/imx6_ccm.h b/include/hw/misc/imx6_ccm.h
index affa13087e..85f32417d6 100644
--- a/include/hw/misc/imx6_ccm.h
+++ b/include/hw/misc/imx6_ccm.h
@@ -180,7 +180,8 @@
#define TYPE_IMX6_CCM "imx6.ccm"
typedef struct IMX6CCMState IMX6CCMState;
-#define IMX6_CCM(obj) OBJECT_CHECK(IMX6CCMState, (obj), TYPE_IMX6_CCM)
+DECLARE_INSTANCE_CHECKER(IMX6CCMState, IMX6_CCM,
+ TYPE_IMX6_CCM)
struct IMX6CCMState {
/* <private> */
diff --git a/include/hw/misc/imx6_src.h b/include/hw/misc/imx6_src.h
index f1d70ec177..15b51757ba 100644
--- a/include/hw/misc/imx6_src.h
+++ b/include/hw/misc/imx6_src.h
@@ -59,7 +59,8 @@
#define TYPE_IMX6_SRC "imx6.src"
typedef struct IMX6SRCState IMX6SRCState;
-#define IMX6_SRC(obj) OBJECT_CHECK(IMX6SRCState, (obj), TYPE_IMX6_SRC)
+DECLARE_INSTANCE_CHECKER(IMX6SRCState, IMX6_SRC,
+ TYPE_IMX6_SRC)
struct IMX6SRCState {
/* <private> */
diff --git a/include/hw/misc/imx6ul_ccm.h b/include/hw/misc/imx6ul_ccm.h
index 2304c6e738..d614de0edd 100644
--- a/include/hw/misc/imx6ul_ccm.h
+++ b/include/hw/misc/imx6ul_ccm.h
@@ -209,7 +209,8 @@
#define TYPE_IMX6UL_CCM "imx6ul.ccm"
typedef struct IMX6ULCCMState IMX6ULCCMState;
-#define IMX6UL_CCM(obj) OBJECT_CHECK(IMX6ULCCMState, (obj), TYPE_IMX6UL_CCM)
+DECLARE_INSTANCE_CHECKER(IMX6ULCCMState, IMX6UL_CCM,
+ TYPE_IMX6UL_CCM)
struct IMX6ULCCMState {
/* <private> */
diff --git a/include/hw/misc/imx7_ccm.h b/include/hw/misc/imx7_ccm.h
index 9e9e58a5c2..e2757622d0 100644
--- a/include/hw/misc/imx7_ccm.h
+++ b/include/hw/misc/imx7_ccm.h
@@ -106,7 +106,8 @@ enum IMX7PMURegisters {
#define TYPE_IMX7_CCM "imx7.ccm"
typedef struct IMX7CCMState IMX7CCMState;
-#define IMX7_CCM(obj) OBJECT_CHECK(IMX7CCMState, (obj), TYPE_IMX7_CCM)
+DECLARE_INSTANCE_CHECKER(IMX7CCMState, IMX7_CCM,
+ TYPE_IMX7_CCM)
struct IMX7CCMState {
/* <private> */
@@ -121,7 +122,8 @@ struct IMX7CCMState {
#define TYPE_IMX7_ANALOG "imx7.analog"
typedef struct IMX7AnalogState IMX7AnalogState;
-#define IMX7_ANALOG(obj) OBJECT_CHECK(IMX7AnalogState, (obj), TYPE_IMX7_ANALOG)
+DECLARE_INSTANCE_CHECKER(IMX7AnalogState, IMX7_ANALOG,
+ TYPE_IMX7_ANALOG)
struct IMX7AnalogState {
/* <private> */
diff --git a/include/hw/misc/imx7_gpr.h b/include/hw/misc/imx7_gpr.h
index 83384ec0cc..f80b3ed28c 100644
--- a/include/hw/misc/imx7_gpr.h
+++ b/include/hw/misc/imx7_gpr.h
@@ -18,7 +18,8 @@
#define TYPE_IMX7_GPR "imx7.gpr"
typedef struct IMX7GPRState IMX7GPRState;
-#define IMX7_GPR(obj) OBJECT_CHECK(IMX7GPRState, (obj), TYPE_IMX7_GPR)
+DECLARE_INSTANCE_CHECKER(IMX7GPRState, IMX7_GPR,
+ TYPE_IMX7_GPR)
struct IMX7GPRState {
/* <private> */
diff --git a/include/hw/misc/imx7_snvs.h b/include/hw/misc/imx7_snvs.h
index f8659acb7d..ea5395c107 100644
--- a/include/hw/misc/imx7_snvs.h
+++ b/include/hw/misc/imx7_snvs.h
@@ -25,7 +25,8 @@ enum IMX7SNVSRegisters {
#define TYPE_IMX7_SNVS "imx7.snvs"
typedef struct IMX7SNVSState IMX7SNVSState;
-#define IMX7_SNVS(obj) OBJECT_CHECK(IMX7SNVSState, (obj), TYPE_IMX7_SNVS)
+DECLARE_INSTANCE_CHECKER(IMX7SNVSState, IMX7_SNVS,
+ TYPE_IMX7_SNVS)
struct IMX7SNVSState {
/* <private> */
diff --git a/include/hw/misc/imx_ccm.h b/include/hw/misc/imx_ccm.h
index 174248e5df..e9d82a2a50 100644
--- a/include/hw/misc/imx_ccm.h
+++ b/include/hw/misc/imx_ccm.h
@@ -30,12 +30,8 @@
#define TYPE_IMX_CCM "imx.ccm"
typedef struct IMXCCMClass IMXCCMClass;
typedef struct IMXCCMState IMXCCMState;
-#define IMX_CCM(obj) \
- OBJECT_CHECK(IMXCCMState, (obj), TYPE_IMX_CCM)
-#define IMX_CCM_CLASS(klass) \
- OBJECT_CLASS_CHECK(IMXCCMClass, (klass), TYPE_IMX_CCM)
-#define IMX_CCM_GET_CLASS(obj) \
- OBJECT_GET_CLASS(IMXCCMClass, (obj), TYPE_IMX_CCM)
+DECLARE_OBJ_CHECKERS(IMXCCMState, IMXCCMClass,
+ IMX_CCM, TYPE_IMX_CCM)
struct IMXCCMState {
/* <private> */
diff --git a/include/hw/misc/imx_rngc.h b/include/hw/misc/imx_rngc.h
index cd7ba8f91e..f7b569cac5 100644
--- a/include/hw/misc/imx_rngc.h
+++ b/include/hw/misc/imx_rngc.h
@@ -15,7 +15,8 @@
#define TYPE_IMX_RNGC "imx.rngc"
typedef struct IMXRNGCState IMXRNGCState;
-#define IMX_RNGC(obj) OBJECT_CHECK(IMXRNGCState, (obj), TYPE_IMX_RNGC)
+DECLARE_INSTANCE_CHECKER(IMXRNGCState, IMX_RNGC,
+ TYPE_IMX_RNGC)
struct IMXRNGCState {
/*< private >*/
diff --git a/include/hw/misc/iotkit-secctl.h b/include/hw/misc/iotkit-secctl.h
index 3d54d8f3de..d062ed43e7 100644
--- a/include/hw/misc/iotkit-secctl.h
+++ b/include/hw/misc/iotkit-secctl.h
@@ -60,7 +60,8 @@
#define TYPE_IOTKIT_SECCTL "iotkit-secctl"
typedef struct IoTKitSecCtl IoTKitSecCtl;
-#define IOTKIT_SECCTL(obj) OBJECT_CHECK(IoTKitSecCtl, (obj), TYPE_IOTKIT_SECCTL)
+DECLARE_INSTANCE_CHECKER(IoTKitSecCtl, IOTKIT_SECCTL,
+ TYPE_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 27fe6346e6..22ceb5d76d 100644
--- a/include/hw/misc/iotkit-sysctl.h
+++ b/include/hw/misc/iotkit-sysctl.h
@@ -32,8 +32,8 @@
#define TYPE_IOTKIT_SYSCTL "iotkit-sysctl"
typedef struct IoTKitSysCtl IoTKitSysCtl;
-#define IOTKIT_SYSCTL(obj) OBJECT_CHECK(IoTKitSysCtl, (obj), \
- TYPE_IOTKIT_SYSCTL)
+DECLARE_INSTANCE_CHECKER(IoTKitSysCtl, IOTKIT_SYSCTL,
+ TYPE_IOTKIT_SYSCTL)
struct IoTKitSysCtl {
/*< private >*/
diff --git a/include/hw/misc/iotkit-sysinfo.h b/include/hw/misc/iotkit-sysinfo.h
index e0e610c75c..23ae43e549 100644
--- a/include/hw/misc/iotkit-sysinfo.h
+++ b/include/hw/misc/iotkit-sysinfo.h
@@ -27,8 +27,8 @@
#define TYPE_IOTKIT_SYSINFO "iotkit-sysinfo"
typedef struct IoTKitSysInfo IoTKitSysInfo;
-#define IOTKIT_SYSINFO(obj) OBJECT_CHECK(IoTKitSysInfo, (obj), \
- TYPE_IOTKIT_SYSINFO)
+DECLARE_INSTANCE_CHECKER(IoTKitSysInfo, IOTKIT_SYSINFO,
+ TYPE_IOTKIT_SYSINFO)
struct IoTKitSysInfo {
/*< private >*/
diff --git a/include/hw/misc/mac_via.h b/include/hw/misc/mac_via.h
index a59750634f..862cbba3ab 100644
--- a/include/hw/misc/mac_via.h
+++ b/include/hw/misc/mac_via.h
@@ -33,8 +33,8 @@
#define TYPE_MOS6522_Q800_VIA1 "mos6522-q800-via1"
typedef struct MOS6522Q800VIA1State MOS6522Q800VIA1State;
-#define MOS6522_Q800_VIA1(obj) OBJECT_CHECK(MOS6522Q800VIA1State, (obj), \
- TYPE_MOS6522_Q800_VIA1)
+DECLARE_INSTANCE_CHECKER(MOS6522Q800VIA1State, MOS6522_Q800_VIA1,
+ TYPE_MOS6522_Q800_VIA1)
struct MOS6522Q800VIA1State {
/*< private >*/
@@ -69,8 +69,8 @@ struct MOS6522Q800VIA1State {
#define TYPE_MOS6522_Q800_VIA2 "mos6522-q800-via2"
typedef struct MOS6522Q800VIA2State MOS6522Q800VIA2State;
-#define MOS6522_Q800_VIA2(obj) OBJECT_CHECK(MOS6522Q800VIA2State, (obj), \
- TYPE_MOS6522_Q800_VIA2)
+DECLARE_INSTANCE_CHECKER(MOS6522Q800VIA2State, MOS6522_Q800_VIA2,
+ TYPE_MOS6522_Q800_VIA2)
struct MOS6522Q800VIA2State {
/*< private >*/
@@ -80,7 +80,8 @@ struct MOS6522Q800VIA2State {
#define TYPE_MAC_VIA "mac_via"
typedef struct MacVIAState MacVIAState;
-#define MAC_VIA(obj) OBJECT_CHECK(MacVIAState, (obj), TYPE_MAC_VIA)
+DECLARE_INSTANCE_CHECKER(MacVIAState, MAC_VIA,
+ TYPE_MAC_VIA)
struct MacVIAState {
SysBusDevice busdev;
diff --git a/include/hw/misc/macio/cuda.h b/include/hw/misc/macio/cuda.h
index f2b0069262..e738b6376f 100644
--- a/include/hw/misc/macio/cuda.h
+++ b/include/hw/misc/macio/cuda.h
@@ -66,13 +66,14 @@ struct MOS6522CUDAState {
typedef struct MOS6522CUDAState MOS6522CUDAState;
#define TYPE_MOS6522_CUDA "mos6522-cuda"
-#define MOS6522_CUDA(obj) OBJECT_CHECK(MOS6522CUDAState, (obj), \
- TYPE_MOS6522_CUDA)
+DECLARE_INSTANCE_CHECKER(MOS6522CUDAState, MOS6522_CUDA,
+ TYPE_MOS6522_CUDA)
/* Cuda */
#define TYPE_CUDA "cuda"
typedef struct CUDAState CUDAState;
-#define CUDA(obj) OBJECT_CHECK(CUDAState, (obj), TYPE_CUDA)
+DECLARE_INSTANCE_CHECKER(CUDAState, CUDA,
+ TYPE_CUDA)
struct CUDAState {
/*< private >*/
diff --git a/include/hw/misc/macio/gpio.h b/include/hw/misc/macio/gpio.h
index 2234873250..1d0c8434ae 100644
--- a/include/hw/misc/macio/gpio.h
+++ b/include/hw/misc/macio/gpio.h
@@ -32,7 +32,8 @@
#define TYPE_MACIO_GPIO "macio-gpio"
typedef struct MacIOGPIOState MacIOGPIOState;
-#define MACIO_GPIO(obj) OBJECT_CHECK(MacIOGPIOState, (obj), TYPE_MACIO_GPIO)
+DECLARE_INSTANCE_CHECKER(MacIOGPIOState, MACIO_GPIO,
+ TYPE_MACIO_GPIO)
struct MacIOGPIOState {
/*< private >*/
diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h
index 81c28eeef7..02dbf37630 100644
--- a/include/hw/misc/macio/macio.h
+++ b/include/hw/misc/macio/macio.h
@@ -41,7 +41,8 @@
/* MacIO virtual bus */
#define TYPE_MACIO_BUS "macio-bus"
typedef struct MacIOBusState MacIOBusState;
-#define MACIO_BUS(obj) OBJECT_CHECK(MacIOBusState, (obj), TYPE_MACIO_BUS)
+DECLARE_INSTANCE_CHECKER(MacIOBusState, MACIO_BUS,
+ TYPE_MACIO_BUS)
struct MacIOBusState {
/*< private >*/
@@ -51,7 +52,8 @@ struct MacIOBusState {
/* MacIO IDE */
#define TYPE_MACIO_IDE "macio-ide"
typedef struct MACIOIDEState MACIOIDEState;
-#define MACIO_IDE(obj) OBJECT_CHECK(MACIOIDEState, (obj), TYPE_MACIO_IDE)
+DECLARE_INSTANCE_CHECKER(MACIOIDEState, MACIO_IDE,
+ TYPE_MACIO_IDE)
struct MACIOIDEState {
/*< private >*/
@@ -78,7 +80,8 @@ void macio_ide_register_dma(MACIOIDEState *ide);
#define TYPE_MACIO "macio"
typedef struct MacIOState MacIOState;
-#define MACIO(obj) OBJECT_CHECK(MacIOState, (obj), TYPE_MACIO)
+DECLARE_INSTANCE_CHECKER(MacIOState, MACIO,
+ TYPE_MACIO)
struct MacIOState {
/*< private >*/
@@ -96,8 +99,8 @@ struct MacIOState {
#define TYPE_OLDWORLD_MACIO "macio-oldworld"
typedef struct OldWorldMacIOState OldWorldMacIOState;
-#define OLDWORLD_MACIO(obj) \
- OBJECT_CHECK(OldWorldMacIOState, (obj), TYPE_OLDWORLD_MACIO)
+DECLARE_INSTANCE_CHECKER(OldWorldMacIOState, OLDWORLD_MACIO,
+ TYPE_OLDWORLD_MACIO)
struct OldWorldMacIOState {
/*< private >*/
@@ -112,8 +115,8 @@ struct OldWorldMacIOState {
#define TYPE_NEWWORLD_MACIO "macio-newworld"
typedef struct NewWorldMacIOState NewWorldMacIOState;
-#define NEWWORLD_MACIO(obj) \
- OBJECT_CHECK(NewWorldMacIOState, (obj), TYPE_NEWWORLD_MACIO)
+DECLARE_INSTANCE_CHECKER(NewWorldMacIOState, NEWWORLD_MACIO,
+ TYPE_NEWWORLD_MACIO)
struct NewWorldMacIOState {
/*< private >*/
diff --git a/include/hw/misc/macio/pmu.h b/include/hw/misc/macio/pmu.h
index b3982f6f32..0d1a5c1406 100644
--- a/include/hw/misc/macio/pmu.h
+++ b/include/hw/misc/macio/pmu.h
@@ -181,8 +181,8 @@ struct MOS6522PMUState {
typedef struct MOS6522PMUState MOS6522PMUState;
#define TYPE_MOS6522_PMU "mos6522-pmu"
-#define MOS6522_PMU(obj) OBJECT_CHECK(MOS6522PMUState, (obj), \
- TYPE_MOS6522_PMU)
+DECLARE_INSTANCE_CHECKER(MOS6522PMUState, MOS6522_PMU,
+ TYPE_MOS6522_PMU)
/**
* PMUState:
* @last_b: last value of B register
@@ -234,6 +234,7 @@ struct PMUState {
typedef struct PMUState PMUState;
#define TYPE_VIA_PMU "via-pmu"
-#define VIA_PMU(obj) OBJECT_CHECK(PMUState, (obj), TYPE_VIA_PMU)
+DECLARE_INSTANCE_CHECKER(PMUState, VIA_PMU,
+ TYPE_VIA_PMU)
#endif /* PMU_H */
diff --git a/include/hw/misc/max111x.h b/include/hw/misc/max111x.h
index e903a1af9c..6350a3f7c0 100644
--- a/include/hw/misc/max111x.h
+++ b/include/hw/misc/max111x.h
@@ -49,8 +49,8 @@ typedef struct MAX111xState MAX111xState;
#define TYPE_MAX_111X "max111x"
-#define MAX_111X(obj) \
- OBJECT_CHECK(MAX111xState, (obj), TYPE_MAX_111X)
+DECLARE_INSTANCE_CHECKER(MAX111xState, MAX_111X,
+ TYPE_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 a334be8edd..923df4f112 100644
--- a/include/hw/misc/mips_cmgcr.h
+++ b/include/hw/misc/mips_cmgcr.h
@@ -15,7 +15,8 @@
#define TYPE_MIPS_GCR "mips-gcr"
typedef struct MIPSGCRState MIPSGCRState;
-#define MIPS_GCR(obj) OBJECT_CHECK(MIPSGCRState, (obj), TYPE_MIPS_GCR)
+DECLARE_INSTANCE_CHECKER(MIPSGCRState, MIPS_GCR,
+ TYPE_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 b0131e4a54..7dc188e8a2 100644
--- a/include/hw/misc/mips_cpc.h
+++ b/include/hw/misc/mips_cpc.h
@@ -36,7 +36,8 @@
#define TYPE_MIPS_CPC "mips-cpc"
typedef struct MIPSCPCState MIPSCPCState;
-#define MIPS_CPC(obj) OBJECT_CHECK(MIPSCPCState, (obj), TYPE_MIPS_CPC)
+DECLARE_INSTANCE_CHECKER(MIPSCPCState, MIPS_CPC,
+ TYPE_MIPS_CPC)
struct MIPSCPCState {
SysBusDevice parent_obj;
diff --git a/include/hw/misc/mips_itu.h b/include/hw/misc/mips_itu.h
index 9ddb04708a..7c19f61fbb 100644
--- a/include/hw/misc/mips_itu.h
+++ b/include/hw/misc/mips_itu.h
@@ -25,7 +25,8 @@
#define TYPE_MIPS_ITU "mips-itu"
typedef struct MIPSITUState MIPSITUState;
-#define MIPS_ITU(obj) OBJECT_CHECK(MIPSITUState, (obj), TYPE_MIPS_ITU)
+DECLARE_INSTANCE_CHECKER(MIPSITUState, MIPS_ITU,
+ TYPE_MIPS_ITU)
#define ITC_CELL_DEPTH_SHIFT 2
#define ITC_CELL_DEPTH (1u << ITC_CELL_DEPTH_SHIFT)
diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h
index b099814879..f73271ba67 100644
--- a/include/hw/misc/mos6522.h
+++ b/include/hw/misc/mos6522.h
@@ -126,7 +126,8 @@ typedef struct MOS6522State MOS6522State;
#define TYPE_MOS6522 "mos6522"
typedef struct MOS6522DeviceClass MOS6522DeviceClass;
-#define MOS6522(obj) OBJECT_CHECK(MOS6522State, (obj), TYPE_MOS6522)
+DECLARE_OBJ_CHECKERS(MOS6522State, MOS6522DeviceClass,
+ MOS6522, TYPE_MOS6522)
struct MOS6522DeviceClass {
DeviceClass parent_class;
@@ -143,10 +144,6 @@ struct MOS6522DeviceClass {
uint64_t (*get_timer2_load_time)(MOS6522State *dev, MOS6522Timer *ti);
};
-#define MOS6522_CLASS(cls) \
- OBJECT_CLASS_CHECK(MOS6522DeviceClass, (cls), TYPE_MOS6522)
-#define MOS6522_GET_CLASS(obj) \
- OBJECT_GET_CLASS(MOS6522DeviceClass, (obj), TYPE_MOS6522)
extern const VMStateDescription vmstate_mos6522;
diff --git a/include/hw/misc/mps2-fpgaio.h b/include/hw/misc/mps2-fpgaio.h
index e844041bb0..991f5b731e 100644
--- a/include/hw/misc/mps2-fpgaio.h
+++ b/include/hw/misc/mps2-fpgaio.h
@@ -26,7 +26,8 @@
#define TYPE_MPS2_FPGAIO "mps2-fpgaio"
typedef struct MPS2FPGAIO MPS2FPGAIO;
-#define MPS2_FPGAIO(obj) OBJECT_CHECK(MPS2FPGAIO, (obj), TYPE_MPS2_FPGAIO)
+DECLARE_INSTANCE_CHECKER(MPS2FPGAIO, MPS2_FPGAIO,
+ TYPE_MPS2_FPGAIO)
struct MPS2FPGAIO {
/*< private >*/
diff --git a/include/hw/misc/mps2-scc.h b/include/hw/misc/mps2-scc.h
index 10393c4e3a..445e268b1f 100644
--- a/include/hw/misc/mps2-scc.h
+++ b/include/hw/misc/mps2-scc.h
@@ -17,7 +17,8 @@
#define TYPE_MPS2_SCC "mps2-scc"
typedef struct MPS2SCC MPS2SCC;
-#define MPS2_SCC(obj) OBJECT_CHECK(MPS2SCC, (obj), TYPE_MPS2_SCC)
+DECLARE_INSTANCE_CHECKER(MPS2SCC, MPS2_SCC,
+ TYPE_MPS2_SCC)
#define NUM_OSCCLK 3
diff --git a/include/hw/misc/msf2-sysreg.h b/include/hw/misc/msf2-sysreg.h
index 6b5d03608a..625932354a 100644
--- a/include/hw/misc/msf2-sysreg.h
+++ b/include/hw/misc/msf2-sysreg.h
@@ -63,7 +63,8 @@ enum {
#define TYPE_MSF2_SYSREG "msf2-sysreg"
typedef struct MSF2SysregState MSF2SysregState;
-#define MSF2_SYSREG(obj) OBJECT_CHECK(MSF2SysregState, (obj), TYPE_MSF2_SYSREG)
+DECLARE_INSTANCE_CHECKER(MSF2SysregState, MSF2_SYSREG,
+ TYPE_MSF2_SYSREG)
struct MSF2SysregState {
SysBusDevice parent_obj;
diff --git a/include/hw/misc/nrf51_rng.h b/include/hw/misc/nrf51_rng.h
index 247f167100..7f2263a906 100644
--- a/include/hw/misc/nrf51_rng.h
+++ b/include/hw/misc/nrf51_rng.h
@@ -39,7 +39,8 @@
#include "qom/object.h"
#define TYPE_NRF51_RNG "nrf51_soc.rng"
typedef struct NRF51RNGState NRF51RNGState;
-#define NRF51_RNG(obj) OBJECT_CHECK(NRF51RNGState, (obj), TYPE_NRF51_RNG)
+DECLARE_INSTANCE_CHECKER(NRF51RNGState, NRF51_RNG,
+ TYPE_NRF51_RNG)
#define NRF51_RNG_SIZE 0x1000
diff --git a/include/hw/misc/pca9552.h b/include/hw/misc/pca9552.h
index ebf8425903..b6f4e264fe 100644
--- a/include/hw/misc/pca9552.h
+++ b/include/hw/misc/pca9552.h
@@ -15,7 +15,8 @@
#define TYPE_PCA9552 "pca9552"
#define TYPE_PCA955X "pca955x"
typedef struct PCA955xState PCA955xState;
-#define PCA955X(obj) OBJECT_CHECK(PCA955xState, (obj), TYPE_PCA955X)
+DECLARE_INSTANCE_CHECKER(PCA955xState, PCA955X,
+ TYPE_PCA955X)
#define PCA955X_NR_REGS 10
#define PCA955X_PIN_COUNT_MAX 16
diff --git a/include/hw/misc/stm32f2xx_syscfg.h b/include/hw/misc/stm32f2xx_syscfg.h
index ff7c976d66..82ccd7cc24 100644
--- a/include/hw/misc/stm32f2xx_syscfg.h
+++ b/include/hw/misc/stm32f2xx_syscfg.h
@@ -38,8 +38,8 @@
#define TYPE_STM32F2XX_SYSCFG "stm32f2xx-syscfg"
typedef struct STM32F2XXSyscfgState STM32F2XXSyscfgState;
-#define STM32F2XX_SYSCFG(obj) \
- OBJECT_CHECK(STM32F2XXSyscfgState, (obj), TYPE_STM32F2XX_SYSCFG)
+DECLARE_INSTANCE_CHECKER(STM32F2XXSyscfgState, STM32F2XX_SYSCFG,
+ TYPE_STM32F2XX_SYSCFG)
struct STM32F2XXSyscfgState {
/* <private> */
diff --git a/include/hw/misc/stm32f4xx_exti.h b/include/hw/misc/stm32f4xx_exti.h
index 7132615785..4987c286ed 100644
--- a/include/hw/misc/stm32f4xx_exti.h
+++ b/include/hw/misc/stm32f4xx_exti.h
@@ -38,8 +38,8 @@
#define TYPE_STM32F4XX_EXTI "stm32f4xx-exti"
typedef struct STM32F4xxExtiState STM32F4xxExtiState;
-#define STM32F4XX_EXTI(obj) \
- OBJECT_CHECK(STM32F4xxExtiState, (obj), TYPE_STM32F4XX_EXTI)
+DECLARE_INSTANCE_CHECKER(STM32F4xxExtiState, STM32F4XX_EXTI,
+ TYPE_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 78130cb9c3..c3d89d4536 100644
--- a/include/hw/misc/stm32f4xx_syscfg.h
+++ b/include/hw/misc/stm32f4xx_syscfg.h
@@ -39,8 +39,8 @@
#define TYPE_STM32F4XX_SYSCFG "stm32f4xx-syscfg"
typedef struct STM32F4xxSyscfgState STM32F4xxSyscfgState;
-#define STM32F4XX_SYSCFG(obj) \
- OBJECT_CHECK(STM32F4xxSyscfgState, (obj), TYPE_STM32F4XX_SYSCFG)
+DECLARE_INSTANCE_CHECKER(STM32F4xxSyscfgState, STM32F4XX_SYSCFG,
+ TYPE_STM32F4XX_SYSCFG)
#define SYSCFG_NUM_EXTICR 4
diff --git a/include/hw/misc/tz-mpc.h b/include/hw/misc/tz-mpc.h
index 2d3eae0834..34e45fdb97 100644
--- a/include/hw/misc/tz-mpc.h
+++ b/include/hw/misc/tz-mpc.h
@@ -36,7 +36,8 @@
#define TYPE_TZ_MPC "tz-mpc"
typedef struct TZMPC TZMPC;
-#define TZ_MPC(obj) OBJECT_CHECK(TZMPC, (obj), TYPE_TZ_MPC)
+DECLARE_INSTANCE_CHECKER(TZMPC, TZ_MPC,
+ TYPE_TZ_MPC)
#define TZ_NUM_PORTS 16
diff --git a/include/hw/misc/tz-msc.h b/include/hw/misc/tz-msc.h
index 3f719833a9..7169f330ff 100644
--- a/include/hw/misc/tz-msc.h
+++ b/include/hw/misc/tz-msc.h
@@ -56,7 +56,8 @@
#define TYPE_TZ_MSC "tz-msc"
typedef struct TZMSC TZMSC;
-#define TZ_MSC(obj) OBJECT_CHECK(TZMSC, (obj), TYPE_TZ_MSC)
+DECLARE_INSTANCE_CHECKER(TZMSC, TZ_MSC,
+ TYPE_TZ_MSC)
struct TZMSC {
/*< private >*/
diff --git a/include/hw/misc/tz-ppc.h b/include/hw/misc/tz-ppc.h
index 4646005fa5..b5251b715e 100644
--- a/include/hw/misc/tz-ppc.h
+++ b/include/hw/misc/tz-ppc.h
@@ -70,7 +70,8 @@
#define TYPE_TZ_PPC "tz-ppc"
typedef struct TZPPC TZPPC;
-#define TZ_PPC(obj) OBJECT_CHECK(TZPPC, (obj), TYPE_TZ_PPC)
+DECLARE_INSTANCE_CHECKER(TZPPC, TZ_PPC,
+ TYPE_TZ_PPC)
#define TZ_NUM_PORTS 16
diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h
index 6c04c8a923..7c724bab94 100644
--- a/include/hw/misc/unimp.h
+++ b/include/hw/misc/unimp.h
@@ -16,8 +16,8 @@
#define TYPE_UNIMPLEMENTED_DEVICE "unimplemented-device"
typedef struct UnimplementedDeviceState UnimplementedDeviceState;
-#define UNIMPLEMENTED_DEVICE(obj) \
- OBJECT_CHECK(UnimplementedDeviceState, (obj), TYPE_UNIMPLEMENTED_DEVICE)
+DECLARE_INSTANCE_CHECKER(UnimplementedDeviceState, UNIMPLEMENTED_DEVICE,
+ TYPE_UNIMPLEMENTED_DEVICE)
struct UnimplementedDeviceState {
SysBusDevice parent_obj;
diff --git a/include/hw/misc/vmcoreinfo.h b/include/hw/misc/vmcoreinfo.h
index cf0e51f863..ebada6617a 100644
--- a/include/hw/misc/vmcoreinfo.h
+++ b/include/hw/misc/vmcoreinfo.h
@@ -18,7 +18,8 @@
#define VMCOREINFO_DEVICE "vmcoreinfo"
typedef struct VMCoreInfoState VMCoreInfoState;
-#define VMCOREINFO(obj) OBJECT_CHECK(VMCoreInfoState, (obj), VMCOREINFO_DEVICE)
+DECLARE_INSTANCE_CHECKER(VMCoreInfoState, VMCOREINFO,
+ VMCOREINFO_DEVICE)
typedef struct fw_cfg_vmcoreinfo FWCfgVMCoreInfo;
diff --git a/include/hw/misc/zynq-xadc.h b/include/hw/misc/zynq-xadc.h
index 7e9767c74f..052f47954f 100644
--- a/include/hw/misc/zynq-xadc.h
+++ b/include/hw/misc/zynq-xadc.h
@@ -25,8 +25,8 @@
#define TYPE_ZYNQ_XADC "xlnx,zynq-xadc"
typedef struct ZynqXADCState ZynqXADCState;
-#define ZYNQ_XADC(obj) \
- OBJECT_CHECK(ZynqXADCState, (obj), TYPE_ZYNQ_XADC)
+DECLARE_INSTANCE_CHECKER(ZynqXADCState, ZYNQ_XADC,
+ TYPE_ZYNQ_XADC)
struct ZynqXADCState {
/*< private >*/