aboutsummaryrefslogtreecommitdiff
path: root/hw/arm
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 /hw/arm
parentdb1015e92e04835c9eb50c29625fe566d1202dbd (diff)
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 'hw/arm')
-rw-r--r--hw/arm/collie.c4
-rw-r--r--hw/arm/highbank.c4
-rw-r--r--hw/arm/integratorcp.c12
-rw-r--r--hw/arm/microbit.c4
-rw-r--r--hw/arm/mps2-tz.c8
-rw-r--r--hw/arm/mps2.c8
-rw-r--r--hw/arm/musca.c8
-rw-r--r--hw/arm/musicpal.c32
-rw-r--r--hw/arm/palm.c4
-rw-r--r--hw/arm/pxa2xx.c12
-rw-r--r--hw/arm/pxa2xx_gpio.c4
-rw-r--r--hw/arm/pxa2xx_pic.c4
-rw-r--r--hw/arm/raspi.c8
-rw-r--r--hw/arm/sbsa-ref.c4
-rw-r--r--hw/arm/spitz.c25
-rw-r--r--hw/arm/stellaris.c12
-rw-r--r--hw/arm/strongarm.c24
-rw-r--r--hw/arm/tosa.c7
-rw-r--r--hw/arm/versatilepb.c4
-rw-r--r--hw/arm/vexpress.c8
-rw-r--r--hw/arm/xilinx_zynq.c4
-rw-r--r--hw/arm/xlnx-versal-virt.c4
-rw-r--r--hw/arm/xlnx-zcu102.c4
-rw-r--r--hw/arm/z2.c6
24 files changed, 98 insertions, 116 deletions
diff --git a/hw/arm/collie.c b/hw/arm/collie.c
index 82ffc82dc7..a49f4a1c7c 100644
--- a/hw/arm/collie.c
+++ b/hw/arm/collie.c
@@ -28,8 +28,8 @@ struct CollieMachineState {
typedef struct CollieMachineState CollieMachineState;
#define TYPE_COLLIE_MACHINE MACHINE_TYPE_NAME("collie")
-#define COLLIE_MACHINE(obj) \
- OBJECT_CHECK(CollieMachineState, obj, TYPE_COLLIE_MACHINE)
+DECLARE_INSTANCE_CHECKER(CollieMachineState, COLLIE_MACHINE,
+ TYPE_COLLIE_MACHINE)
static struct arm_boot_info collie_binfo = {
.loader_start = SA_SDCS0,
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index cbf6e72ad6..e2ace803ef 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -157,8 +157,8 @@ static const MemoryRegionOps hb_mem_ops = {
#define TYPE_HIGHBANK_REGISTERS "highbank-regs"
typedef struct HighbankRegsState HighbankRegsState;
-#define HIGHBANK_REGISTERS(obj) \
- OBJECT_CHECK(HighbankRegsState, (obj), TYPE_HIGHBANK_REGISTERS)
+DECLARE_INSTANCE_CHECKER(HighbankRegsState, HIGHBANK_REGISTERS,
+ TYPE_HIGHBANK_REGISTERS)
struct HighbankRegsState {
/*< private >*/
diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index 75e608e68e..19989b61b9 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -30,8 +30,8 @@
#define TYPE_INTEGRATOR_CM "integrator_core"
typedef struct IntegratorCMState IntegratorCMState;
-#define INTEGRATOR_CM(obj) \
- OBJECT_CHECK(IntegratorCMState, (obj), TYPE_INTEGRATOR_CM)
+DECLARE_INSTANCE_CHECKER(IntegratorCMState, INTEGRATOR_CM,
+ TYPE_INTEGRATOR_CM)
struct IntegratorCMState {
/*< private >*/
@@ -329,8 +329,8 @@ static void integratorcm_realize(DeviceState *d, Error **errp)
#define TYPE_INTEGRATOR_PIC "integrator_pic"
typedef struct icp_pic_state icp_pic_state;
-#define INTEGRATOR_PIC(obj) \
- OBJECT_CHECK(icp_pic_state, (obj), TYPE_INTEGRATOR_PIC)
+DECLARE_INSTANCE_CHECKER(icp_pic_state, INTEGRATOR_PIC,
+ TYPE_INTEGRATOR_PIC)
struct icp_pic_state {
/*< private >*/
@@ -469,8 +469,8 @@ static void icp_pic_init(Object *obj)
#define TYPE_ICP_CONTROL_REGS "icp-ctrl-regs"
typedef struct ICPCtrlRegsState ICPCtrlRegsState;
-#define ICP_CONTROL_REGS(obj) \
- OBJECT_CHECK(ICPCtrlRegsState, (obj), TYPE_ICP_CONTROL_REGS)
+DECLARE_INSTANCE_CHECKER(ICPCtrlRegsState, ICP_CONTROL_REGS,
+ TYPE_ICP_CONTROL_REGS)
struct ICPCtrlRegsState {
/*< private >*/
diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c
index e94f711e89..9a4a3d357a 100644
--- a/hw/arm/microbit.c
+++ b/hw/arm/microbit.c
@@ -30,8 +30,8 @@ typedef struct MicrobitMachineState MicrobitMachineState;
#define TYPE_MICROBIT_MACHINE MACHINE_TYPE_NAME("microbit")
-#define MICROBIT_MACHINE(obj) \
- OBJECT_CHECK(MicrobitMachineState, obj, TYPE_MICROBIT_MACHINE)
+DECLARE_INSTANCE_CHECKER(MicrobitMachineState, MICROBIT_MACHINE,
+ TYPE_MICROBIT_MACHINE)
static void microbit_init(MachineState *machine)
{
diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
index 8870aea814..dbf7d63dc8 100644
--- a/hw/arm/mps2-tz.c
+++ b/hw/arm/mps2-tz.c
@@ -108,12 +108,8 @@ typedef struct MPS2TZMachineState MPS2TZMachineState;
#define TYPE_MPS2TZ_AN505_MACHINE MACHINE_TYPE_NAME("mps2-an505")
#define TYPE_MPS2TZ_AN521_MACHINE MACHINE_TYPE_NAME("mps2-an521")
-#define MPS2TZ_MACHINE(obj) \
- OBJECT_CHECK(MPS2TZMachineState, obj, TYPE_MPS2TZ_MACHINE)
-#define MPS2TZ_MACHINE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(MPS2TZMachineClass, obj, TYPE_MPS2TZ_MACHINE)
-#define MPS2TZ_MACHINE_CLASS(klass) \
- OBJECT_CLASS_CHECK(MPS2TZMachineClass, klass, TYPE_MPS2TZ_MACHINE)
+DECLARE_OBJ_CHECKERS(MPS2TZMachineState, MPS2TZMachineClass,
+ MPS2TZ_MACHINE, TYPE_MPS2TZ_MACHINE)
/* Main SYSCLK frequency in Hz */
#define SYSCLK_FRQ 20000000
diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index b5173e398d..4ee5c38459 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -84,12 +84,8 @@ typedef struct MPS2MachineState MPS2MachineState;
#define TYPE_MPS2_AN385_MACHINE MACHINE_TYPE_NAME("mps2-an385")
#define TYPE_MPS2_AN511_MACHINE MACHINE_TYPE_NAME("mps2-an511")
-#define MPS2_MACHINE(obj) \
- OBJECT_CHECK(MPS2MachineState, obj, TYPE_MPS2_MACHINE)
-#define MPS2_MACHINE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(MPS2MachineClass, obj, TYPE_MPS2_MACHINE)
-#define MPS2_MACHINE_CLASS(klass) \
- OBJECT_CLASS_CHECK(MPS2MachineClass, klass, TYPE_MPS2_MACHINE)
+DECLARE_OBJ_CHECKERS(MPS2MachineState, MPS2MachineClass,
+ MPS2_MACHINE, TYPE_MPS2_MACHINE)
/* Main SYSCLK frequency in Hz */
#define SYSCLK_FRQ 25000000
diff --git a/hw/arm/musca.c b/hw/arm/musca.c
index 7fd8634ac5..16015255c8 100644
--- a/hw/arm/musca.c
+++ b/hw/arm/musca.c
@@ -90,12 +90,8 @@ typedef struct MuscaMachineState MuscaMachineState;
#define TYPE_MUSCA_A_MACHINE MACHINE_TYPE_NAME("musca-a")
#define TYPE_MUSCA_B1_MACHINE MACHINE_TYPE_NAME("musca-b1")
-#define MUSCA_MACHINE(obj) \
- OBJECT_CHECK(MuscaMachineState, obj, TYPE_MUSCA_MACHINE)
-#define MUSCA_MACHINE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(MuscaMachineClass, obj, TYPE_MUSCA_MACHINE)
-#define MUSCA_MACHINE_CLASS(klass) \
- OBJECT_CLASS_CHECK(MuscaMachineClass, klass, TYPE_MUSCA_MACHINE)
+DECLARE_OBJ_CHECKERS(MuscaMachineState, MuscaMachineClass,
+ MUSCA_MACHINE, TYPE_MUSCA_MACHINE)
/*
* Main SYSCLK frequency in Hz
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index 695699e01e..2117a04171 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -156,8 +156,8 @@ typedef struct mv88w8618_rx_desc {
#define TYPE_MV88W8618_ETH "mv88w8618_eth"
typedef struct mv88w8618_eth_state mv88w8618_eth_state;
-#define MV88W8618_ETH(obj) \
- OBJECT_CHECK(mv88w8618_eth_state, (obj), TYPE_MV88W8618_ETH)
+DECLARE_INSTANCE_CHECKER(mv88w8618_eth_state, MV88W8618_ETH,
+ TYPE_MV88W8618_ETH)
struct mv88w8618_eth_state {
/*< private >*/
@@ -486,8 +486,8 @@ static const TypeInfo mv88w8618_eth_info = {
#define TYPE_MUSICPAL_LCD "musicpal_lcd"
typedef struct musicpal_lcd_state musicpal_lcd_state;
-#define MUSICPAL_LCD(obj) \
- OBJECT_CHECK(musicpal_lcd_state, (obj), TYPE_MUSICPAL_LCD)
+DECLARE_INSTANCE_CHECKER(musicpal_lcd_state, MUSICPAL_LCD,
+ TYPE_MUSICPAL_LCD)
struct musicpal_lcd_state {
/*< private >*/
@@ -704,8 +704,8 @@ static const TypeInfo musicpal_lcd_info = {
#define TYPE_MV88W8618_PIC "mv88w8618_pic"
typedef struct mv88w8618_pic_state mv88w8618_pic_state;
-#define MV88W8618_PIC(obj) \
- OBJECT_CHECK(mv88w8618_pic_state, (obj), TYPE_MV88W8618_PIC)
+DECLARE_INSTANCE_CHECKER(mv88w8618_pic_state, MV88W8618_PIC,
+ TYPE_MV88W8618_PIC)
struct mv88w8618_pic_state {
/*< private >*/
@@ -842,8 +842,8 @@ typedef struct mv88w8618_timer_state {
#define TYPE_MV88W8618_PIT "mv88w8618_pit"
typedef struct mv88w8618_pit_state mv88w8618_pit_state;
-#define MV88W8618_PIT(obj) \
- OBJECT_CHECK(mv88w8618_pit_state, (obj), TYPE_MV88W8618_PIT)
+DECLARE_INSTANCE_CHECKER(mv88w8618_pit_state, MV88W8618_PIT,
+ TYPE_MV88W8618_PIT)
struct mv88w8618_pit_state {
/*< private >*/
@@ -1010,8 +1010,8 @@ static const TypeInfo mv88w8618_pit_info = {
#define TYPE_MV88W8618_FLASHCFG "mv88w8618_flashcfg"
typedef struct mv88w8618_flashcfg_state mv88w8618_flashcfg_state;
-#define MV88W8618_FLASHCFG(obj) \
- OBJECT_CHECK(mv88w8618_flashcfg_state, (obj), TYPE_MV88W8618_FLASHCFG)
+DECLARE_INSTANCE_CHECKER(mv88w8618_flashcfg_state, MV88W8618_FLASHCFG,
+ TYPE_MV88W8618_FLASHCFG)
struct mv88w8618_flashcfg_state {
/*< private >*/
@@ -1103,8 +1103,8 @@ struct MusicPalMiscState {
typedef struct MusicPalMiscState MusicPalMiscState;
#define TYPE_MUSICPAL_MISC "musicpal-misc"
-#define MUSICPAL_MISC(obj) \
- OBJECT_CHECK(MusicPalMiscState, (obj), TYPE_MUSICPAL_MISC)
+DECLARE_INSTANCE_CHECKER(MusicPalMiscState, MUSICPAL_MISC,
+ TYPE_MUSICPAL_MISC)
static uint64_t musicpal_misc_read(void *opaque, hwaddr offset,
unsigned size)
@@ -1210,8 +1210,8 @@ static void mv88w8618_wlan_realize(DeviceState *dev, Error **errp)
#define TYPE_MUSICPAL_GPIO "musicpal_gpio"
typedef struct musicpal_gpio_state musicpal_gpio_state;
-#define MUSICPAL_GPIO(obj) \
- OBJECT_CHECK(musicpal_gpio_state, (obj), TYPE_MUSICPAL_GPIO)
+DECLARE_INSTANCE_CHECKER(musicpal_gpio_state, MUSICPAL_GPIO,
+ TYPE_MUSICPAL_GPIO)
struct musicpal_gpio_state {
/*< private >*/
@@ -1461,8 +1461,8 @@ static const TypeInfo musicpal_gpio_info = {
#define TYPE_MUSICPAL_KEY "musicpal_key"
typedef struct musicpal_key_state musicpal_key_state;
-#define MUSICPAL_KEY(obj) \
- OBJECT_CHECK(musicpal_key_state, (obj), TYPE_MUSICPAL_KEY)
+DECLARE_INSTANCE_CHECKER(musicpal_key_state, MUSICPAL_KEY,
+ TYPE_MUSICPAL_KEY)
struct musicpal_key_state {
/*< private >*/
diff --git a/hw/arm/palm.c b/hw/arm/palm.c
index ddabb0e2d6..abc6495489 100644
--- a/hw/arm/palm.c
+++ b/hw/arm/palm.c
@@ -134,8 +134,8 @@ static void palmte_button_event(void *opaque, int keycode)
#define TYPE_PALM_MISC_GPIO "palm-misc-gpio"
typedef struct PalmMiscGPIOState PalmMiscGPIOState;
-#define PALM_MISC_GPIO(obj) \
- OBJECT_CHECK(PalmMiscGPIOState, (obj), TYPE_PALM_MISC_GPIO)
+DECLARE_INSTANCE_CHECKER(PalmMiscGPIOState, PALM_MISC_GPIO,
+ TYPE_PALM_MISC_GPIO)
struct PalmMiscGPIOState {
SysBusDevice parent_obj;
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index a48a32ee09..701baa84ca 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -471,8 +471,8 @@ static const VMStateDescription vmstate_pxa2xx_mm = {
#define TYPE_PXA2XX_SSP "pxa2xx-ssp"
typedef struct PXA2xxSSPState PXA2xxSSPState;
-#define PXA2XX_SSP(obj) \
- OBJECT_CHECK(PXA2xxSSPState, (obj), TYPE_PXA2XX_SSP)
+DECLARE_INSTANCE_CHECKER(PXA2xxSSPState, PXA2XX_SSP,
+ TYPE_PXA2XX_SSP)
/* Synchronous Serial Ports */
struct PXA2xxSSPState {
@@ -812,8 +812,8 @@ static void pxa2xx_ssp_init(Object *obj)
#define TYPE_PXA2XX_RTC "pxa2xx_rtc"
typedef struct PXA2xxRTCState PXA2xxRTCState;
-#define PXA2XX_RTC(obj) \
- OBJECT_CHECK(PXA2xxRTCState, (obj), TYPE_PXA2XX_RTC)
+DECLARE_INSTANCE_CHECKER(PXA2xxRTCState, PXA2XX_RTC,
+ TYPE_PXA2XX_RTC)
struct PXA2xxRTCState {
/*< private >*/
@@ -1246,8 +1246,8 @@ static const TypeInfo pxa2xx_rtc_sysbus_info = {
#define TYPE_PXA2XX_I2C_SLAVE "pxa2xx-i2c-slave"
typedef struct PXA2xxI2CSlaveState PXA2xxI2CSlaveState;
-#define PXA2XX_I2C_SLAVE(obj) \
- OBJECT_CHECK(PXA2xxI2CSlaveState, (obj), TYPE_PXA2XX_I2C_SLAVE)
+DECLARE_INSTANCE_CHECKER(PXA2xxI2CSlaveState, PXA2XX_I2C_SLAVE,
+ TYPE_PXA2XX_I2C_SLAVE)
struct PXA2xxI2CSlaveState {
I2CSlave parent_obj;
diff --git a/hw/arm/pxa2xx_gpio.c b/hw/arm/pxa2xx_gpio.c
index 2cd6dd929e..16bbe4fb70 100644
--- a/hw/arm/pxa2xx_gpio.c
+++ b/hw/arm/pxa2xx_gpio.c
@@ -23,8 +23,8 @@
#define TYPE_PXA2XX_GPIO "pxa2xx-gpio"
typedef struct PXA2xxGPIOInfo PXA2xxGPIOInfo;
-#define PXA2XX_GPIO(obj) \
- OBJECT_CHECK(PXA2xxGPIOInfo, (obj), TYPE_PXA2XX_GPIO)
+DECLARE_INSTANCE_CHECKER(PXA2xxGPIOInfo, PXA2XX_GPIO,
+ TYPE_PXA2XX_GPIO)
struct PXA2xxGPIOInfo {
/*< private >*/
diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c
index 00e72fde4e..cb52a9dff3 100644
--- a/hw/arm/pxa2xx_pic.c
+++ b/hw/arm/pxa2xx_pic.c
@@ -39,8 +39,8 @@
#define TYPE_PXA2XX_PIC "pxa2xx_pic"
typedef struct PXA2xxPICState PXA2xxPICState;
-#define PXA2XX_PIC(obj) \
- OBJECT_CHECK(PXA2xxPICState, (obj), TYPE_PXA2XX_PIC)
+DECLARE_INSTANCE_CHECKER(PXA2xxPICState, PXA2XX_PIC,
+ TYPE_PXA2XX_PIC)
struct PXA2xxPICState {
/*< private >*/
diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
index d9f7eeb06b..d2f674587d 100644
--- a/hw/arm/raspi.c
+++ b/hw/arm/raspi.c
@@ -53,13 +53,9 @@ struct RaspiMachineClass {
typedef struct RaspiMachineClass RaspiMachineClass;
#define TYPE_RASPI_MACHINE MACHINE_TYPE_NAME("raspi-common")
-#define RASPI_MACHINE(obj) \
- OBJECT_CHECK(RaspiMachineState, (obj), TYPE_RASPI_MACHINE)
+DECLARE_OBJ_CHECKERS(RaspiMachineState, RaspiMachineClass,
+ RASPI_MACHINE, TYPE_RASPI_MACHINE)
-#define RASPI_MACHINE_CLASS(klass) \
- OBJECT_CLASS_CHECK(RaspiMachineClass, (klass), TYPE_RASPI_MACHINE)
-#define RASPI_MACHINE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(RaspiMachineClass, (obj), TYPE_RASPI_MACHINE)
/*
* Board revision codes:
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index a638fb369e..ac68b4640d 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -98,8 +98,8 @@ struct SBSAMachineState {
typedef struct SBSAMachineState SBSAMachineState;
#define TYPE_SBSA_MACHINE MACHINE_TYPE_NAME("sbsa-ref")
-#define SBSA_MACHINE(obj) \
- OBJECT_CHECK(SBSAMachineState, (obj), TYPE_SBSA_MACHINE)
+DECLARE_INSTANCE_CHECKER(SBSAMachineState, SBSA_MACHINE,
+ TYPE_SBSA_MACHINE)
static const MemMapEntry sbsa_ref_memmap[] = {
/* 512M boot ROM */
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index 0bf5745eb2..a7ad667f06 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -59,12 +59,8 @@ struct SpitzMachineState {
typedef struct SpitzMachineState SpitzMachineState;
#define TYPE_SPITZ_MACHINE "spitz-common"
-#define SPITZ_MACHINE(obj) \
- OBJECT_CHECK(SpitzMachineState, obj, TYPE_SPITZ_MACHINE)
-#define SPITZ_MACHINE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(SpitzMachineClass, obj, TYPE_SPITZ_MACHINE)
-#define SPITZ_MACHINE_CLASS(klass) \
- OBJECT_CLASS_CHECK(SpitzMachineClass, klass, TYPE_SPITZ_MACHINE)
+DECLARE_OBJ_CHECKERS(SpitzMachineState, SpitzMachineClass,
+ SPITZ_MACHINE, TYPE_SPITZ_MACHINE)
#define zaurus_printf(format, ...) \
fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__)
@@ -89,7 +85,8 @@ typedef struct SpitzMachineState SpitzMachineState;
#define TYPE_SL_NAND "sl-nand"
typedef struct SLNANDState SLNANDState;
-#define SL_NAND(obj) OBJECT_CHECK(SLNANDState, (obj), TYPE_SL_NAND)
+DECLARE_INSTANCE_CHECKER(SLNANDState, SL_NAND,
+ TYPE_SL_NAND)
struct SLNANDState {
SysBusDevice parent_obj;
@@ -266,8 +263,8 @@ static const int spitz_gpiomap[5] = {
#define TYPE_SPITZ_KEYBOARD "spitz-keyboard"
typedef struct SpitzKeyboardState SpitzKeyboardState;
-#define SPITZ_KEYBOARD(obj) \
- OBJECT_CHECK(SpitzKeyboardState, (obj), TYPE_SPITZ_KEYBOARD)
+DECLARE_INSTANCE_CHECKER(SpitzKeyboardState, SPITZ_KEYBOARD,
+ TYPE_SPITZ_KEYBOARD)
struct SpitzKeyboardState {
SysBusDevice parent_obj;
@@ -586,7 +583,8 @@ static void spitz_keyboard_realize(DeviceState *dev, Error **errp)
#define TYPE_SPITZ_LCDTG "spitz-lcdtg"
typedef struct SpitzLCDTG SpitzLCDTG;
-#define SPITZ_LCDTG(obj) OBJECT_CHECK(SpitzLCDTG, (obj), TYPE_SPITZ_LCDTG)
+DECLARE_INSTANCE_CHECKER(SpitzLCDTG, SPITZ_LCDTG,
+ TYPE_SPITZ_LCDTG)
struct SpitzLCDTG {
SSISlave ssidev;
@@ -675,7 +673,8 @@ static void spitz_lcdtg_realize(SSISlave *ssi, Error **errp)
#define TYPE_CORGI_SSP "corgi-ssp"
typedef struct CorgiSSPState CorgiSSPState;
-#define CORGI_SSP(obj) OBJECT_CHECK(CorgiSSPState, (obj), TYPE_CORGI_SSP)
+DECLARE_INSTANCE_CHECKER(CorgiSSPState, CORGI_SSP,
+ TYPE_CORGI_SSP)
/* "Demux" the signal based on current chipselect */
struct CorgiSSPState {
@@ -827,8 +826,8 @@ static void spitz_akita_i2c_setup(PXA2xxState *cpu)
*/
#define TYPE_SPITZ_MISC_GPIO "spitz-misc-gpio"
typedef struct SpitzMiscGPIOState SpitzMiscGPIOState;
-#define SPITZ_MISC_GPIO(obj) \
- OBJECT_CHECK(SpitzMiscGPIOState, (obj), TYPE_SPITZ_MISC_GPIO)
+DECLARE_INSTANCE_CHECKER(SpitzMiscGPIOState, SPITZ_MISC_GPIO,
+ TYPE_SPITZ_MISC_GPIO)
struct SpitzMiscGPIOState {
SysBusDevice parent_obj;
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index d8d7d3a43b..d6fc4a4681 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -59,8 +59,8 @@ typedef const struct {
#define TYPE_STELLARIS_GPTM "stellaris-gptm"
typedef struct gptm_state gptm_state;
-#define STELLARIS_GPTM(obj) \
- OBJECT_CHECK(gptm_state, (obj), TYPE_STELLARIS_GPTM)
+DECLARE_INSTANCE_CHECKER(gptm_state, STELLARIS_GPTM,
+ TYPE_STELLARIS_GPTM)
struct gptm_state {
SysBusDevice parent_obj;
@@ -722,8 +722,8 @@ static int stellaris_sys_init(uint32_t base, qemu_irq irq,
#define TYPE_STELLARIS_I2C "stellaris-i2c"
typedef struct stellaris_i2c_state stellaris_i2c_state;
-#define STELLARIS_I2C(obj) \
- OBJECT_CHECK(stellaris_i2c_state, (obj), TYPE_STELLARIS_I2C)
+DECLARE_INSTANCE_CHECKER(stellaris_i2c_state, STELLARIS_I2C,
+ TYPE_STELLARIS_I2C)
struct stellaris_i2c_state {
SysBusDevice parent_obj;
@@ -936,8 +936,8 @@ static void stellaris_i2c_init(Object *obj)
#define TYPE_STELLARIS_ADC "stellaris-adc"
typedef struct StellarisADCState stellaris_adc_state;
-#define STELLARIS_ADC(obj) \
- OBJECT_CHECK(stellaris_adc_state, (obj), TYPE_STELLARIS_ADC)
+DECLARE_INSTANCE_CHECKER(stellaris_adc_state, STELLARIS_ADC,
+ TYPE_STELLARIS_ADC)
struct StellarisADCState {
SysBusDevice parent_obj;
diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c
index 8faeaf8079..0fe829b868 100644
--- a/hw/arm/strongarm.c
+++ b/hw/arm/strongarm.c
@@ -86,8 +86,8 @@ static struct {
#define TYPE_STRONGARM_PIC "strongarm_pic"
typedef struct StrongARMPICState StrongARMPICState;
-#define STRONGARM_PIC(obj) \
- OBJECT_CHECK(StrongARMPICState, (obj), TYPE_STRONGARM_PIC)
+DECLARE_INSTANCE_CHECKER(StrongARMPICState, STRONGARM_PIC,
+ TYPE_STRONGARM_PIC)
struct StrongARMPICState {
SysBusDevice parent_obj;
@@ -255,8 +255,8 @@ static const TypeInfo strongarm_pic_info = {
#define TYPE_STRONGARM_RTC "strongarm-rtc"
typedef struct StrongARMRTCState StrongARMRTCState;
-#define STRONGARM_RTC(obj) \
- OBJECT_CHECK(StrongARMRTCState, (obj), TYPE_STRONGARM_RTC)
+DECLARE_INSTANCE_CHECKER(StrongARMRTCState, STRONGARM_RTC,
+ TYPE_STRONGARM_RTC)
struct StrongARMRTCState {
SysBusDevice parent_obj;
@@ -482,8 +482,8 @@ static const TypeInfo strongarm_rtc_sysbus_info = {
#define TYPE_STRONGARM_GPIO "strongarm-gpio"
typedef struct StrongARMGPIOInfo StrongARMGPIOInfo;
-#define STRONGARM_GPIO(obj) \
- OBJECT_CHECK(StrongARMGPIOInfo, (obj), TYPE_STRONGARM_GPIO)
+DECLARE_INSTANCE_CHECKER(StrongARMGPIOInfo, STRONGARM_GPIO,
+ TYPE_STRONGARM_GPIO)
struct StrongARMGPIOInfo {
SysBusDevice busdev;
@@ -721,8 +721,8 @@ static const TypeInfo strongarm_gpio_info = {
#define TYPE_STRONGARM_PPC "strongarm-ppc"
typedef struct StrongARMPPCInfo StrongARMPPCInfo;
-#define STRONGARM_PPC(obj) \
- OBJECT_CHECK(StrongARMPPCInfo, (obj), TYPE_STRONGARM_PPC)
+DECLARE_INSTANCE_CHECKER(StrongARMPPCInfo, STRONGARM_PPC,
+ TYPE_STRONGARM_PPC)
struct StrongARMPPCInfo {
SysBusDevice parent_obj;
@@ -922,8 +922,8 @@ static const TypeInfo strongarm_ppc_info = {
#define TYPE_STRONGARM_UART "strongarm-uart"
typedef struct StrongARMUARTState StrongARMUARTState;
-#define STRONGARM_UART(obj) \
- OBJECT_CHECK(StrongARMUARTState, (obj), TYPE_STRONGARM_UART)
+DECLARE_INSTANCE_CHECKER(StrongARMUARTState, STRONGARM_UART,
+ TYPE_STRONGARM_UART)
struct StrongARMUARTState {
SysBusDevice parent_obj;
@@ -1354,8 +1354,8 @@ static const TypeInfo strongarm_uart_info = {
#define TYPE_STRONGARM_SSP "strongarm-ssp"
typedef struct StrongARMSSPState StrongARMSSPState;
-#define STRONGARM_SSP(obj) \
- OBJECT_CHECK(StrongARMSSPState, (obj), TYPE_STRONGARM_SSP)
+DECLARE_INSTANCE_CHECKER(StrongARMSSPState, STRONGARM_SSP,
+ TYPE_STRONGARM_SSP)
struct StrongARMSSPState {
SysBusDevice parent_obj;
diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
index 6ec83a2e2d..2ef6c7b288 100644
--- a/hw/arm/tosa.c
+++ b/hw/arm/tosa.c
@@ -76,8 +76,8 @@ static void tosa_microdrive_attach(PXA2xxState *cpu)
#define TYPE_TOSA_MISC_GPIO "tosa-misc-gpio"
typedef struct TosaMiscGPIOState TosaMiscGPIOState;
-#define TOSA_MISC_GPIO(obj) \
- OBJECT_CHECK(TosaMiscGPIOState, (obj), TYPE_TOSA_MISC_GPIO)
+DECLARE_INSTANCE_CHECKER(TosaMiscGPIOState, TOSA_MISC_GPIO,
+ TYPE_TOSA_MISC_GPIO)
struct TosaMiscGPIOState {
SysBusDevice parent_obj;
@@ -173,7 +173,8 @@ static void tosa_ssp_realize(SSISlave *dev, Error **errp)
#define TYPE_TOSA_DAC "tosa_dac"
typedef struct TosaDACState TosaDACState;
-#define TOSA_DAC(obj) OBJECT_CHECK(TosaDACState, (obj), TYPE_TOSA_DAC)
+DECLARE_INSTANCE_CHECKER(TosaDACState, TOSA_DAC,
+ TYPE_TOSA_DAC)
struct TosaDACState {
I2CSlave parent_obj;
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index 0e2d74cef2..2ba69f24b7 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -36,8 +36,8 @@
#define TYPE_VERSATILE_PB_SIC "versatilepb_sic"
typedef struct vpb_sic_state vpb_sic_state;
-#define VERSATILE_PB_SIC(obj) \
- OBJECT_CHECK(vpb_sic_state, (obj), TYPE_VERSATILE_PB_SIC)
+DECLARE_INSTANCE_CHECKER(vpb_sic_state, VERSATILE_PB_SIC,
+ TYPE_VERSATILE_PB_SIC)
struct vpb_sic_state {
SysBusDevice parent_obj;
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 4c2c377823..01bb4bba1e 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -183,12 +183,8 @@ typedef struct VexpressMachineState VexpressMachineState;
#define TYPE_VEXPRESS_MACHINE "vexpress"
#define TYPE_VEXPRESS_A9_MACHINE MACHINE_TYPE_NAME("vexpress-a9")
#define TYPE_VEXPRESS_A15_MACHINE MACHINE_TYPE_NAME("vexpress-a15")
-#define VEXPRESS_MACHINE(obj) \
- OBJECT_CHECK(VexpressMachineState, (obj), TYPE_VEXPRESS_MACHINE)
-#define VEXPRESS_MACHINE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(VexpressMachineClass, obj, TYPE_VEXPRESS_MACHINE)
-#define VEXPRESS_MACHINE_CLASS(klass) \
- OBJECT_CLASS_CHECK(VexpressMachineClass, klass, TYPE_VEXPRESS_MACHINE)
+DECLARE_OBJ_CHECKERS(VexpressMachineState, VexpressMachineClass,
+ VEXPRESS_MACHINE, TYPE_VEXPRESS_MACHINE)
typedef void DBoardInitFn(const VexpressMachineState *machine,
ram_addr_t ram_size,
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index bce99ef7be..9eb9cea8d4 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -41,8 +41,8 @@
#define TYPE_ZYNQ_MACHINE MACHINE_TYPE_NAME("xilinx-zynq-a9")
typedef struct ZynqMachineState ZynqMachineState;
-#define ZYNQ_MACHINE(obj) \
- OBJECT_CHECK(ZynqMachineState, (obj), TYPE_ZYNQ_MACHINE)
+DECLARE_INSTANCE_CHECKER(ZynqMachineState, ZYNQ_MACHINE,
+ TYPE_ZYNQ_MACHINE)
/* board base frequency: 33.333333 MHz */
#define PS_CLK_FREQUENCY (100 * 1000 * 1000 / 3)
diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c
index ffa9dd476b..5a01e856fd 100644
--- a/hw/arm/xlnx-versal-virt.c
+++ b/hw/arm/xlnx-versal-virt.c
@@ -26,8 +26,8 @@
#define TYPE_XLNX_VERSAL_VIRT_MACHINE MACHINE_TYPE_NAME("xlnx-versal-virt")
typedef struct VersalVirt VersalVirt;
-#define XLNX_VERSAL_VIRT_MACHINE(obj) \
- OBJECT_CHECK(VersalVirt, (obj), TYPE_XLNX_VERSAL_VIRT_MACHINE)
+DECLARE_INSTANCE_CHECKER(VersalVirt, XLNX_VERSAL_VIRT_MACHINE,
+ TYPE_XLNX_VERSAL_VIRT_MACHINE)
struct VersalVirt {
MachineState parent_obj;
diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c
index 74f48325ac..19d5a4d4e0 100644
--- a/hw/arm/xlnx-zcu102.c
+++ b/hw/arm/xlnx-zcu102.c
@@ -39,8 +39,8 @@ struct XlnxZCU102 {
typedef struct XlnxZCU102 XlnxZCU102;
#define TYPE_ZCU102_MACHINE MACHINE_TYPE_NAME("xlnx-zcu102")
-#define ZCU102_MACHINE(obj) \
- OBJECT_CHECK(XlnxZCU102, (obj), TYPE_ZCU102_MACHINE)
+DECLARE_INSTANCE_CHECKER(XlnxZCU102, ZCU102_MACHINE,
+ TYPE_ZCU102_MACHINE)
static bool zcu102_get_secure(Object *obj, Error **errp)
diff --git a/hw/arm/z2.c b/hw/arm/z2.c
index 9c69481269..72ecb6df29 100644
--- a/hw/arm/z2.c
+++ b/hw/arm/z2.c
@@ -114,7 +114,8 @@ struct ZipitLCD {
typedef struct ZipitLCD ZipitLCD;
#define TYPE_ZIPIT_LCD "zipit-lcd"
-#define ZIPIT_LCD(obj) OBJECT_CHECK(ZipitLCD, (obj), TYPE_ZIPIT_LCD)
+DECLARE_INSTANCE_CHECKER(ZipitLCD, ZIPIT_LCD,
+ TYPE_ZIPIT_LCD)
static uint32_t zipit_lcd_transfer(SSISlave *dev, uint32_t value)
{
@@ -198,7 +199,8 @@ static const TypeInfo zipit_lcd_info = {
#define TYPE_AER915 "aer915"
typedef struct AER915State AER915State;
-#define AER915(obj) OBJECT_CHECK(AER915State, (obj), TYPE_AER915)
+DECLARE_INSTANCE_CHECKER(AER915State, AER915,
+ TYPE_AER915)
struct AER915State {
I2CSlave parent_obj;