aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc
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/ppc
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/ppc')
-rw-r--r--hw/ppc/e500-ccsr.h3
-rw-r--r--hw/ppc/e500.h8
-rw-r--r--hw/ppc/mac.h8
-rw-r--r--hw/ppc/mpc8544_guts.c3
-rw-r--r--hw/ppc/ppc440_pcix.c4
-rw-r--r--hw/ppc/ppc440_uc.c4
-rw-r--r--hw/ppc/ppc4xx_pci.c4
-rw-r--r--hw/ppc/ppce500_spin.c3
-rw-r--r--hw/ppc/prep_systemio.c4
-rw-r--r--hw/ppc/rs6000_mc.c4
-rw-r--r--hw/ppc/spapr_rng.c4
11 files changed, 24 insertions, 25 deletions
diff --git a/hw/ppc/e500-ccsr.h b/hw/ppc/e500-ccsr.h
index f7fd73fc0d..de4b9d2bc3 100644
--- a/hw/ppc/e500-ccsr.h
+++ b/hw/ppc/e500-ccsr.h
@@ -14,6 +14,7 @@ struct PPCE500CCSRState {
typedef struct PPCE500CCSRState PPCE500CCSRState;
#define TYPE_CCSR "e500-ccsr"
-#define CCSR(obj) OBJECT_CHECK(PPCE500CCSRState, (obj), TYPE_CCSR)
+DECLARE_INSTANCE_CHECKER(PPCE500CCSRState, CCSR,
+ TYPE_CCSR)
#endif /* E500_CCSR_H */
diff --git a/hw/ppc/e500.h b/hw/ppc/e500.h
index 5773460d5e..63870751ff 100644
--- a/hw/ppc/e500.h
+++ b/hw/ppc/e500.h
@@ -46,11 +46,7 @@ void ppce500_init(MachineState *machine);
hwaddr booke206_page_size_to_tlb(uint64_t size);
#define TYPE_PPCE500_MACHINE "ppce500-base-machine"
-#define PPCE500_MACHINE(obj) \
- OBJECT_CHECK(PPCE500MachineState, (obj), TYPE_PPCE500_MACHINE)
-#define PPCE500_MACHINE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(PPCE500MachineClass, obj, TYPE_PPCE500_MACHINE)
-#define PPCE500_MACHINE_CLASS(klass) \
- OBJECT_CLASS_CHECK(PPCE500MachineClass, klass, TYPE_PPCE500_MACHINE)
+DECLARE_OBJ_CHECKERS(PPCE500MachineState, PPCE500MachineClass,
+ PPCE500_MACHINE, TYPE_PPCE500_MACHINE)
#endif
diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h
index f4ef3f32b0..2b6425f600 100644
--- a/hw/ppc/mac.h
+++ b/hw/ppc/mac.h
@@ -73,8 +73,8 @@
/* Core99 machine */
#define TYPE_CORE99_MACHINE MACHINE_TYPE_NAME("mac99")
typedef struct Core99MachineState Core99MachineState;
-#define CORE99_MACHINE(obj) OBJECT_CHECK(Core99MachineState, (obj), \
- TYPE_CORE99_MACHINE)
+DECLARE_INSTANCE_CHECKER(Core99MachineState, CORE99_MACHINE,
+ TYPE_CORE99_MACHINE)
#define CORE99_VIA_CONFIG_CUDA 0x0
#define CORE99_VIA_CONFIG_PMU 0x1
@@ -93,8 +93,8 @@ struct Core99MachineState {
/* Mac NVRAM */
#define TYPE_MACIO_NVRAM "macio-nvram"
typedef struct MacIONVRAMState MacIONVRAMState;
-#define MACIO_NVRAM(obj) \
- OBJECT_CHECK(MacIONVRAMState, (obj), TYPE_MACIO_NVRAM)
+DECLARE_INSTANCE_CHECKER(MacIONVRAMState, MACIO_NVRAM,
+ TYPE_MACIO_NVRAM)
struct MacIONVRAMState {
/*< private >*/
diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c
index f74bcdca16..b76b5e4701 100644
--- a/hw/ppc/mpc8544_guts.c
+++ b/hw/ppc/mpc8544_guts.c
@@ -56,7 +56,8 @@
#define TYPE_MPC8544_GUTS "mpc8544-guts"
typedef struct GutsState GutsState;
-#define MPC8544_GUTS(obj) OBJECT_CHECK(GutsState, (obj), TYPE_MPC8544_GUTS)
+DECLARE_INSTANCE_CHECKER(GutsState, MPC8544_GUTS,
+ TYPE_MPC8544_GUTS)
struct GutsState {
/*< private >*/
diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c
index f82d520d25..a564fcd600 100644
--- a/hw/ppc/ppc440_pcix.c
+++ b/hw/ppc/ppc440_pcix.c
@@ -47,8 +47,8 @@ struct PLBInMap {
#define TYPE_PPC440_PCIX_HOST_BRIDGE "ppc440-pcix-host"
typedef struct PPC440PCIXState PPC440PCIXState;
-#define PPC440_PCIX_HOST_BRIDGE(obj) \
- OBJECT_CHECK(PPC440PCIXState, (obj), TYPE_PPC440_PCIX_HOST_BRIDGE)
+DECLARE_INSTANCE_CHECKER(PPC440PCIXState, PPC440_PCIX_HOST_BRIDGE,
+ TYPE_PPC440_PCIX_HOST_BRIDGE)
#define PPC440_PCIX_NR_POMS 3
#define PPC440_PCIX_NR_PIMS 3
diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c
index 73cb93a3a5..d9ca6bba9b 100644
--- a/hw/ppc/ppc440_uc.c
+++ b/hw/ppc/ppc440_uc.c
@@ -1034,8 +1034,8 @@ void ppc4xx_dma_init(CPUPPCState *env, int dcr_base)
#define TYPE_PPC460EX_PCIE_HOST "ppc460ex-pcie-host"
typedef struct PPC460EXPCIEState PPC460EXPCIEState;
-#define PPC460EX_PCIE_HOST(obj) \
- OBJECT_CHECK(PPC460EXPCIEState, (obj), TYPE_PPC460EX_PCIE_HOST)
+DECLARE_INSTANCE_CHECKER(PPC460EXPCIEState, PPC460EX_PCIE_HOST,
+ TYPE_PPC460EX_PCIE_HOST)
struct PPC460EXPCIEState {
PCIExpressHost host;
diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
index 6ee7eeed98..c24bac96c3 100644
--- a/hw/ppc/ppc4xx_pci.c
+++ b/hw/ppc/ppc4xx_pci.c
@@ -45,8 +45,8 @@ struct PCITargetMap {
};
typedef struct PPC4xxPCIState PPC4xxPCIState;
-#define PPC4xx_PCI_HOST_BRIDGE(obj) \
- OBJECT_CHECK(PPC4xxPCIState, (obj), TYPE_PPC4xx_PCI_HOST_BRIDGE)
+DECLARE_INSTANCE_CHECKER(PPC4xxPCIState, PPC4xx_PCI_HOST_BRIDGE,
+ TYPE_PPC4xx_PCI_HOST_BRIDGE)
#define PPC4xx_PCI_NR_PMMS 3
#define PPC4xx_PCI_NR_PTMS 2
diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c
index b1b6d559c4..cd8000ad73 100644
--- a/hw/ppc/ppce500_spin.c
+++ b/hw/ppc/ppce500_spin.c
@@ -48,7 +48,8 @@ typedef struct spin_info {
#define TYPE_E500_SPIN "e500-spin"
typedef struct SpinState SpinState;
-#define E500_SPIN(obj) OBJECT_CHECK(SpinState, (obj), TYPE_E500_SPIN)
+DECLARE_INSTANCE_CHECKER(SpinState, E500_SPIN,
+ TYPE_E500_SPIN)
struct SpinState {
SysBusDevice parent_obj;
diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c
index d13044acce..d1e2fb3f8b 100644
--- a/hw/ppc/prep_systemio.c
+++ b/hw/ppc/prep_systemio.c
@@ -37,8 +37,8 @@
#define TYPE_PREP_SYSTEMIO "prep-systemio"
typedef struct PrepSystemIoState PrepSystemIoState;
-#define PREP_SYSTEMIO(obj) \
- OBJECT_CHECK(PrepSystemIoState, (obj), TYPE_PREP_SYSTEMIO)
+DECLARE_INSTANCE_CHECKER(PrepSystemIoState, PREP_SYSTEMIO,
+ TYPE_PREP_SYSTEMIO)
/* Bit as defined in PowerPC Reference Plaform v1.1, sect. 6.1.5, p. 132 */
#define PREP_BIT(n) (1 << (7 - (n)))
diff --git a/hw/ppc/rs6000_mc.c b/hw/ppc/rs6000_mc.c
index ec25a701dc..56e96010b8 100644
--- a/hw/ppc/rs6000_mc.c
+++ b/hw/ppc/rs6000_mc.c
@@ -30,8 +30,8 @@
#define TYPE_RS6000MC "rs6000-mc"
typedef struct RS6000MCState RS6000MCState;
-#define RS6000MC_DEVICE(obj) \
- OBJECT_CHECK(RS6000MCState, (obj), TYPE_RS6000MC)
+DECLARE_INSTANCE_CHECKER(RS6000MCState, RS6000MC_DEVICE,
+ TYPE_RS6000MC)
struct RS6000MCState {
ISADevice parent_obj;
diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c
index b400438394..6c99633faa 100644
--- a/hw/ppc/spapr_rng.c
+++ b/hw/ppc/spapr_rng.c
@@ -31,8 +31,8 @@
#include "qom/object.h"
typedef struct SpaprRngState SpaprRngState;
-#define SPAPR_RNG(obj) \
- OBJECT_CHECK(SpaprRngState, (obj), TYPE_SPAPR_RNG)
+DECLARE_INSTANCE_CHECKER(SpaprRngState, SPAPR_RNG,
+ TYPE_SPAPR_RNG)
struct SpaprRngState {
/*< private >*/