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>
This commit is contained in:
Eduardo Habkost 2020-08-31 17:07:33 -04:00
parent db1015e92e
commit 8110fa1d94
791 changed files with 1987 additions and 2423 deletions

View File

@ -46,8 +46,8 @@ typedef struct TCGState TCGState;
#define TYPE_TCG_ACCEL ACCEL_CLASS_NAME("tcg")
#define TCG_STATE(obj) \
OBJECT_CHECK(TCGState, (obj), TYPE_TCG_ACCEL)
DECLARE_INSTANCE_CHECKER(TCGState, TCG_STATE,
TYPE_TCG_ACCEL)
/* mask must never be zero, except for A20 change call */
static void tcg_handle_interrupt(CPUState *cpu, int mask)

View File

@ -37,9 +37,8 @@
typedef struct CryptoDevBackendBuiltin
CryptoDevBackendBuiltin;
#define CRYPTODEV_BACKEND_BUILTIN(obj) \
OBJECT_CHECK(CryptoDevBackendBuiltin, \
(obj), TYPE_CRYPTODEV_BACKEND_BUILTIN)
DECLARE_INSTANCE_CHECKER(CryptoDevBackendBuiltin, CRYPTODEV_BACKEND_BUILTIN,
TYPE_CRYPTODEV_BACKEND_BUILTIN)
typedef struct CryptoDevBackendBuiltinSession {

View File

@ -40,9 +40,8 @@
#define TYPE_CRYPTODEV_BACKEND_VHOST_USER "cryptodev-vhost-user"
typedef struct CryptoDevBackendVhostUser CryptoDevBackendVhostUser;
#define CRYPTODEV_BACKEND_VHOST_USER(obj) \
OBJECT_CHECK(CryptoDevBackendVhostUser, \
(obj), TYPE_CRYPTODEV_BACKEND_VHOST_USER)
DECLARE_INSTANCE_CHECKER(CryptoDevBackendVhostUser, CRYPTODEV_BACKEND_VHOST_USER,
TYPE_CRYPTODEV_BACKEND_VHOST_USER)
struct CryptoDevBackendVhostUser {

View File

@ -25,12 +25,8 @@ typedef struct DBusVMState DBusVMState;
typedef struct DBusVMStateClass DBusVMStateClass;
#define TYPE_DBUS_VMSTATE "dbus-vmstate"
#define DBUS_VMSTATE(obj) \
OBJECT_CHECK(DBusVMState, (obj), TYPE_DBUS_VMSTATE)
#define DBUS_VMSTATE_GET_CLASS(obj) \
OBJECT_GET_CLASS(DBusVMStateClass, (obj), TYPE_DBUS_VMSTATE)
#define DBUS_VMSTATE_CLASS(klass) \
OBJECT_CLASS_CHECK(DBusVMStateClass, (klass), TYPE_DBUS_VMSTATE)
DECLARE_OBJ_CHECKERS(DBusVMState, DBusVMStateClass,
DBUS_VMSTATE, TYPE_DBUS_VMSTATE)
struct DBusVMStateClass {
ObjectClass parent_class;

View File

@ -20,8 +20,8 @@
#include "qom/object.h"
typedef struct HostMemoryBackendFile HostMemoryBackendFile;
#define MEMORY_BACKEND_FILE(obj) \
OBJECT_CHECK(HostMemoryBackendFile, (obj), TYPE_MEMORY_BACKEND_FILE)
DECLARE_INSTANCE_CHECKER(HostMemoryBackendFile, MEMORY_BACKEND_FILE,
TYPE_MEMORY_BACKEND_FILE)
struct HostMemoryBackendFile {

View File

@ -22,8 +22,8 @@
#define TYPE_MEMORY_BACKEND_MEMFD "memory-backend-memfd"
typedef struct HostMemoryBackendMemfd HostMemoryBackendMemfd;
#define MEMORY_BACKEND_MEMFD(obj) \
OBJECT_CHECK(HostMemoryBackendMemfd, (obj), TYPE_MEMORY_BACKEND_MEMFD)
DECLARE_INSTANCE_CHECKER(HostMemoryBackendMemfd, MEMORY_BACKEND_MEMFD,
TYPE_MEMORY_BACKEND_MEMFD)
struct HostMemoryBackendMemfd {

View File

@ -12,7 +12,8 @@
#include "qom/object.h"
typedef struct RngBuiltin RngBuiltin;
#define RNG_BUILTIN(obj) OBJECT_CHECK(RngBuiltin, (obj), TYPE_RNG_BUILTIN)
DECLARE_INSTANCE_CHECKER(RngBuiltin, RNG_BUILTIN,
TYPE_RNG_BUILTIN)
struct RngBuiltin {
RngBackend parent;

View File

@ -20,7 +20,8 @@
#define TYPE_RNG_EGD "rng-egd"
typedef struct RngEgd RngEgd;
#define RNG_EGD(obj) OBJECT_CHECK(RngEgd, (obj), TYPE_RNG_EGD)
DECLARE_INSTANCE_CHECKER(RngEgd, RNG_EGD,
TYPE_RNG_EGD)
struct RngEgd {
RngBackend parent;

View File

@ -46,8 +46,8 @@
#define TYPE_TPM_EMULATOR "tpm-emulator"
typedef struct TPMEmulator TPMEmulator;
#define TPM_EMULATOR(obj) \
OBJECT_CHECK(TPMEmulator, (obj), TYPE_TPM_EMULATOR)
DECLARE_INSTANCE_CHECKER(TPMEmulator, TPM_EMULATOR,
TYPE_TPM_EMULATOR)
#define TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(S, cap) (((S)->caps & (cap)) == (cap))

View File

@ -37,8 +37,8 @@
#define TYPE_TPM_PASSTHROUGH "tpm-passthrough"
typedef struct TPMPassthruState TPMPassthruState;
#define TPM_PASSTHROUGH(obj) \
OBJECT_CHECK(TPMPassthruState, (obj), TYPE_TPM_PASSTHROUGH)
DECLARE_INSTANCE_CHECKER(TPMPassthruState, TPM_PASSTHROUGH,
TYPE_TPM_PASSTHROUGH)
/* data structures */
struct TPMPassthruState {

View File

@ -105,7 +105,8 @@ struct BaumChardev {
typedef struct BaumChardev BaumChardev;
#define TYPE_CHARDEV_BRAILLE "chardev-braille"
#define BAUM_CHARDEV(obj) OBJECT_CHECK(BaumChardev, (obj), TYPE_CHARDEV_BRAILLE)
DECLARE_INSTANCE_CHECKER(BaumChardev, BAUM_CHARDEV,
TYPE_CHARDEV_BRAILLE)
/* Let's assume NABCC by default */
enum way {

View File

@ -45,7 +45,8 @@ struct PtyChardev {
};
typedef struct PtyChardev PtyChardev;
#define PTY_CHARDEV(obj) OBJECT_CHECK(PtyChardev, (obj), TYPE_CHARDEV_PTY)
DECLARE_INSTANCE_CHECKER(PtyChardev, PTY_CHARDEV,
TYPE_CHARDEV_PTY)
static void pty_chr_state(Chardev *chr, int connected);

View File

@ -42,8 +42,8 @@ struct RingBufChardev {
};
typedef struct RingBufChardev RingBufChardev;
#define RINGBUF_CHARDEV(obj) \
OBJECT_CHECK(RingBufChardev, (obj), TYPE_CHARDEV_RINGBUF)
DECLARE_INSTANCE_CHECKER(RingBufChardev, RINGBUF_CHARDEV,
TYPE_CHARDEV_RINGBUF)
static size_t ringbuf_count(const Chardev *chr)
{

View File

@ -88,8 +88,8 @@ struct SocketChardev {
};
typedef struct SocketChardev SocketChardev;
#define SOCKET_CHARDEV(obj) \
OBJECT_CHECK(SocketChardev, (obj), TYPE_CHARDEV_SOCKET)
DECLARE_INSTANCE_CHECKER(SocketChardev, SOCKET_CHARDEV,
TYPE_CHARDEV_SOCKET)
static gboolean socket_reconnect_timeout(gpointer opaque);
static void tcp_chr_telnet_init(Chardev *chr);

View File

@ -45,7 +45,8 @@ struct UdpChardev {
};
typedef struct UdpChardev UdpChardev;
#define UDP_CHARDEV(obj) OBJECT_CHECK(UdpChardev, (obj), TYPE_CHARDEV_UDP)
DECLARE_INSTANCE_CHECKER(UdpChardev, UDP_CHARDEV,
TYPE_CHARDEV_UDP)
/* Called with chr_write_lock held. */
static int udp_chr_write(Chardev *chr, const uint8_t *buf, int len)

View File

@ -40,8 +40,8 @@ struct WinStdioChardev {
};
typedef struct WinStdioChardev WinStdioChardev;
#define WIN_STDIO_CHARDEV(obj) \
OBJECT_CHECK(WinStdioChardev, (obj), TYPE_CHARDEV_WIN_STDIO)
DECLARE_INSTANCE_CHECKER(WinStdioChardev, WIN_STDIO_CHARDEV,
TYPE_CHARDEV_WIN_STDIO)
static void win_stdio_wait_func(void *opaque)
{

View File

@ -54,7 +54,8 @@ struct MuxChardev {
};
typedef struct MuxChardev MuxChardev;
#define MUX_CHARDEV(obj) OBJECT_CHECK(MuxChardev, (obj), TYPE_CHARDEV_MUX)
DECLARE_INSTANCE_CHECKER(MuxChardev, MUX_CHARDEV,
TYPE_CHARDEV_MUX)
#define CHARDEV_IS_MUX(chr) \
object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_MUX)

View File

@ -45,8 +45,8 @@ struct MouseChardev {
typedef struct MouseChardev MouseChardev;
#define TYPE_CHARDEV_MSMOUSE "chardev-msmouse"
#define MOUSE_CHARDEV(obj) \
OBJECT_CHECK(MouseChardev, (obj), TYPE_CHARDEV_MSMOUSE)
DECLARE_INSTANCE_CHECKER(MouseChardev, MOUSE_CHARDEV,
TYPE_CHARDEV_MSMOUSE)
static void msmouse_chr_accept_input(Chardev *chr)
{

View File

@ -40,8 +40,8 @@ struct TestdevChardev {
typedef struct TestdevChardev TestdevChardev;
#define TYPE_CHARDEV_TESTDEV "chardev-testdev"
#define TESTDEV_CHARDEV(obj) \
OBJECT_CHECK(TestdevChardev, (obj), TYPE_CHARDEV_TESTDEV)
DECLARE_INSTANCE_CHECKER(TestdevChardev, TESTDEV_CHARDEV,
TYPE_CHARDEV_TESTDEV)
/* Try to interpret a whole incoming packet */
static int testdev_eat_packet(TestdevChardev *testdev)

View File

@ -86,8 +86,8 @@ struct TabletChardev {
typedef struct TabletChardev TabletChardev;
#define TYPE_CHARDEV_WCTABLET "chardev-wctablet"
#define WCTABLET_CHARDEV(obj) \
OBJECT_CHECK(TabletChardev, (obj), TYPE_CHARDEV_WCTABLET)
DECLARE_INSTANCE_CHECKER(TabletChardev, WCTABLET_CHARDEV,
TYPE_CHARDEV_WCTABLET)
static void wctablet_chr_accept_input(Chardev *chr);

View File

@ -16,7 +16,7 @@ struct V9fsVirtioState {
typedef struct V9fsVirtioState V9fsVirtioState;
#define TYPE_VIRTIO_9P "virtio-9p-device"
#define VIRTIO_9P(obj) \
OBJECT_CHECK(V9fsVirtioState, (obj), TYPE_VIRTIO_9P)
DECLARE_INSTANCE_CHECKER(V9fsVirtioState, VIRTIO_9P,
TYPE_VIRTIO_9P)
#endif

View File

@ -93,8 +93,8 @@ struct PIIX4PMState {
};
typedef struct PIIX4PMState PIIX4PMState;
#define PIIX4_PM(obj) \
OBJECT_CHECK(PIIX4PMState, (obj), TYPE_PIIX4_PM)
DECLARE_INSTANCE_CHECKER(PIIX4PMState, PIIX4_PM,
TYPE_PIIX4_PM)
static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
PCIBus *bus, PIIX4PMState *s);

View File

@ -51,8 +51,8 @@ typedef struct TyphoonPchip {
} TyphoonPchip;
typedef struct TyphoonState TyphoonState;
#define TYPHOON_PCI_HOST_BRIDGE(obj) \
OBJECT_CHECK(TyphoonState, (obj), TYPE_TYPHOON_PCI_HOST_BRIDGE)
DECLARE_INSTANCE_CHECKER(TyphoonState, TYPHOON_PCI_HOST_BRIDGE,
TYPE_TYPHOON_PCI_HOST_BRIDGE)
struct TyphoonState {
PCIHostState parent_obj;

View File

@ -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,

View File

@ -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 >*/

View File

@ -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 >*/

View File

@ -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)
{

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 >*/

View File

@ -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;

View File

@ -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;

View File

@ -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 >*/

View File

@ -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 >*/

View File

@ -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:

View File

@ -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 */

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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,

View File

@ -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)

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -128,8 +128,8 @@ enum {
#define TYPE_AC97 "AC97"
typedef struct AC97LinkState AC97LinkState;
#define AC97(obj) \
OBJECT_CHECK(AC97LinkState, (obj), TYPE_AC97)
DECLARE_INSTANCE_CHECKER(AC97LinkState, AC97,
TYPE_AC97)
#define REC_MASK 7
enum {

View File

@ -53,7 +53,8 @@
#define TYPE_ADLIB "adlib"
typedef struct AdlibState AdlibState;
#define ADLIB(obj) OBJECT_CHECK(AdlibState, (obj), TYPE_ADLIB)
DECLARE_INSTANCE_CHECKER(AdlibState, ADLIB,
TYPE_ADLIB)
struct AdlibState {
ISADevice parent_obj;

View File

@ -39,8 +39,8 @@
#define TYPE_CS4231 "SUNW,CS4231"
typedef struct CSState CSState;
#define CS4231(obj) \
OBJECT_CHECK(CSState, (obj), TYPE_CS4231)
DECLARE_INSTANCE_CHECKER(CSState, CS4231,
TYPE_CS4231)
struct CSState {
SysBusDevice parent_obj;

View File

@ -64,7 +64,8 @@ static struct {
#define TYPE_CS4231A "cs4231a"
typedef struct CSState CSState;
#define CS4231A(obj) OBJECT_CHECK (CSState, (obj), TYPE_CS4231A)
DECLARE_INSTANCE_CHECKER(CSState, CS4231A,
TYPE_CS4231A)
struct CSState {
ISADevice dev;

View File

@ -293,8 +293,8 @@ struct chan_bits {
};
#define TYPE_ES1370 "ES1370"
#define ES1370(obj) \
OBJECT_CHECK(ES1370State, (obj), TYPE_ES1370)
DECLARE_INSTANCE_CHECKER(ES1370State, ES1370,
TYPE_ES1370)
static void es1370_dac1_calc_freq (ES1370State *s, uint32_t ctl,
uint32_t *old_freq, uint32_t *new_freq);

View File

@ -44,7 +44,8 @@
#define TYPE_GUS "gus"
typedef struct GUSState GUSState;
#define GUS(obj) OBJECT_CHECK (GUSState, (obj), TYPE_GUS)
DECLARE_INSTANCE_CHECKER(GUSState, GUS,
TYPE_GUS)
struct GUSState {
ISADevice dev;

View File

@ -172,7 +172,8 @@ struct HDAAudioStream {
};
#define TYPE_HDA_AUDIO "hda-audio"
#define HDA_AUDIO(obj) OBJECT_CHECK(HDAAudioState, (obj), TYPE_HDA_AUDIO)
DECLARE_INSTANCE_CHECKER(HDAAudioState, HDA_AUDIO,
TYPE_HDA_AUDIO)
struct HDAAudioState {
HDACodecDevice hda;

View File

@ -204,8 +204,8 @@ struct IntelHDAState {
#define TYPE_INTEL_HDA_GENERIC "intel-hda-generic"
#define INTEL_HDA(obj) \
OBJECT_CHECK(IntelHDAState, (obj), TYPE_INTEL_HDA_GENERIC)
DECLARE_INSTANCE_CHECKER(IntelHDAState, INTEL_HDA,
TYPE_INTEL_HDA_GENERIC)
struct IntelHDAReg {
const char *name; /* register name */

View File

@ -10,16 +10,13 @@
#define TYPE_HDA_CODEC_DEVICE "hda-codec"
typedef struct HDACodecDevice HDACodecDevice;
typedef struct HDACodecDeviceClass HDACodecDeviceClass;
#define HDA_CODEC_DEVICE(obj) \
OBJECT_CHECK(HDACodecDevice, (obj), TYPE_HDA_CODEC_DEVICE)
#define HDA_CODEC_DEVICE_CLASS(klass) \
OBJECT_CLASS_CHECK(HDACodecDeviceClass, (klass), TYPE_HDA_CODEC_DEVICE)
#define HDA_CODEC_DEVICE_GET_CLASS(obj) \
OBJECT_GET_CLASS(HDACodecDeviceClass, (obj), TYPE_HDA_CODEC_DEVICE)
DECLARE_OBJ_CHECKERS(HDACodecDevice, HDACodecDeviceClass,
HDA_CODEC_DEVICE, TYPE_HDA_CODEC_DEVICE)
#define TYPE_HDA_BUS "HDA"
typedef struct HDACodecBus HDACodecBus;
#define HDA_BUS(obj) OBJECT_CHECK(HDACodecBus, (obj), TYPE_HDA_BUS)
DECLARE_INSTANCE_CHECKER(HDACodecBus, HDA_BUS,
TYPE_HDA_BUS)
typedef void (*hda_codec_response_func)(HDACodecDevice *dev,

View File

@ -44,8 +44,8 @@
#define MP_AUDIO_MONO (1 << 14)
typedef struct mv88w8618_audio_state mv88w8618_audio_state;
#define MV88W8618_AUDIO(obj) \
OBJECT_CHECK(mv88w8618_audio_state, (obj), TYPE_MV88W8618_AUDIO)
DECLARE_INSTANCE_CHECKER(mv88w8618_audio_state, MV88W8618_AUDIO,
TYPE_MV88W8618_AUDIO)
struct mv88w8618_audio_state {
SysBusDevice parent_obj;

View File

@ -57,8 +57,8 @@ enum {
#define TYPE_MILKYMIST_AC97 "milkymist-ac97"
typedef struct MilkymistAC97State MilkymistAC97State;
#define MILKYMIST_AC97(obj) \
OBJECT_CHECK(MilkymistAC97State, (obj), TYPE_MILKYMIST_AC97)
DECLARE_INSTANCE_CHECKER(MilkymistAC97State, MILKYMIST_AC97,
TYPE_MILKYMIST_AC97)
struct MilkymistAC97State {
SysBusDevice parent_obj;

View File

@ -41,7 +41,8 @@
#define PCSPK_MIN_COUNT DIV_ROUND_UP(PIT_FREQ, PCSPK_MAX_FREQ)
typedef struct PCSpkState PCSpkState;
#define PC_SPEAKER(obj) OBJECT_CHECK(PCSpkState, (obj), TYPE_PC_SPEAKER)
DECLARE_INSTANCE_CHECKER(PCSpkState, PC_SPEAKER,
TYPE_PC_SPEAKER)
struct PCSpkState {
ISADevice parent_obj;

View File

@ -79,7 +79,8 @@ typedef struct {
#define TYPE_PL041 "pl041"
typedef struct PL041State PL041State;
#define PL041(obj) OBJECT_CHECK(PL041State, (obj), TYPE_PL041)
DECLARE_INSTANCE_CHECKER(PL041State, PL041,
TYPE_PL041)
struct PL041State {
SysBusDevice parent_obj;

View File

@ -51,7 +51,8 @@ static const char e3[] = "COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992.";
#define TYPE_SB16 "sb16"
typedef struct SB16State SB16State;
#define SB16(obj) OBJECT_CHECK (SB16State, (obj), TYPE_SB16)
DECLARE_INSTANCE_CHECKER(SB16State, SB16,
TYPE_SB16)
struct SB16State {
ISADevice parent_obj;

View File

@ -28,7 +28,8 @@ typedef struct {
} WMRate;
typedef struct WM8750State WM8750State;
#define WM8750(obj) OBJECT_CHECK(WM8750State, (obj), TYPE_WM8750)
DECLARE_INSTANCE_CHECKER(WM8750State, WM8750,
TYPE_WM8750)
struct WM8750State {
I2CSlave parent_obj;

View File

@ -36,12 +36,8 @@ typedef struct ArduinoMachineClass ArduinoMachineClass;
#define TYPE_ARDUINO_MACHINE \
MACHINE_TYPE_NAME("arduino")
#define ARDUINO_MACHINE(obj) \
OBJECT_CHECK(ArduinoMachineState, (obj), TYPE_ARDUINO_MACHINE)
#define ARDUINO_MACHINE_CLASS(klass) \
OBJECT_CLASS_CHECK(ArduinoMachineClass, (klass), TYPE_ARDUINO_MACHINE)
#define ARDUINO_MACHINE_GET_CLASS(obj) \
OBJECT_GET_CLASS(ArduinoMachineClass, (obj), TYPE_ARDUINO_MACHINE)
DECLARE_OBJ_CHECKERS(ArduinoMachineState, ArduinoMachineClass,
ARDUINO_MACHINE, TYPE_ARDUINO_MACHINE)
static void arduino_machine_init(MachineState *machine)
{

View File

@ -63,10 +63,8 @@ struct AtmegaMcuClass {
};
typedef struct AtmegaMcuClass AtmegaMcuClass;
#define ATMEGA_MCU_CLASS(klass) \
OBJECT_CLASS_CHECK(AtmegaMcuClass, (klass), TYPE_ATMEGA_MCU)
#define ATMEGA_MCU_GET_CLASS(obj) \
OBJECT_GET_CLASS(AtmegaMcuClass, (obj), TYPE_ATMEGA_MCU)
DECLARE_CLASS_CHECKERS(AtmegaMcuClass, ATMEGA_MCU,
TYPE_ATMEGA_MCU)
static const peripheral_cfg dev168_328[PERIFMAX] = {
[USART0] = { 0xc0, POWER0, 1 },

View File

@ -24,7 +24,8 @@
#define TYPE_ATMEGA2560_MCU "ATmega2560"
typedef struct AtmegaMcuState AtmegaMcuState;
#define ATMEGA_MCU(obj) OBJECT_CHECK(AtmegaMcuState, (obj), TYPE_ATMEGA_MCU)
DECLARE_INSTANCE_CHECKER(AtmegaMcuState, ATMEGA_MCU,
TYPE_ATMEGA_MCU)
#define POWER_MAX 2
#define USART_MAX 4

View File

@ -66,7 +66,8 @@
#define TYPE_FLOPPY_BUS "floppy-bus"
typedef struct FloppyBus FloppyBus;
#define FLOPPY_BUS(obj) OBJECT_CHECK(FloppyBus, (obj), TYPE_FLOPPY_BUS)
DECLARE_INSTANCE_CHECKER(FloppyBus, FLOPPY_BUS,
TYPE_FLOPPY_BUS)
typedef struct FDCtrl FDCtrl;
typedef struct FDrive FDrive;
@ -497,8 +498,8 @@ static const BlockDevOps fd_block_ops = {
#define TYPE_FLOPPY_DRIVE "floppy"
typedef struct FloppyDrive FloppyDrive;
#define FLOPPY_DRIVE(obj) \
OBJECT_CHECK(FloppyDrive, (obj), TYPE_FLOPPY_DRIVE)
DECLARE_INSTANCE_CHECKER(FloppyDrive, FLOPPY_DRIVE,
TYPE_FLOPPY_DRIVE)
struct FloppyDrive {
DeviceState qdev;
@ -890,7 +891,8 @@ static FloppyDriveType get_fallback_drive_type(FDrive *drv)
#define TYPE_SYSBUS_FDC "base-sysbus-fdc"
typedef struct FDCtrlSysBus FDCtrlSysBus;
#define SYSBUS_FDC(obj) OBJECT_CHECK(FDCtrlSysBus, (obj), TYPE_SYSBUS_FDC)
DECLARE_INSTANCE_CHECKER(FDCtrlSysBus, SYSBUS_FDC,
TYPE_SYSBUS_FDC)
struct FDCtrlSysBus {
/*< private >*/
@ -901,7 +903,8 @@ struct FDCtrlSysBus {
};
typedef struct FDCtrlISABus FDCtrlISABus;
#define ISA_FDC(obj) OBJECT_CHECK(FDCtrlISABus, (obj), TYPE_ISA_FDC)
DECLARE_INSTANCE_CHECKER(FDCtrlISABus, ISA_FDC,
TYPE_ISA_FDC)
struct FDCtrlISABus {
ISADevice parent_obj;

View File

@ -465,12 +465,8 @@ struct M25P80Class {
typedef struct M25P80Class M25P80Class;
#define TYPE_M25P80 "m25p80-generic"
#define M25P80(obj) \
OBJECT_CHECK(Flash, (obj), TYPE_M25P80)
#define M25P80_CLASS(klass) \
OBJECT_CLASS_CHECK(M25P80Class, (klass), TYPE_M25P80)
#define M25P80_GET_CLASS(obj) \
OBJECT_GET_CLASS(M25P80Class, (obj), TYPE_M25P80)
DECLARE_OBJ_CHECKERS(Flash, M25P80Class,
M25P80, TYPE_M25P80)
static inline Manufacturer get_man(Flash *s)
{

View File

@ -90,8 +90,8 @@ struct NANDFlashState {
#define TYPE_NAND "nand"
#define NAND(obj) \
OBJECT_CHECK(NANDFlashState, (obj), TYPE_NAND)
DECLARE_INSTANCE_CHECKER(NANDFlashState, NAND,
TYPE_NAND)
static void mem_and(uint8_t *dest, const uint8_t *src, size_t n)
{

View File

@ -41,7 +41,8 @@
#define TYPE_ONE_NAND "onenand"
typedef struct OneNANDState OneNANDState;
#define ONE_NAND(obj) OBJECT_CHECK(OneNANDState, (obj), TYPE_ONE_NAND)
DECLARE_INSTANCE_CHECKER(OneNANDState, ONE_NAND,
TYPE_ONE_NAND)
struct OneNANDState {
SysBusDevice parent_obj;

View File

@ -34,8 +34,8 @@
#define TYPE_ISA_DEBUGCON_DEVICE "isa-debugcon"
typedef struct ISADebugconState ISADebugconState;
#define ISA_DEBUGCON_DEVICE(obj) \
OBJECT_CHECK(ISADebugconState, (obj), TYPE_ISA_DEBUGCON_DEVICE)
DECLARE_INSTANCE_CHECKER(ISADebugconState, ISA_DEBUGCON_DEVICE,
TYPE_ISA_DEBUGCON_DEVICE)
//#define DEBUG_DEBUGCON

View File

@ -51,8 +51,8 @@
#define TYPE_ETRAX_FS_SERIAL "etraxfs,serial"
typedef struct ETRAXSerial ETRAXSerial;
#define ETRAX_SERIAL(obj) \
OBJECT_CHECK(ETRAXSerial, (obj), TYPE_ETRAX_FS_SERIAL)
DECLARE_INSTANCE_CHECKER(ETRAXSerial, ETRAX_SERIAL,
TYPE_ETRAX_FS_SERIAL)
struct ETRAXSerial {
SysBusDevice parent_obj;

View File

@ -140,8 +140,8 @@ typedef struct {
#define TYPE_EXYNOS4210_UART "exynos4210.uart"
typedef struct Exynos4210UartState Exynos4210UartState;
#define EXYNOS4210_UART(obj) \
OBJECT_CHECK(Exynos4210UartState, (obj), TYPE_EXYNOS4210_UART)
DECLARE_INSTANCE_CHECKER(Exynos4210UartState, EXYNOS4210_UART,
TYPE_EXYNOS4210_UART)
struct Exynos4210UartState {
SysBusDevice parent_obj;

View File

@ -74,8 +74,8 @@
#define FIFO_LENGTH 1024
typedef struct UART UART;
#define GRLIB_APB_UART(obj) \
OBJECT_CHECK(UART, (obj), TYPE_GRLIB_APB_UART)
DECLARE_INSTANCE_CHECKER(UART, GRLIB_APB_UART,
TYPE_GRLIB_APB_UART)
struct UART {
SysBusDevice parent_obj;

View File

@ -123,8 +123,8 @@ struct IPOctalState {
#define TYPE_IPOCTAL "ipoctal232"
#define IPOCTAL(obj) \
OBJECT_CHECK(IPOctalState, (obj), TYPE_IPOCTAL)
DECLARE_INSTANCE_CHECKER(IPOctalState, IPOCTAL,
TYPE_IPOCTAL)
static const VMStateDescription vmstate_scc2698_channel = {
.name = "scc2698_channel",

View File

@ -43,7 +43,8 @@ enum {
};
typedef struct LM32JuartState LM32JuartState;
#define LM32_JUART(obj) OBJECT_CHECK(LM32JuartState, (obj), TYPE_LM32_JUART)
DECLARE_INSTANCE_CHECKER(LM32JuartState, LM32_JUART,
TYPE_LM32_JUART)
struct LM32JuartState {
SysBusDevice parent_obj;

View File

@ -96,7 +96,8 @@ enum {
#define TYPE_LM32_UART "lm32-uart"
typedef struct LM32UartState LM32UartState;
#define LM32_UART(obj) OBJECT_CHECK(LM32UartState, (obj), TYPE_LM32_UART)
DECLARE_INSTANCE_CHECKER(LM32UartState, LM32_UART,
TYPE_LM32_UART)
struct LM32UartState {
SysBusDevice parent_obj;

View File

@ -38,7 +38,8 @@ struct mcf_uart_state {
typedef struct mcf_uart_state mcf_uart_state;
#define TYPE_MCF_UART "mcf-uart"
#define MCF_UART(obj) OBJECT_CHECK(mcf_uart_state, (obj), TYPE_MCF_UART)
DECLARE_INSTANCE_CHECKER(mcf_uart_state, MCF_UART,
TYPE_MCF_UART)
/* UART Status Register bits. */
#define MCF_UART_RxRDY 0x01

View File

@ -59,8 +59,8 @@ enum {
#define TYPE_MILKYMIST_UART "milkymist-uart"
typedef struct MilkymistUartState MilkymistUartState;
#define MILKYMIST_UART(obj) \
OBJECT_CHECK(MilkymistUartState, (obj), TYPE_MILKYMIST_UART)
DECLARE_INSTANCE_CHECKER(MilkymistUartState, MILKYMIST_UART,
TYPE_MILKYMIST_UART)
struct MilkymistUartState {
SysBusDevice parent_obj;

View File

@ -94,8 +94,8 @@ typedef struct ParallelState {
#define TYPE_ISA_PARALLEL "isa-parallel"
typedef struct ISAParallelState ISAParallelState;
#define ISA_PARALLEL(obj) \
OBJECT_CHECK(ISAParallelState, (obj), TYPE_ISA_PARALLEL)
DECLARE_INSTANCE_CHECKER(ISAParallelState, ISA_PARALLEL,
TYPE_ISA_PARALLEL)
struct ISAParallelState {
ISADevice parent_obj;

View File

@ -49,8 +49,8 @@ struct SCLPConsoleLM {
typedef struct SCLPConsoleLM SCLPConsoleLM;
#define TYPE_SCLPLM_CONSOLE "sclplmconsole"
#define SCLPLM_CONSOLE(obj) \
OBJECT_CHECK(SCLPConsoleLM, (obj), TYPE_SCLPLM_CONSOLE)
DECLARE_INSTANCE_CHECKER(SCLPConsoleLM, SCLPLM_CONSOLE,
TYPE_SCLPLM_CONSOLE)
/*
* Character layer call-back functions

View File

@ -45,8 +45,8 @@ struct SCLPConsole {
typedef struct SCLPConsole SCLPConsole;
#define TYPE_SCLP_CONSOLE "sclpconsole"
#define SCLP_CONSOLE(obj) \
OBJECT_CHECK(SCLPConsole, (obj), TYPE_SCLP_CONSOLE)
DECLARE_INSTANCE_CHECKER(SCLPConsole, SCLP_CONSOLE,
TYPE_SCLP_CONSOLE)
/* character layer call-back functions */

View File

@ -35,7 +35,8 @@
#include "qom/object.h"
typedef struct ISASerialState ISASerialState;
#define ISA_SERIAL(obj) OBJECT_CHECK(ISASerialState, (obj), TYPE_ISA_SERIAL)
DECLARE_INSTANCE_CHECKER(ISASerialState, ISA_SERIAL,
TYPE_ISA_SERIAL)
struct ISASerialState {
ISADevice parent_obj;

View File

@ -43,7 +43,8 @@ struct PCISerialState {
typedef struct PCISerialState PCISerialState;
#define TYPE_PCI_SERIAL "pci-serial"
#define PCI_SERIAL(s) OBJECT_CHECK(PCISerialState, (s), TYPE_PCI_SERIAL)
DECLARE_INSTANCE_CHECKER(PCISerialState, PCI_SERIAL,
TYPE_PCI_SERIAL)
static void serial_pci_realize(PCIDevice *dev, Error **errp)
{

View File

@ -21,8 +21,8 @@ struct SpaprVioVty {
typedef struct SpaprVioVty SpaprVioVty;
#define TYPE_VIO_SPAPR_VTY_DEVICE "spapr-vty"
#define VIO_SPAPR_VTY_DEVICE(obj) \
OBJECT_CHECK(SpaprVioVty, (obj), TYPE_VIO_SPAPR_VTY_DEVICE)
DECLARE_INSTANCE_CHECKER(SpaprVioVty, VIO_SPAPR_VTY_DEVICE,
TYPE_VIO_SPAPR_VTY_DEVICE)
static int vty_can_receive(void *opaque)
{

View File

@ -39,8 +39,8 @@ struct Terminal3270 {
typedef struct Terminal3270 Terminal3270;
#define TYPE_TERMINAL_3270 "x-terminal3270"
#define TERMINAL_3270(obj) \
OBJECT_CHECK(Terminal3270, (obj), TYPE_TERMINAL_3270)
DECLARE_INSTANCE_CHECKER(Terminal3270, TERMINAL_3270,
TYPE_TERMINAL_3270)
static int terminal_can_read(void *opaque)
{

View File

@ -23,8 +23,8 @@
#define TYPE_VIRTIO_CONSOLE_SERIAL_PORT "virtserialport"
typedef struct VirtConsole VirtConsole;
#define VIRTIO_CONSOLE(obj) \
OBJECT_CHECK(VirtConsole, (obj), TYPE_VIRTIO_CONSOLE_SERIAL_PORT)
DECLARE_INSTANCE_CHECKER(VirtConsole, VIRTIO_CONSOLE,
TYPE_VIRTIO_CONSOLE_SERIAL_PORT)
struct VirtConsole {
VirtIOSerialPort parent_obj;

View File

@ -54,8 +54,8 @@
#define TYPE_XILINX_UARTLITE "xlnx.xps-uartlite"
typedef struct XilinxUARTLite XilinxUARTLite;
#define XILINX_UARTLITE(obj) \
OBJECT_CHECK(XilinxUARTLite, (obj), TYPE_XILINX_UARTLITE)
DECLARE_INSTANCE_CHECKER(XilinxUARTLite, XILINX_UARTLITE,
TYPE_XILINX_UARTLITE)
struct XilinxUARTLite {
SysBusDevice parent_obj;

View File

@ -26,7 +26,8 @@
#include "hw/irq.h"
#include "qom/object.h"
#define IRQ(obj) OBJECT_CHECK(struct IRQState, (obj), TYPE_IRQ)
DECLARE_INSTANCE_CHECKER(struct IRQState, IRQ,
TYPE_IRQ)
struct IRQState {
Object parent_obj;

View File

@ -19,8 +19,8 @@
#define TYPE_REALVIEW_MPCORE_RIRQ "realview_mpcore"
typedef struct mpcore_rirq_state mpcore_rirq_state;
#define REALVIEW_MPCORE_RIRQ(obj) \
OBJECT_CHECK(mpcore_rirq_state, (obj), TYPE_REALVIEW_MPCORE_RIRQ)
DECLARE_INSTANCE_CHECKER(mpcore_rirq_state, REALVIEW_MPCORE_RIRQ,
TYPE_REALVIEW_MPCORE_RIRQ)
/* Dummy PIC to route IRQ lines. The baseboard has 4 independent IRQ
controllers. The output of these, plus some of the raw input lines

View File

@ -32,7 +32,8 @@ struct ADS7846State {
typedef struct ADS7846State ADS7846State;
#define TYPE_ADS7846 "ads7846"
#define ADS7846(obj) OBJECT_CHECK(ADS7846State, (obj), TYPE_ADS7846)
DECLARE_INSTANCE_CHECKER(ADS7846State, ADS7846,
TYPE_ADS7846)
/* Control-byte bitfields */
#define CB_PD0 (1 << 0)

View File

@ -26,7 +26,8 @@
#define TYPE_ARTIST "artist"
typedef struct ARTISTState ARTISTState;
#define ARTIST(obj) OBJECT_CHECK(ARTISTState, (obj), TYPE_ARTIST)
DECLARE_INSTANCE_CHECKER(ARTISTState, ARTIST,
TYPE_ARTIST)
#ifdef HOST_WORDS_BIGENDIAN
#define ROP8OFF(_i) (3 - (_i))

View File

@ -31,7 +31,8 @@
#define TYPE_ATI_VGA "ati-vga"
typedef struct ATIVGAState ATIVGAState;
#define ATI_VGA(obj) OBJECT_CHECK(ATIVGAState, (obj), TYPE_ATI_VGA)
DECLARE_INSTANCE_CHECKER(ATIVGAState, ATI_VGA,
TYPE_ATI_VGA)
typedef struct ATIVGARegs {
uint32_t mm_index;

View File

@ -58,8 +58,8 @@ struct BochsDisplayState {
typedef struct BochsDisplayState BochsDisplayState;
#define TYPE_BOCHS_DISPLAY "bochs-display"
#define BOCHS_DISPLAY(obj) OBJECT_CHECK(BochsDisplayState, (obj), \
TYPE_BOCHS_DISPLAY)
DECLARE_INSTANCE_CHECKER(BochsDisplayState, BOCHS_DISPLAY,
TYPE_BOCHS_DISPLAY)
static const VMStateDescription vmstate_bochs_display = {
.name = "bochs-display",

View File

@ -67,7 +67,8 @@
#define TYPE_CG3 "cgthree"
typedef struct CG3State CG3State;
#define CG3(obj) OBJECT_CHECK(CG3State, (obj), TYPE_CG3)
DECLARE_INSTANCE_CHECKER(CG3State, CG3,
TYPE_CG3)
struct CG3State {
SysBusDevice parent_obj;

View File

@ -186,8 +186,8 @@ struct PCICirrusVGAState {
typedef struct PCICirrusVGAState PCICirrusVGAState;
#define TYPE_PCI_CIRRUS_VGA "cirrus-vga"
#define PCI_CIRRUS_VGA(obj) \
OBJECT_CHECK(PCICirrusVGAState, (obj), TYPE_PCI_CIRRUS_VGA)
DECLARE_INSTANCE_CHECKER(PCICirrusVGAState, PCI_CIRRUS_VGA,
TYPE_PCI_CIRRUS_VGA)
static uint8_t rop_to_index[256];

View File

@ -34,8 +34,8 @@
#define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga"
typedef struct ISACirrusVGAState ISACirrusVGAState;
#define ISA_CIRRUS_VGA(obj) \
OBJECT_CHECK(ISACirrusVGAState, (obj), TYPE_ISA_CIRRUS_VGA)
DECLARE_INSTANCE_CHECKER(ISACirrusVGAState, ISA_CIRRUS_VGA,
TYPE_ISA_CIRRUS_VGA)
struct ISACirrusVGAState {
ISADevice parent_obj;

View File

@ -295,8 +295,8 @@ struct Exynos4210fimdWindow {
#define TYPE_EXYNOS4210_FIMD "exynos4210.fimd"
typedef struct Exynos4210fimdState Exynos4210fimdState;
#define EXYNOS4210_FIMD(obj) \
OBJECT_CHECK(Exynos4210fimdState, (obj), TYPE_EXYNOS4210_FIMD)
DECLARE_INSTANCE_CHECKER(Exynos4210fimdState, EXYNOS4210_FIMD,
TYPE_EXYNOS4210_FIMD)
struct Exynos4210fimdState {
SysBusDevice parent_obj;

View File

@ -488,7 +488,8 @@ static void g364fb_init(DeviceState *dev, G364State *s)
#define TYPE_G364 "sysbus-g364"
typedef struct G364SysBusState G364SysBusState;
#define G364(obj) OBJECT_CHECK(G364SysBusState, (obj), TYPE_G364)
DECLARE_INSTANCE_CHECKER(G364SysBusState, G364,
TYPE_G364)
struct G364SysBusState {
SysBusDevice parent_obj;

View File

@ -37,7 +37,8 @@ typedef enum {
#define TYPE_JAZZ_LED "jazz-led"
typedef struct LedState LedState;
#define JAZZ_LED(obj) OBJECT_CHECK(LedState, (obj), TYPE_JAZZ_LED)
DECLARE_INSTANCE_CHECKER(LedState, JAZZ_LED,
TYPE_JAZZ_LED)
struct LedState {
SysBusDevice parent_obj;

View File

@ -84,8 +84,8 @@ struct vertex {
#define TYPE_MILKYMIST_TMU2 "milkymist-tmu2"
typedef struct MilkymistTMU2State MilkymistTMU2State;
#define MILKYMIST_TMU2(obj) \
OBJECT_CHECK(MilkymistTMU2State, (obj), TYPE_MILKYMIST_TMU2)
DECLARE_INSTANCE_CHECKER(MilkymistTMU2State, MILKYMIST_TMU2,
TYPE_MILKYMIST_TMU2)
struct MilkymistTMU2State {
SysBusDevice parent_obj;

Some files were not shown because too many files have changed in this diff Show More