qom: Get rid of all manual usage of OBJECT_CHECK & friends
Subsystems (8)
cover qom: Get rid of all manual usage of OBJECT_CHECK & friends
This series gets rid of all manual usage of OBJECT_CHECK, OBJECT_CLASS_CHECK, and OBJECT_GET_CLASS.
All type check macros defined manually are replaced with DEFINE_*CHECKER* or OBJECT_DECLARE* macros.
All manual usage of OBJECT_CHECK/OBJECT_CLASS_CHECK/OBJECT_GET_CLASS is manually replaced with the corresponding type-specific wrappers.
For a git tree containing all dependencies, see:
https://gitlab.com/ehabkost/qemu.git work/qom-automated-declare-type-pass2
This series is based on multiple other series I have submitted recently, including:
Date: Thu, 5 Aug 2021 15:34:25 -0400
Subject: [PATCH for-6.2 0/6] qom: Fix broken OBJECT_CHECK usage
Message-Id: <[email protected]>
https://lore.kernel.org/qemu-devel/[email protected]
Date: Thu, 5 Aug 2021 17:47:39 -0400
Subject: [PATCH] bcm2836: Remove redundant typedef and macros
Message-Id: <[email protected]>
https://lore.kernel.org/qemu-devel/[email protected]
Date: Thu, 5 Aug 2021 22:31:19 -0400
Subject: [PATCH for-6.2] sbsa-ref: Rename SBSA_GWDT enum value
Message-Id: <[email protected]>
https://lore.kernel.org/qemu-devel/[email protected]
Based-on: <[email protected]>
Based-on: <[email protected]>
Based-on: <[email protected]>
Eduardo Habkost (12):
accel: Rename TYPE_ACCEL to TYPE_ACCEL_BASE
qom: Use DEVICE_*CLASS instead of OBJECT_*CLASS scripts/codeconverter: Update to latest version [automated] Add struct names to typedefs used by QOM types [automated] Move QOM typedefs and add missing includes [automated] Split QOM "typedef struct T { ... } T" declarations [automated] Use DECLARE_*CHECKER* macros when possible
npcm7xx_clk: Use DECLARE_INSTANCE_CHECKER
npcm7xx_otp: Use DECLARE_CLASS_CHECKERS
[automated] Use DECLARE_OBJ_CHECKERS when possible [automated] Use OBJECT_DECLARE_TYPE when possible [automated] Use OBJECT_DECLARE_SIMPLE_TYPE when possible
hw/core/machine.c | 2 +- hw/nvme/nvme.h | 24 +- hw/usb/hcd-uhci.h | 6 +- hw/usb/hcd-xhci-pci.h | 8 +- hw/usb/hcd-xhci-sysbus.h | 8 +- hw/usb/u2f.h | 17 +- include/crypto/tlscreds.h | 5 +- include/hw/acpi/acpi_dev_interface.h | 2 +- include/hw/adc/npcm7xx_adc.h | 8 +- include/hw/arm/linux-boot-if.h | 2 +- include/hw/arm/npcm7xx.h | 36 ++- include/hw/char/shakti_uart.h | 8 +- include/hw/core/accel-cpu.h | 6 +- include/hw/dma/sifive_pdma.h | 8 +- include/hw/dma/xlnx_csu_dma.h | 8 +- include/hw/fw-path-provider.h | 2 +- include/hw/gpio/npcm7xx_gpio.h | 10 +- include/hw/gpio/sifive_gpio.h | 4 +- include/hw/hotplug.h | 2 +- include/hw/i2c/npcm7xx_smbus.h | 10 +- include/hw/intc/intc.h | 2 +- include/hw/intc/m68k_irqc.h | 8 +- include/hw/intc/sifive_clint.h | 8 +- include/hw/intc/sifive_plic.h | 4 +- include/hw/ipmi/ipmi.h | 2 +- include/hw/mem/memory-device.h | 2 +- include/hw/mem/npcm7xx_mc.h | 9 +- include/hw/misc/aspeed_lpc.h | 7 +- include/hw/misc/bcm2835_cprman.h | 21 +- include/hw/misc/bcm2835_cprman_internals.h | 13 +- include/hw/misc/led.h | 3 +- include/hw/misc/mchp_pfsoc_dmc.h | 17 +- include/hw/misc/mchp_pfsoc_ioscb.h | 8 +- include/hw/misc/mchp_pfsoc_sysreg.h | 9 +- include/hw/misc/npcm7xx_clk.h | 18 +- include/hw/misc/npcm7xx_gcr.h | 7 +- include/hw/misc/npcm7xx_mft.h | 7 +- include/hw/misc/npcm7xx_pwm.h | 4 +- include/hw/misc/npcm7xx_rng.h | 9 +- include/hw/misc/sifive_e_prci.h | 4 +- include/hw/misc/sifive_test.h | 4 +- include/hw/misc/sifive_u_otp.h | 4 +- include/hw/misc/sifive_u_prci.h | 4 +- include/hw/misc/xlnx-versal-xramc.h | 8 +- include/hw/net/npcm7xx_emc.h | 5 +- include/hw/net/xlnx-zynqmp-can.h | 8 +- include/hw/nmi.h | 2 +- include/hw/nvram/npcm7xx_otp.h | 12 +- include/hw/ppc/spapr_drc.h | 23 +- include/hw/ppc/spapr_xive.h | 15 +- include/hw/ppc/vof.h | 1 + include/hw/rdma/rdma.h | 2 +- include/hw/register.h | 3 +- include/hw/riscv/microchip_pfsoc.h | 18 +- include/hw/riscv/shakti_c.h | 15 +- include/hw/riscv/sifive_e.h | 17 +- include/hw/riscv/sifive_u.h | 17 +- include/hw/rtc/m48t59.h | 2 +- include/hw/sd/cadence_sdhci.h | 8 +- include/hw/ssi/npcm7xx_fiu.h | 4 +- include/hw/ssi/sifive_spi.h | 7 +- include/hw/stream.h | 2 +- include/hw/timer/npcm7xx_timer.h | 4 +- include/hw/tricore/tricore_testdevice.h | 8 +- include/hw/usb/hcd-dwc3.h | 8 +- include/hw/usb/msd.h | 1 + include/hw/usb/xlnx-usb-subsystem.h | 10 +- include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 8 +- include/hw/vmstate-if.h | 2 +- include/hw/watchdog/sbsa_gwdt.h | 10 +- include/qemu/accel.h | 20 +- include/qom/object_interfaces.h | 2 +- include/sysemu/tpm.h | 2 +- target/arm/idau.h | 2 +- target/hexagon/cpu.h | 19 +- accel/accel-common.c | 4 +- accel/accel-softmmu.c | 4 +- accel/accel-user.c | 2 +- accel/hvf/hvf-accel-ops.c | 4 +- accel/kvm/kvm-all.c | 4 +- accel/qtest/qtest.c | 4 +- accel/tcg/tcg-all.c | 5 +- accel/xen/xen-all.c | 4 +- bsd-user/main.c | 2 +- chardev/char-parallel.c | 17 +- hw/arm/bcm2836.c | 1 + hw/block/fdc-sysbus.c | 5 +- hw/i2c/i2c_mux_pca954x.c | 9 +- hw/m68k/mcf5206.c | 7 +- hw/mem/sparse-mem.c | 9 +- hw/mips/boston.c | 4 +- hw/mips/loongson3_virt.c | 1 + hw/misc/npcm7xx_clk.c | 10 +- hw/misc/sbsa_ec.c | 9 +- hw/net/can/ctucan_pci.c | 5 +- hw/nvram/npcm7xx_otp.c | 6 +- hw/pci/pci.c | 3 +- hw/s390x/vhost-user-fs-ccw.c | 8 +- hw/sensor/adm1272.c | 7 +- hw/sensor/max34451.c | 7 +- hw/usb/hcd-ehci-pci.c | 2 +- hw/usb/u2f-emulated.c | 5 +- hw/usb/u2f-passthru.c | 5 +- hw/virtio/vhost-user-i2c-pci.c | 1 + linux-user/main.c | 2 +- migration/savevm.c | 3 +- monitor/misc.c | 3 +- .../codeconverter/codeconverter/patching.py | 18 +- .../codeconverter/codeconverter/qom_macros.py | 187 +++++++++++-- .../codeconverter/qom_type_info.py | 247 +++++++++++++++++- .../codeconverter/codeconverter/regexps.py | 3 +- softmmu/memory.c | 2 +- softmmu/qdev-monitor.c | 3 +- softmmu/vl.c | 6 +- target/i386/hax/hax-all.c | 4 +- target/i386/nvmm/nvmm-all.c | 4 +- target/i386/whpx/whpx-all.c | 4 +- tests/qtest/pnv-xscom-test.c | 5 +- tests/unit/check-qom-interface.c | 2 +- ui/vdagent.c | 1 + 120 files changed, 805 insertions(+), 458 deletions(-)
Signature · 1 line
2.31.1
PATCH 1/12 accel: Rename TYPE_ACCEL to TYPE_ACCEL_BASE
The ACCEL name conflicts with a Windows API typedef name, and it is difficult to work around this because windows.h needs to be included by osdep.h. This prevents us from replacing the existing ACCEL macro with an inline function generated by OBJECT_DEFINE_TYPE.
Work around the conflict by renaming TYPE_ACCEL to TYPE_ACCEL_BASE.
Note that the actual QOM type name is still "accel", because QOM type names are user-visible and I don't want to make any user-visible change here.
---
Notes about name alternatives:
I have considered using the name "CPU_ACCEL" as Daniel suggested, but this would lead to a parent class named CPU_ACCEL, while the subclasses would be still named KVM_ACCEL, HVF_ACCEL, TCG_ACCEL, etc. I that this would be confusing, because it would look like CPU_ACCEL is just another type of accel, not the parent type of all other *_ACCEL types.
Renaming KVM_ACCEL/HVF_ACCEL/TCG_ACCEL to KVM_CPU_ACCEL/HVF_CPU_ACCEL/TCG_CPU_ACCEL would be clearer, but I believe it would be too intrusive and the resulting type names would be too long.
Renaming the base classe ACCEL_BASE sounds like a reasonable alternative, as there are other examples in QEMU where abstract base classes are called *_BASE: TYPE_VIRTIO_GPU_PCI_BASE, TYPE_VIRTIO_GPU_BASE, TYPE_E1000_BASE, TYPE_RISCV_CPU_BASE, TYPE_MEGASAS_BASE, TYPE_SCSI_DISK_BASE, etc.
---
Cc: Richard Henderson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Cameron Esfahani <[email protected]>
Cc: Roman Bolshakov <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>
Cc: Paul Durrant <[email protected]>
Cc: Warner Losh <[email protected]>
Cc: Kyle Evans <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: Marcel Apfelbaum <[email protected]>
Cc: Peter Xu <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Wenchao Wang <[email protected]>
Cc: Colin Xu <[email protected]>
Cc: Kamil Rytarowski <[email protected]>
Cc: Reinoud Zandijk <[email protected]>
Cc: Sunil Muthuswamy <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- hw/core/machine.c | 2 +- include/qemu/accel.h | 16 ++++++++-------- accel/accel-common.c | 4 ++-- accel/accel-softmmu.c | 4 ++-- accel/accel-user.c | 2 +- accel/hvf/hvf-accel-ops.c | 4 ++-- accel/kvm/kvm-all.c | 4 ++-- accel/qtest/qtest.c | 4 ++-- accel/tcg/tcg-all.c | 4 ++-- accel/xen/xen-all.c | 4 ++-- bsd-user/main.c | 2 +- linux-user/main.c | 2 +- softmmu/memory.c | 2 +- softmmu/vl.c | 6 +++--- target/i386/hax/hax-all.c | 4 ++-- target/i386/nvmm/nvmm-all.c | 4 ++-- target/i386/whpx/whpx-all.c | 4 ++-- 17 files changed, 36 insertions(+), 36 deletions(-)
hw/core/machine.c +1 -1
@@ -1268,7 +1268,7 @@ void machine_run_board_init(MachineState *machine) "on", false); } -accel_init_interfaces (ACCEL_GET_CLASS (machine->accelerator)); +accel_init_interfaces (ACCEL_BASE_GET_CLASS (machine->accelerator)); machine_class->init (machine);phase_advance (PHASE_MACHINE_INITIALIZED ); }
include/qemu/accel.h +8 -8
@@ -54,17 +54,17 @@ typedef struct AccelClass {GPtrArray *compat_props; } AccelClass; -#define TYPE_ACCEL "accel" +#define TYPE_ACCEL_BASE "accel" -#define ACCEL_CLASS_SUFFIX "-" TYPE_ACCEL +#define ACCEL_CLASS_SUFFIX "-" TYPE_ACCEL_BASE#define ACCEL_CLASS_NAME (a) (a ACCEL_CLASS_SUFFIX) -#define ACCEL_CLASS (klass) \ - OBJECT_CLASS_CHECK(AccelClass, (klass), TYPE_ACCEL) -#define ACCEL (obj) \ - OBJECT_CHECK(AccelState, (obj), TYPE_ACCEL) -#define ACCEL_GET_CLASS (obj) \ - OBJECT_GET_CLASS(AccelClass, (obj), TYPE_ACCEL) +#define ACCEL_BASE_CLASS (klass) \ + OBJECT_CLASS_CHECK(AccelClass, (klass), TYPE_ACCEL_BASE) +#define ACCEL_BASE (obj) \ + OBJECT_CHECK(AccelState, (obj), TYPE_ACCEL_BASE) +#define ACCEL_BASE_GET_CLASS (obj) \ + OBJECT_GET_CLASS(AccelClass, (obj), TYPE_ACCEL_BASE)AccelClass *accel_find (const char *opt_name);AccelState *current_accel (void );
accel/accel-common.c +2 -2
@@ -34,7 +34,7 @@#endif /* !CONFIG_USER_ONLY */ static const TypeInfo accel_type = { - .name =TYPE_ACCEL , + .name =TYPE_ACCEL_BASE , .parent =TYPE_OBJECT , .class_size =sizeof (AccelClass), .instance_size =sizeof (AccelState),
@@ -44,7 +44,7 @@ static const TypeInfo accel_type = {AccelClass *accel_find (const char *opt_name) {char *class_name =g_strdup_printf (ACCEL_CLASS_NAME ("%s" ), opt_name); -AccelClass *ac =ACCEL_CLASS (module_object_class_by_name (class_name)); +AccelClass *ac =ACCEL_BASE_CLASS (module_object_class_by_name (class_name));g_free (class_name);return ac; }
accel/accel-softmmu.c +2 -2
@@ -32,7 +32,7 @@int accel_init_machine (AccelState *accel,MachineState *ms) { -AccelClass *acc =ACCEL_GET_CLASS (accel); +AccelClass *acc =ACCEL_BASE_GET_CLASS (accel);int ret; ms->accelerator = accel; *(acc->allowed) = true;
@@ -55,7 +55,7 @@ AccelState *current_accel(void)void accel_setup_post (MachineState *ms) {AccelState *accel = ms->accelerator; -AccelClass *acc =ACCEL_GET_CLASS (accel); +AccelClass *acc =ACCEL_BASE_GET_CLASS (accel);if (acc->setup_post) { acc->setup_post (ms, accel); }
accel/accel-user.c +1 -1
@@ -18,7 +18,7 @@ AccelState *current_accel(void)AccelClass *ac =accel_find ("tcg" );g_assert (ac !=NULL ); - accel =ACCEL (object_new_with_class (OBJECT_CLASS (ac))); + accel =ACCEL_BASE (object_new_with_class (OBJECT_CLASS (ac))); }return accel; }
accel/hvf/hvf-accel-ops.c +2 -2
@@ -329,7 +329,7 @@ static int hvf_accel_init(MachineState *ms)static void hvf_accel_class_init (ObjectClass *oc,void *data) { -AccelClass *ac =ACCEL_CLASS (oc); +AccelClass *ac =ACCEL_BASE_CLASS (oc); ac->name ="HVF" ; ac->init_machine = hvf_accel_init; ac->allowed = &hvf_allowed;
@@ -337,7 +337,7 @@ static void hvf_accel_class_init(ObjectClass *oc, void *data)static const TypeInfo hvf_accel_type = { .name =TYPE_HVF_ACCEL , - .parent =TYPE_ACCEL , + .parent =TYPE_ACCEL_BASE , .class_init = hvf_accel_class_init, };
accel/kvm/kvm-all.c +2 -2
@@ -3618,7 +3618,7 @@ static void kvm_accel_instance_init(Object *obj)static void kvm_accel_class_init (ObjectClass *oc,void *data) { -AccelClass *ac =ACCEL_CLASS (oc); +AccelClass *ac =ACCEL_BASE_CLASS (oc); ac->name ="KVM" ; ac->init_machine = kvm_init; ac->has_memory = kvm_accel_has_memory;
@@ -3645,7 +3645,7 @@ static void kvm_accel_class_init(ObjectClass *oc, void *data)static const TypeInfo kvm_accel_type = { .name =TYPE_KVM_ACCEL , - .parent =TYPE_ACCEL , + .parent =TYPE_ACCEL_BASE , .instance_init = kvm_accel_instance_init, .class_init = kvm_accel_class_init, .instance_size =sizeof (KVMState),
accel/qtest/qtest.c +2 -2
@@ -32,7 +32,7 @@ static int qtest_init_accel(MachineState *ms)static void qtest_accel_class_init (ObjectClass *oc,void *data) { -AccelClass *ac =ACCEL_CLASS (oc); +AccelClass *ac =ACCEL_BASE_CLASS (oc); ac->name ="QTest" ; ac->init_machine = qtest_init_accel; ac->allowed = &qtest_allowed;
@@ -42,7 +42,7 @@ static void qtest_accel_class_init(ObjectClass *oc, void *data)static const TypeInfo qtest_accel_type = { .name =TYPE_QTEST_ACCEL , - .parent =TYPE_ACCEL , + .parent =TYPE_ACCEL_BASE , .class_init = qtest_accel_class_init, };module_obj (TYPE_QTEST_ACCEL );
accel/tcg/tcg-all.c +2 -2
@@ -210,7 +210,7 @@ static void tcg_set_splitwx(Object *obj, bool value, Error **errp)static void tcg_accel_class_init (ObjectClass *oc,void *data) { -AccelClass *ac =ACCEL_CLASS (oc); +AccelClass *ac =ACCEL_BASE_CLASS (oc); ac->name ="tcg" ; ac->init_machine = tcg_init_machine; ac->allowed = &tcg_allowed;
@@ -233,7 +233,7 @@ static void tcg_accel_class_init(ObjectClass *oc, void *data)static const TypeInfo tcg_accel_type = { .name =TYPE_TCG_ACCEL , - .parent =TYPE_ACCEL , + .parent =TYPE_ACCEL_BASE , .instance_init = tcg_accel_instance_init, .class_init = tcg_accel_class_init, .instance_size =sizeof (TCGState),
accel/xen/xen-all.c +2 -2
@@ -186,7 +186,7 @@ static int xen_init(MachineState *ms)static void xen_accel_class_init (ObjectClass *oc,void *data) { -AccelClass *ac =ACCEL_CLASS (oc); +AccelClass *ac =ACCEL_BASE_CLASS (oc);static GlobalProperty compat[] = { {"migration" ,"store-global-state" ,"off" }, {"migration" ,"send-configuration" ,"off" },
@@ -211,7 +211,7 @@ static void xen_accel_class_init(ObjectClass *oc, void *data)static const TypeInfo xen_accel_type = { .name =TYPE_XEN_ACCEL , - .parent =TYPE_ACCEL , + .parent =TYPE_ACCEL_BASE , .class_init = xen_accel_class_init, };
bsd-user/main.c +1 -1
@@ -793,7 +793,7 @@ int main(int argc, char **argv) cpu_type =parse_cpu_option (cpu_model);/* init tcg before creating CPUs and to get qemu_host_page_size */ { -AccelClass *ac =ACCEL_GET_CLASS (current_accel ()); +AccelClass *ac =ACCEL_BASE_GET_CLASS (current_accel ());accel_init_interfaces (ac); ac->init_machine (NULL );
linux-user/main.c +1 -1
@@ -723,7 +723,7 @@ int main(int argc, char **argv, char **envp)/* init tcg before creating CPUs and to get qemu_host_page_size */ { -AccelClass *ac =ACCEL_GET_CLASS (current_accel ()); +AccelClass *ac =ACCEL_BASE_GET_CLASS (current_accel ());accel_init_interfaces (ac); ac->init_machine (NULL );
softmmu/memory.c +1 -1
@@ -3261,7 +3261,7 @@ void mtree_info(bool flatview, bool dispatch_tree, bool owner, bool disabled) };GArray *fv_address_spaces;GHashTable *views =g_hash_table_new (g_direct_hash, g_direct_equal); -AccelClass *ac =ACCEL_GET_CLASS (current_accel ()); +AccelClass *ac =ACCEL_BASE_GET_CLASS (current_accel ());if (ac->has_memory) { fvi.ac = ac;
softmmu/vl.c +3 -3
@@ -2305,7 +2305,7 @@ static int do_configure_accelerator(void *opaque, QemuOpts *opts, Error **errp) }return 0 ; } - accel =ACCEL (object_new_with_class (OBJECT_CLASS (ac))); + accel =ACCEL_BASE (object_new_with_class (OBJECT_CLASS (ac)));object_apply_compat_props (OBJECT (accel)); qemu_opt_foreach(opts, accelerator_set_property, accel,
@@ -2386,7 +2386,7 @@ static void configure_accelerators(const char *progname) }if (init_failed && !qtest_chrdev) { -AccelClass *ac =ACCEL_GET_CLASS (current_accel ()); +AccelClass *ac =ACCEL_BASE_GET_CLASS (current_accel ());error_report ("falling back to %s" , ac->name); }
@@ -3315,7 +3315,7 @@ void qemu_init(int argc, char **argv, char **envp) optarg =qemu_opt_get (accel_opts,"accel" );if (!optarg ||is_help_option (optarg)) {printf ("Accelerators supported in QEMU binary:\n" ); -GSList *el, *accel_list =object_class_get_list (TYPE_ACCEL , +GSList *el, *accel_list =object_class_get_list (TYPE_ACCEL_BASE , false);for (el = accel_list; el; el = el->next) { gchar *typename = g_strdup(object_class_get_name(
target/i386/hax/hax-all.c +2 -2
@@ -1120,7 +1120,7 @@ void hax_reset_vcpu_state(void *opaque)static void hax_accel_class_init (ObjectClass *oc,void *data) { -AccelClass *ac =ACCEL_CLASS (oc); +AccelClass *ac =ACCEL_BASE_CLASS (oc); ac->name ="HAX" ; ac->init_machine = hax_accel_init; ac->allowed = &hax_allowed;
@@ -1128,7 +1128,7 @@ static void hax_accel_class_init(ObjectClass *oc, void *data)static const TypeInfo hax_accel_type = { .name =ACCEL_CLASS_NAME ("hax" ), - .parent =TYPE_ACCEL , + .parent =TYPE_ACCEL_BASE , .class_init = hax_accel_class_init, };
target/i386/nvmm/nvmm-all.c +2 -2
@@ -1205,7 +1205,7 @@ nvmm_enabled(void)static void nvmm_accel_class_init (ObjectClass *oc,void *data) { -AccelClass *ac =ACCEL_CLASS (oc); +AccelClass *ac =ACCEL_BASE_CLASS (oc); ac->name ="NVMM" ; ac->init_machine = nvmm_accel_init; ac->allowed = &nvmm_allowed;
@@ -1213,7 +1213,7 @@ nvmm_accel_class_init(ObjectClass *oc, void *data)static const TypeInfo nvmm_accel_type = { .name =ACCEL_CLASS_NAME ("nvmm" ), - .parent =TYPE_ACCEL , + .parent =TYPE_ACCEL_BASE , .class_init = nvmm_accel_class_init, };
target/i386/whpx/whpx-all.c +2 -2
@@ -1873,7 +1873,7 @@ bool whpx_apic_in_platform(void) {static void whpx_accel_class_init (ObjectClass *oc,void *data) { -AccelClass *ac =ACCEL_CLASS (oc); +AccelClass *ac =ACCEL_BASE_CLASS (oc); ac->name ="WHPX" ; ac->init_machine = whpx_accel_init; ac->allowed = &whpx_allowed;
@@ -1896,7 +1896,7 @@ static void whpx_accel_instance_init(Object *obj)static const TypeInfo whpx_accel_type = { .name =ACCEL_CLASS_NAME ("whpx" ), - .parent =TYPE_ACCEL , + .parent =TYPE_ACCEL_BASE , .instance_init = whpx_accel_instance_init, .class_init = whpx_accel_class_init, };
Signature · 1 line
2.31.1
PATCH 2/12 qom: Use DEVICE_*CLASS instead of OBJECT_*CLASS
In reply to Eduardo HabkostThere are multiple functions where OBJECT_GET_CLASS or OBJECT_CLASS_CHECK are being used directly for DeviceClass/TYPE_DEVICE, instead of the DEVICE_GET_CLASS or DEVICE_CLASS wrappers. There's no reason to not use the wrappers, so use them.
---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Marcel Apfelbaum <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Juan Quintela <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: Markus Armbruster <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: [email protected]
--- hw/pci/pci.c | 3 +-- hw/usb/hcd-ehci-pci.c | 2 +- migration/savevm.c | 3 +-- monitor/misc.c | 3 +-- softmmu/qdev-monitor.c | 3 +-- 5 files changed, 5 insertions(+), 9 deletions(-)
hw/pci/pci.c +1 -2
@@ -1915,8 +1915,7 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus, list =object_class_get_list_sorted (TYPE_PCI_DEVICE , false); pci_nic_models =g_ptr_array_new ();while (list) { -DeviceClass *dc =OBJECT_CLASS_CHECK (DeviceClass, list->data, -TYPE_DEVICE ); +DeviceClass *dc =DEVICE_CLASS (list->data);GSList *next;if (test_bit (DEVICE_CATEGORY_NETWORK , dc->categories) && dc->user_creatable) {
hw/usb/hcd-ehci-pci.c +1 -1
@@ -74,7 +74,7 @@ static void usb_ehci_pci_realize(PCIDevice *dev, Error **errp)static void usb_ehci_pci_init (Object *obj) { -DeviceClass *dc =OBJECT_GET_CLASS (DeviceClass, obj,TYPE_DEVICE ); +DeviceClass *dc =DEVICE_GET_CLASS (obj);EHCIPCIState *i =PCI_EHCI (obj);EHCIState *s = &i->ehci;
migration/savevm.c +1 -2
@@ -663,8 +663,7 @@ void dump_vmstate_json_to_file(FILE *out_file) first = true; list =object_class_get_list (TYPE_DEVICE , true);for (elt = list; elt; elt = elt->next) { -DeviceClass *dc =OBJECT_CLASS_CHECK (DeviceClass, elt->data, -TYPE_DEVICE ); +DeviceClass *dc =DEVICE_CLASS (elt->data);const char *name;int indent =2 ;
monitor/misc.c +1 -2
@@ -1549,8 +1549,7 @@ void device_add_completion(ReadLineState *rs, int nb_args, const char *str) list = elt =object_class_get_list (TYPE_DEVICE , false);while (elt) {const char *name; -DeviceClass *dc =OBJECT_CLASS_CHECK (DeviceClass, elt->data, -TYPE_DEVICE ); +DeviceClass *dc =DEVICE_CLASS (elt->data); name =object_class_get_name (OBJECT_CLASS (dc)); if (dc->user_creatable
softmmu/qdev-monitor.c +1 -2
@@ -165,8 +165,7 @@ static void qdev_print_devinfos(bool show_no_user)for (i =0 ; i <=DEVICE_CATEGORY_MAX ; i++) { cat_printed = false;for (elt = list; elt; elt = elt->next) { -DeviceClass *dc =OBJECT_CLASS_CHECK (DeviceClass, elt->data, -TYPE_DEVICE ); +DeviceClass *dc =DEVICE_CLASS (elt->data);if ((i <DEVICE_CATEGORY_MAX ? !test_bit (i, dc->categories) : !bitmap_empty(dc->categories, DEVICE_CATEGORY_MAX))
Signature · 1 line
2.31.1
Re: [PATCH for-6.2 02/12] qom: Use DEVICE_*CLASS instead of OBJECT_*CLASS
Quoted 18 lines · Eduardo Habkost
There are multiple functions where
OBJECT_GET_CLASSorOBJECT_CLASS_CHECKare being used directly for DeviceClass/TYPE_DEVICE, instead of theDEVICE_GET_CLASSorDEVICE_CLASSwrappers. There's no reason to not use the wrappers, so use them.Signed-off-by Eduardo Habkost <[email protected]>---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Marcel Apfelbaum <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Juan Quintela <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: Markus Armbruster <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: [email protected]
Quoted 7 lines
--- hw/pci/pci.c | 3 +-- hw/usb/hcd-ehci-pci.c | 2 +- migration/savevm.c | 3 +-- monitor/misc.c | 3 +-- softmmu/qdev-monitor.c | 3 +-- 5 files changed, 5 insertions(+), 9 deletions(-)
Re: [PATCH for-6.2 02/12] qom: Use DEVICE_*CLASS instead of OBJECT_*CLASS
In reply to Eduardo HabkostQuoted 7 lines · Eduardo Habkost
There are multiple functions where
OBJECT_GET_CLASSorOBJECT_CLASS_CHECKare being used directly for DeviceClass/TYPE_DEVICE, instead of theDEVICE_GET_CLASSorDEVICE_CLASSwrappers. There's no reason to not use the wrappers, so use them.Signed-off-by Eduardo Habkost <[email protected]>
hw/pci/pci.c PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus, · line 1918
Quoted 3 lines
hw/pci/pci.c +1
-2-DeviceClass *dc =OBJECT_CLASS_CHECK (DeviceClass, list->data, -TYPE_DEVICE ); +DeviceClass *dc =DEVICE_CLASS (list->data);
Finding where DEVICE_CLASS is defined is .... interesting.
Re: [PATCH for-6.2 02/12] qom: Use DEVICE_*CLASS instead of OBJECT_*CLASS
Quoted 5 lines · Juan Quintela
hw/pci/pci.c PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus, · line 1918
Quoted 3 lines
hw/pci/pci.c +1
-2-DeviceClass *dc =OBJECT_CLASS_CHECK (DeviceClass, list->data, -TYPE_DEVICE ); +DeviceClass *dc =DEVICE_CLASS (list->data);Finding where
DEVICE_CLASSis defined is .... interesting.
That's a valid concern, but I wonder what we can do to address this. The existing practice of defining all macros manually leads to a high number of mistakes and inconsistencies[1].
Now, once all QOM types are converted to the new macros (which is work in progress), maybe we could replace:
DEVICE_CLASS(oc)
DEVICE_GET_CLASS(dev)
with more grep-friendly expressions like:
CLASS(DEVICE, oc)
GET_CLASS(DEVICE, dev)
The type of those expressions would still be (DeviceClass*).
---
[1] These are some of the fixes for bugs or inconsistencies that were already merged to qemu.git:
6a567fbcf0b8 nubus: Delete unused NUBUS_BRIDGE macro 98b49b2bea15 spapr: Remove unnecessary DRC type-checker macros 08e14bb7e060 platform-bus: Delete macros for non-existing typedef 5c8b0f2cc799 can_emu: Delete macros for non-existing typedef f58b770fbbd9 virtio-ccw: Fix definition of VIRTIO_CCW_BUS_GET_CLASS
These are fixes for broken QOM macros I submitted recently:
[PATCH for-6.2 1/6] acpi: Delete broken ACPI_GED_X86 macro [PATCH for-6.2 2/6] sbsa_gwdt: Delete broken SBSA_*CLASS macros
And these are some other inconsistencies that are still in the current tree, that need to be addressed:
hw/i386/kvm/i8254.c:45:1: type name mismatch: TYPE_KVM_I8254 vs KVM_PIThw/net/e1000.c:158:1: type name mismatch: TYPE_E1000_BASE vs E1000hw/rtc/m48t59-isa.c:38:1: mismatching class type for M48TXX_ISA (M48txxISADeviceClass) hw/rtc/m48t59-isa.c:131:1: class type declared here (None)hw/rtc/m48t59.c:47:1: mismatching class type for M48TXX_SYS_BUS (M48txxSysBusDeviceClass) hw/rtc/m48t59.c:654:1: class type declared here (None)hw/s390x/virtio-ccw.h:63:1: typedef name mismatch: VirtioCcwBusState is defined as struct VirtioBusState hw/s390x/virtio-ccw.h:59:1: typedef is herehw/scsi/megasas.c:137:1: type name mismatch: TYPE_MEGASAS_BASE vs MEGASAS hw/virtio/virtio-pci.h:29:1: typedef name mismatch: VirtioPCIBusState is defined as struct VirtioBusState hw/virtio/virtio-pci.h:25:1: typedef is hereinclude/exec/memory.h:48:1: mismatching instance type for RAM_DISCARD_MANAGER (RamDiscardManager) softmmu/memory.c:3418:1: instance type declared here (None)include/hw/isa/superio.h:20:1: mismatching instance type for ISA_SUPERIO (ISASuperIODevice) hw/isa/isa-superio.c:180:1: instance type declared here (None) include/hw/s390x/event-facility.h:197:1: type name mismatch: TYPE_SCLP_EVENT_FACILITY vs EVENT_FACILITY include/hw/s390x/s390-ccw.h:22:1: type name mismatch: TYPE_S390_CCW vs S390_CCW_DEVICE include/hw/vfio/vfio-amd-xgbe.h:43:1: type name mismatch: TYPE_VFIO_AMD_XGBE vs VFIO_AMD_XGBE_DEVICE include/hw/vfio/vfio-calxeda-xgmac.h:40:1: type name mismatch: TYPE_VFIO_CALXEDA_XGMAC vs VFIO_CALXEDA_XGMAC_DEVICE include/hw/vfio/vfio-platform.h:73:1: type name mismatch: TYPE_VFIO_PLATFORM vs VFIO_PLATFORM_DEVICE include/hw/watchdog/wdt_diag288.h:10:1: type name mismatch: TYPE_WDT_DIAG288 vs DIAG288 migration/migration.h:141:1: type name mismatch: TYPE_MIGRATION vs MIGRATION_OBJ target/ppc/cpu.h:1253:1: mismatching instance type for PPC_VIRTUAL_HYPERVISOR (PPCVirtualHypervisor) target/ppc/cpu_init.c:9090:1: instance type declared here (None)
Signature · 1 line
Eduardo
PATCH 3/12 scripts/codeconverter: Update to latest version
In reply to Eduardo HabkostI'm not documenting every single change in the codeconverter script because most of that code will be deleted once we finish the QOM code conversion. This patch updates the script to the latest version that was used to perform changes in the QOM code.
--- .../codeconverter/codeconverter/patching.py | 18 +- .../codeconverter/codeconverter/qom_macros.py | 187 +++++++++++-- .../codeconverter/qom_type_info.py | 247 +++++++++++++++++- .../codeconverter/codeconverter/regexps.py | 3 +- 4 files changed, 405 insertions(+), 50 deletions(-)
scripts/codeconverter/codeconverter/patching.py +6 -12
@@ -59,11 +59,11 @@ def name(self) -> str: def compiled_re(klass): return re.compile(klass.regexp, re.MULTILINE) - def start(self) -> int: - return self.match.start() + def start(self, *args) -> int: + return self.match.start(*args) - def end(self) -> int: - return self.match.end() + def end(self, *args) -> int: + return self.match.end(*args) def line_col(self) -> LineAndColumn: return self.file.line_col(self.start())
@@ -114,9 +114,6 @@ def make_patch(self, replacement: str) -> 'Patch': """Make patch replacing the content of this match""" return Patch(self.start(), self.end(), replacement) - def make_subpatch(self, start: int, end: int, replacement: str) -> 'Patch': - return Patch(self.start() + start, self.start() + end, replacement) - def make_removal_patch(self) -> 'Patch': """Make patch removing contents of match completely""" return self.make_patch('')
@@ -377,8 +374,8 @@ def scan_for_matches(self, class_names: Optional[List[str]]=None) -> Iterable[Fi DBG("class_names: %r", class_names) for cn in class_names: matches = self.matches_of_type(class_dict[cn]) - DBG('%d matches found for %s: %s', - len(matches), cn, ' '.join(names(matches))) + INFO('%d matches found for %s: %s', + len(matches), cn, ' '.join(names(matches))) yield from matches def apply_patches(self) -> None:
@@ -407,9 +404,6 @@ def show_diff(self) -> None: f.flush() subprocess.call(['diff', '-u', self.filename, f.name]) - def ref(self): - return TypeInfoReference - class FileList(RegexpScanner): def __init__(self): super().__init__()
scripts/codeconverter/codeconverter/qom_macros.py +163 -24
293 lines not on this page · raw message
scripts/codeconverter/codeconverter/qom_type_info.py +234 -13
330 lines not on this page · raw message
scripts/codeconverter/codeconverter/regexps.py +2 -1
@@ -101,6 +101,7 @@ def test_optional_pars(): RE_FUN_CALL = S(RE_IDENTIFIER, r'\s*\(\s*', RE_SIMPLE_VALUE, r'\s*\)') RE_SIZEOF = S(r'sizeof\s*\(\s*', NAMED('sizeoftype', RE_TYPE), r'\s*\)') +RE_ALIGNOF = S(r'__alignof__\s*\(\s*', NAMED('alignoftype', RE_TYPE), r'\s*\)') RE_ADDRESS = S(r'&\s*', RE_IDENTIFIER)
@@ -113,6 +114,6 @@ def test_optional_pars(): # NOTE: this covers a very small subset of valid expressions -RE_EXPRESSION = OR(RE_SIZEOF, RE_FUN_CALL, RE_MACRO_CONCAT, RE_SIMPLE_VALUE, +RE_EXPRESSION = OR(RE_SIZEOF, RE_ALIGNOF, RE_FUN_CALL, RE_MACRO_CONCAT, RE_SIMPLE_VALUE, RE_ARRAY, RE_ADDRESS)
Signature · 1 line
2.31.1
PATCH 4/12 Add struct names to typedefs used by QOM types
In reply to Eduardo HabkostAnonymous structs on QOM typedefs make the code harder to convert to OBJECT_DEFINE* macros, as the macros expect the struct name to exist.
Use a codeconverter rule to automatically add names to the structs used in QOM typedefs.
Generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=AddNamesToTypedefs $(git grep -l '' -- '*.[ch]')
---
Cc: "Marc-André Lureau" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Vijai Kumar K <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- include/hw/adc/npcm7xx_adc.h | 2 +- include/hw/char/shakti_uart.h | 2 +- include/hw/tricore/tricore_testdevice.h | 2 +- chardev/char-parallel.c | 4 ++-- hw/m68k/mcf5206.c | 2 +- hw/misc/sbsa_ec.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-)
include/hw/adc/npcm7xx_adc.h +1 -1
@@ -42,7 +42,7 @@* @iref: The internal reference voltage, initialized at launch time. * @rv: The calibrated output values of 0.5V and 1.5V for the ADC. */ -typedef struct { +typedef struct NPCM7xxADCState { SysBusDevice parent; MemoryRegion iomem;
include/hw/char/shakti_uart.h +1 -1
@@ -51,7 +51,7 @@#define SHAKTI_UART (obj) \ OBJECT_CHECK(ShaktiUartState, (obj), TYPE_SHAKTI_UART) -typedef struct { +typedef struct ShaktiUartState { /* <private> */ SysBusDevice parent_obj;
include/hw/tricore/tricore_testdevice.h +1 -1
@@ -26,7 +26,7 @@#define TRICORE_TESTDEVICE (obj) \ OBJECT_CHECK(TriCoreTestDeviceState, (obj), TYPE_TRICORE_TESTDEVICE) -typedef struct { +typedef struct TriCoreTestDeviceState { /* <private> */ SysBusDevice parent_obj;
chardev/char-parallel.c +2 -2
@@ -49,7 +49,7 @@ #if defined(__linux__) -typedef struct { +typedef struct ParallelChardev { Chardev parent; int fd; int mode;
@@ -177,7 +177,7 @@ static void qemu_chr_open_pp_fd(Chardev *chr,#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -typedef struct { +typedef struct ParallelChardev {Chardev parent;int fd; }ParallelChardev ;
hw/m68k/mcf5206.c +1 -1
@@ -160,7 +160,7 @@ static m5206_timer_state *m5206_timer_init(qemu_irq irq)/* System Integration Module. */ -typedef struct { +typedef struct m5206_mbar_state { SysBusDevice parent_obj; M68kCPU *cpu;
hw/misc/sbsa_ec.c +1 -1
@@ -16,7 +16,7 @@#include "hw/sysbus.h" #include "sysemu/runstate.h" -typedef struct { +typedef struct SECUREECState {SysBusDevice parent_obj;MemoryRegion iomem; }SECUREECState ;
Signature · 1 line
2.31.1
Re: [PATCH for-6.2 04/12] [automated] Add struct names to typedefs used by QOM types
Quoted 24 lines · Eduardo Habkost
Anonymous structs on QOM typedefs make the code harder to convert to OBJECT_DEFINE* macros, as the macros expect the struct name to exist.
Use a codeconverter rule to automatically add names to the structs used in QOM typedefs.
Generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=AddNamesToTypedefs $(git grep -l '' -- '*.[ch]')Signed-off-by Eduardo Habkost <[email protected]>---
Cc: "Marc-André Lureau" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Vijai Kumar K <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Quoted 8 lines
--- include/hw/adc/npcm7xx_adc.h | 2 +- include/hw/char/shakti_uart.h | 2 +- include/hw/tricore/tricore_testdevice.h | 2 +- chardev/char-parallel.c | 4 ++-- hw/m68k/mcf5206.c | 2 +- hw/misc/sbsa_ec.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-)
PATCH 5/12 Move QOM typedefs and add missing includes
In reply to Eduardo HabkostSome typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with OBJECT_DECLARE_TYPE.
Patch generated using:
$ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \
$(git grep -l '' -- '*.[ch]')which will:
- split "typdef struct { ... } TypedefName" declarations
- move the typedefs and #defines above the type check macros
- add missing #include "qom/object.h" lines if necessary
---
Cc: Richard Henderson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Marc-André Lureau" <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Andrew Baumann <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Igor Mammedov <[email protected]>
Cc: Alexander Bulekov <[email protected]>
Cc: Bandan Das <[email protected]>
Cc: Stefan Hajnoczi <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Jiaxun Yang <[email protected]>
Cc: Aurelien Jarno <[email protected]>
Cc: Aleksandar Rikalo <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Pavel Pisa <[email protected]>
Cc: Vikram Garhwal <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Klaus Jensen <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Vijai Kumar K <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: Corey Minyard <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Andrew Jeffery <[email protected]>
Cc: Joel Stanley <[email protected]>
Cc: Francisco Iglesias <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: Alexey Kardashevskiy <[email protected]>
Cc: "Hervé Poussineau" <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: Juan Quintela <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: Stefan Berger <[email protected]>
Cc: Taylor Simpson <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- hw/nvme/nvme.h | 6 ++++-- hw/usb/hcd-uhci.h | 1 + hw/usb/hcd-xhci-pci.h | 6 ++++-- hw/usb/hcd-xhci-sysbus.h | 6 ++++-- hw/usb/u2f.h | 6 ++++-- include/hw/acpi/acpi_dev_interface.h | 2 +- include/hw/adc/npcm7xx_adc.h | 1 + include/hw/arm/linux-boot-if.h | 2 +- include/hw/arm/npcm7xx.h | 11 +++++++---- include/hw/char/shakti_uart.h | 6 ++++-- include/hw/core/accel-cpu.h | 1 + include/hw/dma/sifive_pdma.h | 1 + include/hw/dma/xlnx_csu_dma.h | 1 + include/hw/fw-path-provider.h | 2 +- include/hw/gpio/npcm7xx_gpio.h | 1 + include/hw/hotplug.h | 2 +- include/hw/i2c/npcm7xx_smbus.h | 1 + include/hw/intc/intc.h | 2 +- include/hw/intc/m68k_irqc.h | 6 ++++-- include/hw/intc/sifive_clint.h | 6 ++++-- include/hw/ipmi/ipmi.h | 2 +- include/hw/mem/memory-device.h | 2 +- include/hw/mem/npcm7xx_mc.h | 1 + include/hw/misc/aspeed_lpc.h | 6 ++++-- include/hw/misc/bcm2835_cprman.h | 1 + include/hw/misc/bcm2835_cprman_internals.h | 1 + include/hw/misc/mchp_pfsoc_dmc.h | 1 + include/hw/misc/mchp_pfsoc_ioscb.h | 1 + include/hw/misc/mchp_pfsoc_sysreg.h | 1 + include/hw/misc/npcm7xx_clk.h | 1 + include/hw/misc/npcm7xx_gcr.h | 1 + include/hw/misc/npcm7xx_pwm.h | 1 + include/hw/misc/npcm7xx_rng.h | 1 + include/hw/misc/xlnx-versal-xramc.h | 6 ++++-- include/hw/net/npcm7xx_emc.h | 1 + include/hw/net/xlnx-zynqmp-can.h | 6 ++++-- include/hw/nmi.h | 2 +- include/hw/nvram/npcm7xx_otp.h | 1 + include/hw/ppc/spapr_drc.h | 15 +++++++++------ include/hw/ppc/spapr_xive.h | 11 +++++++---- include/hw/ppc/vof.h | 1 + include/hw/rdma/rdma.h | 2 +- include/hw/riscv/microchip_pfsoc.h | 1 + include/hw/riscv/shakti_c.h | 11 +++++++---- include/hw/riscv/sifive_e.h | 6 ++++-- include/hw/riscv/sifive_u.h | 11 +++++++---- include/hw/rtc/m48t59.h | 2 +- include/hw/sd/cadence_sdhci.h | 1 + include/hw/ssi/npcm7xx_fiu.h | 1 + include/hw/ssi/sifive_spi.h | 6 ++++-- include/hw/stream.h | 2 +- include/hw/timer/npcm7xx_timer.h | 1 + include/hw/tricore/tricore_testdevice.h | 6 ++++-- include/hw/usb/hcd-dwc3.h | 6 ++++-- include/hw/usb/msd.h | 1 + include/hw/usb/xlnx-usb-subsystem.h | 6 ++++-- include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 6 ++++-- include/hw/vmstate-if.h | 2 +- include/hw/watchdog/sbsa_gwdt.h | 6 ++++-- include/qom/object_interfaces.h | 2 +- include/sysemu/tpm.h | 2 +- target/arm/idau.h | 2 +- target/hexagon/cpu.h | 11 +++++++---- accel/tcg/tcg-all.c | 1 + chardev/char-parallel.c | 1 + hw/arm/bcm2836.c | 1 + hw/m68k/mcf5206.c | 1 + hw/mem/sparse-mem.c | 6 ++++-- hw/mips/loongson3_virt.c | 1 + hw/misc/npcm7xx_clk.c | 1 + hw/misc/sbsa_ec.c | 1 + hw/net/can/ctucan_pci.c | 1 + hw/nvram/npcm7xx_otp.c | 1 + hw/s390x/vhost-user-fs-ccw.c | 1 + hw/sensor/adm1272.c | 6 ++++-- hw/sensor/max34451.c | 6 ++++-- hw/usb/u2f-emulated.c | 1 + hw/usb/u2f-passthru.c | 1 + hw/virtio/vhost-user-i2c-pci.c | 1 + tests/unit/check-qom-interface.c | 2 +- ui/vdagent.c | 1 + 81 files changed, 179 insertions(+), 82 deletions(-)
hw/nvme/nvme.h +4 -2
@@ -23,6 +23,7 @@#include "hw/block/block.h" #include "block/nvme.h" +#include "qom/object.h" #define NVME_MAX_CONTROLLERS 32#define NVME_MAX_NAMESPACES 256
@@ -41,10 +42,11 @@ typedef struct NvmeBus { } NvmeBus;#define TYPE_NVME_SUBSYS "nvme-subsys" +typedef struct NvmeSubsystem NvmeSubsystem ;#define NVME_SUBSYS (obj) \ OBJECT_CHECK(NvmeSubsystem, (obj), TYPE_NVME_SUBSYS) -typedef struct NvmeSubsystem { +struct NvmeSubsystem {DeviceState parent_obj;NvmeBus bus;uint8_t subnqn[256 ];
@@ -55,7 +57,7 @@ typedef struct NvmeSubsystem {struct {char *nqn; } params; -} NvmeSubsystem; +};int nvme_subsys_register_ctrl (NvmeCtrl *n,Error **errp);void nvme_subsys_unregister_ctrl (NvmeSubsystem *subsys,NvmeCtrl *n);
hw/usb/hcd-uhci.h +1 -0
@@ -32,6 +32,7 @@#include "qemu/timer.h" #include "hw/pci/pci.h" #include "hw/usb.h" +#include "qom/object.h" typedef struct UHCIQueue UHCIQueue ;
hw/usb/hcd-xhci-pci.h +4 -2
@@ -26,19 +26,21 @@#include "hw/usb.h" #include "hcd-xhci.h" +#include "qom/object.h" #define TYPE_XHCI_PCI "pci-xhci" +typedef struct XHCIPciState XHCIPciState ;#define XHCI_PCI (obj) \ OBJECT_CHECK(XHCIPciState, (obj), TYPE_XHCI_PCI) -typedef struct XHCIPciState { +struct XHCIPciState {/*< private >*/ PCIDevice parent_obj;/*< public >*/ XHCIState xhci;OnOffAuto msi;OnOffAuto msix; -}XHCIPciState ; +};#endif
hw/usb/hcd-xhci-sysbus.h +4 -2
@@ -14,18 +14,20 @@#include "hw/usb.h" #include "hcd-xhci.h" #include "hw/sysbus.h" +#include "qom/object.h" +typedef struct XHCISysbusState XHCISysbusState ;#define XHCI_SYSBUS (obj) \ OBJECT_CHECK(XHCISysbusState, (obj), TYPE_XHCI_SYSBUS) -typedef struct XHCISysbusState { +struct XHCISysbusState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/ XHCIState xhci;qemu_irq *irq; -}XHCISysbusState ; +};void xhci_sysbus_reset (DeviceState *dev);#endif
hw/usb/u2f.h +4 -2
@@ -27,6 +27,7 @@#define U2F_H #include "hw/qdev-core.h" +#include "qom/object.h" #define U2FHID_PACKET_SIZE 64#define U2FHID_PENDING_IN_NUM 32
@@ -35,6 +36,7 @@ typedef struct U2FKeyState U2FKeyState;typedef struct U2FKeyInfo U2FKeyInfo ;#define TYPE_U2F_KEY "u2f-key" +typedef struct U2FKeyClass U2FKeyClass ;#define U2F_KEY (obj) \ OBJECT_CHECK(U2FKeyState, (obj), TYPE_U2F_KEY)#define U2F_KEY_CLASS (klass) \
@@ -46,7 +48,7 @@ typedef struct U2FKeyInfo U2FKeyInfo;* Callbacks to be used by the U2F key base device (i.e. hw/u2f.c) * to interact with its variants (i.e. hw/u2f-*.c) */ -typedef struct U2FKeyClass { +struct U2FKeyClass {/*< private >*/ USBDeviceClass parent_class;
@@ -55,7 +57,7 @@ typedef struct U2FKeyClass { const uint8_t packet[U2FHID_PACKET_SIZE]);void (*realize)(U2FKeyState *key,Error **errp);void (*unrealize)(U2FKeyState *key); -} U2FKeyClass; +};/* * State of the U2F key base device (i.e. hw/u2f.c)
include/hw/acpi/acpi_dev_interface.h +1 -1
@@ -21,11 +21,11 @@ typedef enum {typedef struct AcpiDeviceIfClass AcpiDeviceIfClass ;DECLARE_CLASS_CHECKERS (AcpiDeviceIfClass,ACPI_DEVICE_IF , TYPE_ACPI_DEVICE_IF) +typedef struct AcpiDeviceIf AcpiDeviceIf ;#define ACPI_DEVICE_IF (obj) \ INTERFACE_CHECK(AcpiDeviceIf, (obj), \ TYPE_ACPI_DEVICE_IF) -typedef struct AcpiDeviceIf AcpiDeviceIf ;void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event);
include/hw/adc/npcm7xx_adc.h +1 -0
@@ -20,6 +20,7 @@#include "hw/irq.h" #include "hw/sysbus.h" #include "qemu/timer.h" +#include "qom/object.h" #define NPCM7XX_ADC_NUM_INPUTS 8/**
include/hw/arm/linux-boot-if.h +1 -1
@@ -12,10 +12,10 @@typedef struct ARMLinuxBootIfClass ARMLinuxBootIfClass ;DECLARE_CLASS_CHECKERS (ARMLinuxBootIfClass,ARM_LINUX_BOOT_IF , TYPE_ARM_LINUX_BOOT_IF) +typedef struct ARMLinuxBootIf ARMLinuxBootIf ;#define ARM_LINUX_BOOT_IF (obj) \ INTERFACE_CHECK(ARMLinuxBootIf, (obj), TYPE_ARM_LINUX_BOOT_IF) -typedef struct ARMLinuxBootIf ARMLinuxBootIf ;struct ARMLinuxBootIfClass {/*< private >*/
include/hw/arm/npcm7xx.h +7 -4
@@ -35,6 +35,7 @@#include "hw/usb/hcd-ehci.h" #include "hw/usb/hcd-ohci.h" #include "target/arm/cpu.h" +#include "qom/object.h" #define NPCM7XX_MAX_NUM_CPUS (2)
@@ -62,14 +63,15 @@ typedef struct NPCM7xxMachine { } NPCM7xxMachine;#define TYPE_NPCM7XX_MACHINE MACHINE_TYPE_NAME("npcm7xx") +typedef struct NPCM7xxMachineClass NPCM7xxMachineClass ;#define NPCM7XX_MACHINE (obj) \ OBJECT_CHECK(NPCM7xxMachine, (obj), TYPE_NPCM7XX_MACHINE) -typedef struct NPCM7xxMachineClass { +struct NPCM7xxMachineClass {MachineClass parent;const char *soc_type; -}NPCM7xxMachineClass ; +};#define NPCM7XX_MACHINE_CLASS (klass) \ OBJECT_CLASS_CHECK(NPCM7xxMachineClass, (klass), TYPE_NPCM7XX_MACHINE)
@@ -106,19 +108,20 @@ typedef struct NPCM7xxState { } NPCM7xxState;#define TYPE_NPCM7XX "npcm7xx" +typedef struct NPCM7xxClass NPCM7xxClass ;#define NPCM7XX (obj) OBJECT_CHECK(NPCM7xxState, (obj), TYPE_NPCM7XX)#define TYPE_NPCM730 "npcm730"#define TYPE_NPCM750 "npcm750" -typedef struct NPCM7xxClass { +struct NPCM7xxClass {DeviceClass parent;/* Bitmask of modules that are permanently disabled on this chip. */ uint32_t disabled_modules;/* Number of CPU cores enabled in this SoC class (may be 1 or 2). */ uint32_t num_cpus; -}NPCM7xxClass ; +};#define NPCM7XX_CLASS (klass) \ OBJECT_CLASS_CHECK(NPCM7xxClass, (klass), TYPE_NPCM7XX)
include/hw/char/shakti_uart.h +4 -2
@@ -27,6 +27,7 @@#include "hw/sysbus.h" #include "chardev/char-fe.h" +#include "qom/object.h" #define SHAKTI_UART_BAUD 0x00#define SHAKTI_UART_TX 0x04
@@ -48,10 +49,11 @@#define SHAKTI_UART_CONTROL_DEFAULT 0x0100#define TYPE_SHAKTI_UART "shakti-uart" +typedef struct ShaktiUartState ShaktiUartState ;#define SHAKTI_UART (obj) \ OBJECT_CHECK(ShaktiUartState, (obj), TYPE_SHAKTI_UART) -typedef struct ShaktiUartState { +struct ShaktiUartState {/* <private> */ SysBusDevice parent_obj;
@@ -69,6 +71,6 @@ typedef struct ShaktiUartState {uint32_t uart_rx_threshold; CharBackend chr; -} ShaktiUartState; +};#endif /* HW_SHAKTI_UART_H */
include/hw/core/accel-cpu.h +1 -0
@@ -10,6 +10,7 @@#ifndef ACCEL_CPU_H #define ACCEL_CPU_H +#include "qom/object.h" /* * This header is used to define new accelerator-specific target-specific
include/hw/dma/sifive_pdma.h +1 -0
@@ -22,6 +22,7 @@ #ifndef SIFIVE_PDMA_H #define SIFIVE_PDMA_H +#include "qom/object.h" struct sifive_pdma_chan { uint32_t control;
include/hw/dma/xlnx_csu_dma.h +1 -0
@@ -20,6 +20,7 @@#ifndef XLNX_CSU_DMA_H #define XLNX_CSU_DMA_H +#include "qom/object.h" #define TYPE_XLNX_CSU_DMA "xlnx.csu_dma"
include/hw/fw-path-provider.h +1 -1
@@ -25,10 +25,10 @@typedef struct FWPathProviderClass FWPathProviderClass ;DECLARE_CLASS_CHECKERS (FWPathProviderClass,FW_PATH_PROVIDER , TYPE_FW_PATH_PROVIDER) +typedef struct FWPathProvider FWPathProvider ;#define FW_PATH_PROVIDER (obj) \ INTERFACE_CHECK(FWPathProvider, (obj), TYPE_FW_PATH_PROVIDER) -typedef struct FWPathProvider FWPathProvider ;struct FWPathProviderClass {InterfaceClass parent_class;
include/hw/gpio/npcm7xx_gpio.h +1 -0
@@ -17,6 +17,7 @@#include "exec/memory.h" #include "hw/sysbus.h" +#include "qom/object.h" /* Number of pins managed by each controller. */ #define NPCM7XX_GPIO_NR_PINS (32)
include/hw/hotplug.h +1 -1
@@ -19,10 +19,10 @@typedef struct HotplugHandlerClass HotplugHandlerClass ;DECLARE_CLASS_CHECKERS (HotplugHandlerClass,HOTPLUG_HANDLER , TYPE_HOTPLUG_HANDLER) +typedef struct HotplugHandler HotplugHandler ;#define HOTPLUG_HANDLER (obj) \ INTERFACE_CHECK(HotplugHandler, (obj), TYPE_HOTPLUG_HANDLER) -typedef struct HotplugHandler HotplugHandler ;/** * hotplug_fn:
include/hw/i2c/npcm7xx_smbus.h +1 -0
@@ -20,6 +20,7 @@#include "hw/i2c/i2c.h" #include "hw/irq.h" #include "hw/sysbus.h" +#include "qom/object.h" /* * Number of addresses this module contains. Do not change this without
include/hw/intc/intc.h +1 -1
@@ -8,11 +8,11 @@typedef struct InterruptStatsProviderClass InterruptStatsProviderClass ;DECLARE_CLASS_CHECKERS (InterruptStatsProviderClass,INTERRUPT_STATS_PROVIDER , TYPE_INTERRUPT_STATS_PROVIDER) +typedef struct InterruptStatsProvider InterruptStatsProvider ;#define INTERRUPT_STATS_PROVIDER (obj) \ INTERFACE_CHECK(InterruptStatsProvider, (obj), \ TYPE_INTERRUPT_STATS_PROVIDER) -typedef struct InterruptStatsProvider InterruptStatsProvider ;struct InterruptStatsProviderClass {InterfaceClass parent;
include/hw/intc/m68k_irqc.h +4 -2
@@ -11,8 +11,10 @@#define M68K_IRQC_H #include "hw/sysbus.h" +#include "qom/object.h" #define TYPE_M68K_IRQC "m68k-irq-controller" +typedef struct M68KIRQCState M68KIRQCState ;#define M68K_IRQC (obj) OBJECT_CHECK(M68KIRQCState, (obj), \ TYPE_M68K_IRQC)
@@ -29,13 +31,13 @@ enum { };#define M68K_IRQC_LEVEL_NUM (M68K_IRQC_LEVEL_7 - M68K_IRQC_LEVEL_1 + 1) -typedef struct M68KIRQCState { +struct M68KIRQCState {SysBusDevice parent_obj;uint8_t ipr;/* statistics */ uint64_t stats_irq_count[M68K_IRQC_LEVEL_NUM ]; -}M68KIRQCState ; +};#endif
include/hw/intc/sifive_clint.h +4 -2
@@ -21,13 +21,15 @@#define HW_SIFIVE_CLINT_H #include "hw/sysbus.h" +#include "qom/object.h" #define TYPE_SIFIVE_CLINT "riscv.sifive.clint" +typedef struct SiFiveCLINTState SiFiveCLINTState ;#define SIFIVE_CLINT (obj) \ OBJECT_CHECK(SiFiveCLINTState, (obj), TYPE_SIFIVE_CLINT) -typedef struct SiFiveCLINTState { +struct SiFiveCLINTState {/*< private >*/ SysBusDevice parent_obj;
@@ -40,7 +42,7 @@ typedef struct SiFiveCLINTState {uint32_t time_base;uint32_t aperture_size;uint32_t timebase_freq; -} SiFiveCLINTState; +}; DeviceState *sifive_clint_create(hwaddr addr, hwaddr size, uint32_t hartid_base, uint32_t num_harts, uint32_t sip_base,
include/hw/ipmi/ipmi.h +1 -1
@@ -109,13 +109,13 @@ uint32_t ipmi_next_uuid(void);* and the BMC. */ #define TYPE_IPMI_INTERFACE "ipmi-interface" +typedef struct IPMIInterface IPMIInterface ;#define IPMI_INTERFACE (obj) \ INTERFACE_CHECK(IPMIInterface, (obj), TYPE_IPMI_INTERFACE)typedef struct IPMIInterfaceClass IPMIInterfaceClass ;DECLARE_CLASS_CHECKERS (IPMIInterfaceClass,IPMI_INTERFACE , TYPE_IPMI_INTERFACE) -typedef struct IPMIInterface IPMIInterface ;struct IPMIInterfaceClass {InterfaceClass parent;
include/hw/mem/memory-device.h +1 -1
@@ -22,10 +22,10 @@typedef struct MemoryDeviceClass MemoryDeviceClass ;DECLARE_CLASS_CHECKERS (MemoryDeviceClass,MEMORY_DEVICE , TYPE_MEMORY_DEVICE) +typedef struct MemoryDeviceState MemoryDeviceState ;#define MEMORY_DEVICE (obj) \ INTERFACE_CHECK(MemoryDeviceState, (obj), TYPE_MEMORY_DEVICE) -typedef struct MemoryDeviceState MemoryDeviceState ;/** * MemoryDeviceClass:
include/hw/mem/npcm7xx_mc.h +1 -0
@@ -18,6 +18,7 @@#include "exec/memory.h" #include "hw/sysbus.h" +#include "qom/object.h" /** * struct NPCM7xxMCState - Device state for the memory controller.
include/hw/misc/aspeed_lpc.h +4 -2
@@ -13,8 +13,10 @@#include "hw/sysbus.h" #include <stdint.h> +#include "qom/object.h" #define TYPE_ASPEED_LPC "aspeed.lpc" +typedef struct AspeedLPCState AspeedLPCState ;#define ASPEED_LPC (obj) OBJECT_CHECK(AspeedLPCState, (obj), TYPE_ASPEED_LPC)#define ASPEED_LPC_NR_REGS (0x260 >> 2)
@@ -29,7 +31,7 @@ enum aspeed_lpc_subdevice {#define ASPEED_LPC_NR_SUBDEVS 5 -typedef struct AspeedLPCState { +struct AspeedLPCState {/* <private> */ SysBusDevice parent;
@@ -42,6 +44,6 @@ typedef struct AspeedLPCState {uint32_t regs[ASPEED_LPC_NR_REGS ]; uint32_t hicr7; -} AspeedLPCState; +};#endif /* _ASPEED_LPC_H_ */
include/hw/misc/bcm2835_cprman.h +1 -0
@@ -11,6 +11,7 @@#include "hw/sysbus.h" #include "hw/qdev-clock.h" +#include "qom/object.h" #define TYPE_BCM2835_CPRMAN "bcm2835-cprman"
include/hw/misc/bcm2835_cprman_internals.h +1 -0
@@ -11,6 +11,7 @@#include "hw/registerfields.h" #include "hw/misc/bcm2835_cprman.h" +#include "qom/object.h" #define TYPE_CPRMAN_PLL "bcm2835-cprman-pll"#define TYPE_CPRMAN_PLL_CHANNEL "bcm2835-cprman-pll-channel"
include/hw/misc/mchp_pfsoc_dmc.h +1 -0
@@ -22,6 +22,7 @@#ifndef MCHP_PFSOC_DMC_H #define MCHP_PFSOC_DMC_H +#include "qom/object.h" /* DDR SGMII PHY module */
include/hw/misc/mchp_pfsoc_ioscb.h +1 -0
@@ -22,6 +22,7 @@ #ifndef MCHP_PFSOC_IOSCB_H #define MCHP_PFSOC_IOSCB_H +#include "qom/object.h" typedef struct MchpPfSoCIoscbState { SysBusDevice parent;
include/hw/misc/mchp_pfsoc_sysreg.h +1 -0
@@ -22,6 +22,7 @@#ifndef MCHP_PFSOC_SYSREG_H #define MCHP_PFSOC_SYSREG_H +#include "qom/object.h" #define MCHP_PFSOC_SYSREG_REG_SIZE 0x2000
include/hw/misc/npcm7xx_clk.h +1 -0
@@ -19,6 +19,7 @@#include "exec/memory.h" #include "hw/clock.h" #include "hw/sysbus.h" +#include "qom/object.h" /* * Number of registers in our device state structure. Don't change this without
include/hw/misc/npcm7xx_gcr.h +1 -0
@@ -18,6 +18,7 @@#include "exec/memory.h" #include "hw/sysbus.h" +#include "qom/object.h" /* * Number of registers in our device state structure. Don't change this without
include/hw/misc/npcm7xx_pwm.h +1 -0
@@ -19,6 +19,7 @@#include "hw/clock.h" #include "hw/sysbus.h" #include "hw/irq.h" +#include "qom/object.h" /* Each PWM module holds 4 PWM channels. */ #define NPCM7XX_PWM_PER_MODULE 4
include/hw/misc/npcm7xx_rng.h +1 -0
@@ -17,6 +17,7 @@#define NPCM7XX_RNG_H #include "hw/sysbus.h" +#include "qom/object.h" typedef struct NPCM7xxRNGState { SysBusDevice parent;
include/hw/misc/xlnx-versal-xramc.h +4 -2
@@ -11,9 +11,11 @@#include "hw/sysbus.h" #include "hw/register.h" +#include "qom/object.h" #define TYPE_XLNX_XRAM_CTRL "xlnx.versal-xramc" +typedef struct XlnxXramCtrl XlnxXramCtrl ;#define XLNX_XRAM_CTRL (obj) \ OBJECT_CHECK(XlnxXramCtrl, (obj), TYPE_XLNX_XRAM_CTRL)
@@ -80,7 +82,7 @@ REG32(XRAM_SAFETY_CHK, 0xff8)#define XRAM_CTRL_R_MAX (R_XRAM_SAFETY_CHK + 1) -typedef struct XlnxXramCtrl { +struct XlnxXramCtrl {SysBusDevice parent_obj;MemoryRegion ram;qemu_irq irq;
@@ -93,5 +95,5 @@ typedef struct XlnxXramCtrl {RegisterInfoArray *reg_array;uint32_t regs[XRAM_CTRL_R_MAX ]; RegisterInfo regs_info[XRAM_CTRL_R_MAX]; -} XlnxXramCtrl; +};#endif
include/hw/net/npcm7xx_emc.h +1 -0
@@ -20,6 +20,7 @@#include "hw/irq.h" #include "hw/sysbus.h" #include "net/net.h" +#include "qom/object.h" /* 32-bit register indices. */ enum NPCM7xxPWMRegister {
include/hw/net/xlnx-zynqmp-can.h +4 -2
@@ -36,9 +36,11 @@#include "qemu/fifo32.h" #include "hw/ptimer.h" #include "hw/qdev-clock.h" +#include "qom/object.h" #define TYPE_XLNX_ZYNQMP_CAN "xlnx.zynqmp-can" +typedef struct XlnxZynqMPCANState XlnxZynqMPCANState ;#define XLNX_ZYNQMP_CAN (obj) \ OBJECT_CHECK(XlnxZynqMPCANState, (obj), TYPE_XLNX_ZYNQMP_CAN)
@@ -52,7 +54,7 @@#define CAN_FRAME_SIZE 4#define RXFIFO_SIZE (MAILBOX_CAPACITY * CAN_FRAME_SIZE) -typedef struct XlnxZynqMPCANState { +struct XlnxZynqMPCANState {SysBusDevice parent_obj;MemoryRegion iomem;
@@ -73,6 +75,6 @@ typedef struct XlnxZynqMPCANState {Fifo32 txhpb_fifo; ptimer_state *can_timer; -} XlnxZynqMPCANState; +};#endif
include/hw/nmi.h +1 -1
@@ -29,10 +29,10 @@typedef struct NMIClass NMIClass ;DECLARE_CLASS_CHECKERS (NMIClass,NMI , TYPE_NMI) +typedef struct NMIState NMIState ;#define NMI (obj) \ INTERFACE_CHECK(NMIState, (obj), TYPE_NMI) -typedef struct NMIState NMIState ;struct NMIClass {InterfaceClass parent_class;
include/hw/nvram/npcm7xx_otp.h +1 -0
@@ -18,6 +18,7 @@#include "exec/memory.h" #include "hw/sysbus.h" +#include "qom/object.h" /* Each OTP module holds 8192 bits of one-time programmable storage */ #define NPCM7XX_OTP_ARRAY_BITS (8192)
include/hw/ppc/spapr_drc.h +9 -6
@@ -20,6 +20,8 @@#include "qapi/error.h" #define TYPE_SPAPR_DR_CONNECTOR "spapr-dr-connector" +typedef struct SpaprDrc SpaprDrc ; +typedef struct SpaprDrcClass SpaprDrcClass ;#define SPAPR_DR_CONNECTOR_GET_CLASS (obj) \ OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DR_CONNECTOR)#define SPAPR_DR_CONNECTOR_CLASS (klass) \
@@ -29,6 +31,7 @@ TYPE_SPAPR_DR_CONNECTOR)#define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical" +typedef struct SpaprDrcPhysical SpaprDrcPhysical ;#define SPAPR_DRC_PHYSICAL (obj) OBJECT_CHECK(SpaprDrcPhysical, (obj), \ TYPE_SPAPR_DRC_PHYSICAL)
@@ -168,7 +171,7 @@ typedef enum { SPAPR_DRC_STATE_PHYSICAL_CONFIGURED = 8, } SpaprDrcState; -typedef struct SpaprDrc { +struct SpaprDrc {/*< private >*/ DeviceState parent;
@@ -187,11 +190,11 @@ typedef struct SpaprDrc {bool unplug_requested;void *fdt;int fdt_start_offset; -} SpaprDrc; +};struct SpaprMachineState ; -typedef struct SpaprDrcClass { +struct SpaprDrcClass {/*< private >*/ DeviceClass parent;SpaprDrcState empty_state;
@@ -209,15 +212,15 @@ typedef struct SpaprDrcClass {int (*dt_populate)(SpaprDrc *drc,struct SpaprMachineState *spapr,void *fdt,int *fdt_start_offset,Error **errp); -} SpaprDrcClass; +}; -typedef struct SpaprDrcPhysical { +struct SpaprDrcPhysical {/*< private >*/ SpaprDrc parent;/* DR-indicator */ uint32_t dr_indicator; -}SpaprDrcPhysical ; +};static inline bool spapr_drc_hotplugged (DeviceState *dev) {
include/hw/ppc/spapr_xive.h +7 -4
@@ -12,15 +12,18 @@#include "hw/ppc/spapr_irq.h" #include "hw/ppc/xive.h" +#include "qom/object.h" #define TYPE_SPAPR_XIVE "spapr-xive" +typedef struct SpaprXive SpaprXive ; +typedef struct SpaprXiveClass SpaprXiveClass ;#define SPAPR_XIVE (obj) OBJECT_CHECK(SpaprXive, (obj), TYPE_SPAPR_XIVE)#define SPAPR_XIVE_CLASS (klass) \ OBJECT_CLASS_CHECK(SpaprXiveClass, (klass), TYPE_SPAPR_XIVE)#define SPAPR_XIVE_GET_CLASS (obj) \ OBJECT_GET_CLASS(SpaprXiveClass, (obj), TYPE_SPAPR_XIVE) -typedef struct SpaprXive { +struct SpaprXive {XiveRouter parent;/* Internal interrupt source for IPIs and virtual devices */
@@ -51,13 +54,13 @@ typedef struct SpaprXive {VMChangeStateEntry *change;uint8_t hv_prio; -} SpaprXive; +}; -typedef struct SpaprXiveClass { +struct SpaprXiveClass {XiveRouterClass parent;DeviceRealize parent_realize; -}SpaprXiveClass ; +};/* * The sPAPR machine has a unique XIVE IC device. Assign a fixed value
include/hw/ppc/vof.h +1 -0
@@ -5,6 +5,7 @@*/ #ifndef HW_VOF_H #define HW_VOF_H +#include "qom/object.h" typedef struct Vof { uint64_t top_addr; /* copied from rma_size */
include/hw/rdma/rdma.h +1 -1
@@ -22,11 +22,11 @@typedef struct RdmaProviderClass RdmaProviderClass ;DECLARE_CLASS_CHECKERS (RdmaProviderClass,RDMA_PROVIDER , INTERFACE_RDMA_PROVIDER) +typedef struct RdmaProvider RdmaProvider ;#define RDMA_PROVIDER (obj) \ INTERFACE_CHECK(RdmaProvider, (obj), \ INTERFACE_RDMA_PROVIDER) -typedef struct RdmaProvider RdmaProvider ;struct RdmaProviderClass {InterfaceClass parent;
include/hw/riscv/microchip_pfsoc.h +1 -0
@@ -29,6 +29,7 @@#include "hw/misc/mchp_pfsoc_sysreg.h" #include "hw/net/cadence_gem.h" #include "hw/sd/cadence_sdhci.h" +#include "qom/object.h" typedef struct MicrochipPFSoCState { /*< private >*/
include/hw/riscv/shakti_c.h +7 -4
@@ -22,12 +22,14 @@#include "hw/riscv/riscv_hart.h" #include "hw/boards.h" #include "hw/char/shakti_uart.h" +#include "qom/object.h" #define TYPE_RISCV_SHAKTI_SOC "riscv.shakti.cclass.soc" +typedef struct ShaktiCSoCState ShaktiCSoCState ;#define RISCV_SHAKTI_SOC (obj) \ OBJECT_CHECK(ShaktiCSoCState, (obj), TYPE_RISCV_SHAKTI_SOC) -typedef struct ShaktiCSoCState { +struct ShaktiCSoCState {/*< private >*/ DeviceState parent_obj;
@@ -37,18 +39,19 @@ typedef struct ShaktiCSoCState {ShaktiUartState uart;MemoryRegion rom; -} ShaktiCSoCState; +};#define TYPE_RISCV_SHAKTI_MACHINE MACHINE_TYPE_NAME("shakti_c") +typedef struct ShaktiCMachineState ShaktiCMachineState ;#define RISCV_SHAKTI_MACHINE (obj) \ OBJECT_CHECK(ShaktiCMachineState, (obj), TYPE_RISCV_SHAKTI_MACHINE) -typedef struct ShaktiCMachineState { +struct ShaktiCMachineState {/*< private >*/ MachineState parent_obj;/*< public >*/ ShaktiCSoCState soc; -}ShaktiCMachineState ; +};enum {SHAKTI_C_ROM ,
include/hw/riscv/sifive_e.h +4 -2
@@ -22,12 +22,14 @@#include "hw/riscv/riscv_hart.h" #include "hw/riscv/sifive_cpu.h" #include "hw/gpio/sifive_gpio.h" +#include "qom/object.h" #define TYPE_RISCV_E_SOC "riscv.sifive.e.soc" +typedef struct SiFiveESoCState SiFiveESoCState ;#define RISCV_E_SOC (obj) \ OBJECT_CHECK(SiFiveESoCState, (obj), TYPE_RISCV_E_SOC) -typedef struct SiFiveESoCState { +struct SiFiveESoCState {/*< private >*/ DeviceState parent_obj;
@@ -37,7 +39,7 @@ typedef struct SiFiveESoCState {SIFIVEGPIOState gpio;MemoryRegion xip_mem;MemoryRegion mask_rom; -} SiFiveESoCState; +}; typedef struct SiFiveEState { /*< private >*/
include/hw/riscv/sifive_u.h +7 -4
@@ -27,12 +27,14 @@#include "hw/misc/sifive_u_otp.h" #include "hw/misc/sifive_u_prci.h" #include "hw/ssi/sifive_spi.h" +#include "qom/object.h" #define TYPE_RISCV_U_SOC "riscv.sifive.u.soc" +typedef struct SiFiveUSoCState SiFiveUSoCState ;#define RISCV_U_SOC (obj) \ OBJECT_CHECK(SiFiveUSoCState, (obj), TYPE_RISCV_U_SOC) -typedef struct SiFiveUSoCState { +struct SiFiveUSoCState {/*< private >*/ DeviceState parent_obj;
@@ -52,13 +54,14 @@ typedef struct SiFiveUSoCState {uint32_t serial;char *cpu_type; -} SiFiveUSoCState; +};#define TYPE_RISCV_U_MACHINE MACHINE_TYPE_NAME("sifive_u") +typedef struct SiFiveUState SiFiveUState ;#define RISCV_U_MACHINE (obj) \ OBJECT_CHECK(SiFiveUState, (obj), TYPE_RISCV_U_MACHINE) -typedef struct SiFiveUState { +struct SiFiveUState {/*< private >*/ MachineState parent_obj;
@@ -71,7 +74,7 @@ typedef struct SiFiveUState {bool start_in_flash;uint32_t msel;uint32_t serial; -} SiFiveUState; +};enum {SIFIVE_U_DEV_DEBUG ,
include/hw/rtc/m48t59.h +1 -1
@@ -34,10 +34,10 @@typedef struct NvramClass NvramClass ;DECLARE_CLASS_CHECKERS (NvramClass,NVRAM , TYPE_NVRAM) +typedef struct Nvram Nvram ;#define NVRAM (obj) \ INTERFACE_CHECK(Nvram, (obj), TYPE_NVRAM) -typedef struct Nvram Nvram ;struct NvramClass {InterfaceClass parent;
include/hw/sd/cadence_sdhci.h +1 -0
@@ -24,6 +24,7 @@#define CADENCE_SDHCI_H #include "hw/sd/sdhci.h" +#include "qom/object.h" #define CADENCE_SDHCI_REG_SIZE 0x100#define CADENCE_SDHCI_NUM_REGS (CADENCE_SDHCI_REG_SIZE / sizeof(uint32_t))
include/hw/ssi/npcm7xx_fiu.h +1 -0
@@ -18,6 +18,7 @@#include "hw/ssi/ssi.h" #include "hw/sysbus.h" +#include "qom/object.h" /* * Number of registers in our device state structure. Don't change this without
include/hw/ssi/sifive_spi.h +4 -2
@@ -21,13 +21,15 @@ #ifndef HW_SIFIVE_SPI_H #define HW_SIFIVE_SPI_H +#include "qom/object.h" #define SIFIVE_SPI_REG_NUM (0x78 / 4) #define TYPE_SIFIVE_SPI "sifive.spi" +typedef struct SiFiveSPIState SiFiveSPIState; #define SIFIVE_SPI(obj) OBJECT_CHECK(SiFiveSPIState, (obj), TYPE_SIFIVE_SPI) -typedef struct SiFiveSPIState { +struct SiFiveSPIState { SysBusDevice parent_obj; MemoryRegion mmio;
@@ -42,6 +44,6 @@ typedef struct SiFiveSPIState {Fifo8 rx_fifo; uint32_t regs[SIFIVE_SPI_REG_NUM]; -} SiFiveSPIState; +};#endif /* HW_SIFIVE_SPI_H */
include/hw/stream.h +1 -1
@@ -8,10 +8,10 @@typedef struct StreamSinkClass StreamSinkClass ;DECLARE_CLASS_CHECKERS (StreamSinkClass,STREAM_SINK , TYPE_STREAM_SINK) +typedef struct StreamSink StreamSink ;#define STREAM_SINK (obj) \ INTERFACE_CHECK(StreamSink, (obj), TYPE_STREAM_SINK) -typedef struct StreamSink StreamSink ;typedef void (*StreamCanPushNotifyFn )(void *opaque);
include/hw/timer/npcm7xx_timer.h +1 -0
@@ -19,6 +19,7 @@#include "exec/memory.h" #include "hw/sysbus.h" #include "qemu/timer.h" +#include "qom/object.h" /* Each Timer Module (TIM) instance holds five 25 MHz timers. */ #define NPCM7XX_TIMERS_PER_CTRL (5)
include/hw/tricore/tricore_testdevice.h +4 -2
@@ -21,18 +21,20 @@#include "hw/sysbus.h" #include "hw/hw.h" +#include "qom/object.h" #define TYPE_TRICORE_TESTDEVICE "tricore_testdevice" +typedef struct TriCoreTestDeviceState TriCoreTestDeviceState ;#define TRICORE_TESTDEVICE (obj) \ OBJECT_CHECK(TriCoreTestDeviceState, (obj), TYPE_TRICORE_TESTDEVICE) -typedef struct TriCoreTestDeviceState { +struct TriCoreTestDeviceState {/* <private> */ SysBusDevice parent_obj;/* <public> */ MemoryRegion iomem; -}TriCoreTestDeviceState ; +};#endif
include/hw/usb/hcd-dwc3.h +4 -2
@@ -28,16 +28,18 @@#include "hw/usb/hcd-xhci.h" #include "hw/usb/hcd-xhci-sysbus.h" +#include "qom/object.h" #define TYPE_USB_DWC3 "usb_dwc3" +typedef struct USBDWC3 USBDWC3 ;#define USB_DWC3 (obj) \ OBJECT_CHECK(USBDWC3, (obj), TYPE_USB_DWC3)#define USB_DWC3_R_MAX ((0x530 / 4) + 1)#define DWC3_SIZE 0x10000 -typedef struct USBDWC3 { +struct USBDWC3 {SysBusDevice parent_obj;MemoryRegion iomem;XHCISysbusState sysbus_xhci;
@@ -50,6 +52,6 @@ typedef struct USBDWC3 { uint32_t dwc_usb3_user; } cfg; -}USBDWC3 ; +};#endif
include/hw/usb/msd.h +1 -0
@@ -9,6 +9,7 @@#include "hw/usb.h" #include "hw/scsi/scsi.h" +#include "qom/object.h" enum USBMSDMode {USB_MSDM_CBW ,/* Command Block. */
include/hw/usb/xlnx-usb-subsystem.h +4 -2
@@ -27,19 +27,21 @@#include "hw/usb/xlnx-versal-usb2-ctrl-regs.h" #include "hw/usb/hcd-dwc3.h" +#include "qom/object.h" #define TYPE_XILINX_VERSAL_USB2 "xlnx.versal-usb2" +typedef struct VersalUsb2 VersalUsb2 ;#define VERSAL_USB2 (obj) \ OBJECT_CHECK(VersalUsb2, (obj), TYPE_XILINX_VERSAL_USB2) -typedef struct VersalUsb2 { +struct VersalUsb2 {SysBusDevice parent_obj;MemoryRegion dwc3_mr;MemoryRegion usb2Ctrl_mr;VersalUsb2CtrlRegs usb2Ctrl;USBDWC3 dwc3; -}VersalUsb2 ; +};#endif
include/hw/usb/xlnx-versal-usb2-ctrl-regs.h +4 -2
@@ -25,21 +25,23 @@#ifndef XLNX_USB2_REGS_H #define XLNX_USB2_REGS_H +#include "qom/object.h" #define TYPE_XILINX_VERSAL_USB2_CTRL_REGS "xlnx.versal-usb2-ctrl-regs" +typedef struct VersalUsb2CtrlRegs VersalUsb2CtrlRegs ;#define XILINX_VERSAL_USB2_CTRL_REGS (obj) \ OBJECT_CHECK(VersalUsb2CtrlRegs, (obj), TYPE_XILINX_VERSAL_USB2_CTRL_REGS)#define USB2_REGS_R_MAX ((0x78 / 4) + 1) -typedef struct VersalUsb2CtrlRegs { +struct VersalUsb2CtrlRegs {SysBusDevice parent_obj;MemoryRegion iomem;qemu_irq irq_ir;uint32_t regs[USB2_REGS_R_MAX ];RegisterInfo regs_info[USB2_REGS_R_MAX ]; -}VersalUsb2CtrlRegs ; +};#endif
include/hw/vmstate-if.h +1 -1
@@ -16,10 +16,10 @@typedef struct VMStateIfClass VMStateIfClass ;DECLARE_CLASS_CHECKERS (VMStateIfClass,VMSTATE_IF , TYPE_VMSTATE_IF) +typedef struct VMStateIf VMStateIf ;#define VMSTATE_IF (obj) \ INTERFACE_CHECK(VMStateIf, (obj), TYPE_VMSTATE_IF) -typedef struct VMStateIf VMStateIf ;struct VMStateIfClass {InterfaceClass parent_class;
include/hw/watchdog/sbsa_gwdt.h +4 -2
@@ -15,8 +15,10 @@#include "qemu/bitops.h" #include "hw/sysbus.h" #include "hw/irq.h" +#include "qom/object.h" #define TYPE_WDT_SBSA "sbsa_gwdt" +typedef struct SBSA_GWDTState SBSA_GWDTState ;#define SBSA_GWDT (obj) \ OBJECT_CHECK(SBSA_GWDTState, (obj), TYPE_WDT_SBSA)
@@ -53,7 +55,7 @@#define SBSA_TIMER_FREQ 62500000/* Hz */ -typedef struct SBSA_GWDTState { +struct SBSA_GWDTState {/* <private> */ SysBusDevice parent_obj;
@@ -70,6 +72,6 @@ typedef struct SBSA_GWDTState {uint32_t woru;uint32_t wcvl; uint32_t wcvu; -} SBSA_GWDTState; +};#endif /* WDT_SBSA_GWDT_H */
include/qom/object_interfaces.h +1 -1
@@ -10,11 +10,11 @@typedef struct UserCreatableClass UserCreatableClass ;DECLARE_CLASS_CHECKERS (UserCreatableClass,USER_CREATABLE , TYPE_USER_CREATABLE) +typedef struct UserCreatable UserCreatable ;#define USER_CREATABLE (obj) \ INTERFACE_CHECK(UserCreatable, (obj), \ TYPE_USER_CREATABLE) -typedef struct UserCreatable UserCreatable ;/** * UserCreatableClass:
include/sysemu/tpm.h +1 -1
@@ -31,10 +31,10 @@ typedef enum TPMVersion {typedef struct TPMIfClass TPMIfClass ;DECLARE_CLASS_CHECKERS (TPMIfClass,TPM_IF , TYPE_TPM_IF) +typedef struct TPMIf TPMIf ;#define TPM_IF (obj) \ INTERFACE_CHECK(TPMIf, (obj), TYPE_TPM_IF) -typedef struct TPMIf TPMIf ;struct TPMIfClass {InterfaceClass parent_class;
target/arm/idau.h +1 -1
@@ -31,13 +31,13 @@#include "qom/object.h" #define TYPE_IDAU_INTERFACE "idau-interface" +typedef struct IDAUInterface IDAUInterface ;#define IDAU_INTERFACE (obj) \ INTERFACE_CHECK(IDAUInterface, (obj), TYPE_IDAU_INTERFACE)typedef struct IDAUInterfaceClass IDAUInterfaceClass ;DECLARE_CLASS_CHECKERS (IDAUInterfaceClass,IDAU_INTERFACE , TYPE_IDAU_INTERFACE) -typedef struct IDAUInterface IDAUInterface ;#define IREGION_NOTVALID -1
target/hexagon/cpu.h +7 -4
@@ -17,6 +17,7 @@#ifndef HEXAGON_CPU_H #define HEXAGON_CPU_H +#include "qom/object.h" /* Forward declaration needed by some of the header files */ typedef struct CPUHexagonState CPUHexagonState ;
@@ -101,6 +102,8 @@ struct CPUHexagonState {target_ulong gather_issued; }; +typedef struct HexagonCPUClass HexagonCPUClass ; +typedef struct HexagonCPU HexagonCPU ;#define HEXAGON_CPU_CLASS (klass) \ OBJECT_CLASS_CHECK(HexagonCPUClass, (klass), TYPE_HEXAGON_CPU)#define HEXAGON_CPU (obj) \
@@ -108,15 +111,15 @@ struct CPUHexagonState {#define HEXAGON_CPU_GET_CLASS (obj) \ OBJECT_GET_CLASS(HexagonCPUClass, (obj), TYPE_HEXAGON_CPU) -typedef struct HexagonCPUClass { +struct HexagonCPUClass {/*< private >*/ CPUClass parent_class;/*< public >*/ DeviceRealize parent_realize;DeviceReset parent_reset; -}HexagonCPUClass ; +}; -typedef struct HexagonCPU { +struct HexagonCPU {/*< private >*/ CPUState parent_obj;/*< public >*/
@@ -125,7 +128,7 @@ typedef struct HexagonCPU {bool lldb_compat;target_ulong lldb_stack_adjust; -} HexagonCPU; +};#include "cpu_bits.h"
accel/tcg/tcg-all.c +1 -0
@@ -33,6 +33,7 @@#include "qemu/accel.h" #include "qapi/qapi-builtin-visit.h" #include "qemu/units.h" +#include "qom/object.h" #if !defined(CONFIG_USER_ONLY )#include "hw/boards.h" #endif
chardev/char-parallel.c +1 -0
@@ -28,6 +28,7 @@#include "qemu/module.h" #include "qemu/option.h" #include <sys/ioctl.h> +#include "qom/object.h" #ifdef CONFIG_BSD #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
hw/arm/bcm2836.c +1 -0
@@ -15,6 +15,7 @@#include "hw/arm/bcm2836.h" #include "hw/arm/raspi_platform.h" #include "hw/sysbus.h" +#include "qom/object.h" struct BCM283XClass {/*< private >*/
hw/m68k/mcf5206.c +1 -0
@@ -17,6 +17,7 @@#include "hw/ptimer.h" #include "sysemu/sysemu.h" #include "hw/sysbus.h" +#include "qom/object.h" /* General purpose timer module. */ typedef struct {
hw/mem/sparse-mem.c +4 -2
@@ -18,11 +18,13 @@#include "qemu/units.h" #include "sysemu/qtest.h" #include "hw/mem/sparse-mem.h" +#include "qom/object.h" +typedef struct SparseMemState SparseMemState ;#define SPARSE_MEM (obj) OBJECT_CHECK(SparseMemState, (obj), TYPE_SPARSE_MEM)#define SPARSE_BLOCK_SIZE 0x1000 -typedef struct SparseMemState { +struct SparseMemState {SysBusDevice parent_obj;MemoryRegion mmio;uint64_t baseaddr;
@@ -30,7 +32,7 @@ typedef struct SparseMemState {uint64_t size_used;uint64_t maxsize;GHashTable *mapped; -} SparseMemState; +}; typedef struct sparse_mem_block { uint8_t data[SPARSE_BLOCK_SIZE];
hw/mips/loongson3_virt.c +1 -0
@@ -52,6 +52,7 @@#include "sysemu/reset.h" #include "sysemu/runstate.h" #include "qemu/error-report.h" +#include "qom/object.h" #define PM_CNTL_MODE 0x10
hw/misc/npcm7xx_clk.c +1 -0
@@ -27,6 +27,7 @@#include "qemu/units.h" #include "trace.h" #include "sysemu/watchdog.h" +#include "qom/object.h" /* * The reference clock hz, and the SECCNT and CNTR25M registers in this module,
hw/misc/sbsa_ec.c +1 -0
@@ -15,6 +15,7 @@#include "qemu/log.h" #include "hw/sysbus.h" #include "sysemu/runstate.h" +#include "qom/object.h" typedef struct SECUREECState { SysBusDevice parent_obj;
hw/net/can/ctucan_pci.c +1 -0
@@ -40,6 +40,7 @@#include "net/can_emu.h" #include "ctucan_core.h" +#include "qom/object.h" #define TYPE_CTUCAN_PCI_DEV "ctucan_pci"
hw/nvram/npcm7xx_otp.c +1 -0
@@ -23,6 +23,7 @@#include "qemu/log.h" #include "qemu/module.h" #include "qemu/units.h" +#include "qom/object.h" /* Each module has 4 KiB of register space. Only a fraction of it is used. */ #define NPCM7XX_OTP_REGS_SIZE (4 * KiB)
hw/s390x/vhost-user-fs-ccw.c +1 -0
@@ -12,6 +12,7 @@#include "qapi/error.h" #include "hw/virtio/vhost-user-fs.h" #include "virtio-ccw.h" +#include "qom/object.h" typedef struct VHostUserFSCcw { VirtioCcwDevice parent_obj;
hw/sensor/adm1272.c +4 -2
@@ -16,8 +16,10 @@#include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" #define TYPE_ADM1272 "adm1272" +typedef struct ADM1272State ADM1272State ;#define ADM1272 (obj) OBJECT_CHECK(ADM1272State, (obj), TYPE_ADM1272)#define ADM1272_RESTART_TIME 0xCC
@@ -70,7 +72,7 @@#define ADM1272_IOUT_OFFSET 0x5000 -typedef struct ADM1272State { +struct ADM1272State {PMBusDevice parent;uint64_t ein_ext;
@@ -96,7 +98,7 @@ typedef struct ADM1272State {uint16_t strt_up_iout_lim; -} ADM1272State; +};static const PMBusCoefficients adm1272_coefficients[] = { [0 ] = {6770 ,0 ,-2 },/* voltage, vrange 60V */
hw/sensor/max34451.c +4 -2
@@ -14,8 +14,10 @@#include "qapi/visitor.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qom/object.h" #define TYPE_MAX34451 "max34451" +typedef struct MAX34451State MAX34451State ;#define MAX34451 (obj) OBJECT_CHECK(MAX34451State, (obj), TYPE_MAX34451)#define MAX34451_MFR_MODE 0xD1
@@ -134,7 +136,7 @@* @vout_scale: scale ADC reading to actual device reading if different * @iout_cal_gain: set ratio of the voltage at the ADC input to sensed current */ -typedef struct MAX34451State { +struct MAX34451State {PMBusDevice parent;uint16_t power_good_on[MAX34451_NUM_PWR_DEVICES ];
@@ -168,7 +170,7 @@ typedef struct MAX34451State {uint16_t temp_sensor_config[MAX34451_NUM_TEMP_DEVICES ];uint16_t store_single;uint16_t crc; -} MAX34451State; +};static void max34451_check_limits (MAX34451State *s)
hw/usb/u2f-emulated.c +1 -0
@@ -34,6 +34,7 @@#include <u2f-emu/u2f-emu.h> #include "u2f.h" +#include "qom/object.h" /* Counter which sync with a file */ struct synced_counter {
hw/usb/u2f-passthru.c +1 -0
@@ -33,6 +33,7 @@#include "migration/vmstate.h" #include "u2f.h" +#include "qom/object.h" #ifdef CONFIG_LIBUDEV #include <libudev.h>
hw/virtio/vhost-user-i2c-pci.c +1 -0
@@ -10,6 +10,7 @@#include "hw/qdev-properties.h" #include "hw/virtio/vhost-user-i2c.h" #include "virtio-pci.h" +#include "qom/object.h" struct VHostUserI2CPCI {VirtIOPCIProxy parent_obj;
tests/unit/check-qom-interface.c +1 -1
@@ -19,10 +19,10 @@typedef struct TestIfClass TestIfClass ;DECLARE_CLASS_CHECKERS (TestIfClass,TEST_IF , TYPE_TEST_IF) +typedef struct TestIf TestIf ;#define TEST_IF (obj) \ INTERFACE_CHECK(TestIf, (obj), TYPE_TEST_IF) -typedef struct TestIf TestIf ;struct TestIfClass {InterfaceClass parent_class;
ui/vdagent.c +1 -0
@@ -15,6 +15,7 @@#include "qapi/qapi-types-ui.h" #include "spice/vd_agent.h" +#include "qom/object.h" #define VDAGENT_BUFFER_LIMIT (1 * MiB)#define VDAGENT_MOUSE_DEFAULT true
Signature · 1 line
2.31.1
Re: [PATCH for-6.2 05/12] [automated] Move QOM typedefs and add missing includes
Quoted 147 lines · Eduardo Habkost
Some typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with
OBJECT_DECLARE_TYPE.Patch generated using:
$ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \ $(git grep -l '' -- '*.[ch]')which will:
- split "typdef struct { ... } TypedefName" declarations
- move the typedefs and #defines above the type check macros
- add missing #include "qom/object.h" lines if necessarySigned-off-by Eduardo Habkost <[email protected]>---
Cc: Richard Henderson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Marc-André Lureau" <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Andrew Baumann <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Igor Mammedov <[email protected]>
Cc: Alexander Bulekov <[email protected]>
Cc: Bandan Das <[email protected]>
Cc: Stefan Hajnoczi <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Jiaxun Yang <[email protected]>
Cc: Aurelien Jarno <[email protected]>
Cc: Aleksandar Rikalo <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Pavel Pisa <[email protected]>
Cc: Vikram Garhwal <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Klaus Jensen <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Vijai Kumar K <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: Corey Minyard <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Andrew Jeffery <[email protected]>
Cc: Joel Stanley <[email protected]>
Cc: Francisco Iglesias <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: Alexey Kardashevskiy <[email protected]>
Cc: "Hervé Poussineau" <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: Juan Quintela <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: Stefan Berger <[email protected]>
Cc: Taylor Simpson <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- hw/nvme/nvme.h | 6 ++++-- hw/usb/hcd-uhci.h | 1 + hw/usb/hcd-xhci-pci.h | 6 ++++-- hw/usb/hcd-xhci-sysbus.h | 6 ++++-- hw/usb/u2f.h | 6 ++++-- include/hw/acpi/acpi_dev_interface.h | 2 +- include/hw/adc/npcm7xx_adc.h | 1 + include/hw/arm/linux-boot-if.h | 2 +- include/hw/arm/npcm7xx.h | 11 +++++++---- include/hw/char/shakti_uart.h | 6 ++++-- include/hw/core/accel-cpu.h | 1 + include/hw/dma/sifive_pdma.h | 1 + include/hw/dma/xlnx_csu_dma.h | 1 + include/hw/fw-path-provider.h | 2 +- include/hw/gpio/npcm7xx_gpio.h | 1 + include/hw/hotplug.h | 2 +- include/hw/i2c/npcm7xx_smbus.h | 1 + include/hw/intc/intc.h | 2 +- include/hw/intc/m68k_irqc.h | 6 ++++-- include/hw/intc/sifive_clint.h | 6 ++++-- include/hw/ipmi/ipmi.h | 2 +- include/hw/mem/memory-device.h | 2 +- include/hw/mem/npcm7xx_mc.h | 1 + include/hw/misc/aspeed_lpc.h | 6 ++++-- include/hw/misc/bcm2835_cprman.h | 1 + include/hw/misc/bcm2835_cprman_internals.h | 1 + include/hw/misc/mchp_pfsoc_dmc.h | 1 + include/hw/misc/mchp_pfsoc_ioscb.h | 1 + include/hw/misc/mchp_pfsoc_sysreg.h | 1 + include/hw/misc/npcm7xx_clk.h | 1 + include/hw/misc/npcm7xx_gcr.h | 1 + include/hw/misc/npcm7xx_pwm.h | 1 + include/hw/misc/npcm7xx_rng.h | 1 + include/hw/misc/xlnx-versal-xramc.h | 6 ++++-- include/hw/net/npcm7xx_emc.h | 1 + include/hw/net/xlnx-zynqmp-can.h | 6 ++++-- include/hw/nmi.h | 2 +- include/hw/nvram/npcm7xx_otp.h | 1 + include/hw/ppc/spapr_drc.h | 15 +++++++++------ include/hw/ppc/spapr_xive.h | 11 +++++++---- include/hw/ppc/vof.h | 1 + include/hw/rdma/rdma.h | 2 +- include/hw/riscv/microchip_pfsoc.h | 1 + include/hw/riscv/shakti_c.h | 11 +++++++---- include/hw/riscv/sifive_e.h | 6 ++++-- include/hw/riscv/sifive_u.h | 11 +++++++---- include/hw/rtc/m48t59.h | 2 +- include/hw/sd/cadence_sdhci.h | 1 + include/hw/ssi/npcm7xx_fiu.h | 1 + include/hw/ssi/sifive_spi.h | 6 ++++-- include/hw/stream.h | 2 +- include/hw/timer/npcm7xx_timer.h | 1 + include/hw/tricore/tricore_testdevice.h | 6 ++++-- include/hw/usb/hcd-dwc3.h | 6 ++++-- include/hw/usb/msd.h | 1 + include/hw/usb/xlnx-usb-subsystem.h | 6 ++++-- include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 6 ++++-- include/hw/vmstate-if.h | 2 +- include/hw/watchdog/sbsa_gwdt.h | 6 ++++-- include/qom/object_interfaces.h | 2 +- include/sysemu/tpm.h | 2 +- target/arm/idau.h | 2 +- target/hexagon/cpu.h | 11 +++++++---- accel/tcg/tcg-all.c | 1 + chardev/char-parallel.c | 1 + hw/arm/bcm2836.c | 1 + hw/m68k/mcf5206.c | 1 + hw/mem/sparse-mem.c | 6 ++++-- hw/mips/loongson3_virt.c | 1 + hw/misc/npcm7xx_clk.c | 1 + hw/misc/sbsa_ec.c | 1 + hw/net/can/ctucan_pci.c | 1 + hw/nvram/npcm7xx_otp.c | 1 + hw/s390x/vhost-user-fs-ccw.c | 1 +
Quoted 8 lines
hw/sensor/adm1272.c | 6 ++++-- hw/sensor/max34451.c | 6 ++++-- hw/usb/u2f-emulated.c | 1 + hw/usb/u2f-passthru.c | 1 + hw/virtio/vhost-user-i2c-pci.c | 1 + tests/unit/check-qom-interface.c | 2 +- ui/vdagent.c | 1 + 81 files changed, 179 insertions(+), 82 deletions(-)
Re: [PATCH for-6.2 05/12] [automated] Move QOM typedefs and add missing includes
In reply to Eduardo HabkostQuoted 147 lines · Eduardo Habkost
Some typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with
OBJECT_DECLARE_TYPE.Patch generated using:
$ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \ $(git grep -l '' -- '*.[ch]')which will:
- split "typdef struct { ... } TypedefName" declarations
- move the typedefs and #defines above the type check macros
- add missing #include "qom/object.h" lines if necessarySigned-off-by Eduardo Habkost <[email protected]>---
Cc: Richard Henderson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: "Marc-André Lureau" <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Andrew Baumann <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Igor Mammedov <[email protected]>
Cc: Alexander Bulekov <[email protected]>
Cc: Bandan Das <[email protected]>
Cc: Stefan Hajnoczi <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Jiaxun Yang <[email protected]>
Cc: Aurelien Jarno <[email protected]>
Cc: Aleksandar Rikalo <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Pavel Pisa <[email protected]>
Cc: Vikram Garhwal <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Klaus Jensen <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Vijai Kumar K <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: Corey Minyard <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Andrew Jeffery <[email protected]>
Cc: Joel Stanley <[email protected]>
Cc: Francisco Iglesias <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: Alexey Kardashevskiy <[email protected]>
Cc: "Hervé Poussineau" <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: Juan Quintela <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: Stefan Berger <[email protected]>
Cc: Taylor Simpson <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- hw/nvme/nvme.h | 6 ++++-- hw/usb/hcd-uhci.h | 1 + hw/usb/hcd-xhci-pci.h | 6 ++++-- hw/usb/hcd-xhci-sysbus.h | 6 ++++-- hw/usb/u2f.h | 6 ++++-- include/hw/acpi/acpi_dev_interface.h | 2 +- include/hw/adc/npcm7xx_adc.h | 1 + include/hw/arm/linux-boot-if.h | 2 +- include/hw/arm/npcm7xx.h | 11 +++++++---- include/hw/char/shakti_uart.h | 6 ++++-- include/hw/core/accel-cpu.h | 1 + include/hw/dma/sifive_pdma.h | 1 + include/hw/dma/xlnx_csu_dma.h | 1 + include/hw/fw-path-provider.h | 2 +- include/hw/gpio/npcm7xx_gpio.h | 1 + include/hw/hotplug.h | 2 +- include/hw/i2c/npcm7xx_smbus.h | 1 + include/hw/intc/intc.h | 2 +- include/hw/intc/m68k_irqc.h | 6 ++++-- include/hw/intc/sifive_clint.h | 6 ++++-- include/hw/ipmi/ipmi.h | 2 +- include/hw/mem/memory-device.h | 2 +- include/hw/mem/npcm7xx_mc.h | 1 + include/hw/misc/aspeed_lpc.h | 6 ++++-- include/hw/misc/bcm2835_cprman.h | 1 + include/hw/misc/bcm2835_cprman_internals.h | 1 + include/hw/misc/mchp_pfsoc_dmc.h | 1 + include/hw/misc/mchp_pfsoc_ioscb.h | 1 + include/hw/misc/mchp_pfsoc_sysreg.h | 1 + include/hw/misc/npcm7xx_clk.h | 1 + include/hw/misc/npcm7xx_gcr.h | 1 + include/hw/misc/npcm7xx_pwm.h | 1 + include/hw/misc/npcm7xx_rng.h | 1 + include/hw/misc/xlnx-versal-xramc.h | 6 ++++-- include/hw/net/npcm7xx_emc.h | 1 + include/hw/net/xlnx-zynqmp-can.h | 6 ++++-- include/hw/nmi.h | 2 +- include/hw/nvram/npcm7xx_otp.h | 1 + include/hw/ppc/spapr_drc.h | 15 +++++++++------ include/hw/ppc/spapr_xive.h | 11 +++++++---- include/hw/ppc/vof.h | 1 + include/hw/rdma/rdma.h | 2 +- include/hw/riscv/microchip_pfsoc.h | 1 + include/hw/riscv/shakti_c.h | 11 +++++++---- include/hw/riscv/sifive_e.h | 6 ++++-- include/hw/riscv/sifive_u.h | 11 +++++++---- include/hw/rtc/m48t59.h | 2 +- include/hw/sd/cadence_sdhci.h | 1 + include/hw/ssi/npcm7xx_fiu.h | 1 + include/hw/ssi/sifive_spi.h | 6 ++++-- include/hw/stream.h | 2 +- include/hw/timer/npcm7xx_timer.h | 1 + include/hw/tricore/tricore_testdevice.h | 6 ++++-- include/hw/usb/hcd-dwc3.h | 6 ++++-- include/hw/usb/msd.h | 1 + include/hw/usb/xlnx-usb-subsystem.h | 6 ++++-- include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 6 ++++-- include/hw/vmstate-if.h | 2 +- include/hw/watchdog/sbsa_gwdt.h | 6 ++++-- include/qom/object_interfaces.h | 2 +- include/sysemu/tpm.h | 2 +- target/arm/idau.h | 2 +- target/hexagon/cpu.h | 11 +++++++---- accel/tcg/tcg-all.c | 1 + chardev/char-parallel.c | 1 + hw/arm/bcm2836.c | 1 + hw/m68k/mcf5206.c | 1 + hw/mem/sparse-mem.c | 6 ++++-- hw/mips/loongson3_virt.c | 1 + hw/misc/npcm7xx_clk.c | 1 + hw/misc/sbsa_ec.c | 1 + hw/net/can/ctucan_pci.c | 1 + hw/nvram/npcm7xx_otp.c | 1 + hw/s390x/vhost-user-fs-ccw.c | 1 +
Quoted 8 lines
hw/sensor/adm1272.c | 6 ++++-- hw/sensor/max34451.c | 6 ++++-- hw/usb/u2f-emulated.c | 1 + hw/usb/u2f-passthru.c | 1 + hw/virtio/vhost-user-i2c-pci.c | 1 + tests/unit/check-qom-interface.c | 2 +- ui/vdagent.c | 1 + 81 files changed, 179 insertions(+), 82 deletions(-)
Re: [PATCH for-6.2 05/12] [automated] Move QOM typedefs and add missing includes
In reply to Eduardo HabkostQuoted 9 lines · Eduardo Habkost
Some typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with
OBJECT_DECLARE_TYPE.Patch generated using:
$ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \ $(git grep -l '' -- '*.[ch]')
Quoted 6 lines
which will:
- split "typdef struct { ... } TypedefName" declarations
- move the typedefs and #defines above the type check macros
- add missing #include "qom/object.h" lines if necessarySigned-off-by Eduardo Habkost <[email protected]>
Just curious, how did my name ended on the CC'd list? I don't see any file that I touched or that is migration related.
Later, Juan.
Re: [PATCH for-6.2 05/12] [automated] Move QOM typedefs and add missing includes
Quoted 10 lines · Juan Quintela
Quoted 9 lines · Eduardo Habkost
Some typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with
OBJECT_DECLARE_TYPE.Patch generated using:
$ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \ $(git grep -l '' -- '*.[ch]')
Quoted 8 lines
Quoted 6 lines
which will:
- split "typdef struct { ... } TypedefName" declarations
- move the typedefs and #defines above the type check macros
- add missing #include "qom/object.h" lines if necessarySigned-off-by Eduardo Habkost <[email protected]>Reviewed-by Juan Quintela <[email protected]>
Thanks!
Quoted 3 lines
Just curious, how did my name ended on the CC'd list? I don't see any file that I touched or that is migration related.
include/hw/vmstate-if.h is in the migration section in MAINTAINERS.
Signature · 1 line
Eduardo
PATCH 6/12 Split QOM "typedef struct T { ... } T" declarations
In reply to Eduardo HabkostAutomatically split struct definition and typedef declaration in separate declarations, using a codeconverter rule. The rule will only touch declarations of structs/typedefs actually used by QOM types.
This will make automated changes to use OBJECT_DECLARE* macros easier to implement, because automated removal of typedef lines will be easier and safer.
Generated using:
$ ./scripts/codeconverter/converter.py -i \
--pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]')---
Cc: "Marc-André Lureau" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Patrick Venture <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Klaus Jensen <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Andrew Baumann <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- hw/nvme/nvme.h | 10 ++++++---- hw/usb/hcd-uhci.h | 5 +++-- hw/usb/u2f.h | 5 +++-- include/hw/adc/npcm7xx_adc.h | 5 +++-- include/hw/arm/npcm7xx.h | 10 ++++++---- include/hw/core/accel-cpu.h | 5 +++-- include/hw/dma/sifive_pdma.h | 5 +++-- include/hw/dma/xlnx_csu_dma.h | 5 +++-- include/hw/gpio/npcm7xx_gpio.h | 5 +++-- include/hw/i2c/npcm7xx_smbus.h | 5 +++-- include/hw/mem/npcm7xx_mc.h | 5 +++-- include/hw/misc/bcm2835_cprman.h | 20 ++++++++++++-------- include/hw/misc/mchp_pfsoc_dmc.h | 10 ++++++---- include/hw/misc/mchp_pfsoc_ioscb.h | 5 +++-- include/hw/misc/mchp_pfsoc_sysreg.h | 5 +++-- include/hw/misc/npcm7xx_clk.h | 15 +++++++++------ include/hw/misc/npcm7xx_gcr.h | 5 +++-- include/hw/misc/npcm7xx_mft.h | 5 +++-- include/hw/misc/npcm7xx_rng.h | 5 +++-- include/hw/nvram/npcm7xx_otp.h | 5 +++-- include/hw/riscv/microchip_pfsoc.h | 10 ++++++---- include/hw/riscv/sifive_e.h | 5 +++-- include/hw/sd/cadence_sdhci.h | 5 +++-- include/qemu/accel.h | 10 ++++++---- chardev/char-parallel.c | 10 ++++++---- hw/i2c/i2c_mux_pca954x.c | 5 +++-- hw/m68k/mcf5206.c | 5 +++-- hw/misc/sbsa_ec.c | 5 +++-- hw/s390x/vhost-user-fs-ccw.c | 5 +++-- tests/qtest/pnv-xscom-test.c | 5 +++-- 30 files changed, 123 insertions(+), 82 deletions(-)
hw/nvme/nvme.h +6 -4
@@ -118,7 +118,7 @@ typedef struct NvmeNamespaceParams {uint32_t zd_extension_size; } NvmeNamespaceParams; -typedef struct NvmeNamespace { +struct NvmeNamespace {DeviceState parent_obj;BlockConf blkconf;int32_t bootindex;
@@ -153,7 +153,8 @@ typedef struct NvmeNamespace {struct {uint32_t err_rec; } features; -} NvmeNamespace; +}; +typedef struct NvmeNamespace NvmeNamespace ;static inline uint32_t nvme_nsid (NvmeNamespace *ns) {
@@ -395,7 +396,7 @@ typedef struct NvmeParams {bool legacy_cmb; } NvmeParams; -typedef struct NvmeCtrl { +struct NvmeCtrl {PCIDevice parent_obj;MemoryRegion bar0;MemoryRegion iomem;
@@ -462,7 +463,8 @@ typedef struct NvmeCtrl { };uint32_t async_config; } features; -} NvmeCtrl; +}; +typedef struct NvmeCtrl NvmeCtrl ;static inline NvmeNamespace *nvme_ns (NvmeCtrl *n,uint32_t nsid) {
hw/usb/hcd-uhci.h +3 -2
@@ -43,7 +43,7 @@ typedef struct UHCIPort {uint16_t ctrl; } UHCIPort; -typedef struct UHCIState { +struct UHCIState {PCIDevice dev;MemoryRegion io_bar;USBBus bus;/* Note unused when we're a companion controller */
@@ -73,7 +73,8 @@ typedef struct UHCIState {char *masterbus;uint32_t firstport;uint32_t maxframes; -} UHCIState; +}; +typedef struct UHCIState UHCIState ;#define TYPE_UHCI "pci-uhci-usb"DECLARE_INSTANCE_CHECKER (UHCIState,UHCI ,TYPE_UHCI )
hw/usb/u2f.h +3 -2
@@ -62,7 +62,7 @@ struct U2FKeyClass {/* * State of the U2F key base device (i.e. hw/u2f.c) */ -typedef struct U2FKeyState { +struct U2FKeyState {USBDevice dev;USBEndpoint *ep;uint8_t idle;
@@ -72,7 +72,8 @@ typedef struct U2FKeyState {uint8_t pending_in_start;uint8_t pending_in_end;uint8_t pending_in_num; -} U2FKeyState; +}; +typedef struct U2FKeyState U2FKeyState ;/* * API to be used by the U2F key device variants (i.e. hw/u2f-*.c)
include/hw/adc/npcm7xx_adc.h +3 -2
@@ -43,7 +43,7 @@* @iref: The internal reference voltage, initialized at launch time. * @rv: The calibrated output values of 0.5V and 1.5V for the ADC. */ -typedef struct NPCM7xxADCState { +struct NPCM7xxADCState {SysBusDevice parent;MemoryRegion iomem;
@@ -61,7 +61,8 @@ typedef struct NPCM7xxADCState {uint32_t iref;uint16_t calibration_r_values[NPCM7XX_ADC_NUM_CALIB ]; -} NPCM7xxADCState; +}; +typedef struct NPCM7xxADCState NPCM7xxADCState ;#define TYPE_NPCM7XX_ADC "npcm7xx-adc"#define NPCM7XX_ADC (obj) \
include/hw/arm/npcm7xx.h +6 -4
@@ -52,7 +52,7 @@#define NPCM7XX_NR_PWM_MODULES 2 -typedef struct NPCM7xxMachine { +struct NPCM7xxMachine {MachineState parent;/* * PWM fan splitter. each splitter connects to one PWM output and
@@ -60,7 +60,8 @@ typedef struct NPCM7xxMachine {*/ SplitIRQ fan_splitter[NPCM7XX_NR_PWM_MODULES *NPCM7XX_PWM_PER_MODULE ]; -} NPCM7xxMachine; +}; +typedef struct NPCM7xxMachine NPCM7xxMachine ;#define TYPE_NPCM7XX_MACHINE MACHINE_TYPE_NAME("npcm7xx")typedef struct NPCM7xxMachineClass NPCM7xxMachineClass ;
@@ -78,7 +79,7 @@ struct NPCM7xxMachineClass {#define NPCM7XX_MACHINE_GET_CLASS (obj) \ OBJECT_GET_CLASS(NPCM7xxMachineClass, (obj), TYPE_NPCM7XX_MACHINE) -typedef struct NPCM7xxState { +struct NPCM7xxState {DeviceState parent;ARMCPU cpu[NPCM7XX_MAX_NUM_CPUS ];
@@ -105,7 +106,8 @@ typedef struct NPCM7xxState {OHCISysBusState ohci;NPCM7xxFIUState fiu[2 ];NPCM7xxEMCState emc[2 ]; -} NPCM7xxState; +}; +typedef struct NPCM7xxState NPCM7xxState ;#define TYPE_NPCM7XX "npcm7xx"typedef struct NPCM7xxClass NPCM7xxClass ;
include/hw/core/accel-cpu.h +3 -2
@@ -26,7 +26,7 @@typedef struct AccelCPUClass AccelCPUClass ; DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) -typedef struct AccelCPUClass { +struct AccelCPUClass {/*< private >*/ ObjectClass parent_class;/*< public >*/
@@ -34,6 +34,7 @@ typedef struct AccelCPUClass {void (*cpu_class_init)(CPUClass *cc);void (*cpu_instance_init)(CPUState *cpu); bool (*cpu_realizefn)(CPUState *cpu, Error **errp); -} AccelCPUClass; +}; +typedef struct AccelCPUClass AccelCPUClass ;#endif /* ACCEL_CPU_H */
include/hw/dma/sifive_pdma.h +3 -2
@@ -42,13 +42,14 @@ struct sifive_pdma_chan {#define SIFIVE_PDMA_REG_SIZE 0x100000#define SIFIVE_PDMA_CHAN_NO (reg) ((reg & (SIFIVE_PDMA_REG_SIZE - 1)) >> 12) -typedef struct SiFivePDMAState { +struct SiFivePDMAState {SysBusDevice parent;MemoryRegion iomem;qemu_irq irq[SIFIVE_PDMA_IRQS ];struct sifive_pdma_chan chan[SIFIVE_PDMA_CHANS ]; -}SiFivePDMAState ; +}; +typedef struct SiFivePDMAState SiFivePDMAState ;#define TYPE_SIFIVE_PDMA "sifive.pdma"
include/hw/dma/xlnx_csu_dma.h +3 -2
@@ -26,7 +26,7 @@#define XLNX_CSU_DMA_R_MAX (0x2c / 4) -typedef struct XlnxCSUDMA { +struct XlnxCSUDMA {SysBusDevice busdev;MemoryRegion iomem;MemTxAttrs attr;
@@ -45,7 +45,8 @@ typedef struct XlnxCSUDMA {uint32_t regs[XLNX_CSU_DMA_R_MAX ];RegisterInfo regs_info[XLNX_CSU_DMA_R_MAX ]; -} XlnxCSUDMA; +}; +typedef struct XlnxCSUDMA XlnxCSUDMA ;#define XLNX_CSU_DMA (obj) \ OBJECT_CHECK(XlnxCSUDMA, (obj), TYPE_XLNX_CSU_DMA)
include/hw/gpio/npcm7xx_gpio.h +3 -2
@@ -28,7 +28,7 @@*/ #define NPCM7XX_GPIO_NR_REGS (0x80 / sizeof(uint32_t)) -typedef struct NPCM7xxGPIOState { +struct NPCM7xxGPIOState {SysBusDevice parent;/* Properties to be defined by the SoC */
@@ -47,7 +47,8 @@ typedef struct NPCM7xxGPIOState {uint32_t ext_driven;uint32_t regs[NPCM7XX_GPIO_NR_REGS ]; -} NPCM7xxGPIOState; +}; +typedef struct NPCM7xxGPIOState NPCM7xxGPIOState ;#define TYPE_NPCM7XX_GPIO "npcm7xx-gpio"#define NPCM7XX_GPIO (obj) \
include/hw/i2c/npcm7xx_smbus.h +3 -2
@@ -69,7 +69,7 @@ typedef enum NPCM7xxSMBusStatus {* @rx_cur: The current position of rx_fifo. * @status: The current status of the SMBus. */ -typedef struct NPCM7xxSMBusState { +struct NPCM7xxSMBusState {SysBusDevice parent;MemoryRegion iomem;
@@ -105,7 +105,8 @@ typedef struct NPCM7xxSMBusState {uint8_t rx_cur;NPCM7xxSMBusStatus status; -} NPCM7xxSMBusState; +}; +typedef struct NPCM7xxSMBusState NPCM7xxSMBusState ;#define TYPE_NPCM7XX_SMBUS "npcm7xx-smbus"#define NPCM7XX_SMBUS (obj) OBJECT_CHECK(NPCM7xxSMBusState, (obj), \
include/hw/mem/npcm7xx_mc.h +3 -2
@@ -25,11 +25,12 @@* @parent: System bus device. * @mmio: Memory region through which registers are accessed. */ -typedef struct NPCM7xxMCState { +struct NPCM7xxMCState {SysBusDevice parent;MemoryRegion mmio; -}NPCM7xxMCState ; +}; +typedef struct NPCM7xxMCState NPCM7xxMCState ;#define TYPE_NPCM7XX_MC "npcm7xx-mc"#define NPCM7XX_MC (obj) OBJECT_CHECK(NPCM7xxMCState, (obj), TYPE_NPCM7XX_MC)
include/hw/misc/bcm2835_cprman.h +12 -8
@@ -118,7 +118,7 @@ typedef enum CprmanClockMuxSource {CPRMAN_NUM_CLOCK_MUX_SRC } CprmanClockMuxSource; -typedef struct CprmanPllState { +struct CprmanPllState {/*< private >*/ DeviceState parent_obj;
@@ -133,9 +133,10 @@ typedef struct CprmanPllState {Clock *xosc_in;Clock *out; -} CprmanPllState; +}; +typedef struct CprmanPllState CprmanPllState ; -typedef struct CprmanPllChannelState { +struct CprmanPllChannelState {/*< private >*/ DeviceState parent_obj;
@@ -151,9 +152,10 @@ typedef struct CprmanPllChannelState {Clock *pll_in;Clock *out; -} CprmanPllChannelState; +}; +typedef struct CprmanPllChannelState CprmanPllChannelState ; -typedef struct CprmanClockMuxState { +struct CprmanClockMuxState {/*< private >*/ DeviceState parent_obj;
@@ -173,9 +175,10 @@ typedef struct CprmanClockMuxState {* source number. */ struct CprmanClockMuxState *backref[CPRMAN_NUM_CLOCK_MUX_SRC ]; -} CprmanClockMuxState; +}; +typedef struct CprmanClockMuxState CprmanClockMuxState ; -typedef struct CprmanDsi0HsckMuxState { +struct CprmanDsi0HsckMuxState {/*< private >*/ DeviceState parent_obj;
@@ -187,7 +190,8 @@ typedef struct CprmanDsi0HsckMuxState {Clock *plla_in;Clock *plld_in;Clock *out; -} CprmanDsi0HsckMuxState; +}; +typedef struct CprmanDsi0HsckMuxState CprmanDsi0HsckMuxState ;struct BCM2835CprmanState {/*< private >*/
include/hw/misc/mchp_pfsoc_dmc.h +6 -4
@@ -28,10 +28,11 @@#define MCHP_PFSOC_DDR_SGMII_PHY_REG_SIZE 0x1000 -typedef struct MchpPfSoCDdrSgmiiPhyState { +struct MchpPfSoCDdrSgmiiPhyState {SysBusDevice parent;MemoryRegion sgmii_phy; -}MchpPfSoCDdrSgmiiPhyState ; +}; +typedef struct MchpPfSoCDdrSgmiiPhyState MchpPfSoCDdrSgmiiPhyState ;#define TYPE_MCHP_PFSOC_DDR_SGMII_PHY "mchp.pfsoc.ddr_sgmii_phy"
@@ -43,10 +44,11 @@ typedef struct MchpPfSoCDdrSgmiiPhyState {#define MCHP_PFSOC_DDR_CFG_REG_SIZE 0x40000 -typedef struct MchpPfSoCDdrCfgState { +struct MchpPfSoCDdrCfgState {SysBusDevice parent;MemoryRegion cfg; -}MchpPfSoCDdrCfgState ; +}; +typedef struct MchpPfSoCDdrCfgState MchpPfSoCDdrCfgState ;#define TYPE_MCHP_PFSOC_DDR_CFG "mchp.pfsoc.ddr_cfg"
include/hw/misc/mchp_pfsoc_ioscb.h +3 -2
@@ -24,7 +24,7 @@#define MCHP_PFSOC_IOSCB_H #include "qom/object.h" -typedef struct MchpPfSoCIoscbState { +struct MchpPfSoCIoscbState {SysBusDevice parent;MemoryRegion container;MemoryRegion lane01;
@@ -41,7 +41,8 @@ typedef struct MchpPfSoCIoscbState {MemoryRegion cfm_sgmii;MemoryRegion bc_sgmii;MemoryRegion io_calib_sgmii; -} MchpPfSoCIoscbState; +}; +typedef struct MchpPfSoCIoscbState MchpPfSoCIoscbState ;#define TYPE_MCHP_PFSOC_IOSCB "mchp.pfsoc.ioscb"
include/hw/misc/mchp_pfsoc_sysreg.h +3 -2
@@ -26,10 +26,11 @@#define MCHP_PFSOC_SYSREG_REG_SIZE 0x2000 -typedef struct MchpPfSoCSysregState { +struct MchpPfSoCSysregState {SysBusDevice parent;MemoryRegion sysreg; -}MchpPfSoCSysregState ; +}; +typedef struct MchpPfSoCSysregState MchpPfSoCSysregState ;#define TYPE_MCHP_PFSOC_SYSREG "mchp.pfsoc.sysreg"
include/hw/misc/npcm7xx_clk.h +9 -6
@@ -91,7 +91,7 @@ typedef struct NPCM7xxCLKState NPCM7xxCLKState;* @clock_out: The output clock of this module. * @reg: The control registers for this PLL module. */ -typedef struct NPCM7xxClockPLLState { +struct NPCM7xxClockPLLState {DeviceState parent;const char *name;
@@ -100,7 +100,8 @@ typedef struct NPCM7xxClockPLLState {Clock *clock_out;int reg; -} NPCM7xxClockPLLState; +}; +typedef struct NPCM7xxClockPLLState NPCM7xxClockPLLState ;/** * struct NPCM7xxClockSELState - A SEL module in CLK module.
@@ -112,7 +113,7 @@ typedef struct NPCM7xxClockPLLState {* @offset: The offset of this module in the control register. * @len: The length of this module in the control register. */ -typedef struct NPCM7xxClockSELState { +struct NPCM7xxClockSELState {DeviceState parent;const char *name;
@@ -123,7 +124,8 @@ typedef struct NPCM7xxClockSELState {int offset;int len; -} NPCM7xxClockSELState; +}; +typedef struct NPCM7xxClockSELState NPCM7xxClockSELState ;/** * struct NPCM7xxClockDividerState - A Divider module in CLK module.
@@ -137,7 +139,7 @@ typedef struct NPCM7xxClockSELState {* @len: The length of the divisor in the control register. * @divisor: The divisor for a constant divisor */ -typedef struct NPCM7xxClockDividerState { +struct NPCM7xxClockDividerState {DeviceState parent;const char *name;
@@ -154,7 +156,8 @@ typedef struct NPCM7xxClockDividerState { };int divisor; }; -} NPCM7xxClockDividerState; +}; +typedef struct NPCM7xxClockDividerState NPCM7xxClockDividerState ;struct NPCM7xxCLKState {SysBusDevice parent;
include/hw/misc/npcm7xx_gcr.h +3 -2
@@ -26,7 +26,7 @@*/ #define NPCM7XX_GCR_NR_REGS (0x148 / sizeof(uint32_t)) -typedef struct NPCM7xxGCRState { +struct NPCM7xxGCRState {SysBusDevice parent;MemoryRegion iomem;
@@ -36,7 +36,8 @@ typedef struct NPCM7xxGCRState {uint32_t reset_pwron;uint32_t reset_mdlr;uint32_t reset_intcr3; -} NPCM7xxGCRState; +}; +typedef struct NPCM7xxGCRState NPCM7xxGCRState ;#define TYPE_NPCM7XX_GCR "npcm7xx-gcr"#define NPCM7XX_GCR (obj) OBJECT_CHECK(NPCM7xxGCRState, (obj), TYPE_NPCM7XX_GCR)
include/hw/misc/npcm7xx_mft.h +3 -2
@@ -49,7 +49,7 @@* @max_rpm: The maximum rpm for fans. Order: A0, B0, A1, B1. * @duty: The duty cycles for fans, relative to NPCM7XX_PWM_MAX_DUTY. */ -typedef struct NPCM7xxMFTState { +struct NPCM7xxMFTState {SysBusDevice parent;MemoryRegion iomem;
@@ -61,7 +61,8 @@ typedef struct NPCM7xxMFTState {uint32_t max_rpm[NPCM7XX_MFT_FANIN_COUNT ];uint32_t duty[NPCM7XX_MFT_FANIN_COUNT ]; -} NPCM7xxMFTState; +}; +typedef struct NPCM7xxMFTState NPCM7xxMFTState ;#define TYPE_NPCM7XX_MFT "npcm7xx-mft"#define NPCM7XX_MFT (obj) \
include/hw/misc/npcm7xx_rng.h +3 -2
@@ -19,7 +19,7 @@#include "hw/sysbus.h" #include "qom/object.h" -typedef struct NPCM7xxRNGState { +struct NPCM7xxRNGState {SysBusDevice parent;MemoryRegion iomem;
@@ -27,7 +27,8 @@ typedef struct NPCM7xxRNGState {uint8_t rngcs;uint8_t rngd;uint8_t rngmode; -} NPCM7xxRNGState; +}; +typedef struct NPCM7xxRNGState NPCM7xxRNGState ;#define TYPE_NPCM7XX_RNG "npcm7xx-rng"#define NPCM7XX_RNG (obj) OBJECT_CHECK(NPCM7xxRNGState, (obj), TYPE_NPCM7XX_RNG)
include/hw/nvram/npcm7xx_otp.h +3 -2
@@ -48,13 +48,14 @@* @regs: Register contents. * @array: OTP storage array. */ -typedef struct NPCM7xxOTPState { +struct NPCM7xxOTPState {SysBusDevice parent;MemoryRegion mmio;uint32_t regs[NPCM7XX_OTP_NR_REGS ];uint8_t array[NPCM7XX_OTP_ARRAY_BYTES ]; -}NPCM7xxOTPState ; +}; +typedef struct NPCM7xxOTPState NPCM7xxOTPState ;#define TYPE_NPCM7XX_OTP "npcm7xx-otp"#define NPCM7XX_OTP (obj) OBJECT_CHECK(NPCM7xxOTPState, (obj), TYPE_NPCM7XX_OTP)
include/hw/riscv/microchip_pfsoc.h +6 -4
@@ -31,7 +31,7 @@#include "hw/sd/cadence_sdhci.h" #include "qom/object.h" -typedef struct MicrochipPFSoCState { +struct MicrochipPFSoCState {/*< private >*/ DeviceState parent_obj;
@@ -54,19 +54,21 @@ typedef struct MicrochipPFSoCState {CadenceGEMState gem0;CadenceGEMState gem1;CadenceSDHCIState sdhci; -} MicrochipPFSoCState; +}; +typedef struct MicrochipPFSoCState MicrochipPFSoCState ;#define TYPE_MICROCHIP_PFSOC "microchip.pfsoc"#define MICROCHIP_PFSOC (obj) \ OBJECT_CHECK(MicrochipPFSoCState, (obj), TYPE_MICROCHIP_PFSOC) -typedef struct MicrochipIcicleKitState { +struct MicrochipIcicleKitState {/*< private >*/ MachineState parent_obj;/*< public >*/ MicrochipPFSoCState soc; -}MicrochipIcicleKitState ; +}; +typedef struct MicrochipIcicleKitState MicrochipIcicleKitState ;#define TYPE_MICROCHIP_ICICLE_KIT_MACHINE \ MACHINE_TYPE_NAME("microchip-icicle-kit")
include/hw/riscv/sifive_e.h +3 -2
@@ -41,14 +41,15 @@ struct SiFiveESoCState {MemoryRegion mask_rom; }; -typedef struct SiFiveEState { +struct SiFiveEState {/*< private >*/ SysBusDevice parent_obj;/*< public >*/ SiFiveESoCState soc;bool revb; -}SiFiveEState ; +}; +typedef struct SiFiveEState SiFiveEState ;#define TYPE_RISCV_E_MACHINE MACHINE_TYPE_NAME("sifive_e")#define RISCV_E_MACHINE (obj) \
include/hw/sd/cadence_sdhci.h +3 -2
@@ -29,7 +29,7 @@#define CADENCE_SDHCI_REG_SIZE 0x100#define CADENCE_SDHCI_NUM_REGS (CADENCE_SDHCI_REG_SIZE / sizeof(uint32_t)) -typedef struct CadenceSDHCIState { +struct CadenceSDHCIState {SysBusDevice parent;MemoryRegion container;
@@ -39,7 +39,8 @@ typedef struct CadenceSDHCIState {uint32_t regs[CADENCE_SDHCI_NUM_REGS ];SDHCIState sdhci; -} CadenceSDHCIState; +}; +typedef struct CadenceSDHCIState CadenceSDHCIState ;#define TYPE_CADENCE_SDHCI "cadence.sdhci"#define CADENCE_SDHCI (obj) OBJECT_CHECK(CadenceSDHCIState, (obj), \
include/qemu/accel.h +6 -4
@@ -26,12 +26,13 @@#include "qom/object.h" #include "exec/hwaddr.h" -typedef struct AccelState { +struct AccelState {/*< private >*/ Object parent_obj; -}AccelState ; +}; +typedef struct AccelState AccelState ; -typedef struct AccelClass { +struct AccelClass {/*< private >*/ ObjectClass parent_class;/*< public >*/
@@ -52,7 +53,8 @@ typedef struct AccelClass {* compat_props or user-provided global properties. */ GPtrArray *compat_props; -} AccelClass; +}; +typedef struct AccelClass AccelClass ;#define TYPE_ACCEL_BASE "accel"
chardev/char-parallel.c +6 -4
@@ -50,11 +50,12 @@#if defined(__linux__) -typedef struct ParallelChardev { +struct ParallelChardev {Chardev parent;int fd;int mode; -}ParallelChardev ; +}; +typedef struct ParallelChardev ParallelChardev ;#define PARALLEL_CHARDEV (obj) \ OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL)
@@ -178,10 +179,11 @@ static void qemu_chr_open_pp_fd(Chardev *chr,#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -typedef struct ParallelChardev { +struct ParallelChardev {Chardev parent;int fd; -}ParallelChardev ; +}; +typedef struct ParallelChardev ParallelChardev ;#define PARALLEL_CHARDEV (obj) \ OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL)
hw/i2c/i2c_mux_pca954x.c +3 -2
@@ -36,13 +36,14 @@* @bus: The owned channel bus. * @enabled: Is this channel active? */ -typedef struct Pca954xChannel { +struct Pca954xChannel {SysBusDevice parent;I2CBus *bus;bool enabled; -}Pca954xChannel ; +}; +typedef struct Pca954xChannel Pca954xChannel ;#define TYPE_PCA954X_CHANNEL "pca954x-channel"#define PCA954X_CHANNEL (obj) \
hw/m68k/mcf5206.c +3 -2
@@ -161,7 +161,7 @@ static m5206_timer_state *m5206_timer_init(qemu_irq irq)/* System Integration Module. */ -typedef struct m5206_mbar_state { +struct m5206_mbar_state {SysBusDevice parent_obj;M68kCPU *cpu;
@@ -178,7 +178,8 @@ typedef struct m5206_mbar_state {uint8_t par;/* Include the UART vector registers here. */ uint8_t uivr[2 ]; -} m5206_mbar_state; +}; +typedef struct m5206_mbar_state m5206_mbar_state ;#define MCF5206_MBAR (obj) OBJECT_CHECK(m5206_mbar_state, (obj), TYPE_MCF5206_MBAR)
hw/misc/sbsa_ec.c +3 -2
@@ -17,10 +17,11 @@#include "sysemu/runstate.h" #include "qom/object.h" -typedef struct SECUREECState { +struct SECUREECState {SysBusDevice parent_obj;MemoryRegion iomem; -}SECUREECState ; +}; +typedef struct SECUREECState SECUREECState ;#define TYPE_SBSA_EC "sbsa-ec"#define SECURE_EC (obj) OBJECT_CHECK(SECUREECState, (obj), TYPE_SBSA_EC)
hw/s390x/vhost-user-fs-ccw.c +3 -2
@@ -14,10 +14,11 @@#include "virtio-ccw.h" #include "qom/object.h" -typedef struct VHostUserFSCcw { +struct VHostUserFSCcw {VirtioCcwDevice parent_obj;VHostUserFS vdev; -}VHostUserFSCcw ; +}; +typedef struct VHostUserFSCcw VHostUserFSCcw ;#define TYPE_VHOST_USER_FS_CCW "vhost-user-fs-ccw"#define VHOST_USER_FS_CCW (obj) \
tests/qtest/pnv-xscom-test.c +3 -2
@@ -17,13 +17,14 @@ typedef enum PnvChipType {PNV_CHIP_POWER9 ,/* AKA Nimbus */ } PnvChipType; -typedef struct PnvChip { +struct PnvChip {PnvChipType chip_type;const char *cpu_model;uint64_t xscom_base;uint64_t cfam_id;uint32_t first_core; -}PnvChip ; +}; +typedef struct PnvChip PnvChip ;static const PnvChip pnv_chips[] = { {
Signature · 1 line
2.31.1
Re: [PATCH for-6.2 06/12] [automated] Split QOM "typedef struct T { ... } T" declarations
Quoted 72 lines · Eduardo Habkost
Automatically split struct definition and typedef declaration in separate declarations, using a codeconverter rule. The rule will only touch declarations of structs/typedefs actually used by QOM types.
This will make automated changes to use OBJECT_DECLARE* macros easier to implement, because automated removal of typedef lines will be easier and safer.
Generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]')Signed-off-by Eduardo Habkost <[email protected]>---
Cc: "Marc-André Lureau" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Patrick Venture <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Klaus Jensen <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Andrew Baumann <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- hw/nvme/nvme.h | 10 ++++++---- hw/usb/hcd-uhci.h | 5 +++-- hw/usb/u2f.h | 5 +++-- include/hw/adc/npcm7xx_adc.h | 5 +++-- include/hw/arm/npcm7xx.h | 10 ++++++---- include/hw/core/accel-cpu.h | 5 +++-- include/hw/dma/sifive_pdma.h | 5 +++-- include/hw/dma/xlnx_csu_dma.h | 5 +++-- include/hw/gpio/npcm7xx_gpio.h | 5 +++-- include/hw/i2c/npcm7xx_smbus.h | 5 +++-- include/hw/mem/npcm7xx_mc.h | 5 +++-- include/hw/misc/bcm2835_cprman.h | 20 ++++++++++++-------- include/hw/misc/mchp_pfsoc_dmc.h | 10 ++++++---- include/hw/misc/mchp_pfsoc_ioscb.h | 5 +++-- include/hw/misc/mchp_pfsoc_sysreg.h | 5 +++-- include/hw/misc/npcm7xx_clk.h | 15 +++++++++------ include/hw/misc/npcm7xx_gcr.h | 5 +++-- include/hw/misc/npcm7xx_mft.h | 5 +++-- include/hw/misc/npcm7xx_rng.h | 5 +++-- include/hw/nvram/npcm7xx_otp.h | 5 +++-- include/hw/riscv/microchip_pfsoc.h | 10 ++++++---- include/hw/riscv/sifive_e.h | 5 +++-- include/hw/sd/cadence_sdhci.h | 5 +++--
Quoted 8 lines
include/qemu/accel.h | 10 ++++++---- chardev/char-parallel.c | 10 ++++++---- hw/i2c/i2c_mux_pca954x.c | 5 +++-- hw/m68k/mcf5206.c | 5 +++-- hw/misc/sbsa_ec.c | 5 +++-- hw/s390x/vhost-user-fs-ccw.c | 5 +++-- tests/qtest/pnv-xscom-test.c | 5 +++-- 30 files changed, 123 insertions(+), 82 deletions(-)
PATCH 7/12 Use DECLARE_*CHECKER* macros when possible
In reply to Eduardo HabkostConverting existing QOM types to OBJECT_DECLARE_TYPE is not always trivial (due to inconsistent type/macro naming schemes), but at least converting existing manual QOM type checking macros to use DECLARE_*CHECKER* is a simpler process, and should at least discourage people from defining new QOM type checker macros manually.
Generated using:
$ ./scripts/codeconverter/converter.py -i \
--pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]')---
Cc: "Marc-André Lureau" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Patrick Venture <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Igor Mammedov <[email protected]>
Cc: Alexander Bulekov <[email protected]>
Cc: Bandan Das <[email protected]>
Cc: Stefan Hajnoczi <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Klaus Jensen <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Vijai Kumar K <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Andrew Jeffery <[email protected]>
Cc: Joel Stanley <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Vikram Garhwal <[email protected]>
Cc: Francisco Iglesias <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: Taylor Simpson <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- hw/nvme/nvme.h | 12 ++++++------ hw/usb/hcd-xhci-pci.h | 4 ++-- hw/usb/hcd-xhci-sysbus.h | 4 ++-- hw/usb/u2f.h | 8 ++------ include/hw/adc/npcm7xx_adc.h | 4 ++-- include/hw/arm/npcm7xx.h | 15 ++++----------- include/hw/char/shakti_uart.h | 4 ++-- include/hw/dma/sifive_pdma.h | 4 ++-- include/hw/dma/xlnx_csu_dma.h | 4 ++-- include/hw/gpio/npcm7xx_gpio.h | 4 ++-- include/hw/i2c/npcm7xx_smbus.h | 4 ++-- include/hw/intc/m68k_irqc.h | 4 ++-- include/hw/intc/sifive_clint.h | 4 ++-- include/hw/mem/npcm7xx_mc.h | 3 ++- include/hw/misc/aspeed_lpc.h | 3 ++- include/hw/misc/mchp_pfsoc_dmc.h | 10 ++++------ include/hw/misc/mchp_pfsoc_ioscb.h | 4 ++-- include/hw/misc/mchp_pfsoc_sysreg.h | 5 ++--- include/hw/misc/npcm7xx_clk.h | 3 ++- include/hw/misc/npcm7xx_gcr.h | 3 ++- include/hw/misc/npcm7xx_mft.h | 4 ++-- include/hw/misc/npcm7xx_pwm.h | 4 ++-- include/hw/misc/npcm7xx_rng.h | 3 ++- include/hw/misc/xlnx-versal-xramc.h | 4 ++-- include/hw/net/npcm7xx_emc.h | 4 ++-- include/hw/net/xlnx-zynqmp-can.h | 4 ++-- include/hw/nvram/npcm7xx_otp.h | 3 ++- include/hw/ppc/spapr_drc.h | 13 ++++--------- include/hw/ppc/spapr_xive.h | 7 ++----- include/hw/riscv/microchip_pfsoc.h | 9 ++++----- include/hw/riscv/shakti_c.h | 8 ++++---- include/hw/riscv/sifive_e.h | 8 ++++---- include/hw/riscv/sifive_u.h | 8 ++++---- include/hw/sd/cadence_sdhci.h | 4 ++-- include/hw/ssi/npcm7xx_fiu.h | 3 ++- include/hw/ssi/sifive_spi.h | 3 ++- include/hw/timer/npcm7xx_timer.h | 4 ++-- include/hw/tricore/tricore_testdevice.h | 4 ++-- include/hw/usb/hcd-dwc3.h | 4 ++-- include/hw/usb/xlnx-usb-subsystem.h | 4 ++-- include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 4 ++-- include/hw/watchdog/sbsa_gwdt.h | 4 ++-- include/qemu/accel.h | 8 ++------ target/hexagon/cpu.h | 8 ++------ chardev/char-parallel.c | 6 ++---- hw/i2c/i2c_mux_pca954x.c | 4 ++-- hw/m68k/mcf5206.c | 3 ++- hw/mem/sparse-mem.c | 3 ++- hw/misc/sbsa_ec.c | 3 ++- hw/s390x/vhost-user-fs-ccw.c | 4 ++-- hw/sensor/adm1272.c | 3 ++- hw/sensor/max34451.c | 3 ++- hw/usb/u2f-emulated.c | 4 ++-- hw/usb/u2f-passthru.c | 4 ++-- 54 files changed, 126 insertions(+), 146 deletions(-)
hw/nvme/nvme.h +6 -6
@@ -43,8 +43,8 @@ typedef struct NvmeBus {#define TYPE_NVME_SUBSYS "nvme-subsys"typedef struct NvmeSubsystem NvmeSubsystem ; -#define NVME_SUBSYS (obj) \ - OBJECT_CHECK(NvmeSubsystem, (obj), TYPE_NVME_SUBSYS) +DECLARE_INSTANCE_CHECKER (NvmeSubsystem,NVME_SUBSYS , + TYPE_NVME_SUBSYS)struct NvmeSubsystem {DeviceState parent_obj;
@@ -83,8 +83,8 @@ static inline NvmeNamespace *nvme_subsys_ns(NvmeSubsystem *subsys, }#define TYPE_NVME_NS "nvme-ns" -#define NVME_NS (obj) \ - OBJECT_CHECK(NvmeNamespace, (obj), TYPE_NVME_NS) +DECLARE_INSTANCE_CHECKER (NvmeNamespace,NVME_NS , + TYPE_NVME_NS) typedef struct NvmeZone { NvmeZoneDescr d;
@@ -377,8 +377,8 @@ typedef struct NvmeCQueue { } NvmeCQueue;#define TYPE_NVME "nvme" -#define NVME (obj) \ - OBJECT_CHECK(NvmeCtrl, (obj), TYPE_NVME) +DECLARE_INSTANCE_CHECKER (NvmeCtrl,NVME , + TYPE_NVME) typedef struct NvmeParams { char *serial;
hw/usb/hcd-xhci-pci.h +2 -2
@@ -30,8 +30,8 @@#define TYPE_XHCI_PCI "pci-xhci"typedef struct XHCIPciState XHCIPciState ; -#define XHCI_PCI (obj) \ - OBJECT_CHECK(XHCIPciState, (obj), TYPE_XHCI_PCI) +DECLARE_INSTANCE_CHECKER (XHCIPciState,XHCI_PCI , + TYPE_XHCI_PCI)struct XHCIPciState {
hw/usb/hcd-xhci-sysbus.h +2 -2
@@ -17,8 +17,8 @@#include "qom/object.h" typedef struct XHCISysbusState XHCISysbusState ; -#define XHCI_SYSBUS (obj) \ - OBJECT_CHECK(XHCISysbusState, (obj), TYPE_XHCI_SYSBUS) +DECLARE_INSTANCE_CHECKER (XHCISysbusState,XHCI_SYSBUS , + TYPE_XHCI_SYSBUS)struct XHCISysbusState {
hw/usb/u2f.h +2 -6
@@ -37,12 +37,8 @@ typedef struct U2FKeyInfo U2FKeyInfo;#define TYPE_U2F_KEY "u2f-key"typedef struct U2FKeyClass U2FKeyClass ; -#define U2F_KEY (obj) \ - OBJECT_CHECK(U2FKeyState, (obj), TYPE_U2F_KEY) -#define U2F_KEY_CLASS (klass) \ - OBJECT_CLASS_CHECK(U2FKeyClass, (klass), TYPE_U2F_KEY) -#define U2F_KEY_GET_CLASS (obj) \ - OBJECT_GET_CLASS(U2FKeyClass, (obj), TYPE_U2F_KEY) +DECLARE_OBJ_CHECKERS (U2FKeyState, U2FKeyClass, +U2F_KEY ,TYPE_U2F_KEY )/* * Callbacks to be used by the U2F key base device (i.e. hw/u2f.c)
include/hw/adc/npcm7xx_adc.h +2 -2
@@ -65,7 +65,7 @@ struct NPCM7xxADCState {typedef struct NPCM7xxADCState NPCM7xxADCState ;#define TYPE_NPCM7XX_ADC "npcm7xx-adc" -#define NPCM7XX_ADC (obj) \ - OBJECT_CHECK(NPCM7xxADCState, (obj), TYPE_NPCM7XX_ADC) +DECLARE_INSTANCE_CHECKER (NPCM7xxADCState,NPCM7XX_ADC , + TYPE_NPCM7XX_ADC)#endif /* NPCM7XX_ADC_H */
include/hw/arm/npcm7xx.h +4 -11
@@ -65,8 +65,8 @@ typedef struct NPCM7xxMachine NPCM7xxMachine;#define TYPE_NPCM7XX_MACHINE MACHINE_TYPE_NAME("npcm7xx")typedef struct NPCM7xxMachineClass NPCM7xxMachineClass ; -#define NPCM7XX_MACHINE (obj) \ - OBJECT_CHECK(NPCM7xxMachine, (obj), TYPE_NPCM7XX_MACHINE) +DECLARE_OBJ_CHECKERS (NPCM7xxMachine, NPCM7xxMachineClass, + NPCM7XX_MACHINE, TYPE_NPCM7XX_MACHINE)struct NPCM7xxMachineClass {MachineClass parent;
@@ -74,10 +74,6 @@ struct NPCM7xxMachineClass {const char *soc_type; }; -#define NPCM7XX_MACHINE_CLASS (klass) \ - OBJECT_CLASS_CHECK(NPCM7xxMachineClass, (klass), TYPE_NPCM7XX_MACHINE) -#define NPCM7XX_MACHINE_GET_CLASS (obj) \ - OBJECT_GET_CLASS(NPCM7xxMachineClass, (obj), TYPE_NPCM7XX_MACHINE)struct NPCM7xxState {DeviceState parent;
@@ -111,7 +107,8 @@ typedef struct NPCM7xxState NPCM7xxState;#define TYPE_NPCM7XX "npcm7xx"typedef struct NPCM7xxClass NPCM7xxClass ; -#define NPCM7XX (obj) OBJECT_CHECK(NPCM7xxState, (obj), TYPE_NPCM7XX) +DECLARE_OBJ_CHECKERS (NPCM7xxState, NPCM7xxClass, + NPCM7XX, TYPE_NPCM7XX)#define TYPE_NPCM730 "npcm730"#define TYPE_NPCM750 "npcm750"
@@ -125,10 +122,6 @@ struct NPCM7xxClass {uint32_t num_cpus; }; -#define NPCM7XX_CLASS (klass) \ - OBJECT_CLASS_CHECK(NPCM7xxClass, (klass), TYPE_NPCM7XX) -#define NPCM7XX_GET_CLASS (obj) \ - OBJECT_GET_CLASS(NPCM7xxClass, (obj), TYPE_NPCM7XX)/** * npcm7xx_load_kernel - Loads memory with everything needed to boot
include/hw/char/shakti_uart.h +2 -2
@@ -50,8 +50,8 @@#define TYPE_SHAKTI_UART "shakti-uart"typedef struct ShaktiUartState ShaktiUartState ; -#define SHAKTI_UART (obj) \ - OBJECT_CHECK(ShaktiUartState, (obj), TYPE_SHAKTI_UART) +DECLARE_INSTANCE_CHECKER (ShaktiUartState,SHAKTI_UART , + TYPE_SHAKTI_UART)struct ShaktiUartState {/* <private> */
include/hw/dma/sifive_pdma.h +2 -2
@@ -53,7 +53,7 @@ typedef struct SiFivePDMAState SiFivePDMAState;#define TYPE_SIFIVE_PDMA "sifive.pdma" -#define SIFIVE_PDMA (obj) \ - OBJECT_CHECK(SiFivePDMAState, (obj), TYPE_SIFIVE_PDMA) +DECLARE_INSTANCE_CHECKER (SiFivePDMAState,SIFIVE_PDMA , + TYPE_SIFIVE_PDMA)#endif /* SIFIVE_PDMA_H */
include/hw/dma/xlnx_csu_dma.h +2 -2
@@ -48,7 +48,7 @@ struct XlnxCSUDMA { }; typedef struct XlnxCSUDMA XlnxCSUDMA; -#define XLNX_CSU_DMA (obj) \ - OBJECT_CHECK(XlnxCSUDMA, (obj), TYPE_XLNX_CSU_DMA) +DECLARE_INSTANCE_CHECKER(XlnxCSUDMA, XLNX_CSU_DMA, + TYPE_XLNX_CSU_DMA)#endif
include/hw/gpio/npcm7xx_gpio.h +2 -2
@@ -51,7 +51,7 @@ struct NPCM7xxGPIOState {typedef struct NPCM7xxGPIOState NPCM7xxGPIOState ;#define TYPE_NPCM7XX_GPIO "npcm7xx-gpio" -#define NPCM7XX_GPIO (obj) \ - OBJECT_CHECK(NPCM7xxGPIOState, (obj), TYPE_NPCM7XX_GPIO) +DECLARE_INSTANCE_CHECKER (NPCM7xxGPIOState,NPCM7XX_GPIO , + TYPE_NPCM7XX_GPIO)#endif /* NPCM7XX_GPIO_H */
include/hw/i2c/npcm7xx_smbus.h +2 -2
@@ -109,7 +109,7 @@ struct NPCM7xxSMBusState {typedef struct NPCM7xxSMBusState NPCM7xxSMBusState ;#define TYPE_NPCM7XX_SMBUS "npcm7xx-smbus" -#define NPCM7XX_SMBUS (obj) OBJECT_CHECK(NPCM7xxSMBusState, (obj), \ - TYPE_NPCM7XX_SMBUS) +DECLARE_INSTANCE_CHECKER (NPCM7xxSMBusState,NPCM7XX_SMBUS , + TYPE_NPCM7XX_SMBUS)#endif /* NPCM7XX_SMBUS_H */
include/hw/intc/m68k_irqc.h +2 -2
@@ -15,8 +15,8 @@#define TYPE_M68K_IRQC "m68k-irq-controller"typedef struct M68KIRQCState M68KIRQCState ; -#define M68K_IRQC (obj) OBJECT_CHECK(M68KIRQCState, (obj), \ - TYPE_M68K_IRQC) +DECLARE_INSTANCE_CHECKER (M68KIRQCState,M68K_IRQC , + TYPE_M68K_IRQC)#define M68K_IRQC_AUTOVECTOR_BASE 25
include/hw/intc/sifive_clint.h +2 -2
@@ -26,8 +26,8 @@#define TYPE_SIFIVE_CLINT "riscv.sifive.clint"typedef struct SiFiveCLINTState SiFiveCLINTState ; -#define SIFIVE_CLINT (obj) \ - OBJECT_CHECK(SiFiveCLINTState, (obj), TYPE_SIFIVE_CLINT) +DECLARE_INSTANCE_CHECKER (SiFiveCLINTState,SIFIVE_CLINT , + TYPE_SIFIVE_CLINT)struct SiFiveCLINTState {/*< private >*/
include/hw/mem/npcm7xx_mc.h +2 -1
@@ -33,6 +33,7 @@ struct NPCM7xxMCState {typedef struct NPCM7xxMCState NPCM7xxMCState ;#define TYPE_NPCM7XX_MC "npcm7xx-mc" -#define NPCM7XX_MC (obj) OBJECT_CHECK(NPCM7xxMCState, (obj), TYPE_NPCM7XX_MC) +DECLARE_INSTANCE_CHECKER (NPCM7xxMCState,NPCM7XX_MC , + TYPE_NPCM7XX_MC)#endif /* NPCM7XX_MC_H */
include/hw/misc/aspeed_lpc.h +2 -1
@@ -17,7 +17,8 @@#define TYPE_ASPEED_LPC "aspeed.lpc"typedef struct AspeedLPCState AspeedLPCState ; -#define ASPEED_LPC (obj) OBJECT_CHECK(AspeedLPCState, (obj), TYPE_ASPEED_LPC) +DECLARE_INSTANCE_CHECKER (AspeedLPCState,ASPEED_LPC , + TYPE_ASPEED_LPC)#define ASPEED_LPC_NR_REGS (0x260 >> 2)
include/hw/misc/mchp_pfsoc_dmc.h +4 -6
@@ -36,9 +36,8 @@ typedef struct MchpPfSoCDdrSgmiiPhyState MchpPfSoCDdrSgmiiPhyState;#define TYPE_MCHP_PFSOC_DDR_SGMII_PHY "mchp.pfsoc.ddr_sgmii_phy" -#define MCHP_PFSOC_DDR_SGMII_PHY (obj) \ - OBJECT_CHECK(MchpPfSoCDdrSgmiiPhyState, (obj), \ - TYPE_MCHP_PFSOC_DDR_SGMII_PHY) +DECLARE_INSTANCE_CHECKER (MchpPfSoCDdrSgmiiPhyState,MCHP_PFSOC_DDR_SGMII_PHY , +TYPE_MCHP_PFSOC_DDR_SGMII_PHY )/* DDR CFG module */
@@ -52,8 +51,7 @@ typedef struct MchpPfSoCDdrCfgState MchpPfSoCDdrCfgState;#define TYPE_MCHP_PFSOC_DDR_CFG "mchp.pfsoc.ddr_cfg" -#define MCHP_PFSOC_DDR_CFG (obj) \ - OBJECT_CHECK(MchpPfSoCDdrCfgState, (obj), \ - TYPE_MCHP_PFSOC_DDR_CFG) +DECLARE_INSTANCE_CHECKER (MchpPfSoCDdrCfgState,MCHP_PFSOC_DDR_CFG , + TYPE_MCHP_PFSOC_DDR_CFG)#endif /* MCHP_PFSOC_DMC_H */
include/hw/misc/mchp_pfsoc_ioscb.h +2 -2
@@ -46,7 +46,7 @@ typedef struct MchpPfSoCIoscbState MchpPfSoCIoscbState;#define TYPE_MCHP_PFSOC_IOSCB "mchp.pfsoc.ioscb" -#define MCHP_PFSOC_IOSCB (obj) \ - OBJECT_CHECK(MchpPfSoCIoscbState, (obj), TYPE_MCHP_PFSOC_IOSCB) +DECLARE_INSTANCE_CHECKER (MchpPfSoCIoscbState,MCHP_PFSOC_IOSCB , + TYPE_MCHP_PFSOC_IOSCB)#endif /* MCHP_PFSOC_IOSCB_H */
include/hw/misc/mchp_pfsoc_sysreg.h +2 -3
@@ -34,8 +34,7 @@ typedef struct MchpPfSoCSysregState MchpPfSoCSysregState;#define TYPE_MCHP_PFSOC_SYSREG "mchp.pfsoc.sysreg" -#define MCHP_PFSOC_SYSREG (obj) \ - OBJECT_CHECK(MchpPfSoCSysregState, (obj), \ - TYPE_MCHP_PFSOC_SYSREG) +DECLARE_INSTANCE_CHECKER (MchpPfSoCSysregState,MCHP_PFSOC_SYSREG , + TYPE_MCHP_PFSOC_SYSREG)#endif /* MCHP_PFSOC_SYSREG_H */
include/hw/misc/npcm7xx_clk.h +2 -1
@@ -179,6 +179,7 @@ struct NPCM7xxCLKState { }; #define TYPE_NPCM7XX_CLK "npcm7xx-clk" -#define NPCM7XX_CLK (obj) OBJECT_CHECK(NPCM7xxCLKState, (obj), TYPE_NPCM7XX_CLK) +DECLARE_INSTANCE_CHECKER(NPCM7xxCLKState, NPCM7XX_CLK, + TYPE_NPCM7XX_CLK)#endif /* NPCM7XX_CLK_H */
include/hw/misc/npcm7xx_gcr.h +2 -1
@@ -40,6 +40,7 @@ struct NPCM7xxGCRState {typedef struct NPCM7xxGCRState NPCM7xxGCRState ;#define TYPE_NPCM7XX_GCR "npcm7xx-gcr" -#define NPCM7XX_GCR (obj) OBJECT_CHECK(NPCM7xxGCRState, (obj), TYPE_NPCM7XX_GCR) +DECLARE_INSTANCE_CHECKER (NPCM7xxGCRState,NPCM7XX_GCR , + TYPE_NPCM7XX_GCR)#endif /* NPCM7XX_GCR_H */
include/hw/misc/npcm7xx_mft.h +2 -2
@@ -65,7 +65,7 @@ struct NPCM7xxMFTState {typedef struct NPCM7xxMFTState NPCM7xxMFTState ;#define TYPE_NPCM7XX_MFT "npcm7xx-mft" -#define NPCM7XX_MFT (obj) \ - OBJECT_CHECK(NPCM7xxMFTState, (obj), TYPE_NPCM7XX_MFT) +DECLARE_INSTANCE_CHECKER (NPCM7xxMFTState,NPCM7XX_MFT , + TYPE_NPCM7XX_MFT)#endif /* NPCM7XX_MFT_H */
include/hw/misc/npcm7xx_pwm.h +2 -2
@@ -102,7 +102,7 @@ struct NPCM7xxPWMState { }; #define TYPE_NPCM7XX_PWM "npcm7xx-pwm" -#define NPCM7XX_PWM (obj) \ - OBJECT_CHECK(NPCM7xxPWMState, (obj), TYPE_NPCM7XX_PWM) +DECLARE_INSTANCE_CHECKER(NPCM7xxPWMState, NPCM7XX_PWM, + TYPE_NPCM7XX_PWM)#endif /* NPCM7XX_PWM_H */
include/hw/misc/npcm7xx_rng.h +2 -1
@@ -31,6 +31,7 @@ struct NPCM7xxRNGState {typedef struct NPCM7xxRNGState NPCM7xxRNGState ;#define TYPE_NPCM7XX_RNG "npcm7xx-rng" -#define NPCM7XX_RNG (obj) OBJECT_CHECK(NPCM7xxRNGState, (obj), TYPE_NPCM7XX_RNG) +DECLARE_INSTANCE_CHECKER (NPCM7xxRNGState,NPCM7XX_RNG , + TYPE_NPCM7XX_RNG)#endif /* NPCM7XX_RNG_H */
include/hw/misc/xlnx-versal-xramc.h +2 -2
@@ -16,8 +16,8 @@#define TYPE_XLNX_XRAM_CTRL "xlnx.versal-xramc"typedef struct XlnxXramCtrl XlnxXramCtrl ; -#define XLNX_XRAM_CTRL (obj) \ - OBJECT_CHECK(XlnxXramCtrl, (obj), TYPE_XLNX_XRAM_CTRL) +DECLARE_INSTANCE_CHECKER (XlnxXramCtrl,XLNX_XRAM_CTRL , + TYPE_XLNX_XRAM_CTRL) REG32(XRAM_ERR_CTRL, 0x0)FIELD (XRAM_ERR_CTRL ,UE_RES ,3 ,1 )
include/hw/net/npcm7xx_emc.h +2 -2
@@ -281,7 +281,7 @@ struct NPCM7xxEMCState {typedef struct NPCM7xxEMCState NPCM7xxEMCState ;#define TYPE_NPCM7XX_EMC "npcm7xx-emc" -#define NPCM7XX_EMC (obj) \ - OBJECT_CHECK(NPCM7xxEMCState, (obj), TYPE_NPCM7XX_EMC) +DECLARE_INSTANCE_CHECKER (NPCM7xxEMCState,NPCM7XX_EMC , + TYPE_NPCM7XX_EMC)#endif /* NPCM7XX_EMC_H */
include/hw/net/xlnx-zynqmp-can.h +2 -2
@@ -41,8 +41,8 @@#define TYPE_XLNX_ZYNQMP_CAN "xlnx.zynqmp-can"typedef struct XlnxZynqMPCANState XlnxZynqMPCANState ; -#define XLNX_ZYNQMP_CAN (obj) \ - OBJECT_CHECK(XlnxZynqMPCANState, (obj), TYPE_XLNX_ZYNQMP_CAN) +DECLARE_INSTANCE_CHECKER (XlnxZynqMPCANState,XLNX_ZYNQMP_CAN , + TYPE_XLNX_ZYNQMP_CAN)#define MAX_CAN_CTRLS 2#define XLNX_ZYNQMP_CAN_R_MAX (0x84 / 4)
include/hw/nvram/npcm7xx_otp.h +2 -1
@@ -58,7 +58,8 @@ struct NPCM7xxOTPState {typedef struct NPCM7xxOTPState NPCM7xxOTPState ;#define TYPE_NPCM7XX_OTP "npcm7xx-otp" -#define NPCM7XX_OTP (obj) OBJECT_CHECK(NPCM7xxOTPState, (obj), TYPE_NPCM7XX_OTP) +DECLARE_INSTANCE_CHECKER (NPCM7xxOTPState,NPCM7XX_OTP , + TYPE_NPCM7XX_OTP)#define TYPE_NPCM7XX_KEY_STORAGE "npcm7xx-key-storage"#define TYPE_NPCM7XX_FUSE_ARRAY "npcm7xx-fuse-array"
include/hw/ppc/spapr_drc.h +4 -9
@@ -22,18 +22,13 @@#define TYPE_SPAPR_DR_CONNECTOR "spapr-dr-connector"typedef struct SpaprDrc SpaprDrc ;typedef struct SpaprDrcClass SpaprDrcClass ; -#define SPAPR_DR_CONNECTOR_GET_CLASS (obj) \ - OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DR_CONNECTOR) -#define SPAPR_DR_CONNECTOR_CLASS (klass) \ - OBJECT_CLASS_CHECK(SpaprDrcClass, klass, \ - TYPE_SPAPR_DR_CONNECTOR) -#define SPAPR_DR_CONNECTOR (obj) OBJECT_CHECK(SpaprDrc, (obj), \ - TYPE_SPAPR_DR_CONNECTOR) +DECLARE_OBJ_CHECKERS (SpaprDrc, SpaprDrcClass, + SPAPR_DR_CONNECTOR, TYPE_SPAPR_DR_CONNECTOR)#define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical"typedef struct SpaprDrcPhysical SpaprDrcPhysical ; -#define SPAPR_DRC_PHYSICAL (obj) OBJECT_CHECK(SpaprDrcPhysical, (obj), \ - TYPE_SPAPR_DRC_PHYSICAL) +DECLARE_INSTANCE_CHECKER (SpaprDrcPhysical,SPAPR_DRC_PHYSICAL , + TYPE_SPAPR_DRC_PHYSICAL)#define TYPE_SPAPR_DRC_LOGICAL "spapr-drc-logical"
include/hw/ppc/spapr_xive.h +2 -5
@@ -17,11 +17,8 @@#define TYPE_SPAPR_XIVE "spapr-xive"typedef struct SpaprXive SpaprXive ;typedef struct SpaprXiveClass SpaprXiveClass ; -#define SPAPR_XIVE (obj) OBJECT_CHECK(SpaprXive, (obj), TYPE_SPAPR_XIVE) -#define SPAPR_XIVE_CLASS (klass) \ - OBJECT_CLASS_CHECK(SpaprXiveClass, (klass), TYPE_SPAPR_XIVE) -#define SPAPR_XIVE_GET_CLASS (obj) \ - OBJECT_GET_CLASS(SpaprXiveClass, (obj), TYPE_SPAPR_XIVE) +DECLARE_OBJ_CHECKERS (SpaprXive, SpaprXiveClass, + SPAPR_XIVE, TYPE_SPAPR_XIVE)struct SpaprXive {XiveRouter parent;
include/hw/riscv/microchip_pfsoc.h +4 -5
@@ -58,8 +58,8 @@ struct MicrochipPFSoCState {typedef struct MicrochipPFSoCState MicrochipPFSoCState ;#define TYPE_MICROCHIP_PFSOC "microchip.pfsoc" -#define MICROCHIP_PFSOC (obj) \ - OBJECT_CHECK(MicrochipPFSoCState, (obj), TYPE_MICROCHIP_PFSOC) +DECLARE_INSTANCE_CHECKER (MicrochipPFSoCState,MICROCHIP_PFSOC , + TYPE_MICROCHIP_PFSOC)struct MicrochipIcicleKitState {/*< private >*/
@@ -72,9 +72,8 @@ typedef struct MicrochipIcicleKitState MicrochipIcicleKitState;#define TYPE_MICROCHIP_ICICLE_KIT_MACHINE \ MACHINE_TYPE_NAME("microchip-icicle-kit") -#define MICROCHIP_ICICLE_KIT_MACHINE (obj) \ - OBJECT_CHECK(MicrochipIcicleKitState, (obj), \ - TYPE_MICROCHIP_ICICLE_KIT_MACHINE) +DECLARE_INSTANCE_CHECKER (MicrochipIcicleKitState,MICROCHIP_ICICLE_KIT_MACHINE , + TYPE_MICROCHIP_ICICLE_KIT_MACHINE)enum {MICROCHIP_PFSOC_RSVD0 ,
include/hw/riscv/shakti_c.h +4 -4
@@ -26,8 +26,8 @@#define TYPE_RISCV_SHAKTI_SOC "riscv.shakti.cclass.soc"typedef struct ShaktiCSoCState ShaktiCSoCState ; -#define RISCV_SHAKTI_SOC (obj) \ - OBJECT_CHECK(ShaktiCSoCState, (obj), TYPE_RISCV_SHAKTI_SOC) +DECLARE_INSTANCE_CHECKER (ShaktiCSoCState,RISCV_SHAKTI_SOC , + TYPE_RISCV_SHAKTI_SOC)struct ShaktiCSoCState {/*< private >*/
@@ -43,8 +43,8 @@ struct ShaktiCSoCState {#define TYPE_RISCV_SHAKTI_MACHINE MACHINE_TYPE_NAME("shakti_c")typedef struct ShaktiCMachineState ShaktiCMachineState ; -#define RISCV_SHAKTI_MACHINE (obj) \ - OBJECT_CHECK(ShaktiCMachineState, (obj), TYPE_RISCV_SHAKTI_MACHINE) +DECLARE_INSTANCE_CHECKER (ShaktiCMachineState,RISCV_SHAKTI_MACHINE , + TYPE_RISCV_SHAKTI_MACHINE)struct ShaktiCMachineState {/*< private >*/ MachineState parent_obj;
include/hw/riscv/sifive_e.h +4 -4
@@ -26,8 +26,8 @@#define TYPE_RISCV_E_SOC "riscv.sifive.e.soc"typedef struct SiFiveESoCState SiFiveESoCState ; -#define RISCV_E_SOC (obj) \ - OBJECT_CHECK(SiFiveESoCState, (obj), TYPE_RISCV_E_SOC) +DECLARE_INSTANCE_CHECKER (SiFiveESoCState,RISCV_E_SOC , + TYPE_RISCV_E_SOC)struct SiFiveESoCState {/*< private >*/
@@ -52,8 +52,8 @@ struct SiFiveEState {typedef struct SiFiveEState SiFiveEState ;#define TYPE_RISCV_E_MACHINE MACHINE_TYPE_NAME("sifive_e") -#define RISCV_E_MACHINE (obj) \ - OBJECT_CHECK(SiFiveEState, (obj), TYPE_RISCV_E_MACHINE) +DECLARE_INSTANCE_CHECKER (SiFiveEState,RISCV_E_MACHINE , + TYPE_RISCV_E_MACHINE)enum {SIFIVE_E_DEV_DEBUG ,
include/hw/riscv/sifive_u.h +4 -4
@@ -31,8 +31,8 @@#define TYPE_RISCV_U_SOC "riscv.sifive.u.soc"typedef struct SiFiveUSoCState SiFiveUSoCState ; -#define RISCV_U_SOC (obj) \ - OBJECT_CHECK(SiFiveUSoCState, (obj), TYPE_RISCV_U_SOC) +DECLARE_INSTANCE_CHECKER (SiFiveUSoCState,RISCV_U_SOC , + TYPE_RISCV_U_SOC)struct SiFiveUSoCState {/*< private >*/
@@ -58,8 +58,8 @@ struct SiFiveUSoCState {#define TYPE_RISCV_U_MACHINE MACHINE_TYPE_NAME("sifive_u")typedef struct SiFiveUState SiFiveUState ; -#define RISCV_U_MACHINE (obj) \ - OBJECT_CHECK(SiFiveUState, (obj), TYPE_RISCV_U_MACHINE) +DECLARE_INSTANCE_CHECKER (SiFiveUState,RISCV_U_MACHINE , + TYPE_RISCV_U_MACHINE)struct SiFiveUState {/*< private >*/
include/hw/sd/cadence_sdhci.h +2 -2
@@ -43,7 +43,7 @@ struct CadenceSDHCIState {typedef struct CadenceSDHCIState CadenceSDHCIState ;#define TYPE_CADENCE_SDHCI "cadence.sdhci" -#define CADENCE_SDHCI (obj) OBJECT_CHECK(CadenceSDHCIState, (obj), \ - TYPE_CADENCE_SDHCI) +DECLARE_INSTANCE_CHECKER (CadenceSDHCIState,CADENCE_SDHCI , + TYPE_CADENCE_SDHCI)#endif /* CADENCE_SDHCI_H */
include/hw/ssi/npcm7xx_fiu.h +2 -1
@@ -69,6 +69,7 @@ struct NPCM7xxFIUState { }; #define TYPE_NPCM7XX_FIU "npcm7xx-fiu" -#define NPCM7XX_FIU (obj) OBJECT_CHECK(NPCM7xxFIUState, (obj), TYPE_NPCM7XX_FIU) +DECLARE_INSTANCE_CHECKER(NPCM7xxFIUState, NPCM7XX_FIU, + TYPE_NPCM7XX_FIU)#endif /* NPCM7XX_FIU_H */
include/hw/ssi/sifive_spi.h +2 -1
@@ -27,7 +27,8 @@#define TYPE_SIFIVE_SPI "sifive.spi"typedef struct SiFiveSPIState SiFiveSPIState ; -#define SIFIVE_SPI (obj) OBJECT_CHECK(SiFiveSPIState, (obj), TYPE_SIFIVE_SPI) +DECLARE_INSTANCE_CHECKER (SiFiveSPIState,SIFIVE_SPI , + TYPE_SIFIVE_SPI)struct SiFiveSPIState {SysBusDevice parent_obj;
include/hw/timer/npcm7xx_timer.h +2 -2
@@ -108,7 +108,7 @@ struct NPCM7xxTimerCtrlState { }; #define TYPE_NPCM7XX_TIMER "npcm7xx-timer" -#define NPCM7XX_TIMER (obj) \ - OBJECT_CHECK(NPCM7xxTimerCtrlState, (obj), TYPE_NPCM7XX_TIMER) +DECLARE_INSTANCE_CHECKER(NPCM7xxTimerCtrlState, NPCM7XX_TIMER, + TYPE_NPCM7XX_TIMER)#endif /* NPCM7XX_TIMER_H */
include/hw/tricore/tricore_testdevice.h +2 -2
@@ -25,8 +25,8 @@#define TYPE_TRICORE_TESTDEVICE "tricore_testdevice"typedef struct TriCoreTestDeviceState TriCoreTestDeviceState ; -#define TRICORE_TESTDEVICE (obj) \ - OBJECT_CHECK(TriCoreTestDeviceState, (obj), TYPE_TRICORE_TESTDEVICE) +DECLARE_INSTANCE_CHECKER (TriCoreTestDeviceState,TRICORE_TESTDEVICE , + TYPE_TRICORE_TESTDEVICE)struct TriCoreTestDeviceState {/* <private> */
include/hw/usb/hcd-dwc3.h +2 -2
@@ -33,8 +33,8 @@#define TYPE_USB_DWC3 "usb_dwc3"typedef struct USBDWC3 USBDWC3 ; -#define USB_DWC3 (obj) \ - OBJECT_CHECK(USBDWC3, (obj), TYPE_USB_DWC3) +DECLARE_INSTANCE_CHECKER (USBDWC3 ,USB_DWC3 , + TYPE_USB_DWC3)#define USB_DWC3_R_MAX ((0x530 / 4) + 1)#define DWC3_SIZE 0x10000
include/hw/usb/xlnx-usb-subsystem.h +2 -2
@@ -32,8 +32,8 @@#define TYPE_XILINX_VERSAL_USB2 "xlnx.versal-usb2"typedef struct VersalUsb2 VersalUsb2 ; -#define VERSAL_USB2 (obj) \ - OBJECT_CHECK(VersalUsb2, (obj), TYPE_XILINX_VERSAL_USB2) +DECLARE_INSTANCE_CHECKER (VersalUsb2,VERSAL_USB2 , + TYPE_XILINX_VERSAL_USB2)struct VersalUsb2 {SysBusDevice parent_obj;
include/hw/usb/xlnx-versal-usb2-ctrl-regs.h +2 -2
@@ -30,8 +30,8 @@#define TYPE_XILINX_VERSAL_USB2_CTRL_REGS "xlnx.versal-usb2-ctrl-regs"typedef struct VersalUsb2CtrlRegs VersalUsb2CtrlRegs ; -#define XILINX_VERSAL_USB2_CTRL_REGS (obj) \ - OBJECT_CHECK(VersalUsb2CtrlRegs, (obj), TYPE_XILINX_VERSAL_USB2_CTRL_REGS) +DECLARE_INSTANCE_CHECKER (VersalUsb2CtrlRegs,XILINX_VERSAL_USB2_CTRL_REGS , + TYPE_XILINX_VERSAL_USB2_CTRL_REGS)#define USB2_REGS_R_MAX ((0x78 / 4) + 1)
include/hw/watchdog/sbsa_gwdt.h +2 -2
@@ -19,8 +19,8 @@#define TYPE_WDT_SBSA "sbsa_gwdt"typedef struct SBSA_GWDTState SBSA_GWDTState ; -#define SBSA_GWDT (obj) \ - OBJECT_CHECK(SBSA_GWDTState, (obj), TYPE_WDT_SBSA) +DECLARE_INSTANCE_CHECKER (SBSA_GWDTState,SBSA_GWDT , +TYPE_WDT_SBSA )/* SBSA Generic Watchdog register definitions */ /* refresh frame */
include/qemu/accel.h +2 -6
@@ -61,12 +61,8 @@ typedef struct AccelClass AccelClass;#define ACCEL_CLASS_SUFFIX "-" TYPE_ACCEL_BASE#define ACCEL_CLASS_NAME (a) (a ACCEL_CLASS_SUFFIX) -#define ACCEL_BASE_CLASS (klass) \ - OBJECT_CLASS_CHECK(AccelClass, (klass), TYPE_ACCEL_BASE) -#define ACCEL_BASE (obj) \ - OBJECT_CHECK(AccelState, (obj), TYPE_ACCEL_BASE) -#define ACCEL_BASE_GET_CLASS (obj) \ - OBJECT_GET_CLASS(AccelClass, (obj), TYPE_ACCEL_BASE) +DECLARE_OBJ_CHECKERS (AccelState, AccelClass, + ACCEL_BASE, TYPE_ACCEL_BASE)AccelClass *accel_find (const char *opt_name);AccelState *current_accel (void );
target/hexagon/cpu.h +2 -6
@@ -104,12 +104,8 @@ struct CPUHexagonState {typedef struct HexagonCPUClass HexagonCPUClass ;typedef struct HexagonCPU HexagonCPU ; -#define HEXAGON_CPU_CLASS (klass) \ - OBJECT_CLASS_CHECK(HexagonCPUClass, (klass), TYPE_HEXAGON_CPU) -#define HEXAGON_CPU (obj) \ - OBJECT_CHECK(HexagonCPU, (obj), TYPE_HEXAGON_CPU) -#define HEXAGON_CPU_GET_CLASS (obj) \ - OBJECT_GET_CLASS(HexagonCPUClass, (obj), TYPE_HEXAGON_CPU) +DECLARE_OBJ_CHECKERS (HexagonCPU, HexagonCPUClass, + HEXAGON_CPU, TYPE_HEXAGON_CPU)struct HexagonCPUClass {/*< private >*/
chardev/char-parallel.c +2 -4
@@ -57,8 +57,8 @@ struct ParallelChardev { };typedef struct ParallelChardev ParallelChardev ; -#define PARALLEL_CHARDEV (obj) \ - OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL) +DECLARE_INSTANCE_CHECKER (ParallelChardev,PARALLEL_CHARDEV , + TYPE_CHARDEV_PARALLEL)static int pp_hw_mode (ParallelChardev *s,uint16_t mode) {
@@ -185,8 +185,6 @@ struct ParallelChardev { };typedef struct ParallelChardev ParallelChardev ; -#define PARALLEL_CHARDEV (obj) \ - OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL)static int pp_ioctl (Chardev *chr,int cmd,void *arg) {
hw/i2c/i2c_mux_pca954x.c +2 -2
@@ -46,8 +46,8 @@ struct Pca954xChannel {typedef struct Pca954xChannel Pca954xChannel ;#define TYPE_PCA954X_CHANNEL "pca954x-channel" -#define PCA954X_CHANNEL (obj) \ - OBJECT_CHECK(Pca954xChannel, (obj), TYPE_PCA954X_CHANNEL) +DECLARE_INSTANCE_CHECKER (Pca954xChannel,PCA954X_CHANNEL , +TYPE_PCA954X_CHANNEL )/* * struct Pca954xState - The pca954x state object.
hw/m68k/mcf5206.c +2 -1
@@ -181,7 +181,8 @@ struct m5206_mbar_state { };typedef struct m5206_mbar_state m5206_mbar_state ; -#define MCF5206_MBAR (obj) OBJECT_CHECK(m5206_mbar_state, (obj), TYPE_MCF5206_MBAR) +DECLARE_INSTANCE_CHECKER (m5206_mbar_state,MCF5206_MBAR , +TYPE_MCF5206_MBAR )/* Interrupt controller. */
hw/mem/sparse-mem.c +2 -1
@@ -21,7 +21,8 @@#include "qom/object.h" typedef struct SparseMemState SparseMemState ; -#define SPARSE_MEM (obj) OBJECT_CHECK(SparseMemState, (obj), TYPE_SPARSE_MEM) +DECLARE_INSTANCE_CHECKER (SparseMemState,SPARSE_MEM , + TYPE_SPARSE_MEM)#define SPARSE_BLOCK_SIZE 0x1000struct SparseMemState {
hw/misc/sbsa_ec.c +2 -1
@@ -24,7 +24,8 @@ struct SECUREECState {typedef struct SECUREECState SECUREECState ;#define TYPE_SBSA_EC "sbsa-ec" -#define SECURE_EC (obj) OBJECT_CHECK(SECUREECState, (obj), TYPE_SBSA_EC) +DECLARE_INSTANCE_CHECKER (SECUREECState,SECURE_EC , + TYPE_SBSA_EC)enum sbsa_ec_powerstates {SBSA_EC_CMD_POWEROFF =0x01 ,
hw/s390x/vhost-user-fs-ccw.c +2 -2
@@ -21,8 +21,8 @@ struct VHostUserFSCcw {typedef struct VHostUserFSCcw VHostUserFSCcw ;#define TYPE_VHOST_USER_FS_CCW "vhost-user-fs-ccw" -#define VHOST_USER_FS_CCW (obj) \ - OBJECT_CHECK(VHostUserFSCcw, (obj), TYPE_VHOST_USER_FS_CCW) +DECLARE_INSTANCE_CHECKER (VHostUserFSCcw,VHOST_USER_FS_CCW , + TYPE_VHOST_USER_FS_CCW)static Property vhost_user_fs_ccw_properties[] = {
hw/sensor/adm1272.c +2 -1
@@ -20,7 +20,8 @@#define TYPE_ADM1272 "adm1272"typedef struct ADM1272State ADM1272State ; -#define ADM1272 (obj) OBJECT_CHECK(ADM1272State, (obj), TYPE_ADM1272) +DECLARE_INSTANCE_CHECKER (ADM1272State,ADM1272 , + TYPE_ADM1272)#define ADM1272_RESTART_TIME 0xCC#define ADM1272_MFR_PEAK_IOUT 0xD0
hw/sensor/max34451.c +2 -1
@@ -18,7 +18,8 @@#define TYPE_MAX34451 "max34451"typedef struct MAX34451State MAX34451State ; -#define MAX34451 (obj) OBJECT_CHECK(MAX34451State, (obj), TYPE_MAX34451) +DECLARE_INSTANCE_CHECKER (MAX34451State,MAX34451 , + TYPE_MAX34451)#define MAX34451_MFR_MODE 0xD1#define MAX34451_MFR_PSEN_CONFIG 0xD2
hw/usb/u2f-emulated.c +2 -2
@@ -99,8 +99,8 @@ struct U2FEmulatedState { };#define TYPE_U2F_EMULATED "u2f-emulated" -#define EMULATED_U2F_KEY (obj) \ - OBJECT_CHECK(U2FEmulatedState, (obj), TYPE_U2F_EMULATED) +DECLARE_INSTANCE_CHECKER (U2FEmulatedState,EMULATED_U2F_KEY , + TYPE_U2F_EMULATED)static void u2f_emulated_reset (U2FEmulatedState *key) {
hw/usb/u2f-passthru.c +2 -2
@@ -77,8 +77,8 @@ struct U2FPassthruState { };#define TYPE_U2F_PASSTHRU "u2f-passthru" -#define PASSTHRU_U2F_KEY (obj) \ - OBJECT_CHECK(U2FPassthruState, (obj), TYPE_U2F_PASSTHRU) +DECLARE_INSTANCE_CHECKER (U2FPassthruState,PASSTHRU_U2F_KEY , +TYPE_U2F_PASSTHRU ) /* Init packet sizes */#define PACKET_INIT_HEADER_SIZE 7
Signature · 1 line
2.31.1
Re: [PATCH for-6.2 07/12] [automated] Use DECLARE_*CHECKER* macros when possible
Quoted 104 lines · Eduardo Habkost
Converting existing QOM types to
OBJECT_DECLARE_TYPEis not always trivial (due to inconsistent type/macro naming schemes), but at least converting existing manual QOM type checking macros to use DECLARE_*CHECKER* is a simpler process, and should at least discourage people from defining new QOM type checker macros manually.Generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]')Signed-off-by Eduardo Habkost <[email protected]>---
Cc: "Marc-André Lureau" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Patrick Venture <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Igor Mammedov <[email protected]>
Cc: Alexander Bulekov <[email protected]>
Cc: Bandan Das <[email protected]>
Cc: Stefan Hajnoczi <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Klaus Jensen <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Vijai Kumar K <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Andrew Jeffery <[email protected]>
Cc: Joel Stanley <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Vikram Garhwal <[email protected]>
Cc: Francisco Iglesias <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: Taylor Simpson <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- hw/nvme/nvme.h | 12 ++++++------ hw/usb/hcd-xhci-pci.h | 4 ++-- hw/usb/hcd-xhci-sysbus.h | 4 ++-- hw/usb/u2f.h | 8 ++------ include/hw/adc/npcm7xx_adc.h | 4 ++-- include/hw/arm/npcm7xx.h | 15 ++++----------- include/hw/char/shakti_uart.h | 4 ++-- include/hw/dma/sifive_pdma.h | 4 ++-- include/hw/dma/xlnx_csu_dma.h | 4 ++-- include/hw/gpio/npcm7xx_gpio.h | 4 ++-- include/hw/i2c/npcm7xx_smbus.h | 4 ++-- include/hw/intc/m68k_irqc.h | 4 ++-- include/hw/intc/sifive_clint.h | 4 ++-- include/hw/mem/npcm7xx_mc.h | 3 ++- include/hw/misc/aspeed_lpc.h | 3 ++- include/hw/misc/mchp_pfsoc_dmc.h | 10 ++++------ include/hw/misc/mchp_pfsoc_ioscb.h | 4 ++-- include/hw/misc/mchp_pfsoc_sysreg.h | 5 ++--- include/hw/misc/npcm7xx_clk.h | 3 ++- include/hw/misc/npcm7xx_gcr.h | 3 ++- include/hw/misc/npcm7xx_mft.h | 4 ++-- include/hw/misc/npcm7xx_pwm.h | 4 ++-- include/hw/misc/npcm7xx_rng.h | 3 ++- include/hw/misc/xlnx-versal-xramc.h | 4 ++-- include/hw/net/npcm7xx_emc.h | 4 ++-- include/hw/net/xlnx-zynqmp-can.h | 4 ++-- include/hw/nvram/npcm7xx_otp.h | 3 ++- include/hw/ppc/spapr_drc.h | 13 ++++--------- include/hw/ppc/spapr_xive.h | 7 ++----- include/hw/riscv/microchip_pfsoc.h | 9 ++++----- include/hw/riscv/shakti_c.h | 8 ++++---- include/hw/riscv/sifive_e.h | 8 ++++---- include/hw/riscv/sifive_u.h | 8 ++++---- include/hw/sd/cadence_sdhci.h | 4 ++-- include/hw/ssi/npcm7xx_fiu.h | 3 ++- include/hw/ssi/sifive_spi.h | 3 ++- include/hw/timer/npcm7xx_timer.h | 4 ++-- include/hw/tricore/tricore_testdevice.h | 4 ++-- include/hw/usb/hcd-dwc3.h | 4 ++-- include/hw/usb/xlnx-usb-subsystem.h | 4 ++-- include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 4 ++-- include/hw/watchdog/sbsa_gwdt.h | 4 ++-- include/qemu/accel.h | 8 ++------ target/hexagon/cpu.h | 8 ++------ chardev/char-parallel.c | 6 ++---- hw/i2c/i2c_mux_pca954x.c | 4 ++-- hw/m68k/mcf5206.c | 3 ++-
Quoted 8 lines
hw/mem/sparse-mem.c | 3 ++- hw/misc/sbsa_ec.c | 3 ++- hw/s390x/vhost-user-fs-ccw.c | 4 ++-- hw/sensor/adm1272.c | 3 ++- hw/sensor/max34451.c | 3 ++- hw/usb/u2f-emulated.c | 4 ++-- hw/usb/u2f-passthru.c | 4 ++-- 54 files changed, 126 insertions(+), 146 deletions(-)
PATCH 8/12 npcm7xx_clk: Use DECLARE_INSTANCE_CHECKER
In reply to Eduardo HabkostUse DECLARE_INSTANCE_CHECKER instead of defining the NPCM7XX_CLOCK_PLL, NPCM7XX_CLOCK_SEL, and NPCM7XX_CLOCK_DIVIDER macros manually.
These changes had to be done manually because the codeconverter script isn't smart enough to figure out that the typedefs exist in a separate header.
---
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: [email protected]
Cc: [email protected]
--- hw/misc/npcm7xx_clk.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
hw/misc/npcm7xx_clk.c +6 -6
@@ -110,14 +110,14 @@ static const uint32_t cold_reset_values[NPCM7XX_CLK_NR_REGS] = {/* Clock converter functions */ #define TYPE_NPCM7XX_CLOCK_PLL "npcm7xx-clock-pll" -#define NPCM7XX_CLOCK_PLL (obj) OBJECT_CHECK(NPCM7xxClockPLLState, \ - (obj), TYPE_NPCM7XX_CLOCK_PLL) +DECLARE_INSTANCE_CHECKER (NPCM7xxClockPLLState,NPCM7XX_CLOCK_PLL , + TYPE_NPCM7XX_CLOCK_PLL)#define TYPE_NPCM7XX_CLOCK_SEL "npcm7xx-clock-sel" -#define NPCM7XX_CLOCK_SEL (obj) OBJECT_CHECK(NPCM7xxClockSELState, \ - (obj), TYPE_NPCM7XX_CLOCK_SEL) +DECLARE_INSTANCE_CHECKER (NPCM7xxClockSELState,NPCM7XX_CLOCK_SEL , + TYPE_NPCM7XX_CLOCK_SEL)#define TYPE_NPCM7XX_CLOCK_DIVIDER "npcm7xx-clock-divider" -#define NPCM7XX_CLOCK_DIVIDER (obj) OBJECT_CHECK(NPCM7xxClockDividerState, \ - (obj), TYPE_NPCM7XX_CLOCK_DIVIDER) +DECLARE_INSTANCE_CHECKER (NPCM7xxClockDividerState,NPCM7XX_CLOCK_DIVIDER , + TYPE_NPCM7XX_CLOCK_DIVIDER)static void npcm7xx_clk_update_pll (void *opaque) {
Signature · 1 line
2.31.1
Re: [PATCH for-6.2 08/12] npcm7xx_clk: Use DECLARE_INSTANCE_CHECKER
Quoted 9 lines · Eduardo Habkost
Use
DECLARE_INSTANCE_CHECKERinstead of defining theNPCM7XX_CLOCK_PLL,NPCM7XX_CLOCK_SEL, andNPCM7XX_CLOCK_DIVIDERmacros manually.These changes had to be done manually because the codeconverter script isn't smart enough to figure out that the typedefs exist in a separate header.
Signed-off-by Eduardo Habkost <[email protected]>
Quoted 8 lines
---
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: [email protected]
Cc: [email protected]--- hw/misc/npcm7xx_clk.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
PATCH 9/12 npcm7xx_otp: Use DECLARE_CLASS_CHECKERS
In reply to Eduardo HabkostUse DECLARE_CLASS_CHECKERS instead of defining the NPCM7XX_OTP_CLASS and NPCM7XX_OTP_GET_CLASS macros manually.
These changes had to be done manually because the typedef and the existing macro definitions were in different files.
---
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: [email protected]
Cc: [email protected]
--- include/hw/nvram/npcm7xx_otp.h | 5 +++-- hw/nvram/npcm7xx_otp.c | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-)
include/hw/nvram/npcm7xx_otp.h +3 -2
@@ -60,12 +60,13 @@ typedef struct NPCM7xxOTPState NPCM7xxOTPState;#define TYPE_NPCM7XX_OTP "npcm7xx-otp"DECLARE_INSTANCE_CHECKER (NPCM7xxOTPState,NPCM7XX_OTP , TYPE_NPCM7XX_OTP) +typedef struct NPCM7xxOTPClass NPCM7xxOTPClass ; +DECLARE_CLASS_CHECKERS (NPCM7xxOTPClass,NPCM7XX_OTP , + TYPE_NPCM7XX_OTP)#define TYPE_NPCM7XX_KEY_STORAGE "npcm7xx-key-storage"#define TYPE_NPCM7XX_FUSE_ARRAY "npcm7xx-fuse-array" -typedef struct NPCM7xxOTPClass NPCM7xxOTPClass ; -/** * npcm7xx_otp_array_write - ECC encode and write data to OTP array. * @s: OTP module.
hw/nvram/npcm7xx_otp.c +0 -5
@@ -73,11 +73,6 @@ struct NPCM7xxOTPClass {const MemoryRegionOps *mmio_ops; }; -#define NPCM7XX_OTP_CLASS (klass) \ - OBJECT_CLASS_CHECK(NPCM7xxOTPClass, (klass), TYPE_NPCM7XX_OTP) -#define NPCM7XX_OTP_GET_CLASS (obj) \ - OBJECT_GET_CLASS(NPCM7xxOTPClass, (obj), TYPE_NPCM7XX_OTP) -static uint8_t ecc_encode_nibble (uint8_t n) {uint8_t result = n;
Signature · 1 line
2.31.1
Re: [PATCH for-6.2 09/12] npcm7xx_otp: Use DECLARE_CLASS_CHECKERS
Quoted 12 lines · Eduardo Habkost
Use
DECLARE_CLASS_CHECKERSinstead of defining theNPCM7XX_OTP_CLASSandNPCM7XX_OTP_GET_CLASSmacros manually.These changes had to be done manually because the typedef and the existing macro definitions were in different files.
Signed-off-by Eduardo Habkost <[email protected]>---
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: [email protected]
Cc: [email protected]
Quoted 4 lines
--- include/hw/nvram/npcm7xx_otp.h | 5 +++-- hw/nvram/npcm7xx_otp.c | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-)
PATCH 10/12 Use DECLARE_OBJ_CHECKERS when possible
In reply to Eduardo HabkostThis automatically convert DECLARE_INSTANCE_CHECKER/DECLARE_CLASS_CHECKER pairs to DECLARE_OBJ_CHECKERS.
Generated using:
$ ./scripts/codeconverter/converter.py -i \
--pattern=AddDeclareObjCheckers $(git grep -l '' -- '*.[ch]')---
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: [email protected]
Cc: [email protected]
--- include/hw/nvram/npcm7xx_otp.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
include/hw/nvram/npcm7xx_otp.h +2 -4
@@ -58,11 +58,9 @@ struct NPCM7xxOTPState {typedef struct NPCM7xxOTPState NPCM7xxOTPState ;#define TYPE_NPCM7XX_OTP "npcm7xx-otp" -DECLARE_INSTANCE_CHECKER (NPCM7xxOTPState,NPCM7XX_OTP , - TYPE_NPCM7XX_OTP)typedef struct NPCM7xxOTPClass NPCM7xxOTPClass ; -DECLARE_CLASS_CHECKERS (NPCM7xxOTPClass,NPCM7XX_OTP , - TYPE_NPCM7XX_OTP) +DECLARE_OBJ_CHECKERS (NPCM7xxOTPState, NPCM7xxOTPClass, + NPCM7XX_OTP, TYPE_NPCM7XX_OTP)#define TYPE_NPCM7XX_KEY_STORAGE "npcm7xx-key-storage"#define TYPE_NPCM7XX_FUSE_ARRAY "npcm7xx-fuse-array"
Signature · 1 line
2.31.1
PATCH 11/12 Use OBJECT_DECLARE_TYPE when possible
In reply to Eduardo HabkostReplace typedefs + DECLARE_OBJ_CHECKERS with equivalent OBJECT_DECLARE_TYPE macro.
Generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareType $(git grep -l '' -- '*.[ch]')
---
Cc: John Snow <[email protected]>
Cc: Kevin Wolf <[email protected]>
Cc: Max Reitz <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- hw/usb/u2f.h | 6 +----- include/crypto/tlscreds.h | 5 +---- include/hw/ppc/spapr_drc.h | 5 +---- include/hw/ppc/spapr_xive.h | 5 +---- include/qemu/accel.h | 4 +--- hw/block/fdc-sysbus.c | 5 +---- 6 files changed, 6 insertions(+), 24 deletions(-)
hw/usb/u2f.h +1 -5
@@ -32,13 +32,10 @@#define U2FHID_PACKET_SIZE 64#define U2FHID_PENDING_IN_NUM 32 -typedef struct U2FKeyState U2FKeyState ;typedef struct U2FKeyInfo U2FKeyInfo ;#define TYPE_U2F_KEY "u2f-key" -typedef struct U2FKeyClass U2FKeyClass ; -DECLARE_OBJ_CHECKERS (U2FKeyState, U2FKeyClass, -U2F_KEY ,TYPE_U2F_KEY ) +OBJECT_DECLARE_TYPE (U2FKeyState, U2FKeyClass,U2F_KEY )/* * Callbacks to be used by the U2F key base device (i.e. hw/u2f.c)
@@ -69,7 +66,6 @@ struct U2FKeyState {uint8_t pending_in_end;uint8_t pending_in_num; }; -typedef struct U2FKeyState U2FKeyState ;/* * API to be used by the U2F key device variants (i.e. hw/u2f-*.c)
include/crypto/tlscreds.h +1 -4
@@ -25,10 +25,7 @@#include "qom/object.h" #define TYPE_QCRYPTO_TLS_CREDS "tls-creds" -typedef struct QCryptoTLSCreds QCryptoTLSCreds ; -typedef struct QCryptoTLSCredsClass QCryptoTLSCredsClass ; -DECLARE_OBJ_CHECKERS (QCryptoTLSCreds, QCryptoTLSCredsClass,QCRYPTO_TLS_CREDS , - TYPE_QCRYPTO_TLS_CREDS) +OBJECT_DECLARE_TYPE(QCryptoTLSCreds, QCryptoTLSCredsClass, QCRYPTO_TLS_CREDS)#define QCRYPTO_TLS_CREDS_DH_PARAMS "dh-params.pem"
include/hw/ppc/spapr_drc.h +1 -4
@@ -20,10 +20,7 @@#include "qapi/error.h" #define TYPE_SPAPR_DR_CONNECTOR "spapr-dr-connector" -typedef struct SpaprDrc SpaprDrc ; -typedef struct SpaprDrcClass SpaprDrcClass ; -DECLARE_OBJ_CHECKERS (SpaprDrc, SpaprDrcClass, - SPAPR_DR_CONNECTOR, TYPE_SPAPR_DR_CONNECTOR) +OBJECT_DECLARE_TYPE(SpaprDrc, SpaprDrcClass, SPAPR_DR_CONNECTOR)#define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical"typedef struct SpaprDrcPhysical SpaprDrcPhysical ;
include/hw/ppc/spapr_xive.h +1 -4
@@ -15,10 +15,7 @@#include "qom/object.h" #define TYPE_SPAPR_XIVE "spapr-xive" -typedef struct SpaprXive SpaprXive ; -typedef struct SpaprXiveClass SpaprXiveClass ; -DECLARE_OBJ_CHECKERS (SpaprXive, SpaprXiveClass, - SPAPR_XIVE, TYPE_SPAPR_XIVE) +OBJECT_DECLARE_TYPE(SpaprXive, SpaprXiveClass, SPAPR_XIVE)struct SpaprXive {XiveRouter parent;
include/qemu/accel.h +1 -3
@@ -54,15 +54,13 @@ struct AccelClass {*/ GPtrArray *compat_props; }; -typedef struct AccelClass AccelClass ;#define TYPE_ACCEL_BASE "accel"#define ACCEL_CLASS_SUFFIX "-" TYPE_ACCEL_BASE#define ACCEL_CLASS_NAME (a) (a ACCEL_CLASS_SUFFIX) -DECLARE_OBJ_CHECKERS (AccelState, AccelClass, - ACCEL_BASE, TYPE_ACCEL_BASE) +OBJECT_DECLARE_TYPE(AccelState, AccelClass, ACCEL_BASE)AccelClass *accel_find (const char *opt_name);AccelState *current_accel (void );
hw/block/fdc-sysbus.c +1 -4
@@ -33,10 +33,7 @@#include "trace.h" #define TYPE_SYSBUS_FDC "base-sysbus-fdc" -typedef struct FDCtrlSysBusClass FDCtrlSysBusClass ; -typedef struct FDCtrlSysBus FDCtrlSysBus ; -DECLARE_OBJ_CHECKERS (FDCtrlSysBus, FDCtrlSysBusClass, - SYSBUS_FDC, TYPE_SYSBUS_FDC) +OBJECT_DECLARE_TYPE(FDCtrlSysBus, FDCtrlSysBusClass, SYSBUS_FDC)struct FDCtrlSysBusClass {/*< private >*/
Signature · 1 line
2.31.1
Re: [PATCH for-6.2 11/12] [automated] Use OBJECT_DECLARE_TYPE when possible
Quoted 23 lines · Eduardo Habkost
Replace typedefs +
DECLARE_OBJ_CHECKERSwith equivalentOBJECT_DECLARE_TYPEmacro.Generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareType $(git grep -l '' -- '*.[ch]')Signed-off-by Eduardo Habkost <[email protected]>---
Cc: John Snow <[email protected]>
Cc: Kevin Wolf <[email protected]>
Cc: Max Reitz <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Quoted 8 lines
--- hw/usb/u2f.h | 6 +----- include/crypto/tlscreds.h | 5 +---- include/hw/ppc/spapr_drc.h | 5 +---- include/hw/ppc/spapr_xive.h | 5 +---- include/qemu/accel.h | 4 +--- hw/block/fdc-sysbus.c | 5 +---- 6 files changed, 6 insertions(+), 24 deletions(-)
PATCH 12/12 Use OBJECT_DECLARE_SIMPLE_TYPE when possible
In reply to Eduardo HabkostReplace typedef + DECLARE_INSTANCE_CHECKER with
equivalent OBJECT_DECLARE_SIMPLE_TYPE macro.
Generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]')
---
Cc: Thomas Huth <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Aleksandar Rikalo <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Aurelien Jarno <[email protected]>
Cc: Jiaxun Yang <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Pavel Pisa <[email protected]>
Cc: Vikram Garhwal <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Klaus Jensen <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Vijai Kumar K <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Andrew Jeffery <[email protected]>
Cc: Joel Stanley <[email protected]>
Cc: Andrew Baumann <[email protected]>
Cc: Francisco Iglesias <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- hw/nvme/nvme.h | 10 +++------- hw/usb/hcd-xhci-pci.h | 4 +--- hw/usb/hcd-xhci-sysbus.h | 4 +--- include/hw/adc/npcm7xx_adc.h | 4 +--- include/hw/char/shakti_uart.h | 4 +--- include/hw/dma/sifive_pdma.h | 4 +--- include/hw/dma/xlnx_csu_dma.h | 4 +--- include/hw/gpio/sifive_gpio.h | 4 +--- include/hw/intc/m68k_irqc.h | 4 +--- include/hw/intc/sifive_clint.h | 4 +--- include/hw/intc/sifive_plic.h | 4 +--- include/hw/misc/aspeed_lpc.h | 4 +--- include/hw/misc/bcm2835_cprman_internals.h | 12 ++++-------- include/hw/misc/led.h | 3 +-- include/hw/misc/mchp_pfsoc_dmc.h | 8 ++------ include/hw/misc/mchp_pfsoc_ioscb.h | 4 +--- include/hw/misc/mchp_pfsoc_sysreg.h | 4 +--- include/hw/misc/npcm7xx_clk.h | 3 +-- include/hw/misc/npcm7xx_gcr.h | 4 +--- include/hw/misc/npcm7xx_mft.h | 4 +--- include/hw/misc/npcm7xx_pwm.h | 3 +-- include/hw/misc/sifive_e_prci.h | 4 +--- include/hw/misc/sifive_test.h | 4 +--- include/hw/misc/sifive_u_otp.h | 4 +--- include/hw/misc/sifive_u_prci.h | 4 +--- include/hw/misc/xlnx-versal-xramc.h | 4 +--- include/hw/net/npcm7xx_emc.h | 4 +--- include/hw/net/xlnx-zynqmp-can.h | 4 +--- include/hw/ppc/spapr_drc.h | 4 +--- include/hw/register.h | 3 +-- include/hw/riscv/microchip_pfsoc.h | 4 +--- include/hw/riscv/shakti_c.h | 8 ++------ include/hw/riscv/sifive_e.h | 4 +--- include/hw/riscv/sifive_u.h | 4 +--- include/hw/sd/cadence_sdhci.h | 4 +--- include/hw/ssi/sifive_spi.h | 4 +--- include/hw/timer/npcm7xx_timer.h | 3 +-- include/hw/tricore/tricore_testdevice.h | 4 +--- include/hw/usb/hcd-dwc3.h | 4 +--- include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 4 +--- hw/m68k/mcf5206.c | 4 +--- hw/mips/boston.c | 4 +--- hw/misc/npcm7xx_clk.c | 9 +++------ hw/net/can/ctucan_pci.c | 4 +--- hw/s390x/vhost-user-fs-ccw.c | 4 +--- hw/sensor/adm1272.c | 4 +--- hw/sensor/max34451.c | 4 +--- 47 files changed, 56 insertions(+), 154 deletions(-)
hw/nvme/nvme.h +3 -7
@@ -42,9 +42,7 @@ typedef struct NvmeBus { } NvmeBus;#define TYPE_NVME_SUBSYS "nvme-subsys" -typedef struct NvmeSubsystem NvmeSubsystem ; -DECLARE_INSTANCE_CHECKER (NvmeSubsystem,NVME_SUBSYS , - TYPE_NVME_SUBSYS) +OBJECT_DECLARE_SIMPLE_TYPE(NvmeSubsystem, NVME_SUBSYS)struct NvmeSubsystem {DeviceState parent_obj;
@@ -83,8 +81,7 @@ static inline NvmeNamespace *nvme_subsys_ns(NvmeSubsystem *subsys, }#define TYPE_NVME_NS "nvme-ns" -DECLARE_INSTANCE_CHECKER (NvmeNamespace,NVME_NS , - TYPE_NVME_NS) +OBJECT_DECLARE_SIMPLE_TYPE(NvmeNamespace, NVME_NS) typedef struct NvmeZone { NvmeZoneDescr d;
@@ -377,8 +374,7 @@ typedef struct NvmeCQueue { } NvmeCQueue;#define TYPE_NVME "nvme" -DECLARE_INSTANCE_CHECKER (NvmeCtrl,NVME , - TYPE_NVME) +OBJECT_DECLARE_SIMPLE_TYPE(NvmeCtrl, NVME) typedef struct NvmeParams { char *serial;
hw/usb/hcd-xhci-pci.h +1 -3
@@ -29,9 +29,7 @@#include "qom/object.h" #define TYPE_XHCI_PCI "pci-xhci" -typedef struct XHCIPciState XHCIPciState ; -DECLARE_INSTANCE_CHECKER (XHCIPciState,XHCI_PCI , - TYPE_XHCI_PCI) +OBJECT_DECLARE_SIMPLE_TYPE(XHCIPciState, XHCI_PCI)struct XHCIPciState {
hw/usb/hcd-xhci-sysbus.h +1 -3
@@ -16,9 +16,7 @@#include "hw/sysbus.h" #include "qom/object.h" -typedef struct XHCISysbusState XHCISysbusState ; -DECLARE_INSTANCE_CHECKER (XHCISysbusState,XHCI_SYSBUS , - TYPE_XHCI_SYSBUS) +OBJECT_DECLARE_SIMPLE_TYPE(XHCISysbusState, XHCI_SYSBUS)struct XHCISysbusState {
include/hw/adc/npcm7xx_adc.h +1 -3
@@ -62,10 +62,8 @@ struct NPCM7xxADCState {uint16_t calibration_r_values[NPCM7XX_ADC_NUM_CALIB ]; }; -typedef struct NPCM7xxADCState NPCM7xxADCState ;#define TYPE_NPCM7XX_ADC "npcm7xx-adc" -DECLARE_INSTANCE_CHECKER (NPCM7xxADCState,NPCM7XX_ADC , - TYPE_NPCM7XX_ADC) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxADCState, NPCM7XX_ADC)#endif /* NPCM7XX_ADC_H */
include/hw/char/shakti_uart.h +1 -3
@@ -49,9 +49,7 @@#define SHAKTI_UART_CONTROL_DEFAULT 0x0100#define TYPE_SHAKTI_UART "shakti-uart" -typedef struct ShaktiUartState ShaktiUartState ; -DECLARE_INSTANCE_CHECKER (ShaktiUartState,SHAKTI_UART , - TYPE_SHAKTI_UART) +OBJECT_DECLARE_SIMPLE_TYPE(ShaktiUartState, SHAKTI_UART)struct ShaktiUartState {/* <private> */
include/hw/dma/sifive_pdma.h +1 -3
@@ -49,11 +49,9 @@ struct SiFivePDMAState {struct sifive_pdma_chan chan[SIFIVE_PDMA_CHANS ]; }; -typedef struct SiFivePDMAState SiFivePDMAState ;#define TYPE_SIFIVE_PDMA "sifive.pdma" -DECLARE_INSTANCE_CHECKER (SiFivePDMAState,SIFIVE_PDMA , - TYPE_SIFIVE_PDMA) +OBJECT_DECLARE_SIMPLE_TYPE(SiFivePDMAState, SIFIVE_PDMA)#endif /* SIFIVE_PDMA_H */
include/hw/dma/xlnx_csu_dma.h +1 -3
@@ -46,9 +46,7 @@ struct XlnxCSUDMA {uint32_t regs[XLNX_CSU_DMA_R_MAX ];RegisterInfo regs_info[XLNX_CSU_DMA_R_MAX ]; }; -typedef struct XlnxCSUDMA XlnxCSUDMA ; -DECLARE_INSTANCE_CHECKER (XlnxCSUDMA,XLNX_CSU_DMA , - TYPE_XLNX_CSU_DMA) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxCSUDMA, XLNX_CSU_DMA)#endif
include/hw/gpio/sifive_gpio.h +1 -3
@@ -18,9 +18,7 @@#include "qom/object.h" #define TYPE_SIFIVE_GPIO "sifive_soc.gpio" -typedef struct SIFIVEGPIOState SIFIVEGPIOState ; -DECLARE_INSTANCE_CHECKER (SIFIVEGPIOState,SIFIVE_GPIO , - TYPE_SIFIVE_GPIO) +OBJECT_DECLARE_SIMPLE_TYPE(SIFIVEGPIOState, SIFIVE_GPIO)#define SIFIVE_GPIO_PINS 32
include/hw/intc/m68k_irqc.h +1 -3
@@ -14,9 +14,7 @@#include "qom/object.h" #define TYPE_M68K_IRQC "m68k-irq-controller" -typedef struct M68KIRQCState M68KIRQCState ; -DECLARE_INSTANCE_CHECKER (M68KIRQCState,M68K_IRQC , - TYPE_M68K_IRQC) +OBJECT_DECLARE_SIMPLE_TYPE(M68KIRQCState, M68K_IRQC)#define M68K_IRQC_AUTOVECTOR_BASE 25
include/hw/intc/sifive_clint.h +1 -3
@@ -25,9 +25,7 @@#define TYPE_SIFIVE_CLINT "riscv.sifive.clint" -typedef struct SiFiveCLINTState SiFiveCLINTState ; -DECLARE_INSTANCE_CHECKER (SiFiveCLINTState,SIFIVE_CLINT , - TYPE_SIFIVE_CLINT) +OBJECT_DECLARE_SIMPLE_TYPE(SiFiveCLINTState, SIFIVE_CLINT)struct SiFiveCLINTState {/*< private >*/
include/hw/intc/sifive_plic.h +1 -3
@@ -26,9 +26,7 @@#define TYPE_SIFIVE_PLIC "riscv.sifive.plic" -typedef struct SiFivePLICState SiFivePLICState ; -DECLARE_INSTANCE_CHECKER (SiFivePLICState,SIFIVE_PLIC , - TYPE_SIFIVE_PLIC) +OBJECT_DECLARE_SIMPLE_TYPE(SiFivePLICState, SIFIVE_PLIC) typedef enum PLICMode { PLICMode_U,
include/hw/misc/aspeed_lpc.h +1 -3
@@ -16,9 +16,7 @@#include "qom/object.h" #define TYPE_ASPEED_LPC "aspeed.lpc" -typedef struct AspeedLPCState AspeedLPCState ; -DECLARE_INSTANCE_CHECKER (AspeedLPCState,ASPEED_LPC , - TYPE_ASPEED_LPC) +OBJECT_DECLARE_SIMPLE_TYPE(AspeedLPCState, ASPEED_LPC)#define ASPEED_LPC_NR_REGS (0x260 >> 2)
include/hw/misc/bcm2835_cprman_internals.h +4 -8
@@ -18,14 +18,10 @@#define TYPE_CPRMAN_CLOCK_MUX "bcm2835-cprman-clock-mux"#define TYPE_CPRMAN_DSI0HSCK_MUX "bcm2835-cprman-dsi0hsck-mux" -DECLARE_INSTANCE_CHECKER (CprmanPllState,CPRMAN_PLL , - TYPE_CPRMAN_PLL) -DECLARE_INSTANCE_CHECKER (CprmanPllChannelState,CPRMAN_PLL_CHANNEL , - TYPE_CPRMAN_PLL_CHANNEL) -DECLARE_INSTANCE_CHECKER (CprmanClockMuxState,CPRMAN_CLOCK_MUX , - TYPE_CPRMAN_CLOCK_MUX) -DECLARE_INSTANCE_CHECKER (CprmanDsi0HsckMuxState,CPRMAN_DSI0HSCK_MUX , -TYPE_CPRMAN_DSI0HSCK_MUX ) +OBJECT_DECLARE_SIMPLE_TYPE(CprmanPllState, CPRMAN_PLL) +OBJECT_DECLARE_SIMPLE_TYPE(CprmanPllChannelState, CPRMAN_PLL_CHANNEL) +OBJECT_DECLARE_SIMPLE_TYPE(CprmanClockMuxState, CPRMAN_CLOCK_MUX) +OBJECT_DECLARE_SIMPLE_TYPE (CprmanDsi0HsckMuxState,CPRMAN_DSI0HSCK_MUX )/* Register map */
include/hw/misc/led.h +1 -2
@@ -51,8 +51,7 @@ struct LEDState {*/ bool gpio_active_high; }; -typedef struct LEDState LEDState ; -DECLARE_INSTANCE_CHECKER (LEDState,LED ,TYPE_LED ) +OBJECT_DECLARE_SIMPLE_TYPE (LEDState,LED )/** * led_set_intensity: Set the intensity of a LED device
include/hw/misc/mchp_pfsoc_dmc.h +2 -6
@@ -32,12 +32,10 @@ struct MchpPfSoCDdrSgmiiPhyState {SysBusDevice parent;MemoryRegion sgmii_phy; }; -typedef struct MchpPfSoCDdrSgmiiPhyState MchpPfSoCDdrSgmiiPhyState ;#define TYPE_MCHP_PFSOC_DDR_SGMII_PHY "mchp.pfsoc.ddr_sgmii_phy" -DECLARE_INSTANCE_CHECKER (MchpPfSoCDdrSgmiiPhyState,MCHP_PFSOC_DDR_SGMII_PHY , -TYPE_MCHP_PFSOC_DDR_SGMII_PHY ) +OBJECT_DECLARE_SIMPLE_TYPE (MchpPfSoCDdrSgmiiPhyState,MCHP_PFSOC_DDR_SGMII_PHY )/* DDR CFG module */
@@ -47,11 +45,9 @@ struct MchpPfSoCDdrCfgState {SysBusDevice parent;MemoryRegion cfg; }; -typedef struct MchpPfSoCDdrCfgState MchpPfSoCDdrCfgState ;#define TYPE_MCHP_PFSOC_DDR_CFG "mchp.pfsoc.ddr_cfg" -DECLARE_INSTANCE_CHECKER (MchpPfSoCDdrCfgState,MCHP_PFSOC_DDR_CFG , - TYPE_MCHP_PFSOC_DDR_CFG) +OBJECT_DECLARE_SIMPLE_TYPE(MchpPfSoCDdrCfgState, MCHP_PFSOC_DDR_CFG)#endif /* MCHP_PFSOC_DMC_H */
include/hw/misc/mchp_pfsoc_ioscb.h +1 -3
@@ -42,11 +42,9 @@ struct MchpPfSoCIoscbState {MemoryRegion bc_sgmii;MemoryRegion io_calib_sgmii; }; -typedef struct MchpPfSoCIoscbState MchpPfSoCIoscbState ;#define TYPE_MCHP_PFSOC_IOSCB "mchp.pfsoc.ioscb" -DECLARE_INSTANCE_CHECKER (MchpPfSoCIoscbState,MCHP_PFSOC_IOSCB , - TYPE_MCHP_PFSOC_IOSCB) +OBJECT_DECLARE_SIMPLE_TYPE(MchpPfSoCIoscbState, MCHP_PFSOC_IOSCB)#endif /* MCHP_PFSOC_IOSCB_H */
include/hw/misc/mchp_pfsoc_sysreg.h +1 -3
@@ -30,11 +30,9 @@ struct MchpPfSoCSysregState {SysBusDevice parent;MemoryRegion sysreg; }; -typedef struct MchpPfSoCSysregState MchpPfSoCSysregState ;#define TYPE_MCHP_PFSOC_SYSREG "mchp.pfsoc.sysreg" -DECLARE_INSTANCE_CHECKER (MchpPfSoCSysregState,MCHP_PFSOC_SYSREG , - TYPE_MCHP_PFSOC_SYSREG) +OBJECT_DECLARE_SIMPLE_TYPE(MchpPfSoCSysregState, MCHP_PFSOC_SYSREG)#endif /* MCHP_PFSOC_SYSREG_H */
include/hw/misc/npcm7xx_clk.h +1 -2
@@ -179,7 +179,6 @@ struct NPCM7xxCLKState { }; #define TYPE_NPCM7XX_CLK "npcm7xx-clk" -DECLARE_INSTANCE_CHECKER(NPCM7xxCLKState, NPCM7XX_CLK, - TYPE_NPCM7XX_CLK) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxCLKState, NPCM7XX_CLK)#endif /* NPCM7XX_CLK_H */
include/hw/misc/npcm7xx_gcr.h +1 -3
@@ -37,10 +37,8 @@ struct NPCM7xxGCRState {uint32_t reset_mdlr;uint32_t reset_intcr3; }; -typedef struct NPCM7xxGCRState NPCM7xxGCRState ;#define TYPE_NPCM7XX_GCR "npcm7xx-gcr" -DECLARE_INSTANCE_CHECKER (NPCM7xxGCRState,NPCM7XX_GCR , - TYPE_NPCM7XX_GCR) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxGCRState, NPCM7XX_GCR)#endif /* NPCM7XX_GCR_H */
include/hw/misc/npcm7xx_mft.h +1 -3
@@ -62,10 +62,8 @@ struct NPCM7xxMFTState {uint32_t max_rpm[NPCM7XX_MFT_FANIN_COUNT ];uint32_t duty[NPCM7XX_MFT_FANIN_COUNT ]; }; -typedef struct NPCM7xxMFTState NPCM7xxMFTState ;#define TYPE_NPCM7XX_MFT "npcm7xx-mft" -DECLARE_INSTANCE_CHECKER (NPCM7xxMFTState,NPCM7XX_MFT , - TYPE_NPCM7XX_MFT) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxMFTState, NPCM7XX_MFT)#endif /* NPCM7XX_MFT_H */
include/hw/misc/npcm7xx_pwm.h +1 -2
@@ -102,7 +102,6 @@ struct NPCM7xxPWMState { }; #define TYPE_NPCM7XX_PWM "npcm7xx-pwm" -DECLARE_INSTANCE_CHECKER(NPCM7xxPWMState, NPCM7XX_PWM, - TYPE_NPCM7XX_PWM) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxPWMState, NPCM7XX_PWM)#endif /* NPCM7XX_PWM_H */
include/hw/misc/sifive_e_prci.h +1 -3
@@ -52,9 +52,7 @@ enum {#define TYPE_SIFIVE_E_PRCI "riscv.sifive.e.prci" -typedef struct SiFiveEPRCIState SiFiveEPRCIState ; -DECLARE_INSTANCE_CHECKER (SiFiveEPRCIState,SIFIVE_E_PRCI , - TYPE_SIFIVE_E_PRCI) +OBJECT_DECLARE_SIMPLE_TYPE(SiFiveEPRCIState, SIFIVE_E_PRCI)struct SiFiveEPRCIState {/*< private >*/
include/hw/misc/sifive_test.h +1 -3
@@ -24,9 +24,7 @@#define TYPE_SIFIVE_TEST "riscv.sifive.test" -typedef struct SiFiveTestState SiFiveTestState ; -DECLARE_INSTANCE_CHECKER (SiFiveTestState,SIFIVE_TEST , - TYPE_SIFIVE_TEST) +OBJECT_DECLARE_SIMPLE_TYPE(SiFiveTestState, SIFIVE_TEST)struct SiFiveTestState {/*< private >*/
include/hw/misc/sifive_u_otp.h +1 -3
@@ -53,9 +53,7 @@#define TYPE_SIFIVE_U_OTP "riscv.sifive.u.otp" -typedef struct SiFiveUOTPState SiFiveUOTPState ; -DECLARE_INSTANCE_CHECKER (SiFiveUOTPState,SIFIVE_U_OTP , - TYPE_SIFIVE_U_OTP) +OBJECT_DECLARE_SIMPLE_TYPE(SiFiveUOTPState, SIFIVE_U_OTP)struct SiFiveUOTPState {/*< private >*/
include/hw/misc/sifive_u_prci.h +1 -3
@@ -59,9 +59,7 @@#define TYPE_SIFIVE_U_PRCI "riscv.sifive.u.prci" -typedef struct SiFiveUPRCIState SiFiveUPRCIState ; -DECLARE_INSTANCE_CHECKER (SiFiveUPRCIState,SIFIVE_U_PRCI , - TYPE_SIFIVE_U_PRCI) +OBJECT_DECLARE_SIMPLE_TYPE(SiFiveUPRCIState, SIFIVE_U_PRCI)struct SiFiveUPRCIState {/*< private >*/
include/hw/misc/xlnx-versal-xramc.h +1 -3
@@ -15,9 +15,7 @@#define TYPE_XLNX_XRAM_CTRL "xlnx.versal-xramc" -typedef struct XlnxXramCtrl XlnxXramCtrl ; -DECLARE_INSTANCE_CHECKER (XlnxXramCtrl,XLNX_XRAM_CTRL , - TYPE_XLNX_XRAM_CTRL) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxXramCtrl, XLNX_XRAM_CTRL) REG32(XRAM_ERR_CTRL, 0x0)FIELD (XRAM_ERR_CTRL ,UE_RES ,3 ,1 )
include/hw/net/npcm7xx_emc.h +1 -3
@@ -278,10 +278,8 @@ struct NPCM7xxEMCState {bool rx_active; }; -typedef struct NPCM7xxEMCState NPCM7xxEMCState ;#define TYPE_NPCM7XX_EMC "npcm7xx-emc" -DECLARE_INSTANCE_CHECKER (NPCM7xxEMCState,NPCM7XX_EMC , - TYPE_NPCM7XX_EMC) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxEMCState, NPCM7XX_EMC)#endif /* NPCM7XX_EMC_H */
include/hw/net/xlnx-zynqmp-can.h +1 -3
@@ -40,9 +40,7 @@#define TYPE_XLNX_ZYNQMP_CAN "xlnx.zynqmp-can" -typedef struct XlnxZynqMPCANState XlnxZynqMPCANState ; -DECLARE_INSTANCE_CHECKER (XlnxZynqMPCANState,XLNX_ZYNQMP_CAN , - TYPE_XLNX_ZYNQMP_CAN) +OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPCANState, XLNX_ZYNQMP_CAN)#define MAX_CAN_CTRLS 2#define XLNX_ZYNQMP_CAN_R_MAX (0x84 / 4)
include/hw/ppc/spapr_drc.h +1 -3
@@ -23,9 +23,7 @@ OBJECT_DECLARE_TYPE(SpaprDrc, SpaprDrcClass, SPAPR_DR_CONNECTOR)#define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical" -typedef struct SpaprDrcPhysical SpaprDrcPhysical ; -DECLARE_INSTANCE_CHECKER (SpaprDrcPhysical,SPAPR_DRC_PHYSICAL , - TYPE_SPAPR_DRC_PHYSICAL) +OBJECT_DECLARE_SIMPLE_TYPE(SpaprDrcPhysical, SPAPR_DRC_PHYSICAL)#define TYPE_SPAPR_DRC_LOGICAL "spapr-drc-logical"
include/hw/register.h +1 -2
@@ -88,8 +88,7 @@ struct RegisterInfo { };#define TYPE_REGISTER "qemu-register" -DECLARE_INSTANCE_CHECKER (RegisterInfo,REGISTER , -TYPE_REGISTER ) +OBJECT_DECLARE_SIMPLE_TYPE (RegisterInfo,REGISTER )/** * This structure is used to group all of the individual registers which are
include/hw/riscv/microchip_pfsoc.h +1 -3
@@ -55,11 +55,9 @@ struct MicrochipPFSoCState {CadenceGEMState gem1;CadenceSDHCIState sdhci; }; -typedef struct MicrochipPFSoCState MicrochipPFSoCState ;#define TYPE_MICROCHIP_PFSOC "microchip.pfsoc" -DECLARE_INSTANCE_CHECKER (MicrochipPFSoCState,MICROCHIP_PFSOC , - TYPE_MICROCHIP_PFSOC) +OBJECT_DECLARE_SIMPLE_TYPE(MicrochipPFSoCState, MICROCHIP_PFSOC)struct MicrochipIcicleKitState {/*< private >*/
include/hw/riscv/shakti_c.h +2 -6
@@ -25,9 +25,7 @@#include "qom/object.h" #define TYPE_RISCV_SHAKTI_SOC "riscv.shakti.cclass.soc" -typedef struct ShaktiCSoCState ShaktiCSoCState ; -DECLARE_INSTANCE_CHECKER (ShaktiCSoCState,RISCV_SHAKTI_SOC , - TYPE_RISCV_SHAKTI_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(ShaktiCSoCState, RISCV_SHAKTI_SOC)struct ShaktiCSoCState {/*< private >*/
@@ -42,9 +40,7 @@ struct ShaktiCSoCState { };#define TYPE_RISCV_SHAKTI_MACHINE MACHINE_TYPE_NAME("shakti_c") -typedef struct ShaktiCMachineState ShaktiCMachineState ; -DECLARE_INSTANCE_CHECKER (ShaktiCMachineState,RISCV_SHAKTI_MACHINE , - TYPE_RISCV_SHAKTI_MACHINE) +OBJECT_DECLARE_SIMPLE_TYPE(ShaktiCMachineState, RISCV_SHAKTI_MACHINE)struct ShaktiCMachineState {/*< private >*/ MachineState parent_obj;
include/hw/riscv/sifive_e.h +1 -3
@@ -25,9 +25,7 @@#include "qom/object.h" #define TYPE_RISCV_E_SOC "riscv.sifive.e.soc" -typedef struct SiFiveESoCState SiFiveESoCState ; -DECLARE_INSTANCE_CHECKER (SiFiveESoCState,RISCV_E_SOC , - TYPE_RISCV_E_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(SiFiveESoCState, RISCV_E_SOC)struct SiFiveESoCState {/*< private >*/
include/hw/riscv/sifive_u.h +1 -3
@@ -30,9 +30,7 @@#include "qom/object.h" #define TYPE_RISCV_U_SOC "riscv.sifive.u.soc" -typedef struct SiFiveUSoCState SiFiveUSoCState ; -DECLARE_INSTANCE_CHECKER (SiFiveUSoCState,RISCV_U_SOC , - TYPE_RISCV_U_SOC) +OBJECT_DECLARE_SIMPLE_TYPE(SiFiveUSoCState, RISCV_U_SOC)struct SiFiveUSoCState {/*< private >*/
include/hw/sd/cadence_sdhci.h +1 -3
@@ -40,10 +40,8 @@ struct CadenceSDHCIState {SDHCIState sdhci; }; -typedef struct CadenceSDHCIState CadenceSDHCIState ;#define TYPE_CADENCE_SDHCI "cadence.sdhci" -DECLARE_INSTANCE_CHECKER (CadenceSDHCIState,CADENCE_SDHCI , - TYPE_CADENCE_SDHCI) +OBJECT_DECLARE_SIMPLE_TYPE(CadenceSDHCIState, CADENCE_SDHCI)#endif /* CADENCE_SDHCI_H */
include/hw/ssi/sifive_spi.h +1 -3
@@ -26,9 +26,7 @@#define SIFIVE_SPI_REG_NUM (0x78 / 4)#define TYPE_SIFIVE_SPI "sifive.spi" -typedef struct SiFiveSPIState SiFiveSPIState ; -DECLARE_INSTANCE_CHECKER (SiFiveSPIState,SIFIVE_SPI , - TYPE_SIFIVE_SPI) +OBJECT_DECLARE_SIMPLE_TYPE(SiFiveSPIState, SIFIVE_SPI)struct SiFiveSPIState {SysBusDevice parent_obj;
include/hw/timer/npcm7xx_timer.h +1 -2
@@ -108,7 +108,6 @@ struct NPCM7xxTimerCtrlState { }; #define TYPE_NPCM7XX_TIMER "npcm7xx-timer" -DECLARE_INSTANCE_CHECKER(NPCM7xxTimerCtrlState, NPCM7XX_TIMER, - TYPE_NPCM7XX_TIMER) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxTimerCtrlState, NPCM7XX_TIMER)#endif /* NPCM7XX_TIMER_H */
include/hw/tricore/tricore_testdevice.h +1 -3
@@ -24,9 +24,7 @@#include "qom/object.h" #define TYPE_TRICORE_TESTDEVICE "tricore_testdevice" -typedef struct TriCoreTestDeviceState TriCoreTestDeviceState ; -DECLARE_INSTANCE_CHECKER (TriCoreTestDeviceState,TRICORE_TESTDEVICE , - TYPE_TRICORE_TESTDEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(TriCoreTestDeviceState, TRICORE_TESTDEVICE)struct TriCoreTestDeviceState {/* <private> */
include/hw/usb/hcd-dwc3.h +1 -3
@@ -32,9 +32,7 @@#define TYPE_USB_DWC3 "usb_dwc3" -typedef struct USBDWC3 USBDWC3 ; -DECLARE_INSTANCE_CHECKER (USBDWC3 ,USB_DWC3 , - TYPE_USB_DWC3) +OBJECT_DECLARE_SIMPLE_TYPE(USBDWC3, USB_DWC3)#define USB_DWC3_R_MAX ((0x530 / 4) + 1)#define DWC3_SIZE 0x10000
include/hw/usb/xlnx-versal-usb2-ctrl-regs.h +1 -3
@@ -29,9 +29,7 @@#define TYPE_XILINX_VERSAL_USB2_CTRL_REGS "xlnx.versal-usb2-ctrl-regs" -typedef struct VersalUsb2CtrlRegs VersalUsb2CtrlRegs ; -DECLARE_INSTANCE_CHECKER (VersalUsb2CtrlRegs,XILINX_VERSAL_USB2_CTRL_REGS , - TYPE_XILINX_VERSAL_USB2_CTRL_REGS) +OBJECT_DECLARE_SIMPLE_TYPE(VersalUsb2CtrlRegs, XILINX_VERSAL_USB2_CTRL_REGS)#define USB2_REGS_R_MAX ((0x78 / 4) + 1)
hw/m68k/mcf5206.c +1 -3
@@ -179,10 +179,8 @@ struct m5206_mbar_state {/* Include the UART vector registers here. */ uint8_t uivr[2 ]; }; -typedef struct m5206_mbar_state m5206_mbar_state ; -DECLARE_INSTANCE_CHECKER (m5206_mbar_state,MCF5206_MBAR , -TYPE_MCF5206_MBAR ) +OBJECT_DECLARE_SIMPLE_TYPE (m5206_mbar_state,MCF5206_MBAR )/* Interrupt controller. */
hw/mips/boston.c +1 -3
@@ -44,9 +44,7 @@#include "qom/object.h" #define TYPE_BOSTON "mips-boston" -typedef struct BostonState BostonState ; -DECLARE_INSTANCE_CHECKER (BostonState,BOSTON , - TYPE_BOSTON) +OBJECT_DECLARE_SIMPLE_TYPE(BostonState, BOSTON)struct BostonState {SysBusDevice parent_obj;
hw/misc/npcm7xx_clk.c +3 -6
@@ -110,14 +110,11 @@ static const uint32_t cold_reset_values[NPCM7XX_CLK_NR_REGS] = {/* Clock converter functions */ #define TYPE_NPCM7XX_CLOCK_PLL "npcm7xx-clock-pll" -DECLARE_INSTANCE_CHECKER (NPCM7xxClockPLLState,NPCM7XX_CLOCK_PLL , - TYPE_NPCM7XX_CLOCK_PLL) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxClockPLLState, NPCM7XX_CLOCK_PLL)#define TYPE_NPCM7XX_CLOCK_SEL "npcm7xx-clock-sel" -DECLARE_INSTANCE_CHECKER (NPCM7xxClockSELState,NPCM7XX_CLOCK_SEL , - TYPE_NPCM7XX_CLOCK_SEL) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxClockSELState, NPCM7XX_CLOCK_SEL)#define TYPE_NPCM7XX_CLOCK_DIVIDER "npcm7xx-clock-divider" -DECLARE_INSTANCE_CHECKER (NPCM7xxClockDividerState,NPCM7XX_CLOCK_DIVIDER , - TYPE_NPCM7XX_CLOCK_DIVIDER) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxClockDividerState, NPCM7XX_CLOCK_DIVIDER)static void npcm7xx_clk_update_pll (void *opaque) {
hw/net/can/ctucan_pci.c +1 -3
@@ -44,9 +44,7 @@#define TYPE_CTUCAN_PCI_DEV "ctucan_pci" -typedef struct CtuCanPCIState CtuCanPCIState ; -DECLARE_INSTANCE_CHECKER (CtuCanPCIState,CTUCAN_PCI_DEV , - TYPE_CTUCAN_PCI_DEV) +OBJECT_DECLARE_SIMPLE_TYPE(CtuCanPCIState, CTUCAN_PCI_DEV)#define CTUCAN_PCI_CORE_COUNT 2#define CTUCAN_PCI_CORE_RANGE 0x10000
hw/s390x/vhost-user-fs-ccw.c +1 -3
@@ -18,11 +18,9 @@ struct VHostUserFSCcw {VirtioCcwDevice parent_obj;VHostUserFS vdev; }; -typedef struct VHostUserFSCcw VHostUserFSCcw ;#define TYPE_VHOST_USER_FS_CCW "vhost-user-fs-ccw" -DECLARE_INSTANCE_CHECKER (VHostUserFSCcw,VHOST_USER_FS_CCW , - TYPE_VHOST_USER_FS_CCW) +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserFSCcw, VHOST_USER_FS_CCW)static Property vhost_user_fs_ccw_properties[] = {
hw/sensor/adm1272.c +1 -3
@@ -19,9 +19,7 @@#include "qom/object.h" #define TYPE_ADM1272 "adm1272" -typedef struct ADM1272State ADM1272State ; -DECLARE_INSTANCE_CHECKER (ADM1272State,ADM1272 , - TYPE_ADM1272) +OBJECT_DECLARE_SIMPLE_TYPE(ADM1272State, ADM1272)#define ADM1272_RESTART_TIME 0xCC#define ADM1272_MFR_PEAK_IOUT 0xD0
hw/sensor/max34451.c +1 -3
@@ -17,9 +17,7 @@#include "qom/object.h" #define TYPE_MAX34451 "max34451" -typedef struct MAX34451State MAX34451State ; -DECLARE_INSTANCE_CHECKER (MAX34451State,MAX34451 , - TYPE_MAX34451) +OBJECT_DECLARE_SIMPLE_TYPE(MAX34451State, MAX34451)#define MAX34451_MFR_MODE 0xD1#define MAX34451_MFR_PSEN_CONFIG 0xD2
Signature · 1 line
2.31.1
Re: [PATCH for-6.2 12/12] [automated] Use OBJECT_DECLARE_SIMPLE_TYPE when possible
Quoted 106 lines · Eduardo Habkost
Replace typedef +
DECLARE_INSTANCE_CHECKERwith
equivalentOBJECT_DECLARE_SIMPLE_TYPEmacro.Generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]')Signed-off-by Eduardo Habkost <[email protected]>---
Cc: Thomas Huth <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Aleksandar Rikalo <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Aurelien Jarno <[email protected]>
Cc: Jiaxun Yang <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Pavel Pisa <[email protected]>
Cc: Vikram Garhwal <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Klaus Jensen <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Vijai Kumar K <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Andrew Jeffery <[email protected]>
Cc: Joel Stanley <[email protected]>
Cc: Andrew Baumann <[email protected]>
Cc: Francisco Iglesias <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- hw/nvme/nvme.h | 10 +++------- hw/usb/hcd-xhci-pci.h | 4 +--- hw/usb/hcd-xhci-sysbus.h | 4 +--- include/hw/adc/npcm7xx_adc.h | 4 +--- include/hw/char/shakti_uart.h | 4 +--- include/hw/dma/sifive_pdma.h | 4 +--- include/hw/dma/xlnx_csu_dma.h | 4 +--- include/hw/gpio/sifive_gpio.h | 4 +--- include/hw/intc/m68k_irqc.h | 4 +--- include/hw/intc/sifive_clint.h | 4 +--- include/hw/intc/sifive_plic.h | 4 +--- include/hw/misc/aspeed_lpc.h | 4 +--- include/hw/misc/bcm2835_cprman_internals.h | 12 ++++-------- include/hw/misc/led.h | 3 +-- include/hw/misc/mchp_pfsoc_dmc.h | 8 ++------ include/hw/misc/mchp_pfsoc_ioscb.h | 4 +--- include/hw/misc/mchp_pfsoc_sysreg.h | 4 +--- include/hw/misc/npcm7xx_clk.h | 3 +-- include/hw/misc/npcm7xx_gcr.h | 4 +--- include/hw/misc/npcm7xx_mft.h | 4 +--- include/hw/misc/npcm7xx_pwm.h | 3 +-- include/hw/misc/sifive_e_prci.h | 4 +--- include/hw/misc/sifive_test.h | 4 +--- include/hw/misc/sifive_u_otp.h | 4 +--- include/hw/misc/sifive_u_prci.h | 4 +--- include/hw/misc/xlnx-versal-xramc.h | 4 +--- include/hw/net/npcm7xx_emc.h | 4 +--- include/hw/net/xlnx-zynqmp-can.h | 4 +--- include/hw/ppc/spapr_drc.h | 4 +--- include/hw/register.h | 3 +-- include/hw/riscv/microchip_pfsoc.h | 4 +--- include/hw/riscv/shakti_c.h | 8 ++------ include/hw/riscv/sifive_e.h | 4 +--- include/hw/riscv/sifive_u.h | 4 +--- include/hw/sd/cadence_sdhci.h | 4 +--- include/hw/ssi/sifive_spi.h | 4 +--- include/hw/timer/npcm7xx_timer.h | 3 +-- include/hw/tricore/tricore_testdevice.h | 4 +--- include/hw/usb/hcd-dwc3.h | 4 +--- include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 4 +--- hw/m68k/mcf5206.c | 4 +--- hw/mips/boston.c | 4 +--- hw/misc/npcm7xx_clk.c | 9 +++------ hw/net/can/ctucan_pci.c | 4 +--- hw/s390x/vhost-user-fs-ccw.c | 4 +--- hw/sensor/adm1272.c | 4 +--- hw/sensor/max34451.c | 4 +--- 47 files changed, 56 insertions(+), 154 deletions(-)include/hw/usb/xlnx-versal-usb2-ctrl-regs.h +0
-0
include/hw/usb/xlnx-versal-usb2-ctrl-regs.h line 32
Quoted 7 lines
include/hw/usb/xlnx-versal-usb2-ctrl-regs.h +1
-3@@ -29,9 +29,7 @@#define TYPE_XILINX_VERSAL_USB2_CTRL_REGS "xlnx.versal-usb2-ctrl-regs" -typedef struct VersalUsb2CtrlRegs VersalUsb2CtrlRegs ; -DECLARE_INSTANCE_CHECKER (VersalUsb2CtrlRegs,XILINX_VERSAL_USB2_CTRL_REGS , -TYPE_XILINX_VERSAL_USB2_CTRL_REGS ) +OBJECT_DECLARE_SIMPLE_TYPE (VersalUsb2CtrlRegs,XILINX_VERSAL_USB2_CTRL_REGS )
Unrelated to this patch, we should remove the _regs suffix from this model.
Re: [PATCH for-6.2 12/12] [automated] Use OBJECT_DECLARE_SIMPLE_TYPE when possible
In reply to Eduardo HabkostQuoted 92 lines · Eduardo Habkost
Replace typedef +
DECLARE_INSTANCE_CHECKERwith
equivalentOBJECT_DECLARE_SIMPLE_TYPEmacro.Generated using:
$ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]')Signed-off-by Eduardo Habkost <[email protected]>---
Cc: Thomas Huth <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Aleksandar Rikalo <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Cc: Aurelien Jarno <[email protected]>
Cc: Jiaxun Yang <[email protected]>
Cc: Havard Skinnemoen <[email protected]>
Cc: Tyrone Ting <[email protected]>
Cc: Pavel Pisa <[email protected]>
Cc: Vikram Garhwal <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Klaus Jensen <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Vijai Kumar K <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: "Cédric Le Goater" <[email protected]>
Cc: Andrew Jeffery <[email protected]>
Cc: Joel Stanley <[email protected]>
Cc: Andrew Baumann <[email protected]>
Cc: Francisco Iglesias <[email protected]>
Cc: David Gibson <[email protected]>
Cc: Greg Kurz <[email protected]>
Cc: Bastian Koppelmann <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- hw/nvme/nvme.h | 10 +++------- hw/usb/hcd-xhci-pci.h | 4 +--- hw/usb/hcd-xhci-sysbus.h | 4 +--- include/hw/adc/npcm7xx_adc.h | 4 +--- include/hw/char/shakti_uart.h | 4 +--- include/hw/dma/sifive_pdma.h | 4 +--- include/hw/dma/xlnx_csu_dma.h | 4 +--- include/hw/gpio/sifive_gpio.h | 4 +--- include/hw/intc/m68k_irqc.h | 4 +--- include/hw/intc/sifive_clint.h | 4 +--- include/hw/intc/sifive_plic.h | 4 +--- include/hw/misc/aspeed_lpc.h | 4 +--- include/hw/misc/bcm2835_cprman_internals.h | 12 ++++-------- include/hw/misc/led.h | 3 +-- include/hw/misc/mchp_pfsoc_dmc.h | 8 ++------ include/hw/misc/mchp_pfsoc_ioscb.h | 4 +--- include/hw/misc/mchp_pfsoc_sysreg.h | 4 +--- include/hw/misc/npcm7xx_clk.h | 3 +-- include/hw/misc/npcm7xx_gcr.h | 4 +--- include/hw/misc/npcm7xx_mft.h | 4 +--- include/hw/misc/npcm7xx_pwm.h | 3 +-- include/hw/misc/sifive_e_prci.h | 4 +--- include/hw/misc/sifive_test.h | 4 +--- include/hw/misc/sifive_u_otp.h | 4 +--- include/hw/misc/sifive_u_prci.h | 4 +--- include/hw/misc/xlnx-versal-xramc.h | 4 +--- include/hw/net/npcm7xx_emc.h | 4 +--- include/hw/net/xlnx-zynqmp-can.h | 4 +--- include/hw/ppc/spapr_drc.h | 4 +--- include/hw/register.h | 3 +-- include/hw/riscv/microchip_pfsoc.h | 4 +--- include/hw/riscv/shakti_c.h | 8 ++------ include/hw/riscv/sifive_e.h | 4 +--- include/hw/riscv/sifive_u.h | 4 +--- include/hw/sd/cadence_sdhci.h | 4 +--- include/hw/ssi/sifive_spi.h | 4 +--- include/hw/timer/npcm7xx_timer.h | 3 +-- include/hw/tricore/tricore_testdevice.h | 4 +--- include/hw/usb/hcd-dwc3.h | 4 +--- include/hw/usb/xlnx-versal-usb2-ctrl-regs.h | 4 +---
Quoted 8 lines
hw/m68k/mcf5206.c | 4 +--- hw/mips/boston.c | 4 +--- hw/misc/npcm7xx_clk.c | 9 +++------ hw/net/can/ctucan_pci.c | 4 +--- hw/s390x/vhost-user-fs-ccw.c | 4 +--- hw/sensor/adm1272.c | 4 +--- hw/sensor/max34451.c | 4 +--- 47 files changed, 56 insertions(+), 154 deletions(-)
Quoted 8 lines · Eduardo Habkost
This series gets rid of all manual usage of
OBJECT_CHECK,OBJECT_CLASS_CHECK, andOBJECT_GET_CLASS.All type check macros defined manually are replaced with DEFINE_*CHECKER* or OBJECT_DECLARE* macros.
All manual usage of OBJECT_CHECK/OBJECT_CLASS_CHECK/OBJECT_GET_CLASS is manually replaced with the corresponding type-specific wrappers.
Is INTERFACE_CHECK already converted / in good shape?
Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 8 lines · Eduardo Habkost
This series gets rid of all manual usage of
OBJECT_CHECK,OBJECT_CLASS_CHECK, andOBJECT_GET_CLASS.All type check macros defined manually are replaced with DEFINE_*CHECKER* or OBJECT_DECLARE* macros.
All manual usage of OBJECT_CHECK/OBJECT_CLASS_CHECK/OBJECT_GET_CLASS is manually replaced with the corresponding type-specific wrappers.
Is
INTERFACE_CHECKalready converted / in good shape?
Not yet. I need to refresh my memory by looking at mailing list archives, but I have a work in progress branch that I haven't touched in a while (except for rebasing it) at:
https://gitlab.com/ehabkost/qemu/-/commits/work/qom-declare-interface-type/
Basically it introduces a DECLARE_INTERFACE_CHECKER macro instead of reusing OBJECT_CHECK/DECLARE_INSTANCE_CHECKER.
Signature · 1 line
Eduardo