summary refs log tree commit diff stats
path: root/hw/misc
diff options
context:
space:
mode:
Diffstat (limited to 'hw/misc')
-rw-r--r--hw/misc/applesmc.c3
-rw-r--r--hw/misc/arm_integrator_debug.c4
-rw-r--r--hw/misc/arm_l2x0.c3
-rw-r--r--hw/misc/arm_sysctl.c4
-rw-r--r--hw/misc/debugexit.c4
-rw-r--r--hw/misc/eccmemctl.c3
-rw-r--r--hw/misc/edu.c3
-rw-r--r--hw/misc/empty_slot.c3
-rw-r--r--hw/misc/exynos4210_clk.c4
-rw-r--r--hw/misc/exynos4210_pmu.c4
-rw-r--r--hw/misc/exynos4210_rng.c4
-rw-r--r--hw/misc/ivshmem.c16
-rw-r--r--hw/misc/milkymist-hpdmc.c4
-rw-r--r--hw/misc/milkymist-pfpu.c4
-rw-r--r--hw/misc/mst_fpga.c4
-rw-r--r--hw/misc/pc-testdev.c4
-rw-r--r--hw/misc/pca9552.c6
-rw-r--r--hw/misc/pci-testdev.c4
-rw-r--r--hw/misc/puv3_pm.c3
-rw-r--r--hw/misc/pvpanic.c4
-rw-r--r--hw/misc/sga.c3
-rw-r--r--hw/misc/slavio_misc.c6
-rw-r--r--hw/misc/tmp105.h3
-rw-r--r--hw/misc/tmp421.c7
-rw-r--r--hw/misc/zynq_slcr.c3
25 files changed, 58 insertions, 52 deletions
diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c
index e3c7b1765c..dca3fba028 100644
--- a/hw/misc/applesmc.c
+++ b/hw/misc/applesmc.c
@@ -91,7 +91,8 @@ struct AppleSMCData {
 };
 
 typedef struct AppleSMCState AppleSMCState;
-#define APPLE_SMC(obj) OBJECT_CHECK(AppleSMCState, (obj), TYPE_APPLE_SMC)
+DECLARE_INSTANCE_CHECKER(AppleSMCState, APPLE_SMC,
+                         TYPE_APPLE_SMC)
 
 struct AppleSMCState {
     ISADevice parent_obj;
diff --git a/hw/misc/arm_integrator_debug.c b/hw/misc/arm_integrator_debug.c
index 4ad2b6a98b..822deffc0c 100644
--- a/hw/misc/arm_integrator_debug.c
+++ b/hw/misc/arm_integrator_debug.c
@@ -22,8 +22,8 @@
 #include "qom/object.h"
 
 typedef struct IntegratorDebugState IntegratorDebugState;
-#define INTEGRATOR_DEBUG(obj) \
-    OBJECT_CHECK(IntegratorDebugState, (obj), TYPE_INTEGRATOR_DEBUG)
+DECLARE_INSTANCE_CHECKER(IntegratorDebugState, INTEGRATOR_DEBUG,
+                         TYPE_INTEGRATOR_DEBUG)
 
 struct IntegratorDebugState {
     SysBusDevice parent_obj;
diff --git a/hw/misc/arm_l2x0.c b/hw/misc/arm_l2x0.c
index f75d7988cc..93948c3bd8 100644
--- a/hw/misc/arm_l2x0.c
+++ b/hw/misc/arm_l2x0.c
@@ -31,7 +31,8 @@
 
 #define TYPE_ARM_L2X0 "l2x0"
 typedef struct L2x0State L2x0State;
-#define ARM_L2X0(obj) OBJECT_CHECK(L2x0State, (obj), TYPE_ARM_L2X0)
+DECLARE_INSTANCE_CHECKER(L2x0State, ARM_L2X0,
+                         TYPE_ARM_L2X0)
 
 struct L2x0State {
     SysBusDevice parent_obj;
diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c
index a3faa516d6..f0f49e76e8 100644
--- a/hw/misc/arm_sysctl.c
+++ b/hw/misc/arm_sysctl.c
@@ -24,8 +24,8 @@
 
 #define TYPE_ARM_SYSCTL "realview_sysctl"
 typedef struct arm_sysctl_state arm_sysctl_state;
-#define ARM_SYSCTL(obj) \
-    OBJECT_CHECK(arm_sysctl_state, (obj), TYPE_ARM_SYSCTL)
+DECLARE_INSTANCE_CHECKER(arm_sysctl_state, ARM_SYSCTL,
+                         TYPE_ARM_SYSCTL)
 
 struct arm_sysctl_state {
     SysBusDevice parent_obj;
diff --git a/hw/misc/debugexit.c b/hw/misc/debugexit.c
index 6c1f9adc38..c6b0cffd77 100644
--- a/hw/misc/debugexit.c
+++ b/hw/misc/debugexit.c
@@ -15,8 +15,8 @@
 
 #define TYPE_ISA_DEBUG_EXIT_DEVICE "isa-debug-exit"
 typedef struct ISADebugExitState ISADebugExitState;
-#define ISA_DEBUG_EXIT_DEVICE(obj) \
-     OBJECT_CHECK(ISADebugExitState, (obj), TYPE_ISA_DEBUG_EXIT_DEVICE)
+DECLARE_INSTANCE_CHECKER(ISADebugExitState, ISA_DEBUG_EXIT_DEVICE,
+                         TYPE_ISA_DEBUG_EXIT_DEVICE)
 
 struct ISADebugExitState {
     ISADevice parent_obj;
diff --git a/hw/misc/eccmemctl.c b/hw/misc/eccmemctl.c
index 47bec04c8e..468c2a491d 100644
--- a/hw/misc/eccmemctl.c
+++ b/hw/misc/eccmemctl.c
@@ -128,7 +128,8 @@
 
 #define TYPE_ECC_MEMCTL "eccmemctl"
 typedef struct ECCState ECCState;
-#define ECC_MEMCTL(obj) OBJECT_CHECK(ECCState, (obj), TYPE_ECC_MEMCTL)
+DECLARE_INSTANCE_CHECKER(ECCState, ECC_MEMCTL,
+                         TYPE_ECC_MEMCTL)
 
 struct ECCState {
     SysBusDevice parent_obj;
diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index 2db9d63eeb..0ff9d1ac78 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -35,7 +35,8 @@
 
 #define TYPE_PCI_EDU_DEVICE "edu"
 typedef struct EduState EduState;
-#define EDU(obj)        OBJECT_CHECK(EduState, obj, TYPE_PCI_EDU_DEVICE)
+DECLARE_INSTANCE_CHECKER(EduState, EDU,
+                         TYPE_PCI_EDU_DEVICE)
 
 #define FACT_IRQ        0x00000001
 #define DMA_IRQ         0x00000100
diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c
index ec3e510b3e..57dcdfbe14 100644
--- a/hw/misc/empty_slot.c
+++ b/hw/misc/empty_slot.c
@@ -19,7 +19,8 @@
 
 #define TYPE_EMPTY_SLOT "empty_slot"
 typedef struct EmptySlot EmptySlot;
-#define EMPTY_SLOT(obj) OBJECT_CHECK(EmptySlot, (obj), TYPE_EMPTY_SLOT)
+DECLARE_INSTANCE_CHECKER(EmptySlot, EMPTY_SLOT,
+                         TYPE_EMPTY_SLOT)
 
 struct EmptySlot {
     SysBusDevice parent_obj;
diff --git a/hw/misc/exynos4210_clk.c b/hw/misc/exynos4210_clk.c
index c54f360aa8..4b469f6419 100644
--- a/hw/misc/exynos4210_clk.c
+++ b/hw/misc/exynos4210_clk.c
@@ -26,8 +26,8 @@
 
 #define TYPE_EXYNOS4210_CLK             "exynos4210.clk"
 typedef struct Exynos4210ClkState Exynos4210ClkState;
-#define EXYNOS4210_CLK(obj) \
-    OBJECT_CHECK(Exynos4210ClkState, (obj), TYPE_EXYNOS4210_CLK)
+DECLARE_INSTANCE_CHECKER(Exynos4210ClkState, EXYNOS4210_CLK,
+                         TYPE_EXYNOS4210_CLK)
 
 #define CLK_PLL_LOCKED                  BIT(29)
 
diff --git a/hw/misc/exynos4210_pmu.c b/hw/misc/exynos4210_pmu.c
index e6bbb1f7c8..b19b82a88c 100644
--- a/hw/misc/exynos4210_pmu.c
+++ b/hw/misc/exynos4210_pmu.c
@@ -396,8 +396,8 @@ static const Exynos4210PmuReg exynos4210_pmu_regs[] = {
 
 #define TYPE_EXYNOS4210_PMU "exynos4210.pmu"
 typedef struct Exynos4210PmuState Exynos4210PmuState;
-#define EXYNOS4210_PMU(obj) \
-    OBJECT_CHECK(Exynos4210PmuState, (obj), TYPE_EXYNOS4210_PMU)
+DECLARE_INSTANCE_CHECKER(Exynos4210PmuState, EXYNOS4210_PMU,
+                         TYPE_EXYNOS4210_PMU)
 
 struct Exynos4210PmuState {
     SysBusDevice parent_obj;
diff --git a/hw/misc/exynos4210_rng.c b/hw/misc/exynos4210_rng.c
index 3e2ec4f543..13ec6e188b 100644
--- a/hw/misc/exynos4210_rng.c
+++ b/hw/misc/exynos4210_rng.c
@@ -37,8 +37,8 @@
 
 #define TYPE_EXYNOS4210_RNG             "exynos4210.rng"
 typedef struct Exynos4210RngState Exynos4210RngState;
-#define EXYNOS4210_RNG(obj) \
-    OBJECT_CHECK(Exynos4210RngState, (obj), TYPE_EXYNOS4210_RNG)
+DECLARE_INSTANCE_CHECKER(Exynos4210RngState, EXYNOS4210_RNG,
+                         TYPE_EXYNOS4210_RNG)
 
 /*
  * Exynos4220, PRNG, only polling mode is supported.
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 1f65f6f2ac..e321e5cb69 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -59,20 +59,20 @@
 
 #define TYPE_IVSHMEM_COMMON "ivshmem-common"
 typedef struct IVShmemState IVShmemState;
-#define IVSHMEM_COMMON(obj) \
-    OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM_COMMON)
+DECLARE_INSTANCE_CHECKER(IVShmemState, IVSHMEM_COMMON,
+                         TYPE_IVSHMEM_COMMON)
 
 #define TYPE_IVSHMEM_PLAIN "ivshmem-plain"
-#define IVSHMEM_PLAIN(obj) \
-    OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM_PLAIN)
+DECLARE_INSTANCE_CHECKER(IVShmemState, IVSHMEM_PLAIN,
+                         TYPE_IVSHMEM_PLAIN)
 
 #define TYPE_IVSHMEM_DOORBELL "ivshmem-doorbell"
-#define IVSHMEM_DOORBELL(obj) \
-    OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM_DOORBELL)
+DECLARE_INSTANCE_CHECKER(IVShmemState, IVSHMEM_DOORBELL,
+                         TYPE_IVSHMEM_DOORBELL)
 
 #define TYPE_IVSHMEM "ivshmem"
-#define IVSHMEM(obj) \
-    OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM)
+DECLARE_INSTANCE_CHECKER(IVShmemState, IVSHMEM,
+                         TYPE_IVSHMEM)
 
 typedef struct Peer {
     int nb_eventfds;
diff --git a/hw/misc/milkymist-hpdmc.c b/hw/misc/milkymist-hpdmc.c
index cf3ed5a49c..f25715e09e 100644
--- a/hw/misc/milkymist-hpdmc.c
+++ b/hw/misc/milkymist-hpdmc.c
@@ -45,8 +45,8 @@ enum {
 
 #define TYPE_MILKYMIST_HPDMC "milkymist-hpdmc"
 typedef struct MilkymistHpdmcState MilkymistHpdmcState;
-#define MILKYMIST_HPDMC(obj) \
-    OBJECT_CHECK(MilkymistHpdmcState, (obj), TYPE_MILKYMIST_HPDMC)
+DECLARE_INSTANCE_CHECKER(MilkymistHpdmcState, MILKYMIST_HPDMC,
+                         TYPE_MILKYMIST_HPDMC)
 
 struct MilkymistHpdmcState {
     SysBusDevice parent_obj;
diff --git a/hw/misc/milkymist-pfpu.c b/hw/misc/milkymist-pfpu.c
index 81251792c1..489bb8873f 100644
--- a/hw/misc/milkymist-pfpu.c
+++ b/hw/misc/milkymist-pfpu.c
@@ -122,8 +122,8 @@ static const char *opcode_to_str[] = {
 
 #define TYPE_MILKYMIST_PFPU "milkymist-pfpu"
 typedef struct MilkymistPFPUState MilkymistPFPUState;
-#define MILKYMIST_PFPU(obj) \
-    OBJECT_CHECK(MilkymistPFPUState, (obj), TYPE_MILKYMIST_PFPU)
+DECLARE_INSTANCE_CHECKER(MilkymistPFPUState, MILKYMIST_PFPU,
+                         TYPE_MILKYMIST_PFPU)
 
 struct MilkymistPFPUState {
     SysBusDevice parent_obj;
diff --git a/hw/misc/mst_fpga.c b/hw/misc/mst_fpga.c
index 314dd5fcbd..f74d8cdd4a 100644
--- a/hw/misc/mst_fpga.c
+++ b/hw/misc/mst_fpga.c
@@ -42,8 +42,8 @@
 
 #define TYPE_MAINSTONE_FPGA "mainstone-fpga"
 typedef struct mst_irq_state mst_irq_state;
-#define MAINSTONE_FPGA(obj) \
-    OBJECT_CHECK(mst_irq_state, (obj), TYPE_MAINSTONE_FPGA)
+DECLARE_INSTANCE_CHECKER(mst_irq_state, MAINSTONE_FPGA,
+                         TYPE_MAINSTONE_FPGA)
 
 struct mst_irq_state {
     SysBusDevice parent_obj;
diff --git a/hw/misc/pc-testdev.c b/hw/misc/pc-testdev.c
index b7f3fcb254..577a15bf58 100644
--- a/hw/misc/pc-testdev.c
+++ b/hw/misc/pc-testdev.c
@@ -57,8 +57,8 @@ struct PCTestdev {
 typedef struct PCTestdev PCTestdev;
 
 #define TYPE_TESTDEV "pc-testdev"
-#define TESTDEV(obj) \
-     OBJECT_CHECK(PCTestdev, (obj), TYPE_TESTDEV)
+DECLARE_INSTANCE_CHECKER(PCTestdev, TESTDEV,
+                         TYPE_TESTDEV)
 
 static uint64_t test_irq_line_read(void *opaque, hwaddr addr, unsigned size)
 {
diff --git a/hw/misc/pca9552.c b/hw/misc/pca9552.c
index 9cd51b1afd..b7686e27d7 100644
--- a/hw/misc/pca9552.c
+++ b/hw/misc/pca9552.c
@@ -34,10 +34,8 @@ struct PCA955xClass {
 };
 typedef struct PCA955xClass PCA955xClass;
 
-#define PCA955X_CLASS(klass) \
-    OBJECT_CLASS_CHECK(PCA955xClass, (klass), TYPE_PCA955X)
-#define PCA955X_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(PCA955xClass, (obj), TYPE_PCA955X)
+DECLARE_CLASS_CHECKERS(PCA955xClass, PCA955X,
+                       TYPE_PCA955X)
 
 #define PCA9552_LED_ON   0x0
 #define PCA9552_LED_OFF  0x1
diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
index db6d0d5a71..86d4816769 100644
--- a/hw/misc/pci-testdev.c
+++ b/hw/misc/pci-testdev.c
@@ -96,8 +96,8 @@ typedef struct PCITestDevState PCITestDevState;
 
 #define TYPE_PCI_TEST_DEV "pci-testdev"
 
-#define PCI_TEST_DEV(obj) \
-    OBJECT_CHECK(PCITestDevState, (obj), TYPE_PCI_TEST_DEV)
+DECLARE_INSTANCE_CHECKER(PCITestDevState, PCI_TEST_DEV,
+                         TYPE_PCI_TEST_DEV)
 
 #define IOTEST_IS_MEM(i) (strcmp(IOTEST_TYPE(i), "portio"))
 #define IOTEST_REGION(d, i) (IOTEST_IS_MEM(i) ?  &(d)->mmio : &(d)->portio)
diff --git a/hw/misc/puv3_pm.c b/hw/misc/puv3_pm.c
index e549c0ff21..cac8497f81 100644
--- a/hw/misc/puv3_pm.c
+++ b/hw/misc/puv3_pm.c
@@ -20,7 +20,8 @@
 
 #define TYPE_PUV3_PM "puv3_pm"
 typedef struct PUV3PMState PUV3PMState;
-#define PUV3_PM(obj) OBJECT_CHECK(PUV3PMState, (obj), TYPE_PUV3_PM)
+DECLARE_INSTANCE_CHECKER(PUV3PMState, PUV3_PM,
+                         TYPE_PUV3_PM)
 
 struct PUV3PMState {
     SysBusDevice parent_obj;
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
index 894c67e6cc..598d5471a4 100644
--- a/hw/misc/pvpanic.c
+++ b/hw/misc/pvpanic.c
@@ -31,8 +31,8 @@
 #define PVPANIC_CRASHLOADED     (1 << PVPANIC_F_CRASHLOADED)
 
 typedef struct PVPanicState PVPanicState;
-#define ISA_PVPANIC_DEVICE(obj)    \
-    OBJECT_CHECK(PVPanicState, (obj), TYPE_PVPANIC)
+DECLARE_INSTANCE_CHECKER(PVPanicState, ISA_PVPANIC_DEVICE,
+                         TYPE_PVPANIC)
 
 static void handle_event(int event)
 {
diff --git a/hw/misc/sga.c b/hw/misc/sga.c
index e5cc2da3d3..477f587ef3 100644
--- a/hw/misc/sga.c
+++ b/hw/misc/sga.c
@@ -35,7 +35,8 @@
 
 #define TYPE_SGA "sga"
 typedef struct ISASGAState ISASGAState;
-#define SGA(obj) OBJECT_CHECK(ISASGAState, (obj), TYPE_SGA)
+DECLARE_INSTANCE_CHECKER(ISASGAState, SGA,
+                         TYPE_SGA)
 
 struct ISASGAState {
     ISADevice parent_obj;
diff --git a/hw/misc/slavio_misc.c b/hw/misc/slavio_misc.c
index f1a039b5a9..ab27ad462e 100644
--- a/hw/misc/slavio_misc.c
+++ b/hw/misc/slavio_misc.c
@@ -41,7 +41,8 @@
 
 #define TYPE_SLAVIO_MISC "slavio_misc"
 typedef struct MiscState MiscState;
-#define SLAVIO_MISC(obj) OBJECT_CHECK(MiscState, (obj), TYPE_SLAVIO_MISC)
+DECLARE_INSTANCE_CHECKER(MiscState, SLAVIO_MISC,
+                         TYPE_SLAVIO_MISC)
 
 struct MiscState {
     SysBusDevice parent_obj;
@@ -65,7 +66,8 @@ struct MiscState {
 
 #define TYPE_APC "apc"
 typedef struct APCState APCState;
-#define APC(obj) OBJECT_CHECK(APCState, (obj), TYPE_APC)
+DECLARE_INSTANCE_CHECKER(APCState, APC,
+                         TYPE_APC)
 
 struct APCState {
     SysBusDevice parent_obj;
diff --git a/hw/misc/tmp105.h b/hw/misc/tmp105.h
index 634bb4a0d6..7ee8a496ff 100644
--- a/hw/misc/tmp105.h
+++ b/hw/misc/tmp105.h
@@ -20,7 +20,8 @@
 
 #define TYPE_TMP105 "tmp105"
 typedef struct TMP105State TMP105State;
-#define TMP105(obj) OBJECT_CHECK(TMP105State, (obj), TYPE_TMP105)
+DECLARE_INSTANCE_CHECKER(TMP105State, TMP105,
+                         TYPE_TMP105)
 
 /**
  * TMP105State:
diff --git a/hw/misc/tmp421.c b/hw/misc/tmp421.c
index a289c83360..212d6e0e83 100644
--- a/hw/misc/tmp421.c
+++ b/hw/misc/tmp421.c
@@ -74,12 +74,9 @@ struct TMP421Class {
 typedef struct TMP421Class TMP421Class;
 
 #define TYPE_TMP421 "tmp421-generic"
-#define TMP421(obj) OBJECT_CHECK(TMP421State, (obj), TYPE_TMP421)
+DECLARE_OBJ_CHECKERS(TMP421State, TMP421Class,
+                     TMP421, TYPE_TMP421)
 
-#define TMP421_CLASS(klass) \
-     OBJECT_CLASS_CHECK(TMP421Class, (klass), TYPE_TMP421)
-#define TMP421_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(TMP421Class, (obj), TYPE_TMP421)
 
 /* the TMP421 registers */
 #define TMP421_STATUS_REG               0x08
diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c
index 223f533ce8..bedf09a6f5 100644
--- a/hw/misc/zynq_slcr.c
+++ b/hw/misc/zynq_slcr.c
@@ -184,7 +184,8 @@ REG32(DDRIOB, 0xb40)
 
 #define TYPE_ZYNQ_SLCR "xilinx,zynq_slcr"
 typedef struct ZynqSLCRState ZynqSLCRState;
-#define ZYNQ_SLCR(obj) OBJECT_CHECK(ZynqSLCRState, (obj), TYPE_ZYNQ_SLCR)
+DECLARE_INSTANCE_CHECKER(ZynqSLCRState, ZYNQ_SLCR,
+                         TYPE_ZYNQ_SLCR)
 
 struct ZynqSLCRState {
     SysBusDevice parent_obj;