mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
Use OBJECT_DECLARE_SIMPLE_TYPE when possible
This converts existing DECLARE_INSTANCE_CHECKER usage to OBJECT_DECLARE_SIMPLE_TYPE when possible. $ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]') Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Paul Durrant <paul@xen.org> Message-Id: <20200916182519.415636-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
a489d1951c
commit
8063396bf3
505 changed files with 609 additions and 1795 deletions
|
@ -90,9 +90,7 @@ struct AppleSMCData {
|
|||
QLIST_ENTRY(AppleSMCData) node;
|
||||
};
|
||||
|
||||
typedef struct AppleSMCState AppleSMCState;
|
||||
DECLARE_INSTANCE_CHECKER(AppleSMCState, APPLE_SMC,
|
||||
TYPE_APPLE_SMC)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(AppleSMCState, APPLE_SMC)
|
||||
|
||||
struct AppleSMCState {
|
||||
ISADevice parent_obj;
|
||||
|
|
|
@ -21,9 +21,7 @@
|
|||
#include "qemu/module.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
typedef struct IntegratorDebugState IntegratorDebugState;
|
||||
DECLARE_INSTANCE_CHECKER(IntegratorDebugState, INTEGRATOR_DEBUG,
|
||||
TYPE_INTEGRATOR_DEBUG)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(IntegratorDebugState, INTEGRATOR_DEBUG)
|
||||
|
||||
struct IntegratorDebugState {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
|
@ -30,9 +30,7 @@
|
|||
#define CACHE_ID 0x410000c8
|
||||
|
||||
#define TYPE_ARM_L2X0 "l2x0"
|
||||
typedef struct L2x0State L2x0State;
|
||||
DECLARE_INSTANCE_CHECKER(L2x0State, ARM_L2X0,
|
||||
TYPE_ARM_L2X0)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(L2x0State, ARM_L2X0)
|
||||
|
||||
struct L2x0State {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
|
@ -23,9 +23,7 @@
|
|||
#define LOCK_VALUE 0xa05f
|
||||
|
||||
#define TYPE_ARM_SYSCTL "realview_sysctl"
|
||||
typedef struct arm_sysctl_state arm_sysctl_state;
|
||||
DECLARE_INSTANCE_CHECKER(arm_sysctl_state, ARM_SYSCTL,
|
||||
TYPE_ARM_SYSCTL)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(arm_sysctl_state, ARM_SYSCTL)
|
||||
|
||||
struct arm_sysctl_state {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_ISA_DEBUG_EXIT_DEVICE "isa-debug-exit"
|
||||
typedef struct ISADebugExitState ISADebugExitState;
|
||||
DECLARE_INSTANCE_CHECKER(ISADebugExitState, ISA_DEBUG_EXIT_DEVICE,
|
||||
TYPE_ISA_DEBUG_EXIT_DEVICE)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(ISADebugExitState, ISA_DEBUG_EXIT_DEVICE)
|
||||
|
||||
struct ISADebugExitState {
|
||||
ISADevice parent_obj;
|
||||
|
|
|
@ -127,9 +127,7 @@
|
|||
#define ECC_DIAG_MASK (ECC_DIAG_SIZE - 1)
|
||||
|
||||
#define TYPE_ECC_MEMCTL "eccmemctl"
|
||||
typedef struct ECCState ECCState;
|
||||
DECLARE_INSTANCE_CHECKER(ECCState, ECC_MEMCTL,
|
||||
TYPE_ECC_MEMCTL)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(ECCState, ECC_MEMCTL)
|
||||
|
||||
struct ECCState {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_EMPTY_SLOT "empty_slot"
|
||||
typedef struct EmptySlot EmptySlot;
|
||||
DECLARE_INSTANCE_CHECKER(EmptySlot, EMPTY_SLOT,
|
||||
TYPE_EMPTY_SLOT)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(EmptySlot, EMPTY_SLOT)
|
||||
|
||||
struct EmptySlot {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
|
@ -25,9 +25,7 @@
|
|||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_EXYNOS4210_CLK "exynos4210.clk"
|
||||
typedef struct Exynos4210ClkState Exynos4210ClkState;
|
||||
DECLARE_INSTANCE_CHECKER(Exynos4210ClkState, EXYNOS4210_CLK,
|
||||
TYPE_EXYNOS4210_CLK)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210ClkState, EXYNOS4210_CLK)
|
||||
|
||||
#define CLK_PLL_LOCKED BIT(29)
|
||||
|
||||
|
|
|
@ -395,9 +395,7 @@ static const Exynos4210PmuReg exynos4210_pmu_regs[] = {
|
|||
#define PMU_NUM_OF_REGISTERS ARRAY_SIZE(exynos4210_pmu_regs)
|
||||
|
||||
#define TYPE_EXYNOS4210_PMU "exynos4210.pmu"
|
||||
typedef struct Exynos4210PmuState Exynos4210PmuState;
|
||||
DECLARE_INSTANCE_CHECKER(Exynos4210PmuState, EXYNOS4210_PMU,
|
||||
TYPE_EXYNOS4210_PMU)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210PmuState, EXYNOS4210_PMU)
|
||||
|
||||
struct Exynos4210PmuState {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
|
@ -36,9 +36,7 @@
|
|||
} while (0)
|
||||
|
||||
#define TYPE_EXYNOS4210_RNG "exynos4210.rng"
|
||||
typedef struct Exynos4210RngState Exynos4210RngState;
|
||||
DECLARE_INSTANCE_CHECKER(Exynos4210RngState, EXYNOS4210_RNG,
|
||||
TYPE_EXYNOS4210_RNG)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(Exynos4210RngState, EXYNOS4210_RNG)
|
||||
|
||||
/*
|
||||
* Exynos4220, PRNG, only polling mode is supported.
|
||||
|
|
|
@ -44,9 +44,7 @@ enum {
|
|||
};
|
||||
|
||||
#define TYPE_MILKYMIST_HPDMC "milkymist-hpdmc"
|
||||
typedef struct MilkymistHpdmcState MilkymistHpdmcState;
|
||||
DECLARE_INSTANCE_CHECKER(MilkymistHpdmcState, MILKYMIST_HPDMC,
|
||||
TYPE_MILKYMIST_HPDMC)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(MilkymistHpdmcState, MILKYMIST_HPDMC)
|
||||
|
||||
struct MilkymistHpdmcState {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
|
@ -121,9 +121,7 @@ static const char *opcode_to_str[] = {
|
|||
#endif
|
||||
|
||||
#define TYPE_MILKYMIST_PFPU "milkymist-pfpu"
|
||||
typedef struct MilkymistPFPUState MilkymistPFPUState;
|
||||
DECLARE_INSTANCE_CHECKER(MilkymistPFPUState, MILKYMIST_PFPU,
|
||||
TYPE_MILKYMIST_PFPU)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(MilkymistPFPUState, MILKYMIST_PFPU)
|
||||
|
||||
struct MilkymistPFPUState {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
|
@ -41,9 +41,7 @@
|
|||
#define MST_PCMCIA_CD1_IRQ 13
|
||||
|
||||
#define TYPE_MAINSTONE_FPGA "mainstone-fpga"
|
||||
typedef struct mst_irq_state mst_irq_state;
|
||||
DECLARE_INSTANCE_CHECKER(mst_irq_state, MAINSTONE_FPGA,
|
||||
TYPE_MAINSTONE_FPGA)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(mst_irq_state, MAINSTONE_FPGA)
|
||||
|
||||
struct mst_irq_state {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
|
@ -54,11 +54,9 @@ struct PCTestdev {
|
|||
uint32_t ioport_data;
|
||||
char iomem_buf[IOMEM_LEN];
|
||||
};
|
||||
typedef struct PCTestdev PCTestdev;
|
||||
|
||||
#define TYPE_TESTDEV "pc-testdev"
|
||||
DECLARE_INSTANCE_CHECKER(PCTestdev, TESTDEV,
|
||||
TYPE_TESTDEV)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(PCTestdev, TESTDEV)
|
||||
|
||||
static uint64_t test_irq_line_read(void *opaque, hwaddr addr, unsigned size)
|
||||
{
|
||||
|
|
|
@ -92,12 +92,10 @@ struct PCITestDevState {
|
|||
uint64_t membar_size;
|
||||
MemoryRegion membar;
|
||||
};
|
||||
typedef struct PCITestDevState PCITestDevState;
|
||||
|
||||
#define TYPE_PCI_TEST_DEV "pci-testdev"
|
||||
|
||||
DECLARE_INSTANCE_CHECKER(PCITestDevState, PCI_TEST_DEV,
|
||||
TYPE_PCI_TEST_DEV)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(PCITestDevState, 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)
|
||||
|
|
|
@ -19,9 +19,7 @@
|
|||
#include "qemu/log.h"
|
||||
|
||||
#define TYPE_PUV3_PM "puv3_pm"
|
||||
typedef struct PUV3PMState PUV3PMState;
|
||||
DECLARE_INSTANCE_CHECKER(PUV3PMState, PUV3_PM,
|
||||
TYPE_PUV3_PM)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(PUV3PMState, PUV3_PM)
|
||||
|
||||
struct PUV3PMState {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
|
@ -34,9 +34,7 @@
|
|||
#define SGABIOS_FILENAME "sgabios.bin"
|
||||
|
||||
#define TYPE_SGA "sga"
|
||||
typedef struct ISASGAState ISASGAState;
|
||||
DECLARE_INSTANCE_CHECKER(ISASGAState, SGA,
|
||||
TYPE_SGA)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(ISASGAState, SGA)
|
||||
|
||||
struct ISASGAState {
|
||||
ISADevice parent_obj;
|
||||
|
|
|
@ -40,9 +40,7 @@
|
|||
*/
|
||||
|
||||
#define TYPE_SLAVIO_MISC "slavio_misc"
|
||||
typedef struct MiscState MiscState;
|
||||
DECLARE_INSTANCE_CHECKER(MiscState, SLAVIO_MISC,
|
||||
TYPE_SLAVIO_MISC)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(MiscState, SLAVIO_MISC)
|
||||
|
||||
struct MiscState {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
|
@ -19,9 +19,7 @@
|
|||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_TMP105 "tmp105"
|
||||
typedef struct TMP105State TMP105State;
|
||||
DECLARE_INSTANCE_CHECKER(TMP105State, TMP105,
|
||||
TYPE_TMP105)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(TMP105State, TMP105)
|
||||
|
||||
/**
|
||||
* TMP105State:
|
||||
|
|
|
@ -183,9 +183,7 @@ REG32(DDRIOB, 0xb40)
|
|||
#define ZYNQ_SLCR_NUM_REGS (ZYNQ_SLCR_MMIO_SIZE / 4)
|
||||
|
||||
#define TYPE_ZYNQ_SLCR "xilinx,zynq_slcr"
|
||||
typedef struct ZynqSLCRState ZynqSLCRState;
|
||||
DECLARE_INSTANCE_CHECKER(ZynqSLCRState, ZYNQ_SLCR,
|
||||
TYPE_ZYNQ_SLCR)
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(ZynqSLCRState, ZYNQ_SLCR)
|
||||
|
||||
struct ZynqSLCRState {
|
||||
SysBusDevice parent_obj;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue