aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/9pfs/virtio-9p-device.c4
-rw-r--r--hw/a9mpcore.c4
-rw-r--r--hw/ac97.c4
-rw-r--r--hw/acpi_piix4.c4
-rw-r--r--hw/ads7846.c4
-rw-r--r--hw/alpha_typhoon.c5
-rw-r--r--hw/apb_pci.c4
-rw-r--r--hw/apic.c4
-rw-r--r--hw/apic_common.c4
-rw-r--r--hw/applesmc.c4
-rw-r--r--hw/arm11mpcore.c4
-rw-r--r--hw/arm_l2x0.c4
-rw-r--r--hw/arm_mptimer.c4
-rw-r--r--hw/arm_sysctl.c4
-rw-r--r--hw/arm_timer.c4
-rw-r--r--hw/armv7m.c4
-rw-r--r--hw/armv7m_nvic.c4
-rw-r--r--hw/bitbang_i2c.c4
-rw-r--r--hw/bonito.c5
-rw-r--r--hw/ccid-card-emulated.c4
-rw-r--r--hw/ccid-card-passthru.c4
-rw-r--r--hw/cirrus_vga.c12
-rw-r--r--hw/cs4231.c4
-rw-r--r--hw/cs4231a.c5
-rw-r--r--hw/debugcon.c4
-rw-r--r--hw/dec_pci.c4
-rw-r--r--hw/ds1225y.c4
-rw-r--r--hw/ds1338.c4
-rw-r--r--hw/e1000.c4
-rw-r--r--hw/eccmemctl.c4
-rw-r--r--hw/eepro100.c4
-rw-r--r--hw/empty_slot.c4
-rw-r--r--hw/es1370.c5
-rw-r--r--hw/escc.c4
-rw-r--r--hw/esp.c4
-rw-r--r--hw/etraxfs_eth.c4
-rw-r--r--hw/etraxfs_pic.c4
-rw-r--r--hw/etraxfs_ser.c4
-rw-r--r--hw/etraxfs_timer.c4
-rw-r--r--hw/fdc.c4
-rw-r--r--hw/framebuffer.c2
-rw-r--r--hw/fw_cfg.c4
-rw-r--r--hw/g364fb.c4
-rw-r--r--hw/grackle_pci.c4
-rw-r--r--hw/grlib_apbuart.c4
-rw-r--r--hw/grlib_gptimer.c4
-rw-r--r--hw/grlib_irqmp.c4
-rw-r--r--hw/gt64xxx.c4
-rw-r--r--hw/gus.c5
-rw-r--r--hw/hda-audio.c5
-rw-r--r--hw/highbank.c4
-rw-r--r--hw/hpet.c4
-rw-r--r--hw/i2c.c4
-rw-r--r--hw/i82374.c4
-rw-r--r--hw/i82378.c4
-rw-r--r--hw/i8254.c5
-rw-r--r--hw/i8259.c4
-rw-r--r--hw/i8259_common.c4
-rw-r--r--hw/ide/ahci.c11
-rw-r--r--hw/ide/cmd646.c5
-rw-r--r--hw/ide/ich.c5
-rw-r--r--hw/ide/isa.c4
-rw-r--r--hw/ide/piix.c5
-rw-r--r--hw/ide/qdev.c5
-rw-r--r--hw/ide/via.c5
-rw-r--r--hw/integratorcp.c4
-rw-r--r--hw/intel-hda.c5
-rw-r--r--hw/ioapic.c4
-rw-r--r--hw/ioapic_common.c5
-rw-r--r--hw/ioh3420.c4
-rw-r--r--hw/isa-bus.c4
-rw-r--r--hw/ivshmem.c4
-rw-r--r--hw/kvm/apic.c4
-rw-r--r--hw/kvm/clock.c4
-rw-r--r--hw/kvm/i8259.c4
-rw-r--r--hw/kvm/ioapic.c4
-rw-r--r--hw/lan9118.c4
-rw-r--r--hw/lance.c5
-rw-r--r--hw/lm32_juart.c4
-rw-r--r--hw/lm32_pic.c4
-rw-r--r--hw/lm32_sys.c4
-rw-r--r--hw/lm32_timer.c4
-rw-r--r--hw/lm32_uart.c4
-rw-r--r--hw/lm832x.c4
-rw-r--r--hw/lsi53c895a.c4
-rw-r--r--hw/m48t59.c4
-rw-r--r--hw/macio.c4
-rw-r--r--hw/marvell_88w8618_audio.c4
-rw-r--r--hw/max111x.c4
-rw-r--r--hw/max7310.c4
-rw-r--r--hw/mc146818rtc.c5
-rw-r--r--hw/milkymist-ac97.c4
-rw-r--r--hw/milkymist-hpdmc.c4
-rw-r--r--hw/milkymist-memcard.c4
-rw-r--r--hw/milkymist-minimac2.c4
-rw-r--r--hw/milkymist-pfpu.c4
-rw-r--r--hw/milkymist-softusb.c4
-rw-r--r--hw/milkymist-sysctl.c4
-rw-r--r--hw/milkymist-tmu2.c4
-rw-r--r--hw/milkymist-uart.c4
-rw-r--r--hw/milkymist-vgafb.c4
-rw-r--r--hw/mips_malta.c4
-rw-r--r--hw/mipsnet.c4
-rw-r--r--hw/mpc8544_guts.c5
-rw-r--r--hw/mst_fpga.c5
-rw-r--r--hw/musicpal.c4
-rw-r--r--hw/nand.c4
-rw-r--r--hw/ne2000-isa.c4
-rw-r--r--hw/ne2000.c4
-rw-r--r--hw/omap_gpio.c4
-rw-r--r--hw/omap_intc.c4
-rw-r--r--hw/onenand.c4
-rw-r--r--hw/opencores_eth.c4
-rw-r--r--hw/parallel.c4
-rw-r--r--hw/pc.c5
-rw-r--r--hw/pci.c4
-rw-r--r--hw/pckbd.c5
-rw-r--r--hw/pcnet-pci.c4
-rw-r--r--hw/pflash_cfi02.c1
-rw-r--r--hw/piix4.c5
-rw-r--r--hw/piix_pci.c5
-rw-r--r--hw/pl011.c4
-rw-r--r--hw/pl022.c4
-rw-r--r--hw/pl031.c4
-rw-r--r--hw/pl041.c4
-rw-r--r--hw/pl050.c4
-rw-r--r--hw/pl061.c4
-rw-r--r--hw/pl080.c4
-rw-r--r--hw/pl110.c4
-rw-r--r--hw/pl181.c4
-rw-r--r--hw/pl190.c4
-rw-r--r--hw/ppc4xx_pci.c5
-rw-r--r--hw/ppce500_pci.c5
-rw-r--r--hw/ppce500_spin.c5
-rw-r--r--hw/prep_pci.c4
-rw-r--r--hw/pxa2xx.c4
-rw-r--r--hw/pxa2xx_dma.c5
-rw-r--r--hw/pxa2xx_gpio.c5
-rw-r--r--hw/pxa2xx_pic.c5
-rw-r--r--hw/pxa2xx_timer.c7
-rw-r--r--hw/qdev-monitor.c18
-rw-r--r--hw/qdev-properties.c41
-rw-r--r--hw/qdev.c4
-rw-r--r--hw/qxl.c4
-rw-r--r--hw/realview.c4
-rw-r--r--hw/realview_gic.c4
-rw-r--r--hw/rtl8139.c4
-rw-r--r--hw/s390-virtio-bus.c17
-rw-r--r--hw/sb16.c5
-rw-r--r--hw/sbi.c4
-rw-r--r--hw/scsi-bus.c4
-rw-r--r--hw/scsi-disk.c5
-rw-r--r--hw/scsi-generic.c5
-rw-r--r--hw/serial.c4
-rw-r--r--hw/sga.c4
-rw-r--r--hw/sh_pci.c4
-rw-r--r--hw/slavio_intctl.c4
-rw-r--r--hw/slavio_misc.c4
-rw-r--r--hw/slavio_timer.c4
-rw-r--r--hw/sm501.c4
-rw-r--r--hw/smbus.c4
-rw-r--r--hw/smbus_eeprom.c4
-rw-r--r--hw/smc91c111.c4
-rw-r--r--hw/spapr_hcall.c5
-rw-r--r--hw/spapr_llan.c5
-rw-r--r--hw/spapr_pci.c4
-rw-r--r--hw/spapr_rtas.c5
-rw-r--r--hw/spapr_vio.c4
-rw-r--r--hw/spapr_vscsi.c5
-rw-r--r--hw/spapr_vty.c5
-rw-r--r--hw/sparc32_dma.c4
-rw-r--r--hw/spitz.c4
-rw-r--r--hw/ssd0303.c4
-rw-r--r--hw/ssd0323.c4
-rw-r--r--hw/ssi-sd.c4
-rw-r--r--hw/ssi.c4
-rw-r--r--hw/stellaris.c4
-rw-r--r--hw/stellaris_enet.c4
-rw-r--r--hw/strongarm.c5
-rw-r--r--hw/sun4c_intctl.c4
-rw-r--r--hw/sun4m.c37
-rw-r--r--hw/sun4m_iommu.c4
-rw-r--r--hw/sun4u.c29
-rw-r--r--hw/sysbus.c4
-rw-r--r--hw/tcx.c4
-rw-r--r--hw/tmp105.c4
-rw-r--r--hw/tosa.c4
-rw-r--r--hw/tusb6010.c4
-rw-r--r--hw/twl92230.c4
-rw-r--r--hw/unin_pci.c4
-rw-r--r--hw/usb-audio.c4
-rw-r--r--hw/usb-bt.c5
-rw-r--r--hw/usb-bus.c4
-rw-r--r--hw/usb-ccid.c5
-rw-r--r--hw/usb-ehci.c5
-rw-r--r--hw/usb-hid.c5
-rw-r--r--hw/usb-hub.c5
-rw-r--r--hw/usb-msd.c5
-rw-r--r--hw/usb-net.c5
-rw-r--r--hw/usb-ohci.c5
-rw-r--r--hw/usb-serial.c5
-rw-r--r--hw/usb-uhci.c5
-rw-r--r--hw/usb-wacom.c5
-rw-r--r--hw/usb-xhci.c5
-rw-r--r--hw/versatile_pci.c4
-rw-r--r--hw/versatilepb.c4
-rw-r--r--hw/vga-isa.c5
-rw-r--r--hw/vga-pci.c5
-rw-r--r--hw/vga.c5
-rw-r--r--hw/virtio-console.c12
-rw-r--r--hw/virtio-pci.c4
-rw-r--r--hw/virtio-serial-bus.c4
-rw-r--r--hw/vmmouse.c5
-rw-r--r--hw/vmport.c5
-rw-r--r--hw/vmware_vga.c5
-rw-r--r--hw/vt82c686.c29
-rw-r--r--hw/wdt_i6300esb.c4
-rw-r--r--hw/wdt_ib700.c4
-rw-r--r--hw/wm8750.c4
-rw-r--r--hw/xen_platform.c4
-rw-r--r--hw/xgmac.c4
-rw-r--r--hw/xilinx_axidma.c4
-rw-r--r--hw/xilinx_axienet.c5
-rw-r--r--hw/xilinx_ethlite.c4
-rw-r--r--hw/xilinx_intc.c4
-rw-r--r--hw/xilinx_timer.c4
-rw-r--r--hw/xilinx_uartlite.c4
-rw-r--r--hw/xio3130_downstream.c4
-rw-r--r--hw/xio3130_upstream.c4
-rw-r--r--hw/zaurus.c5
230 files changed, 576 insertions, 569 deletions
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 791a5572bb..b8220abae7 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -184,10 +184,10 @@ static TypeInfo virtio_9p_info = {
.class_init = virtio_9p_class_init,
};
-static void virtio_9p_register_devices(void)
+static void virtio_9p_register_types(void)
{
type_register_static(&virtio_9p_info);
virtio_9p_set_fd_limit();
}
-device_init(virtio_9p_register_devices)
+type_init(virtio_9p_register_types)
diff --git a/hw/a9mpcore.c b/hw/a9mpcore.c
index 19de12b4b4..03b128ce5b 100644
--- a/hw/a9mpcore.c
+++ b/hw/a9mpcore.c
@@ -238,9 +238,9 @@ static TypeInfo a9mp_priv_info = {
.class_init = a9mp_priv_class_init,
};
-static void a9mp_register_devices(void)
+static void a9mp_register_types(void)
{
type_register_static(&a9mp_priv_info);
}
-device_init(a9mp_register_devices)
+type_init(a9mp_register_types)
diff --git a/hw/ac97.c b/hw/ac97.c
index 7bf9171487..c0fd0197a0 100644
--- a/hw/ac97.c
+++ b/hw/ac97.c
@@ -1372,9 +1372,9 @@ static TypeInfo ac97_info = {
.class_init = ac97_class_init,
};
-static void ac97_register (void)
+static void ac97_register_types (void)
{
type_register_static (&ac97_info);
}
-device_init (ac97_register);
+type_init (ac97_register_types)
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 21484aec42..d959f4907b 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -426,12 +426,12 @@ static TypeInfo piix4_pm_info = {
.class_init = piix4_pm_class_init,
};
-static void piix4_pm_register(void)
+static void piix4_pm_register_types(void)
{
type_register_static(&piix4_pm_info);
}
-device_init(piix4_pm_register);
+type_init(piix4_pm_register_types)
static uint32_t gpe_readb(void *opaque, uint32_t addr)
{
diff --git a/hw/ads7846.c b/hw/ads7846.c
index 3cfdecbe5c..41c7f101c4 100644
--- a/hw/ads7846.c
+++ b/hw/ads7846.c
@@ -168,9 +168,9 @@ static TypeInfo ads7846_info = {
.class_init = ads7846_class_init,
};
-static void ads7846_register_devices(void)
+static void ads7846_register_types(void)
{
type_register_static(&ads7846_info);
}
-device_init(ads7846_register_devices)
+type_init(ads7846_register_types)
diff --git a/hw/alpha_typhoon.c b/hw/alpha_typhoon.c
index 736c28a3a9..b539416589 100644
--- a/hw/alpha_typhoon.c
+++ b/hw/alpha_typhoon.c
@@ -824,8 +824,9 @@ static TypeInfo typhoon_pcihost_info = {
.class_init = typhoon_pcihost_class_init,
};
-static void typhoon_register(void)
+static void typhoon_register_types(void)
{
type_register_static(&typhoon_pcihost_info);
}
-device_init(typhoon_register);
+
+type_init(typhoon_register_types)
diff --git a/hw/apb_pci.c b/hw/apb_pci.c
index c7aaa72d07..1d25da8da9 100644
--- a/hw/apb_pci.c
+++ b/hw/apb_pci.c
@@ -493,11 +493,11 @@ static TypeInfo pbm_pci_bridge_info = {
.class_init = pbm_pci_bridge_class_init,
};
-static void pbm_register_devices(void)
+static void pbm_register_types(void)
{
type_register_static(&pbm_host_info);
type_register_static(&pbm_pci_host_info);
type_register_static(&pbm_pci_bridge_info);
}
-device_init(pbm_register_devices)
+type_init(pbm_register_types)
diff --git a/hw/apic.c b/hw/apic.c
index 086c544bf3..ff9d24e914 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -781,9 +781,9 @@ static TypeInfo apic_info = {
.class_init = apic_class_init,
};
-static void apic_register_devices(void)
+static void apic_register_types(void)
{
type_register_static(&apic_info);
}
-device_init(apic_register_devices)
+type_init(apic_register_types)
diff --git a/hw/apic_common.c b/hw/apic_common.c
index 26991b4516..a440ea8ff5 100644
--- a/hw/apic_common.c
+++ b/hw/apic_common.c
@@ -313,9 +313,9 @@ static TypeInfo apic_common_type = {
.abstract = true,
};
-static void register_devices(void)
+static void register_types(void)
{
type_register_static(&apic_common_type);
}
-device_init(register_devices);
+type_init(register_types)
diff --git a/hw/applesmc.c b/hw/applesmc.c
index b06487f70d..8bedaad310 100644
--- a/hw/applesmc.c
+++ b/hw/applesmc.c
@@ -243,9 +243,9 @@ static TypeInfo applesmc_isa_info = {
.class_init = qdev_applesmc_class_init,
};
-static void applesmc_register_devices(void)
+static void applesmc_register_types(void)
{
type_register_static(&applesmc_isa_info);
}
-device_init(applesmc_register_devices)
+type_init(applesmc_register_types)
diff --git a/hw/arm11mpcore.c b/hw/arm11mpcore.c
index 3c0839c4b4..102348bb70 100644
--- a/hw/arm11mpcore.c
+++ b/hw/arm11mpcore.c
@@ -252,10 +252,10 @@ static TypeInfo mpcore_priv_info = {
.class_init = mpcore_priv_class_init,
};
-static void arm11mpcore_register_devices(void)
+static void arm11mpcore_register_types(void)
{
type_register_static(&mpcore_rirq_info);
type_register_static(&mpcore_priv_info);
}
-device_init(arm11mpcore_register_devices)
+type_init(arm11mpcore_register_types)
diff --git a/hw/arm_l2x0.c b/hw/arm_l2x0.c
index ba26abc6f4..09f290c85f 100644
--- a/hw/arm_l2x0.c
+++ b/hw/arm_l2x0.c
@@ -184,9 +184,9 @@ static TypeInfo l2x0_info = {
.class_init = l2x0_class_init,
};
-static void l2x0_register_device(void)
+static void l2x0_register_types(void)
{
type_register_static(&l2x0_info);
}
-device_init(l2x0_register_device)
+type_init(l2x0_register_types)
diff --git a/hw/arm_mptimer.c b/hw/arm_mptimer.c
index 5a02365b6f..361e887dec 100644
--- a/hw/arm_mptimer.c
+++ b/hw/arm_mptimer.c
@@ -335,9 +335,9 @@ static TypeInfo arm_mptimer_info = {
.class_init = arm_mptimer_class_init,
};
-static void arm_mptimer_register_devices(void)
+static void arm_mptimer_register_types(void)
{
type_register_static(&arm_mptimer_info);
}
-device_init(arm_mptimer_register_devices)
+type_init(arm_mptimer_register_types)
diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c
index 9d257994c0..149c6394e6 100644
--- a/hw/arm_sysctl.c
+++ b/hw/arm_sysctl.c
@@ -425,9 +425,9 @@ static TypeInfo arm_sysctl_info = {
.class_init = arm_sysctl_class_init,
};
-static void arm_sysctl_register_devices(void)
+static void arm_sysctl_register_types(void)
{
type_register_static(&arm_sysctl_info);
}
-device_init(arm_sysctl_register_devices)
+type_init(arm_sysctl_register_types)
diff --git a/hw/arm_timer.c b/hw/arm_timer.c
index 1019d41b3e..e3ecce29f0 100644
--- a/hw/arm_timer.c
+++ b/hw/arm_timer.c
@@ -383,10 +383,10 @@ static TypeInfo sp804_info = {
.class_init = sp804_class_init,
};
-static void arm_timer_register_devices(void)
+static void arm_timer_register_types(void)
{
type_register_static(&icp_pit_info);
type_register_static(&sp804_info);
}
-device_init(arm_timer_register_devices)
+type_init(arm_timer_register_types)
diff --git a/hw/armv7m.c b/hw/armv7m.c
index de3d7e0828..6b805798e6 100644
--- a/hw/armv7m.c
+++ b/hw/armv7m.c
@@ -266,9 +266,9 @@ static TypeInfo bitband_info = {
.class_init = bitband_class_init,
};
-static void armv7m_register_devices(void)
+static void armv7m_register_types(void)
{
type_register_static(&bitband_info);
}
-device_init(armv7m_register_devices)
+type_init(armv7m_register_types)
diff --git a/hw/armv7m_nvic.c b/hw/armv7m_nvic.c
index 1ed0abc3e7..3210129c3f 100644
--- a/hw/armv7m_nvic.c
+++ b/hw/armv7m_nvic.c
@@ -417,9 +417,9 @@ static TypeInfo armv7m_nvic_info = {
.class_init = armv7m_nvic_class_init,
};
-static void armv7m_nvic_register_devices(void)
+static void armv7m_nvic_register_types(void)
{
type_register_static(&armv7m_nvic_info);
}
-device_init(armv7m_nvic_register_devices)
+type_init(armv7m_nvic_register_types)
diff --git a/hw/bitbang_i2c.c b/hw/bitbang_i2c.c
index c9c11823af..44ed7f4d61 100644
--- a/hw/bitbang_i2c.c
+++ b/hw/bitbang_i2c.c
@@ -237,9 +237,9 @@ static TypeInfo gpio_i2c_info = {
.class_init = gpio_i2c_class_init,
};
-static void bitbang_i2c_register(void)
+static void bitbang_i2c_register_types(void)
{
type_register_static(&gpio_i2c_info);
}
-device_init(bitbang_i2c_register)
+type_init(bitbang_i2c_register_types)
diff --git a/hw/bonito.c b/hw/bonito.c
index 7350a4f9ec..77786f8883 100644
--- a/hw/bonito.c
+++ b/hw/bonito.c
@@ -804,9 +804,10 @@ static TypeInfo bonito_pcihost_info = {
.class_init = bonito_pcihost_class_init,
};
-static void bonito_register(void)
+static void bonito_register_types(void)
{
type_register_static(&bonito_pcihost_info);
type_register_static(&bonito_info);
}
-device_init(bonito_register);
+
+type_init(bonito_register_types)
diff --git a/hw/ccid-card-emulated.c b/hw/ccid-card-emulated.c
index 9510ed4d94..f4a6da4283 100644
--- a/hw/ccid-card-emulated.c
+++ b/hw/ccid-card-emulated.c
@@ -594,9 +594,9 @@ static TypeInfo emulated_card_info = {
.class_init = emulated_class_initfn,
};
-static void ccid_card_emulated_register_devices(void)
+static void ccid_card_emulated_register_types(void)
{
type_register_static(&emulated_card_info);
}
-device_init(ccid_card_emulated_register_devices)
+type_init(ccid_card_emulated_register_types)
diff --git a/hw/ccid-card-passthru.c b/hw/ccid-card-passthru.c
index a7006ca035..bd6c77777d 100644
--- a/hw/ccid-card-passthru.c
+++ b/hw/ccid-card-passthru.c
@@ -343,9 +343,9 @@ static TypeInfo passthru_card_info = {
.class_init = passthru_class_initfn,
};
-static void ccid_card_passthru_register_devices(void)
+static void ccid_card_passthru_register_types(void)
{
type_register_static(&passthru_card_info);
}
-device_init(ccid_card_passthru_register_devices)
+type_init(ccid_card_passthru_register_types)
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index a8e8ab7660..4edcb94774 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -2923,12 +2923,6 @@ static TypeInfo isa_cirrus_vga_info = {
.class_init = isa_cirrus_vga_class_init,
};
-static void isa_cirrus_vga_register(void)
-{
- type_register_static(&isa_cirrus_vga_info);
-}
-device_init(isa_cirrus_vga_register)
-
/***************************************
*
* PCI bus support
@@ -2996,8 +2990,10 @@ static TypeInfo cirrus_vga_info = {
.class_init = cirrus_vga_class_init,
};
-static void cirrus_vga_register(void)
+static void cirrus_vga_register_types(void)
{
+ type_register_static(&isa_cirrus_vga_info);
type_register_static(&cirrus_vga_info);
}
-device_init(cirrus_vga_register);
+
+type_init(cirrus_vga_register_types)
diff --git a/hw/cs4231.c b/hw/cs4231.c
index c0badbff5c..cfec1d9cd1 100644
--- a/hw/cs4231.c
+++ b/hw/cs4231.c
@@ -173,9 +173,9 @@ static TypeInfo cs4231_info = {
.class_init = cs4231_class_init,
};
-static void cs4231_register_devices(void)
+static void cs4231_register_types(void)
{
type_register_static(&cs4231_info);
}
-device_init(cs4231_register_devices)
+type_init(cs4231_register_types)
diff --git a/hw/cs4231a.c b/hw/cs4231a.c
index ad04ad667c..e07b9d6237 100644
--- a/hw/cs4231a.c
+++ b/hw/cs4231a.c
@@ -689,8 +689,9 @@ static TypeInfo cs4231a_info = {
.class_init = cs4231a_class_initfn,
};
-static void cs4231a_register (void)
+static void cs4231a_register_types (void)
{
type_register_static (&cs4231a_info);
}
-device_init (cs4231a_register)
+
+type_init (cs4231a_register_types)
diff --git a/hw/debugcon.c b/hw/debugcon.c
index 3903b2605d..14ab326be3 100644
--- a/hw/debugcon.c
+++ b/hw/debugcon.c
@@ -109,9 +109,9 @@ static TypeInfo debugcon_isa_info = {
.class_init = debugcon_isa_class_initfn,
};
-static void debugcon_register_devices(void)
+static void debugcon_register_types(void)
{
type_register_static(&debugcon_isa_info);
}
-device_init(debugcon_register_devices)
+type_init(debugcon_register_types)
diff --git a/hw/dec_pci.c b/hw/dec_pci.c
index a40fbcf3e5..37337bf4b6 100644
--- a/hw/dec_pci.c
+++ b/hw/dec_pci.c
@@ -140,11 +140,11 @@ static TypeInfo pci_dec_21154_device_info = {
.class_init = pci_dec_21154_device_class_init,
};
-static void dec_register_devices(void)
+static void dec_register_types(void)
{
type_register_static(&pci_dec_21154_device_info);
type_register_static(&dec_21154_pci_host_info);
type_register_static(&dec_21154_pci_bridge_info);
}
-device_init(dec_register_devices)
+type_init(dec_register_types)
diff --git a/hw/ds1225y.c b/hw/ds1225y.c
index 539bcebae0..2cd355bd0a 100644
--- a/hw/ds1225y.c
+++ b/hw/ds1225y.c
@@ -157,9 +157,9 @@ static TypeInfo nvram_sysbus_info = {
.class_init = nvram_sysbus_class_init,
};
-static void nvram_register(void)
+static void nvram_register_types(void)
{
type_register_static(&nvram_sysbus_info);
}
-device_init(nvram_register)
+type_init(nvram_register_types)
diff --git a/hw/ds1338.c b/hw/ds1338.c
index b137e13379..6397f0aa6f 100644
--- a/hw/ds1338.c
+++ b/hw/ds1338.c
@@ -135,9 +135,9 @@ static TypeInfo ds1338_info = {
.class_init = ds1338_class_init,
};
-static void ds1338_register_devices(void)
+static void ds1338_register_types(void)
{
type_register_static(&ds1338_info);
}
-device_init(ds1338_register_devices)
+type_init(ds1338_register_types)
diff --git a/hw/e1000.c b/hw/e1000.c
index 751f79d5ff..7babc0b06e 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -1227,9 +1227,9 @@ static TypeInfo e1000_info = {
.class_init = e1000_class_init,
};
-static void e1000_register_devices(void)
+static void e1000_register_types(void)
{
type_register_static(&e1000_info);
}
-device_init(e1000_register_devices)
+type_init(e1000_register_types)
diff --git a/hw/eccmemctl.c b/hw/eccmemctl.c
index 1cf2090c1f..fe1cd90007 100644
--- a/hw/eccmemctl.c
+++ b/hw/eccmemctl.c
@@ -332,9 +332,9 @@ static TypeInfo ecc_info = {
};
-static void ecc_register_devices(void)
+static void ecc_register_types(void)
{
type_register_static(&ecc_info);
}
-device_init(ecc_register_devices)
+type_init(ecc_register_types)
diff --git a/hw/eepro100.c b/hw/eepro100.c
index 843610c933..e3ba71974e 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -2089,7 +2089,7 @@ static void eepro100_class_init(ObjectClass *klass, void *data)
k->subsystem_id = info->subsystem_id;
}
-static void eepro100_register_devices(void)
+static void eepro100_register_types(void)
{
size_t i;
for (i = 0; i < ARRAY_SIZE(e100_devices); i++) {
@@ -2105,4 +2105,4 @@ static void eepro100_register_devices(void)
}
}
-device_init(eepro100_register_devices)
+type_init(eepro100_register_types)
diff --git a/hw/empty_slot.c b/hw/empty_slot.c
index 1bc181555f..099c85e583 100644
--- a/hw/empty_slot.c
+++ b/hw/empty_slot.c
@@ -90,9 +90,9 @@ static TypeInfo empty_slot_info = {
.class_init = empty_slot_class_init,
};
-static void empty_slot_register_devices(void)
+static void empty_slot_register_types(void)
{
type_register_static(&empty_slot_info);
}
-device_init(empty_slot_register_devices);
+type_init(empty_slot_register_types)
diff --git a/hw/es1370.c b/hw/es1370.c
index e377c48e49..f19cef31a6 100644
--- a/hw/es1370.c
+++ b/hw/es1370.c
@@ -1054,9 +1054,10 @@ static TypeInfo es1370_info = {
.class_init = es1370_class_init,
};
-static void es1370_register (void)
+static void es1370_register_types (void)
{
type_register_static (&es1370_info);
}
-device_init (es1370_register);
+
+type_init (es1370_register_types)
diff --git a/hw/escc.c b/hw/escc.c
index 9fe282f7b8..4d8a8e8886 100644
--- a/hw/escc.c
+++ b/hw/escc.c
@@ -931,9 +931,9 @@ static TypeInfo escc_info = {
.class_init = escc_class_init,
};
-static void escc_register_devices(void)
+static void escc_register_types(void)
{
type_register_static(&escc_info);
}
-device_init(escc_register_devices)
+type_init(escc_register_types)
diff --git a/hw/esp.c b/hw/esp.c
index 2f44386233..2dda8e358e 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -775,9 +775,9 @@ static TypeInfo esp_info = {
.class_init = esp_class_init,
};
-static void esp_register_devices(void)
+static void esp_register_types(void)
{
type_register_static(&esp_info);
}
-device_init(esp_register_devices)
+type_init(esp_register_types)
diff --git a/hw/etraxfs_eth.c b/hw/etraxfs_eth.c
index aefd5778ab..16a0637a4a 100644
--- a/hw/etraxfs_eth.c
+++ b/hw/etraxfs_eth.c
@@ -637,9 +637,9 @@ static TypeInfo etraxfs_eth_info = {
.class_init = etraxfs_eth_class_init,
};
-static void etraxfs_eth_register(void)
+static void etraxfs_eth_register_types(void)
{
type_register_static(&etraxfs_eth_info);
}
-device_init(etraxfs_eth_register)
+type_init(etraxfs_eth_register_types)
diff --git a/hw/etraxfs_pic.c b/hw/etraxfs_pic.c
index 33541fcc61..dc27f88ac9 100644
--- a/hw/etraxfs_pic.c
+++ b/hw/etraxfs_pic.c
@@ -172,9 +172,9 @@ static TypeInfo etraxfs_pic_info = {
.class_init = etraxfs_pic_class_init,
};
-static void etraxfs_pic_register(void)
+static void etraxfs_pic_register_types(void)
{
type_register_static(&etraxfs_pic_info);
}
-device_init(etraxfs_pic_register)
+type_init(etraxfs_pic_register_types)
diff --git a/hw/etraxfs_ser.c b/hw/etraxfs_ser.c
index 567cb8cc2d..cecd819584 100644
--- a/hw/etraxfs_ser.c
+++ b/hw/etraxfs_ser.c
@@ -240,9 +240,9 @@ static TypeInfo etraxfs_ser_info = {
.class_init = etraxfs_ser_class_init,
};
-static void etraxfs_serial_register(void)
+static void etraxfs_serial_register_types(void)
{
type_register_static(&etraxfs_ser_info);
}
-device_init(etraxfs_serial_register)
+type_init(etraxfs_serial_register_types)
diff --git a/hw/etraxfs_timer.c b/hw/etraxfs_timer.c
index b71c5ee9d5..9076a49884 100644
--- a/hw/etraxfs_timer.c
+++ b/hw/etraxfs_timer.c
@@ -343,9 +343,9 @@ static TypeInfo etraxfs_timer_info = {
.class_init = etraxfs_timer_class_init,
};
-static void etraxfs_timer_register(void)
+static void etraxfs_timer_register_types(void)
{
type_register_static(&etraxfs_timer_info);
}
-device_init(etraxfs_timer_register)
+type_init(etraxfs_timer_register_types)
diff --git a/hw/fdc.c b/hw/fdc.c
index f575a2c9f5..38fad587cb 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -2043,11 +2043,11 @@ static TypeInfo sun4m_fdc_info = {
.class_init = sun4m_fdc_class_init,
};
-static void fdc_register_devices(void)
+static void fdc_register_types(void)
{
type_register_static(&isa_fdc_info);
type_register_static(&sysbus_fdc_info);
type_register_static(&sun4m_fdc_info);
}
-device_init(fdc_register_devices)
+type_init(fdc_register_types)
diff --git a/hw/framebuffer.c b/hw/framebuffer.c
index ea122fb266..f4747cd646 100644
--- a/hw/framebuffer.c
+++ b/hw/framebuffer.c
@@ -87,7 +87,7 @@ void framebuffer_update_display(
dest += i * dest_row_pitch;
for (; i < rows; i++) {
- dirty = memory_region_get_dirty(mem, addr, addr + src_width,
+ dirty = memory_region_get_dirty(mem, addr, src_width,
DIRTY_MEMORY_VGA);
if (dirty || invalidate) {
fn(opaque, dest, src, cols, dest_col_pitch);
diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
index 6b2f7d1986..7b3b5769a2 100644
--- a/hw/fw_cfg.c
+++ b/hw/fw_cfg.c
@@ -556,9 +556,9 @@ static TypeInfo fw_cfg_info = {
.class_init = fw_cfg_class_init,
};
-static void fw_cfg_register_devices(void)
+static void fw_cfg_register_types(void)
{
type_register_static(&fw_cfg_info);
}
-device_init(fw_cfg_register_devices)
+type_init(fw_cfg_register_types)
diff --git a/hw/g364fb.c b/hw/g364fb.c
index 66d0044c06..9c63bddc59 100644
--- a/hw/g364fb.c
+++ b/hw/g364fb.c
@@ -574,9 +574,9 @@ static TypeInfo g364fb_sysbus_info = {
.class_init = g364fb_sysbus_class_init,
};
-static void g364fb_register(void)
+static void g364fb_register_types(void)
{
type_register_static(&g364fb_sysbus_info);
}
-device_init(g364fb_register);
+type_init(g364fb_register_types)
diff --git a/hw/grackle_pci.c b/hw/grackle_pci.c
index 8122baf482..81ff3a339a 100644
--- a/hw/grackle_pci.c
+++ b/hw/grackle_pci.c
@@ -157,10 +157,10 @@ static TypeInfo grackle_pci_host_info = {
.class_init = pci_grackle_class_init,
};
-static void grackle_register_devices(void)
+static void grackle_register_types(void)
{
type_register_static(&grackle_pci_info);
type_register_static(&grackle_pci_host_info);
}
-device_init(grackle_register_devices)
+type_init(grackle_register_types)
diff --git a/hw/grlib_apbuart.c b/hw/grlib_apbuart.c
index 89de2d85ae..73fc9894db 100644
--- a/hw/grlib_apbuart.c
+++ b/hw/grlib_apbuart.c
@@ -263,9 +263,9 @@ static TypeInfo grlib_gptimer_info = {
.class_init = grlib_gptimer_class_init,
};
-static void grlib_gptimer_register(void)
+static void grlib_gptimer_register_types(void)
{
type_register_static(&grlib_gptimer_info);
}
-device_init(grlib_gptimer_register)
+type_init(grlib_gptimer_register_types)
diff --git a/hw/grlib_gptimer.c b/hw/grlib_gptimer.c
index fb0b236746..41770a9e6c 100644
--- a/hw/grlib_gptimer.c
+++ b/hw/grlib_gptimer.c
@@ -396,9 +396,9 @@ static TypeInfo grlib_gptimer_info = {
.class_init = grlib_gptimer_class_init,
};
-static void grlib_gptimer_register(void)
+static void grlib_gptimer_register_types(void)
{
type_register_static(&grlib_gptimer_info);
}
-device_init(grlib_gptimer_register)
+type_init(grlib_gptimer_register_types)
diff --git a/hw/grlib_irqmp.c b/hw/grlib_irqmp.c
index 1e5ad826f5..0f6e65cf20 100644
--- a/hw/grlib_irqmp.c
+++ b/hw/grlib_irqmp.c
@@ -377,9 +377,9 @@ static TypeInfo grlib_irqmp_info = {
.class_init = grlib_irqmp_class_init,
};
-static void grlib_irqmp_register(void)
+static void grlib_irqmp_register_types(void)
{
type_register_static(&grlib_irqmp_info);
}
-device_init(grlib_irqmp_register)
+type_init(grlib_irqmp_register_types)
diff --git a/hw/gt64xxx.c b/hw/gt64xxx.c
index e8cd59c3a4..a2d0e5a2c3 100644
--- a/hw/gt64xxx.c
+++ b/hw/gt64xxx.c
@@ -1168,10 +1168,10 @@ static TypeInfo gt64120_info = {
.class_init = gt64120_class_init,
};
-static void gt64120_pci_register_devices(void)
+static void gt64120_pci_register_types(void)
{
type_register_static(&gt64120_info);
type_register_static(&gt64120_pci_info);
}
-device_init(gt64120_pci_register_devices)
+type_init(gt64120_pci_register_types)
diff --git a/hw/gus.c b/hw/gus.c
index 20547075ec..840d098d6a 100644
--- a/hw/gus.c
+++ b/hw/gus.c
@@ -324,8 +324,9 @@ static TypeInfo gus_info = {
.class_init = gus_class_initfn,
};
-static void gus_register (void)
+static void gus_register_types (void)
{
type_register_static (&gus_info);
}
-device_init (gus_register)
+
+type_init (gus_register_types)
diff --git a/hw/hda-audio.c b/hw/hda-audio.c
index 152f8e6f13..8995519573 100644
--- a/hw/hda-audio.c
+++ b/hw/hda-audio.c
@@ -948,9 +948,10 @@ static TypeInfo hda_audio_duplex_info = {
.class_init = hda_audio_duplex_class_init,
};
-static void hda_audio_register(void)
+static void hda_audio_register_types(void)
{
type_register_static(&hda_audio_output_info);
type_register_static(&hda_audio_duplex_info);
}
-device_init(hda_audio_register);
+
+type_init(hda_audio_register_types)
diff --git a/hw/highbank.c b/hw/highbank.c
index 684178ee3e..b28b4640aa 100644
--- a/hw/highbank.c
+++ b/hw/highbank.c
@@ -177,12 +177,12 @@ static TypeInfo highbank_regs_info = {
.class_init = highbank_regs_class_init,
};
-static void highbank_regs_register_device(void)
+static void highbank_regs_register_types(void)
{
type_register_static(&highbank_regs_info);
}
-device_init(highbank_regs_register_device)
+type_init(highbank_regs_register_types)
static struct arm_boot_info highbank_binfo;
diff --git a/hw/hpet.c b/hw/hpet.c
index b6ace4e696..ba36e103d0 100644
--- a/hw/hpet.c
+++ b/hw/hpet.c
@@ -720,9 +720,9 @@ static TypeInfo hpet_device_info = {
.class_init = hpet_device_class_init,
};
-static void hpet_register_device(void)
+static void hpet_register_types(void)
{
type_register_static(&hpet_device_info);
}
-device_init(hpet_register_device)
+type_init(hpet_register_types)
diff --git a/hw/i2c.c b/hw/i2c.c
index 8ae4aaae1d..23dfccba14 100644
--- a/hw/i2c.c
+++ b/hw/i2c.c
@@ -230,9 +230,9 @@ static TypeInfo i2c_slave_type_info = {
.class_init = i2c_slave_class_init,
};
-static void i2c_slave_register_devices(void)
+static void i2c_slave_register_types(void)
{
type_register_static(&i2c_slave_type_info);
}
-device_init(i2c_slave_register_devices);
+type_init(i2c_slave_register_types)
diff --git a/hw/i82374.c b/hw/i82374.c
index 220e8cccb6..67298a39f5 100644
--- a/hw/i82374.c
+++ b/hw/i82374.c
@@ -157,9 +157,9 @@ static TypeInfo i82374_isa_info = {
.class_init = i82374_class_init,
};
-static void i82374_register_devices(void)
+static void i82374_register_types(void)
{
type_register_static(&i82374_isa_info);
}
-device_init(i82374_register_devices)
+type_init(i82374_register_types)
diff --git a/hw/i82378.c b/hw/i82378.c
index 9c3efe8b95..3929c041b7 100644
--- a/hw/i82378.c
+++ b/hw/i82378.c
@@ -267,9 +267,9 @@ static TypeInfo pci_i82378_info = {
.class_init = pci_i82378_class_init,
};
-static void i82378_register_devices(void)
+static void i82378_register_types(void)
{
type_register_static(&pci_i82378_info);
}
-device_init(i82378_register_devices)
+type_init(i82378_register_types)
diff --git a/hw/i8254.c b/hw/i8254.c
index 522fed8809..481fc7b252 100644
--- a/hw/i8254.c
+++ b/hw/i8254.c
@@ -559,8 +559,9 @@ static TypeInfo pit_info = {
.class_init = pit_class_initfn,
};
-static void pit_register(void)
+static void pit_register_types(void)
{
type_register_static(&pit_info);
}
-device_init(pit_register)
+
+type_init(pit_register_types)
diff --git a/hw/i8259.c b/hw/i8259.c
index 7ae53805d7..1a4b1ab0dd 100644
--- a/hw/i8259.c
+++ b/hw/i8259.c
@@ -488,9 +488,9 @@ static TypeInfo i8259_info = {
.class_init = i8259_class_init,
};
-static void pic_register(void)
+static void pic_register_types(void)
{
type_register_static(&i8259_info);
}
-device_init(pic_register)
+type_init(pic_register_types)
diff --git a/hw/i8259_common.c b/hw/i8259_common.c
index 9f150bc6d0..775fda453c 100644
--- a/hw/i8259_common.c
+++ b/hw/i8259_common.c
@@ -153,9 +153,9 @@ static TypeInfo pic_common_type = {
.abstract = true,
};
-static void register_devices(void)
+static void register_types(void)
{
type_register_static(&pic_common_type);
}
-device_init(register_devices);
+type_init(register_types);
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index c87a6ca515..b515f417b1 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -146,6 +146,7 @@ static void ahci_check_irq(AHCIState *s)
DPRINTF(-1, "check irq %#x\n", s->control_regs.irqstatus);
+ s->control_regs.irqstatus = 0;
for (i = 0; i < s->ports; i++) {
AHCIPortRegs *pr = &s->dev[i].port_regs;
if (pr->irq_stat & pr->irq_mask) {
@@ -216,6 +217,7 @@ static void ahci_port_write(AHCIState *s, int port, int offset, uint32_t val)
break;
case PORT_IRQ_STAT:
pr->irq_stat &= ~val;
+ ahci_check_irq(s);
break;
case PORT_IRQ_MASK:
pr->irq_mask = val & 0xfdc000ff;
@@ -560,6 +562,11 @@ static void ahci_reset_port(AHCIState *s, int port)
ncq_tfs->aiocb = NULL;
}
+ /* Maybe we just finished the request thanks to bdrv_aio_cancel() */
+ if (!ncq_tfs->used) {
+ continue;
+ }
+
qemu_sglist_destroy(&ncq_tfs->sglist);
ncq_tfs->used = 0;
}
@@ -1261,9 +1268,9 @@ static TypeInfo sysbus_ahci_info = {
.class_init = sysbus_ahci_class_init,
};
-static void sysbus_ahci_register(void)
+static void sysbus_ahci_register_types(void)
{
type_register_static(&sysbus_ahci_info);
}
-device_init(sysbus_ahci_register);
+type_init(sysbus_ahci_register_types)
diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c
index a119500f40..743ec02406 100644
--- a/hw/ide/cmd646.c
+++ b/hw/ide/cmd646.c
@@ -351,8 +351,9 @@ static TypeInfo cmd646_ide_info = {
.class_init = cmd646_ide_class_init,
};
-static void cmd646_ide_register(void)
+static void cmd646_ide_register_types(void)
{
type_register_static(&cmd646_ide_info);
}
-device_init(cmd646_ide_register);
+
+type_init(cmd646_ide_register_types)
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index 5cdaa990ea..560ae37618 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -168,8 +168,9 @@ static TypeInfo ich_ahci_info = {
.class_init = ich_ahci_class_init,
};
-static void ich_ahci_register(void)
+static void ich_ahci_register_types(void)
{
type_register_static(&ich_ahci_info);
}
-device_init(ich_ahci_register);
+
+type_init(ich_ahci_register_types)
diff --git a/hw/ide/isa.c b/hw/ide/isa.c
index a0bcb43eba..8ab2718eea 100644
--- a/hw/ide/isa.c
+++ b/hw/ide/isa.c
@@ -118,9 +118,9 @@ static TypeInfo isa_ide_info = {
.class_init = isa_ide_class_initfn,
};
-static void isa_ide_register_devices(void)
+static void isa_ide_register_types(void)
{
type_register_static(&isa_ide_info);
}
-device_init(isa_ide_register_devices)
+type_init(isa_ide_register_types)
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index bf4465bb49..aee60aa390 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -299,10 +299,11 @@ static TypeInfo piix4_ide_info = {
.class_init = piix4_ide_class_init,
};
-static void piix_ide_register(void)
+static void piix_ide_register_types(void)
{
type_register_static(&piix3_ide_info);
type_register_static(&piix3_ide_xen_info);
type_register_static(&piix4_ide_info);
}
-device_init(piix_ide_register);
+
+type_init(piix_ide_register_types)
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 1640616906..f6a48961c5 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -257,11 +257,12 @@ static TypeInfo ide_device_type_info = {
.class_init = ide_device_class_init,
};
-static void ide_dev_register(void)
+static void ide_register_types(void)
{
type_register_static(&ide_hd_info);
type_register_static(&ide_cd_info);
type_register_static(&ide_drive_info);
type_register_static(&ide_device_type_info);
}
-device_init(ide_dev_register);
+
+type_init(ide_register_types)
diff --git a/hw/ide/via.c b/hw/ide/via.c
index b4ca6f27b3..2886bc6dfb 100644
--- a/hw/ide/via.c
+++ b/hw/ide/via.c
@@ -234,8 +234,9 @@ static TypeInfo via_ide_info = {
.class_init = via_ide_class_init,
};
-static void via_ide_register(void)
+static void via_ide_register_types(void)
{
type_register_static(&via_ide_info);
}
-device_init(via_ide_register);
+
+type_init(via_ide_register_types)
diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index 6dbd649908..294d7da7fc 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -553,10 +553,10 @@ static TypeInfo icp_pic_info = {
.class_init = icp_pic_class_init,
};
-static void integratorcp_register_devices(void)
+static void integratorcp_register_types(void)
{
type_register_static(&icp_pic_info);
type_register_static(&core_info);
}
-device_init(integratorcp_register_devices)
+type_init(integratorcp_register_types)
diff --git a/hw/intel-hda.c b/hw/intel-hda.c
index 83c42d58b6..bb11af286a 100644
--- a/hw/intel-hda.c
+++ b/hw/intel-hda.c
@@ -1287,12 +1287,13 @@ static TypeInfo hda_codec_device_type_info = {
.class_init = hda_codec_device_class_init,
};
-static void intel_hda_register(void)
+static void intel_hda_register_types(void)
{
type_register_static(&intel_hda_info);
type_register_static(&hda_codec_device_type_info);
}
-device_init(intel_hda_register);
+
+type_init(intel_hda_register_types)
/*
* create intel hda controller with codec attached to it,
diff --git a/hw/ioapic.c b/hw/ioapic.c
index 79549f8ed1..3fee0114d9 100644
--- a/hw/ioapic.c
+++ b/hw/ioapic.c
@@ -251,9 +251,9 @@ static TypeInfo ioapic_info = {
.class_init = ioapic_class_init,
};
-static void ioapic_register_devices(void)
+static void ioapic_register_types(void)
{
type_register_static(&ioapic_info);
}
-device_init(ioapic_register_devices)
+type_init(ioapic_register_types)
diff --git a/hw/ioapic_common.c b/hw/ioapic_common.c
index f932700d12..653eef2ce1 100644
--- a/hw/ioapic_common.c
+++ b/hw/ioapic_common.c
@@ -112,10 +112,9 @@ static TypeInfo ioapic_common_type = {
.abstract = true,
};
-static void register_devices(void)
+static void register_types(void)
{
type_register_static(&ioapic_common_type);
}
-device_init(register_devices);
-
+type_init(register_types)
diff --git a/hw/ioh3420.c b/hw/ioh3420.c
index 1c60123d43..1632d31c19 100644
--- a/hw/ioh3420.c
+++ b/hw/ioh3420.c
@@ -237,12 +237,12 @@ static TypeInfo ioh3420_info = {
.class_init = ioh3420_class_init,
};
-static void ioh3420_register(void)
+static void ioh3420_register_types(void)
{
type_register_static(&ioh3420_info);
}
-device_init(ioh3420_register);
+type_init(ioh3420_register_types)
/*
* Local variables:
diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index d03f82824c..5a43f03a7c 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -210,7 +210,7 @@ static TypeInfo isa_device_type_info = {
.class_init = isa_device_class_init,
};
-static void isabus_register_devices(void)
+static void isabus_register_types(void)
{
type_register_static(&isabus_bridge_info);
type_register_static(&isa_device_type_info);
@@ -235,4 +235,4 @@ MemoryRegion *isa_address_space(ISADevice *dev)
return get_system_memory();
}
-device_init(isabus_register_devices)
+type_init(isabus_register_types)
diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index 6f017d474c..64e1cd968e 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -798,9 +798,9 @@ static TypeInfo ivshmem_info = {
.class_init = ivshmem_class_init,
};
-static void ivshmem_register_devices(void)
+static void ivshmem_register_types(void)
{
type_register_static(&ivshmem_info);
}
-device_init(ivshmem_register_devices)
+type_init(ivshmem_register_types)
diff --git a/hw/kvm/apic.c b/hw/kvm/apic.c
index dfc2ab3b03..5bb0a4b9fd 100644
--- a/hw/kvm/apic.c
+++ b/hw/kvm/apic.c
@@ -139,9 +139,9 @@ static TypeInfo kvm_apic_info = {
.class_init = kvm_apic_class_init,
};
-static void kvm_apic_register_device(void)
+static void kvm_apic_register_types(void)
{
type_register_static(&kvm_apic_info);
}
-device_init(kvm_apic_register_device)
+type_init(kvm_apic_register_types)
diff --git a/hw/kvm/clock.c b/hw/kvm/clock.c
index d5a53869b3..2157340326 100644
--- a/hw/kvm/clock.c
+++ b/hw/kvm/clock.c
@@ -119,11 +119,11 @@ void kvmclock_create(void)
}
}
-static void kvmclock_register_device(void)
+static void kvmclock_register_types(void)
{
if (kvm_enabled()) {
type_register_static(&kvmclock_info);
}
}
-device_init(kvmclock_register_device);
+type_init(kvmclock_register_types)
diff --git a/hw/kvm/i8259.c b/hw/kvm/i8259.c
index 14bd427518..eb98889329 100644
--- a/hw/kvm/i8259.c
+++ b/hw/kvm/i8259.c
@@ -130,9 +130,9 @@ static TypeInfo kvm_i8259_info = {
.class_init = kvm_i8259_class_init,
};
-static void kvm_pic_register(void)
+static void kvm_pic_register_types(void)
{
type_register_static(&kvm_i8259_info);
}
-device_init(kvm_pic_register)
+type_init(kvm_pic_register_types)
diff --git a/hw/kvm/ioapic.c b/hw/kvm/ioapic.c
index b316933a96..3ae3175403 100644
--- a/hw/kvm/ioapic.c
+++ b/hw/kvm/ioapic.c
@@ -117,9 +117,9 @@ static TypeInfo kvm_ioapic_info = {
.class_init = kvm_ioapic_class_init,
};
-static void kvm_ioapic_register_device(void)
+static void kvm_ioapic_register_types(void)
{
type_register_static(&kvm_ioapic_info);
}
-device_init(kvm_ioapic_register_device)
+type_init(kvm_ioapic_register_types)
diff --git a/hw/lan9118.c b/hw/lan9118.c
index 78777c7336..aeb0c39529 100644
--- a/hw/lan9118.c
+++ b/hw/lan9118.c
@@ -1261,7 +1261,7 @@ static TypeInfo lan9118_info = {
.class_init = lan9118_class_init,
};
-static void lan9118_register_devices(void)
+static void lan9118_register_types(void)
{
type_register_static(&lan9118_info);
}
@@ -1282,4 +1282,4 @@ void lan9118_init(NICInfo *nd, uint32_t base, qemu_irq irq)
sysbus_connect_irq(s, 0, irq);
}
-device_init(lan9118_register_devices)
+type_init(lan9118_register_types)
diff --git a/hw/lance.c b/hw/lance.c
index 519720bd9c..ce3d46c17b 100644
--- a/hw/lance.c
+++ b/hw/lance.c
@@ -162,8 +162,9 @@ static TypeInfo lance_info = {
.class_init = lance_class_init,
};
-static void lance_register_devices(void)
+static void lance_register_types(void)
{
type_register_static(&lance_info);
}
-device_init(lance_register_devices)
+
+type_init(lance_register_types)
diff --git a/hw/lm32_juart.c b/hw/lm32_juart.c
index 38dd28230d..f07ed3977f 100644
--- a/hw/lm32_juart.c
+++ b/hw/lm32_juart.c
@@ -151,9 +151,9 @@ static TypeInfo lm32_juart_info = {
.class_init = lm32_juart_class_init,
};
-static void lm32_juart_register(void)
+static void lm32_juart_register_types(void)
{
type_register_static(&lm32_juart_info);
}
-device_init(lm32_juart_register)
+type_init(lm32_juart_register_types)
diff --git a/hw/lm32_pic.c b/hw/lm32_pic.c
index 7be6d0d68e..32f65db7f1 100644
--- a/hw/lm32_pic.c
+++ b/hw/lm32_pic.c
@@ -191,9 +191,9 @@ static TypeInfo lm32_pic_info = {
.class_init = lm32_pic_class_init,
};
-static void lm32_pic_register(void)
+static void lm32_pic_register_types(void)
{
type_register_static(&lm32_pic_info);
}
-device_init(lm32_pic_register)
+type_init(lm32_pic_register_types)
diff --git a/hw/lm32_sys.c b/hw/lm32_sys.c
index ba6f4acbaa..bbe03c41d5 100644
--- a/hw/lm32_sys.c
+++ b/hw/lm32_sys.c
@@ -164,9 +164,9 @@ static TypeInfo lm32_sys_info = {
.class_init = lm32_sys_class_init,
};
-static void lm32_sys_register(void)
+static void lm32_sys_register_types(void)
{
type_register_static(&lm32_sys_info);
}
-device_init(lm32_sys_register)
+type_init(lm32_sys_register_types)
diff --git a/hw/lm32_timer.c b/hw/lm32_timer.c
index 3cb4e0a4f3..e9450a0ce1 100644
--- a/hw/lm32_timer.c
+++ b/hw/lm32_timer.c
@@ -222,9 +222,9 @@ static TypeInfo lm32_timer_info = {
.class_init = lm32_timer_class_init,
};
-static void lm32_timer_register(void)
+static void lm32_timer_register_types(void)
{
type_register_static(&lm32_timer_info);
}
-device_init(lm32_timer_register)
+type_init(lm32_timer_register_types)
diff --git a/hw/lm32_uart.c b/hw/lm32_uart.c
index 630ccb7131..57066e28c6 100644
--- a/hw/lm32_uart.c
+++ b/hw/lm32_uart.c
@@ -288,9 +288,9 @@ static TypeInfo lm32_uart_info = {
.class_init = lm32_uart_class_init,
};
-static void lm32_uart_register(void)
+static void lm32_uart_register_types(void)
{
type_register_static(&lm32_uart_info);
}
-device_init(lm32_uart_register)
+type_init(lm32_uart_register_types)
diff --git a/hw/lm832x.c b/hw/lm832x.c
index 895d306635..8e09f9bcc9 100644
--- a/hw/lm832x.c
+++ b/hw/lm832x.c
@@ -513,9 +513,9 @@ static TypeInfo lm8323_info = {
.class_init = lm8323_class_init,
};
-static void lm832x_register_devices(void)
+static void lm832x_register_types(void)
{
type_register_static(&lm8323_info);
}
-device_init(lm832x_register_devices)
+type_init(lm832x_register_types)
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 9a7ffe3f42..0acd1d06df 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -2142,9 +2142,9 @@ static TypeInfo lsi_info = {
.class_init = lsi_class_init,
};
-static void lsi53c895a_register_devices(void)
+static void lsi53c895a_register_types(void)
{
type_register_static(&lsi_info);
}
-device_init(lsi53c895a_register_devices);
+type_init(lsi53c895a_register_types)
diff --git a/hw/m48t59.c b/hw/m48t59.c
index c35867d0a1..60bbb00946 100644
--- a/hw/m48t59.c
+++ b/hw/m48t59.c
@@ -768,10 +768,10 @@ static TypeInfo m48t59_info = {
.class_init = m48t59_class_init,
};
-static void m48t59_register_devices(void)
+static void m48t59_register_types(void)
{
type_register_static(&m48t59_info);
type_register_static(&m48t59_isa_info);
}
-device_init(m48t59_register_devices)
+type_init(m48t59_register_types)
diff --git a/hw/macio.c b/hw/macio.c
index 3d648e934b..eb15b890b1 100644
--- a/hw/macio.c
+++ b/hw/macio.c
@@ -97,12 +97,12 @@ static TypeInfo macio_info = {
.class_init = macio_class_init,
};
-static void macio_register(void)
+static void macio_register_types(void)
{
type_register_static(&macio_info);
}
-device_init(macio_register);
+type_init(macio_register_types)
void macio_init (PCIBus *bus, int device_id, int is_oldworld,
MemoryRegion *pic_mem, MemoryRegion *dbdma_mem,
diff --git a/hw/marvell_88w8618_audio.c b/hw/marvell_88w8618_audio.c
index b628f1718d..f6f1937442 100644
--- a/hw/marvell_88w8618_audio.c
+++ b/hw/marvell_88w8618_audio.c
@@ -295,9 +295,9 @@ static TypeInfo mv88w8618_audio_info = {
.class_init = mv88w8618_audio_class_init,
};
-static void mv88w8618_register_devices(void)
+static void mv88w8618_register_types(void)
{
type_register_static(&mv88w8618_audio_info);
}
-device_init(mv88w8618_register_devices)
+type_init(mv88w8618_register_types)
diff --git a/hw/max111x.c b/hw/max111x.c
index 9d61aa98db..706d89f4fd 100644
--- a/hw/max111x.c
+++ b/hw/max111x.c
@@ -183,10 +183,10 @@ static TypeInfo max1111_info = {
.class_init = max1111_class_init,
};
-static void max111x_register_devices(void)
+static void max111x_register_types(void)
{
type_register_static(&max1110_info);
type_register_static(&max1111_info);
}
-device_init(max111x_register_devices)
+type_init(max111x_register_types)
diff --git a/hw/max7310.c b/hw/max7310.c
index 3a6bb961ef..1ed18ba876 100644
--- a/hw/max7310.c
+++ b/hw/max7310.c
@@ -205,9 +205,9 @@ static TypeInfo max7310_info = {
.class_init = max7310_class_init,
};
-static void max7310_register_devices(void)
+static void max7310_register_types(void)
{
type_register_static(&max7310_info);
}
-device_init(max7310_register_devices)
+type_init(max7310_register_types)
diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 4a43225707..6c1ad38f72 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -733,8 +733,9 @@ static TypeInfo mc146818rtc_info = {
.class_init = rtc_class_initfn,
};
-static void mc146818rtc_register(void)
+static void mc146818rtc_register_types(void)
{
type_register_static(&mc146818rtc_info);
}
-device_init(mc146818rtc_register)
+
+type_init(mc146818rtc_register_types)
diff --git a/hw/milkymist-ac97.c b/hw/milkymist-ac97.c
index 0881643a4c..4414f39734 100644
--- a/hw/milkymist-ac97.c
+++ b/hw/milkymist-ac97.c
@@ -336,9 +336,9 @@ static TypeInfo milkymist_ac97_info = {
.class_init = milkymist_ac97_class_init,
};
-static void milkymist_ac97_register(void)
+static void milkymist_ac97_register_types(void)
{
type_register_static(&milkymist_ac97_info);
}
-device_init(milkymist_ac97_register)
+type_init(milkymist_ac97_register_types)
diff --git a/hw/milkymist-hpdmc.c b/hw/milkymist-hpdmc.c
index b5122afd57..2da0293683 100644
--- a/hw/milkymist-hpdmc.c
+++ b/hw/milkymist-hpdmc.c
@@ -162,9 +162,9 @@ static TypeInfo milkymist_hpdmc_info = {
.class_init = milkymist_hpdmc_class_init,
};
-static void milkymist_hpdmc_register(void)
+static void milkymist_hpdmc_register_types(void)
{
type_register_static(&milkymist_hpdmc_info);
}
-device_init(milkymist_hpdmc_register)
+type_init(milkymist_hpdmc_register_types)
diff --git a/hw/milkymist-memcard.c b/hw/milkymist-memcard.c
index 3c1c68a2e7..3515c3cd9a 100644
--- a/hw/milkymist-memcard.c
+++ b/hw/milkymist-memcard.c
@@ -295,9 +295,9 @@ static TypeInfo milkymist_memcard_info = {
.class_init = milkymist_memcard_class_init,
};
-static void milkymist_memcard_register(void)
+static void milkymist_memcard_register_types(void)
{
type_register_static(&milkymist_memcard_info);
}
-device_init(milkymist_memcard_register)
+type_init(milkymist_memcard_register_types)
diff --git a/hw/milkymist-minimac2.c b/hw/milkymist-minimac2.c
index b9b553fc95..70bf336add 100644
--- a/hw/milkymist-minimac2.c
+++ b/hw/milkymist-minimac2.c
@@ -542,9 +542,9 @@ static TypeInfo milkymist_minimac2_info = {
.class_init = milkymist_minimac2_class_init,
};
-static void milkymist_minimac2_register(void)
+static void milkymist_minimac2_register_types(void)
{
type_register_static(&milkymist_minimac2_info);
}
-device_init(milkymist_minimac2_register)
+type_init(milkymist_minimac2_register_types)
diff --git a/hw/milkymist-pfpu.c b/hw/milkymist-pfpu.c
index 1b73a4686b..0f9ff4a13d 100644
--- a/hw/milkymist-pfpu.c
+++ b/hw/milkymist-pfpu.c
@@ -536,9 +536,9 @@ static TypeInfo milkymist_pfpu_info = {
.class_init = milkymist_pfpu_class_init,
};
-static void milkymist_pfpu_register(void)
+static void milkymist_pfpu_register_types(void)
{
type_register_static(&milkymist_pfpu_info);
}
-device_init(milkymist_pfpu_register)
+type_init(milkymist_pfpu_register_types)
diff --git a/hw/milkymist-softusb.c b/hw/milkymist-softusb.c
index 5d496cbdb0..ecc2be9225 100644
--- a/hw/milkymist-softusb.c
+++ b/hw/milkymist-softusb.c
@@ -323,9 +323,9 @@ static TypeInfo milkymist_softusb_info = {
.class_init = milkymist_softusb_class_init,
};
-static void milkymist_softusb_register(void)
+static void milkymist_softusb_register_types(void)
{
type_register_static(&milkymist_softusb_info);
}
-device_init(milkymist_softusb_register)
+type_init(milkymist_softusb_register_types)
diff --git a/hw/milkymist-sysctl.c b/hw/milkymist-sysctl.c
index 18171f6165..a88548e0aa 100644
--- a/hw/milkymist-sysctl.c
+++ b/hw/milkymist-sysctl.c
@@ -322,9 +322,9 @@ static TypeInfo milkymist_sysctl_info = {
.class_init = milkymist_sysctl_class_init,
};
-static void milkymist_sysctl_register(void)
+static void milkymist_sysctl_register_types(void)
{
type_register_static(&milkymist_sysctl_info);
}
-device_init(milkymist_sysctl_register)
+type_init(milkymist_sysctl_register_types)
diff --git a/hw/milkymist-tmu2.c b/hw/milkymist-tmu2.c
index 474eae0a4a..210ceede2a 100644
--- a/hw/milkymist-tmu2.c
+++ b/hw/milkymist-tmu2.c
@@ -482,9 +482,9 @@ static TypeInfo milkymist_tmu2_info = {
.class_init = milkymist_tmu2_class_init,
};
-static void milkymist_tmu2_register(void)
+static void milkymist_tmu2_register_types(void)
{
type_register_static(&milkymist_tmu2_info);
}
-device_init(milkymist_tmu2_register)
+type_init(milkymist_tmu2_register_types)
diff --git a/hw/milkymist-uart.c b/hw/milkymist-uart.c
index f9a229cf68..291fe3c57b 100644
--- a/hw/milkymist-uart.c
+++ b/hw/milkymist-uart.c
@@ -235,9 +235,9 @@ static TypeInfo milkymist_uart_info = {
.class_init = milkymist_uart_class_init,
};
-static void milkymist_uart_register(void)
+static void milkymist_uart_register_types(void)
{
type_register_static(&milkymist_uart_info);
}
-device_init(milkymist_uart_register)
+type_init(milkymist_uart_register_types)
diff --git a/hw/milkymist-vgafb.c b/hw/milkymist-vgafb.c
index 92ad02f9e2..69afd72d8a 100644
--- a/hw/milkymist-vgafb.c
+++ b/hw/milkymist-vgafb.c
@@ -323,9 +323,9 @@ static TypeInfo milkymist_vgafb_info = {
.class_init = milkymist_vgafb_class_init,
};
-static void milkymist_vgafb_register(void)
+static void milkymist_vgafb_register_types(void)
{
type_register_static(&milkymist_vgafb_info);
}
-device_init(milkymist_vgafb_register)
+type_init(milkymist_vgafb_register_types)
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index d232630e66..ffecefdede 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -1029,7 +1029,7 @@ static QEMUMachine mips_malta_machine = {
.is_default = 1,
};
-static void mips_malta_device_init(void)
+static void mips_malta_register_types(void)
{
type_register_static(&mips_malta_device);
}
@@ -1039,5 +1039,5 @@ static void mips_malta_machine_init(void)
qemu_register_machine(&mips_malta_machine);
}
-device_init(mips_malta_device_init);
+type_init(mips_malta_register_types)
machine_init(mips_malta_machine_init);
diff --git a/hw/mipsnet.c b/hw/mipsnet.c
index a0e6c9fa1e..50d92f8f54 100644
--- a/hw/mipsnet.c
+++ b/hw/mipsnet.c
@@ -276,9 +276,9 @@ static TypeInfo mipsnet_info = {
.class_init = mipsnet_class_init,
};
-static void mipsnet_register_devices(void)
+static void mipsnet_register_types(void)
{
type_register_static(&mipsnet_info);
}
-device_init(mipsnet_register_devices)
+type_init(mipsnet_register_types)
diff --git a/hw/mpc8544_guts.c b/hw/mpc8544_guts.c
index 28cd60d89c..aeb2de7ccc 100644
--- a/hw/mpc8544_guts.c
+++ b/hw/mpc8544_guts.c
@@ -135,8 +135,9 @@ static TypeInfo mpc8544_guts_info = {
.class_init = mpc8544_guts_class_init,
};
-static void mpc8544_guts_register(void)
+static void mpc8544_guts_register_types(void)
{
type_register_static(&mpc8544_guts_info);
}
-device_init(mpc8544_guts_register);
+
+type_init(mpc8544_guts_register_types)
diff --git a/hw/mst_fpga.c b/hw/mst_fpga.c
index 1729db01a4..024192d135 100644
--- a/hw/mst_fpga.c
+++ b/hw/mst_fpga.c
@@ -255,8 +255,9 @@ static TypeInfo mst_fpga_info = {
.class_init = mst_fpga_class_init,
};
-static void mst_fpga_register(void)
+static void mst_fpga_register_types(void)
{
type_register_static(&mst_fpga_info);
}
-device_init(mst_fpga_register);
+
+type_init(mst_fpga_register_types)
diff --git a/hw/musicpal.c b/hw/musicpal.c
index ac909248d4..187a1aef5e 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -1681,7 +1681,7 @@ static TypeInfo mv88w8618_wlan_info = {
.class_init = mv88w8618_wlan_class_init,
};
-static void musicpal_register_devices(void)
+static void musicpal_register_types(void)
{
type_register_static(&mv88w8618_pic_info);
type_register_static(&mv88w8618_pit_info);
@@ -1693,4 +1693,4 @@ static void musicpal_register_devices(void)
type_register_static(&musicpal_key_info);
}
-device_init(musicpal_register_devices)
+type_init(musicpal_register_types)
diff --git a/hw/nand.c b/hw/nand.c
index 5d947b1ced..e9501ae038 100644
--- a/hw/nand.c
+++ b/hw/nand.c
@@ -442,7 +442,7 @@ static TypeInfo nand_info = {
.class_init = nand_class_init,
};
-static void nand_create_device(void)
+static void nand_register_types(void)
{
type_register_static(&nand_info);
}
@@ -635,7 +635,7 @@ DeviceState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id)
return dev;
}
-device_init(nand_create_device)
+type_init(nand_register_types)
#else
diff --git a/hw/ne2000-isa.c b/hw/ne2000-isa.c
index 1352282152..a4a783ab89 100644
--- a/hw/ne2000-isa.c
+++ b/hw/ne2000-isa.c
@@ -104,9 +104,9 @@ static TypeInfo ne2000_isa_info = {
.class_init = isa_ne2000_class_initfn,
};
-static void ne2000_isa_register_devices(void)
+static void ne2000_isa_register_types(void)
{
type_register_static(&ne2000_isa_info);
}
-device_init(ne2000_isa_register_devices)
+type_init(ne2000_isa_register_types)
diff --git a/hw/ne2000.c b/hw/ne2000.c
index 080811ec4d..bb84fd1f93 100644
--- a/hw/ne2000.c
+++ b/hw/ne2000.c
@@ -812,9 +812,9 @@ static TypeInfo ne2000_info = {
.class_init = ne2000_class_init,
};
-static void ne2000_register_devices(void)
+static void ne2000_register_types(void)
{
type_register_static(&ne2000_info);
}
-device_init(ne2000_register_devices)
+type_init(ne2000_register_types)
diff --git a/hw/omap_gpio.c b/hw/omap_gpio.c
index 9a9a8e183f..201ff77c36 100644
--- a/hw/omap_gpio.c
+++ b/hw/omap_gpio.c
@@ -783,10 +783,10 @@ static TypeInfo omap2_gpio_info = {
.class_init = omap2_gpio_class_init,
};
-static void omap_gpio_register_device(void)
+static void omap_gpio_register_types(void)
{
type_register_static(&omap_gpio_info);
type_register_static(&omap2_gpio_info);
}
-device_init(omap_gpio_register_device)
+type_init(omap_gpio_register_types)
diff --git a/hw/omap_intc.c b/hw/omap_intc.c
index 5aa98a8fdb..5076e07ed5 100644
--- a/hw/omap_intc.c
+++ b/hw/omap_intc.c
@@ -640,10 +640,10 @@ static TypeInfo omap2_intc_info = {
.class_init = omap2_intc_class_init,
};
-static void omap_intc_register_device(void)
+static void omap_intc_register_types(void)
{
type_register_static(&omap_intc_info);
type_register_static(&omap2_intc_info);
}
-device_init(omap_intc_register_device)
+type_init(omap_intc_register_types)
diff --git a/hw/onenand.c b/hw/onenand.c
index 8744b04db3..db6af682c4 100644
--- a/hw/onenand.c
+++ b/hw/onenand.c
@@ -828,7 +828,7 @@ static TypeInfo onenand_info = {
.class_init = onenand_class_init,
};
-static void onenand_register_device(void)
+static void onenand_register_types(void)
{
type_register_static(&onenand_info);
}
@@ -838,4 +838,4 @@ void *onenand_raw_otp(DeviceState *onenand_device)
return FROM_SYSBUS(OneNANDState, sysbus_from_qdev(onenand_device))->otp;
}
-device_init(onenand_register_device)
+type_init(onenand_register_types)
diff --git a/hw/opencores_eth.c b/hw/opencores_eth.c
index 09f2757df3..9b036cb103 100644
--- a/hw/opencores_eth.c
+++ b/hw/opencores_eth.c
@@ -750,9 +750,9 @@ static TypeInfo open_eth_info = {
.class_init = open_eth_class_init,
};
-static void open_eth_register_devices(void)
+static void open_eth_register_types(void)
{
type_register_static(&open_eth_info);
}
-device_init(open_eth_register_devices)
+type_init(open_eth_register_types)
diff --git a/hw/parallel.c b/hw/parallel.c
index 484d727927..219f38436f 100644
--- a/hw/parallel.c
+++ b/hw/parallel.c
@@ -606,9 +606,9 @@ static TypeInfo parallel_isa_info = {
.class_init = parallel_isa_class_initfn,
};
-static void parallel_register_devices(void)
+static void parallel_register_types(void)
{
type_register_static(&parallel_isa_info);
}
-device_init(parallel_register_devices)
+type_init(parallel_register_types)
diff --git a/hw/pc.c b/hw/pc.c
index 7f3aa65d20..8d8f59bff5 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -514,11 +514,12 @@ static TypeInfo port92_info = {
.class_init = port92_class_initfn,
};
-static void port92_register(void)
+static void port92_register_types(void)
{
type_register_static(&port92_info);
}
-device_init(port92_register)
+
+type_init(port92_register_types)
static void handle_a20_line_change(void *opaque, int irq, int level)
{
diff --git a/hw/pci.c b/hw/pci.c
index 5f4f80ed10..678a8c1117 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -2003,9 +2003,9 @@ static TypeInfo pci_device_type_info = {
.class_init = pci_device_class_init,
};
-static void pci_register_devices(void)
+static void pci_register_types(void)
{
type_register_static(&pci_device_type_info);
}
-device_init(pci_register_devices);
+type_init(pci_register_types)
diff --git a/hw/pckbd.c b/hw/pckbd.c
index b4c53bed6c..69857bade9 100644
--- a/hw/pckbd.c
+++ b/hw/pckbd.c
@@ -513,8 +513,9 @@ static TypeInfo i8042_info = {
.class_init = i8042_class_initfn,
};
-static void i8042_register(void)
+static void i8042_register_types(void)
{
type_register_static(&i8042_info);
}
-device_init(i8042_register)
+
+type_init(i8042_register_types)
diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c
index 439f32caae..368260959f 100644
--- a/hw/pcnet-pci.c
+++ b/hw/pcnet-pci.c
@@ -376,9 +376,9 @@ static TypeInfo pcnet_info = {
.class_init = pcnet_class_init,
};
-static void pci_pcnet_register_devices(void)
+static void pci_pcnet_register_types(void)
{
type_register_static(&pcnet_info);
}
-device_init(pci_pcnet_register_devices)
+type_init(pci_pcnet_register_types)
diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c
index a9e88b9b3c..2ca0fd4560 100644
--- a/hw/pflash_cfi02.c
+++ b/hw/pflash_cfi02.c
@@ -102,6 +102,7 @@ static void pflash_setup_mappings(pflash_t *pfl)
static void pflash_register_memory(pflash_t *pfl, int rom_mode)
{
memory_region_rom_device_set_readable(&pfl->orig_mem, rom_mode);
+ pfl->rom_mode = rom_mode;
}
static void pflash_timer (void *opaque)
diff --git a/hw/piix4.c b/hw/piix4.c
index 4e7a2370cd..ce4eb0d1ae 100644
--- a/hw/piix4.c
+++ b/hw/piix4.c
@@ -124,8 +124,9 @@ static TypeInfo piix4_info = {
.class_init = piix4_class_init,
};
-static void piix4_register(void)
+static void piix4_register_types(void)
{
type_register_static(&piix4_info);
}
-device_init(piix4_register);
+
+type_init(piix4_register_types)
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 190642733f..e0268fe053 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -589,11 +589,12 @@ static TypeInfo i440fx_pcihost_info = {
.class_init = i440fx_pcihost_class_init,
};
-static void i440fx_register(void)
+static void i440fx_register_types(void)
{
type_register_static(&i440fx_info);
type_register_static(&piix3_info);
type_register_static(&piix3_xen_info);
type_register_static(&i440fx_pcihost_info);
}
-device_init(i440fx_register);
+
+type_init(i440fx_register_types)
diff --git a/hw/pl011.c b/hw/pl011.c
index 752cbf9725..8a5a8f554a 100644
--- a/hw/pl011.c
+++ b/hw/pl011.c
@@ -316,10 +316,10 @@ static TypeInfo pl011_luminary_info = {
.class_init = pl011_luminary_class_init,
};
-static void pl011_register_devices(void)
+static void pl011_register_types(void)
{
type_register_static(&pl011_arm_info);
type_register_static(&pl011_luminary_info);
}
-device_init(pl011_register_devices)
+type_init(pl011_register_types)
diff --git a/hw/pl022.c b/hw/pl022.c
index 30bd3442bb..03bf63c4d2 100644
--- a/hw/pl022.c
+++ b/hw/pl022.c
@@ -299,9 +299,9 @@ static TypeInfo pl022_info = {
.class_init = pl022_class_init,
};
-static void pl022_register_devices(void)
+static void pl022_register_types(void)
{
type_register_static(&pl022_info);
}
-device_init(pl022_register_devices)
+type_init(pl022_register_types)
diff --git a/hw/pl031.c b/hw/pl031.c
index 8416a609ef..05b5b11e1a 100644
--- a/hw/pl031.c
+++ b/hw/pl031.c
@@ -230,9 +230,9 @@ static TypeInfo pl031_info = {
.class_init = pl031_class_init,
};
-static void pl031_register_devices(void)
+static void pl031_register_types(void)
{
type_register_static(&pl031_info);
}
-device_init(pl031_register_devices)
+type_init(pl031_register_types)
diff --git a/hw/pl041.c b/hw/pl041.c
index 6d99c9cbbc..b6723be0a9 100644
--- a/hw/pl041.c
+++ b/hw/pl041.c
@@ -638,9 +638,9 @@ static TypeInfo pl041_device_info = {
.class_init = pl041_device_class_init,
};
-static void pl041_register_device(void)
+static void pl041_register_types(void)
{
type_register_static(&pl041_device_info);
}
-device_init(pl041_register_device)
+type_init(pl041_register_types)
diff --git a/hw/pl050.c b/hw/pl050.c
index b0094ac9b3..b13924a160 100644
--- a/hw/pl050.c
+++ b/hw/pl050.c
@@ -189,10 +189,10 @@ static TypeInfo pl050_mouse_info = {
.class_init = pl050_mouse_class_init,
};
-static void pl050_register_devices(void)
+static void pl050_register_types(void)
{
type_register_static(&pl050_kbd_info);
type_register_static(&pl050_mouse_info);
}
-device_init(pl050_register_devices)
+type_init(pl050_register_types)
diff --git a/hw/pl061.c b/hw/pl061.c
index 3136c99423..2aac7e8e9e 100644
--- a/hw/pl061.c
+++ b/hw/pl061.c
@@ -325,10 +325,10 @@ static TypeInfo pl061_luminary_info = {
.class_init = pl061_luminary_class_init,
};
-static void pl061_register_devices(void)
+static void pl061_register_types(void)
{
type_register_static(&pl061_info);
type_register_static(&pl061_luminary_info);
}
-device_init(pl061_register_devices)
+type_init(pl061_register_types)
diff --git a/hw/pl080.c b/hw/pl080.c
index 4405d1823b..b3cf651ab7 100644
--- a/hw/pl080.c
+++ b/hw/pl080.c
@@ -409,10 +409,10 @@ static TypeInfo pl081_info = {
/* The PL080 and PL081 are the same except for the number of channels
they implement (8 and 2 respectively). */
-static void pl080_register_devices(void)
+static void pl080_register_types(void)
{
type_register_static(&pl080_info);
type_register_static(&pl081_info);
}
-device_init(pl080_register_devices)
+type_init(pl080_register_types)
diff --git a/hw/pl110.c b/hw/pl110.c
index 86e95a3ffd..f94608cb62 100644
--- a/hw/pl110.c
+++ b/hw/pl110.c
@@ -520,11 +520,11 @@ static TypeInfo pl111_info = {
.class_init = pl111_class_init,
};
-static void pl110_register_devices(void)
+static void pl110_register_types(void)
{
type_register_static(&pl110_info);
type_register_static(&pl110_versatile_info);
type_register_static(&pl111_info);
}
-device_init(pl110_register_devices)
+type_init(pl110_register_types)
diff --git a/hw/pl181.c b/hw/pl181.c
index ae636e220e..7d91fbba1d 100644
--- a/hw/pl181.c
+++ b/hw/pl181.c
@@ -505,9 +505,9 @@ static TypeInfo pl181_info = {
.class_init = pl181_class_init,
};
-static void pl181_register_devices(void)
+static void pl181_register_types(void)
{
type_register_static(&pl181_info);
}
-device_init(pl181_register_devices)
+type_init(pl181_register_types)
diff --git a/hw/pl190.c b/hw/pl190.c
index 956ab21c6a..cb50afb9f4 100644
--- a/hw/pl190.c
+++ b/hw/pl190.c
@@ -273,9 +273,9 @@ static TypeInfo pl190_info = {
.class_init = pl190_class_init,
};
-static void pl190_register_devices(void)
+static void pl190_register_types(void)
{
type_register_static(&pl190_info);
}
-device_init(pl190_register_devices)
+type_init(pl190_register_types)
diff --git a/hw/ppc4xx_pci.c b/hw/ppc4xx_pci.c
index d11f120d32..203c3cdc47 100644
--- a/hw/ppc4xx_pci.c
+++ b/hw/ppc4xx_pci.c
@@ -400,9 +400,10 @@ static TypeInfo ppc4xx_pcihost_info = {
.class_init = ppc4xx_pcihost_class_init,
};
-static void ppc4xx_pci_register(void)
+static void ppc4xx_pci_register_types(void)
{
type_register_static(&ppc4xx_pcihost_info);
type_register_static(&ppc4xx_host_bridge_info);
}
-device_init(ppc4xx_pci_register);
+
+type_init(ppc4xx_pci_register_types)
diff --git a/hw/ppce500_pci.c b/hw/ppce500_pci.c
index d5bce71429..0f60b24134 100644
--- a/hw/ppce500_pci.c
+++ b/hw/ppce500_pci.c
@@ -373,9 +373,10 @@ static TypeInfo e500_pcihost_info = {
.class_init = e500_pcihost_class_init,
};
-static void e500_pci_register(void)
+static void e500_pci_register_types(void)
{
type_register_static(&e500_pcihost_info);
type_register_static(&e500_host_bridge_info);
}
-device_init(e500_pci_register);
+
+type_init(e500_pci_register_types)
diff --git a/hw/ppce500_spin.c b/hw/ppce500_spin.c
index 9d648ec90a..6b8a189c0e 100644
--- a/hw/ppce500_spin.c
+++ b/hw/ppce500_spin.c
@@ -217,8 +217,9 @@ static TypeInfo ppce500_spin_info = {
.class_init = ppce500_spin_class_init,
};
-static void ppce500_spin_register(void)
+static void ppce500_spin_register_types(void)
{
type_register_static(&ppce500_spin_info);
}
-device_init(ppce500_spin_register);
+
+type_init(ppce500_spin_register_types)
diff --git a/hw/prep_pci.c b/hw/prep_pci.c
index 40b8bb0edd..8b29da9948 100644
--- a/hw/prep_pci.c
+++ b/hw/prep_pci.c
@@ -173,10 +173,10 @@ static TypeInfo raven_pcihost_info = {
.class_init = raven_pcihost_class_init,
};
-static void raven_register_devices(void)
+static void raven_register_types(void)
{
type_register_static(&raven_pcihost_info);
type_register_static(&raven_info);
}
-device_init(raven_register_devices)
+type_init(raven_register_types)
diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index 244c614510..1ab27012c1 100644
--- a/hw/pxa2xx.c
+++ b/hw/pxa2xx.c
@@ -2330,7 +2330,7 @@ static TypeInfo pxa2xx_ssp_info = {
.class_init = pxa2xx_ssp_class_init,
};
-static void pxa2xx_register_devices(void)
+static void pxa2xx_register_types(void)
{
type_register_static(&pxa2xx_i2c_slave_info);
type_register_static(&pxa2xx_ssp_info);
@@ -2338,4 +2338,4 @@ static void pxa2xx_register_devices(void)
type_register_static(&pxa2xx_rtc_sysbus_info);
}
-device_init(pxa2xx_register_devices)
+type_init(pxa2xx_register_types)
diff --git a/hw/pxa2xx_dma.c b/hw/pxa2xx_dma.c
index 2d61565f1d..8ced0dd8ec 100644
--- a/hw/pxa2xx_dma.c
+++ b/hw/pxa2xx_dma.c
@@ -566,8 +566,9 @@ static TypeInfo pxa2xx_dma_info = {
.class_init = pxa2xx_dma_class_init,
};
-static void pxa2xx_dma_register(void)
+static void pxa2xx_dma_register_types(void)
{
type_register_static(&pxa2xx_dma_info);
}
-device_init(pxa2xx_dma_register);
+
+type_init(pxa2xx_dma_register_types)
diff --git a/hw/pxa2xx_gpio.c b/hw/pxa2xx_gpio.c
index 67fd17c4ca..d5f57162ed 100644
--- a/hw/pxa2xx_gpio.c
+++ b/hw/pxa2xx_gpio.c
@@ -340,8 +340,9 @@ static TypeInfo pxa2xx_gpio_info = {
.class_init = pxa2xx_gpio_class_init,
};
-static void pxa2xx_gpio_register(void)
+static void pxa2xx_gpio_register_types(void)
{
type_register_static(&pxa2xx_gpio_info);
}
-device_init(pxa2xx_gpio_register);
+
+type_init(pxa2xx_gpio_register_types)
diff --git a/hw/pxa2xx_pic.c b/hw/pxa2xx_pic.c
index ca85743aea..6b2bdb0df1 100644
--- a/hw/pxa2xx_pic.c
+++ b/hw/pxa2xx_pic.c
@@ -313,8 +313,9 @@ static TypeInfo pxa2xx_pic_info = {
.class_init = pxa2xx_pic_class_init,
};
-static void pxa2xx_pic_register(void)
+static void pxa2xx_pic_register_types(void)
{
type_register_static(&pxa2xx_pic_info);
}
-device_init(pxa2xx_pic_register);
+
+type_init(pxa2xx_pic_register_types)
diff --git a/hw/pxa2xx_timer.c b/hw/pxa2xx_timer.c
index 90800751b1..77b033b541 100644
--- a/hw/pxa2xx_timer.c
+++ b/hw/pxa2xx_timer.c
@@ -527,9 +527,10 @@ static TypeInfo pxa27x_timer_dev_info = {
.class_init = pxa27x_timer_dev_class_init,
};
-static void pxa2xx_timer_register(void)
+static void pxa2xx_timer_register_types(void)
{
type_register_static(&pxa25x_timer_dev_info);
type_register_static(&pxa27x_timer_dev_info);
-};
-device_init(pxa2xx_timer_register);
+}
+
+type_init(pxa2xx_timer_register_types)
diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index 49f13ca087..a310cc7b16 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -457,6 +457,16 @@ DeviceState *qdev_device_add(QemuOpts *opts)
id = qemu_opts_id(opts);
if (id) {
qdev->id = id;
+ }
+ if (qemu_opt_foreach(opts, set_property, qdev, 1) != 0) {
+ qdev_free(qdev);
+ return NULL;
+ }
+ if (qdev_init(qdev) < 0) {
+ qerror_report(QERR_DEVICE_INIT_FAILED, driver);
+ return NULL;
+ }
+ if (qdev->id) {
object_property_add_child(qdev_get_peripheral(), qdev->id,
OBJECT(qdev), NULL);
} else {
@@ -466,14 +476,6 @@ DeviceState *qdev_device_add(QemuOpts *opts)
OBJECT(qdev), NULL);
g_free(name);
}
- if (qemu_opt_foreach(opts, set_property, qdev, 1) != 0) {
- qdev_free(qdev);
- return NULL;
- }
- if (qdev_init(qdev) < 0) {
- qerror_report(QERR_DEVICE_INIT_FAILED, driver);
- return NULL;
- }
qdev->opts = opts;
return qdev;
}
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index b6d6fcff01..7b74dd5beb 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -613,7 +613,7 @@ static void set_pointer(Object *obj, Visitor *v, Property *prop,
}
if (!*str) {
g_free(str);
- error_set_from_qdev_prop_error(errp, EINVAL, dev, prop, str);
+ *ptr = NULL;
return;
}
ret = parse(dev, str, ptr);
@@ -1072,55 +1072,56 @@ void qdev_prop_set_bit(DeviceState *dev, const char *name, bool value)
{
Error *errp = NULL;
object_property_set_bool(OBJECT(dev), value, name, &errp);
- assert(!errp);
+ assert_no_error(errp);
}
void qdev_prop_set_uint8(DeviceState *dev, const char *name, uint8_t value)
{
Error *errp = NULL;
object_property_set_int(OBJECT(dev), value, name, &errp);
- assert(!errp);
+ assert_no_error(errp);
}
void qdev_prop_set_uint16(DeviceState *dev, const char *name, uint16_t value)
{
Error *errp = NULL;
object_property_set_int(OBJECT(dev), value, name, &errp);
- assert(!errp);
+ assert_no_error(errp);
}
void qdev_prop_set_uint32(DeviceState *dev, const char *name, uint32_t value)
{
Error *errp = NULL;
object_property_set_int(OBJECT(dev), value, name, &errp);
- assert(!errp);
+ assert_no_error(errp);
}
void qdev_prop_set_int32(DeviceState *dev, const char *name, int32_t value)
{
Error *errp = NULL;
object_property_set_int(OBJECT(dev), value, name, &errp);
- assert(!errp);
+ assert_no_error(errp);
}
void qdev_prop_set_uint64(DeviceState *dev, const char *name, uint64_t value)
{
Error *errp = NULL;
object_property_set_int(OBJECT(dev), value, name, &errp);
- assert(!errp);
+ assert_no_error(errp);
}
void qdev_prop_set_string(DeviceState *dev, const char *name, char *value)
{
Error *errp = NULL;
object_property_set_str(OBJECT(dev), value, name, &errp);
- assert(!errp);
+ assert_no_error(errp);
}
int qdev_prop_set_drive(DeviceState *dev, const char *name, BlockDriverState *value)
{
Error *errp = NULL;
- object_property_set_str(OBJECT(dev), bdrv_get_device_name(value),
+ const char *bdrv_name = value ? bdrv_get_device_name(value) : "";
+ object_property_set_str(OBJECT(dev), bdrv_name,
name, &errp);
if (errp) {
qerror_report_err(errp);
@@ -1139,24 +1140,26 @@ void qdev_prop_set_drive_nofail(DeviceState *dev, const char *name, BlockDriverS
void qdev_prop_set_chr(DeviceState *dev, const char *name, CharDriverState *value)
{
Error *errp = NULL;
- assert(value->label);
- object_property_set_str(OBJECT(dev), value->label, name, &errp);
- assert(!errp);
+ assert(!value || value->label);
+ object_property_set_str(OBJECT(dev),
+ value ? value->label : "", name, &errp);
+ assert_no_error(errp);
}
void qdev_prop_set_netdev(DeviceState *dev, const char *name, VLANClientState *value)
{
Error *errp = NULL;
- assert(value->name);
- object_property_set_str(OBJECT(dev), value->name, name, &errp);
- assert(!errp);
+ assert(!value || value->name);
+ object_property_set_str(OBJECT(dev),
+ value ? value->name : "", name, &errp);
+ assert_no_error(errp);
}
void qdev_prop_set_vlan(DeviceState *dev, const char *name, VLANState *value)
{
Error *errp = NULL;
object_property_set_int(OBJECT(dev), value ? value->id : -1, name, &errp);
- assert(!errp);
+ assert_no_error(errp);
}
void qdev_prop_set_macaddr(DeviceState *dev, const char *name, uint8_t *value)
@@ -1167,7 +1170,7 @@ void qdev_prop_set_macaddr(DeviceState *dev, const char *name, uint8_t *value)
value[0], value[1], value[2], value[3], value[4], value[5]);
object_property_set_str(OBJECT(dev), str, name, &errp);
- assert(!errp);
+ assert_no_error(errp);
}
void qdev_prop_set_enum(DeviceState *dev, const char *name, int value)
@@ -1178,7 +1181,7 @@ void qdev_prop_set_enum(DeviceState *dev, const char *name, int value)
prop = qdev_prop_find(dev, name);
object_property_set_str(OBJECT(dev), prop->info->enum_table[value],
name, &errp);
- assert(!errp);
+ assert_no_error(errp);
}
void qdev_prop_set_ptr(DeviceState *dev, const char *name, void *value)
@@ -1210,7 +1213,7 @@ void qdev_prop_set_defaults(DeviceState *dev, Property *props)
} else if (props->qtype == QTYPE_QINT) {
object_property_set_int(obj, props->defval, props->name, &errp);
}
- assert(!errp);
+ assert_no_error(errp);
}
}
diff --git a/hw/qdev.c b/hw/qdev.c
index 8a413ef0ed..f0eb3a7384 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -665,9 +665,9 @@ static TypeInfo device_type_info = {
.class_size = sizeof(DeviceClass),
};
-static void init_qdev(void)
+static void qdev_register_types(void)
{
type_register_static(&device_type_info);
}
-device_init(init_qdev);
+type_init(qdev_register_types)
diff --git a/hw/qxl.c b/hw/qxl.c
index bc03c1dc77..ac69125f27 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1870,10 +1870,10 @@ static TypeInfo qxl_secondary_info = {
.class_init = qxl_secondary_class_init,
};
-static void qxl_register(void)
+static void qxl_register_types(void)
{
type_register_static(&qxl_primary_info);
type_register_static(&qxl_secondary_info);
}
-device_init(qxl_register);
+type_init(qxl_register_types)
diff --git a/hw/realview.c b/hw/realview.c
index 8b0b03d2d3..bcf982fac5 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -96,7 +96,7 @@ static TypeInfo realview_i2c_info = {
.class_init = realview_i2c_class_init,
};
-static void realview_register_devices(void)
+static void realview_register_types(void)
{
type_register_static(&realview_i2c_info);
}
@@ -491,4 +491,4 @@ static void realview_machine_init(void)
}
machine_init(realview_machine_init);
-device_init(realview_register_devices)
+type_init(realview_register_types)
diff --git a/hw/realview_gic.c b/hw/realview_gic.c
index 4121502c7b..071ef13c9e 100644
--- a/hw/realview_gic.c
+++ b/hw/realview_gic.c
@@ -60,9 +60,9 @@ static TypeInfo realview_gic_info = {
.class_init = realview_gic_class_init,
};
-static void realview_gic_register_devices(void)
+static void realview_gic_register_types(void)
{
type_register_static(&realview_gic_info);
}
-device_init(realview_gic_register_devices)
+type_init(realview_gic_register_types)
diff --git a/hw/rtl8139.c b/hw/rtl8139.c
index 1668390e1f..05b8e1e3d7 100644
--- a/hw/rtl8139.c
+++ b/hw/rtl8139.c
@@ -3523,9 +3523,9 @@ static TypeInfo rtl8139_info = {
.class_init = rtl8139_class_init,
};
-static void rtl8139_register_devices(void)
+static void rtl8139_register_types(void)
{
type_register_static(&rtl8139_info);
}
-device_init(rtl8139_register_devices)
+type_init(rtl8139_register_types)
diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index 49140f8a9e..9d480564d7 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -433,15 +433,6 @@ static TypeInfo virtio_s390_device_info = {
.abstract = true,
};
-static void s390_virtio_register(void)
-{
- type_register_static(&virtio_s390_device_info);
- type_register_static(&s390_virtio_serial);
- type_register_static(&s390_virtio_blk);
- type_register_static(&s390_virtio_net);
-}
-device_init(s390_virtio_register);
-
/***************** S390 Virtio Bus Bridge Device *******************/
/* Only required to have the virtio bus as child in the system bus */
@@ -468,9 +459,13 @@ static TypeInfo s390_virtio_bridge_info = {
.class_init = s390_virtio_bridge_class_init,
};
-static void s390_virtio_register_devices(void)
+static void s390_virtio_register_types(void)
{
+ type_register_static(&virtio_s390_device_info);
+ type_register_static(&s390_virtio_serial);
+ type_register_static(&s390_virtio_blk);
+ type_register_static(&s390_virtio_net);
type_register_static(&s390_virtio_bridge_info);
}
-device_init(s390_virtio_register_devices)
+type_init(s390_virtio_register_types)
diff --git a/hw/sb16.c b/hw/sb16.c
index db8929b98e..c81455d7f3 100644
--- a/hw/sb16.c
+++ b/hw/sb16.c
@@ -1417,8 +1417,9 @@ static TypeInfo sb16_info = {
.class_init = sb16_class_initfn,
};
-static void sb16_register (void)
+static void sb16_register_types (void)
{
type_register_static (&sb16_info);
}
-device_init (sb16_register)
+
+type_init (sb16_register_types)
diff --git a/hw/sbi.c b/hw/sbi.c
index 847a4dde84..52982a9a3e 100644
--- a/hw/sbi.c
+++ b/hw/sbi.c
@@ -148,9 +148,9 @@ static TypeInfo sbi_info = {
.class_init = sbi_class_init,
};
-static void sbi_register_devices(void)
+static void sbi_register_types(void)
{
type_register_static(&sbi_info);
}
-device_init(sbi_register_devices)
+type_init(sbi_register_types)
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 0ee50a8360..b3e97ceeec 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -1431,9 +1431,9 @@ static TypeInfo scsi_device_type_info = {
.class_init = scsi_device_class_init,
};
-static void scsi_register_devices(void)
+static void scsi_register_types(void)
{
type_register_static(&scsi_device_type_info);
}
-device_init(scsi_register_devices);
+type_init(scsi_register_types)
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 399e51e494..c12e3a6cb3 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -1823,7 +1823,7 @@ static TypeInfo scsi_disk_info = {
.class_init = scsi_disk_class_initfn,
};
-static void scsi_disk_register_devices(void)
+static void scsi_disk_register_types(void)
{
type_register_static(&scsi_hd_info);
type_register_static(&scsi_cd_info);
@@ -1832,4 +1832,5 @@ static void scsi_disk_register_devices(void)
#endif
type_register_static(&scsi_disk_info);
}
-device_init(scsi_disk_register_devices)
+
+type_init(scsi_disk_register_types)
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index 4859212734..86014aa893 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -483,10 +483,11 @@ static TypeInfo scsi_generic_info = {
.class_init = scsi_generic_class_initfn,
};
-static void scsi_generic_register_devices(void)
+static void scsi_generic_register_types(void)
{
type_register_static(&scsi_generic_info);
}
-device_init(scsi_generic_register_devices)
+
+type_init(scsi_generic_register_types)
#endif /* __linux__ */
diff --git a/hw/serial.c b/hw/serial.c
index 82917e24d7..144d1b3526 100644
--- a/hw/serial.c
+++ b/hw/serial.c
@@ -903,9 +903,9 @@ static TypeInfo serial_isa_info = {
.class_init = serial_isa_class_initfn,
};
-static void serial_register_devices(void)
+static void serial_register_types(void)
{
type_register_static(&serial_isa_info);
}
-device_init(serial_register_devices)
+type_init(serial_register_types)
diff --git a/hw/sga.c b/hw/sga.c
index b08e3c5aea..a666349f82 100644
--- a/hw/sga.c
+++ b/hw/sga.c
@@ -55,9 +55,9 @@ static TypeInfo sga_info = {
.class_init = sga_class_initfn,
};
-static void sga_register(void)
+static void sga_register_types(void)
{
type_register_static(&sga_info);
}
-device_init(sga_register);
+type_init(sga_register_types)
diff --git a/hw/sh_pci.c b/hw/sh_pci.c
index 4234d935e7..0cfac46f7f 100644
--- a/hw/sh_pci.c
+++ b/hw/sh_pci.c
@@ -177,10 +177,10 @@ static TypeInfo sh_pci_device_info = {
.class_init = sh_pci_device_class_init,
};
-static void sh_pci_register_devices(void)
+static void sh_pci_register_types(void)
{
type_register_static(&sh_pci_device_info);
type_register_static(&sh_pci_host_info);
}
-device_init(sh_pci_register_devices)
+type_init(sh_pci_register_types)
diff --git a/hw/slavio_intctl.c b/hw/slavio_intctl.c
index e3701c75d2..7fdc3be086 100644
--- a/hw/slavio_intctl.c
+++ b/hw/slavio_intctl.c
@@ -463,9 +463,9 @@ static TypeInfo slavio_intctl_info = {
.class_init = slavio_intctl_class_init,
};
-static void slavio_intctl_register_devices(void)
+static void slavio_intctl_register_types(void)
{
type_register_static(&slavio_intctl_info);
}
-device_init(slavio_intctl_register_devices)
+type_init(slavio_intctl_register_types)
diff --git a/hw/slavio_misc.c b/hw/slavio_misc.c
index 5a025186af..944835e880 100644
--- a/hw/slavio_misc.c
+++ b/hw/slavio_misc.c
@@ -499,10 +499,10 @@ static TypeInfo apc_info = {
.class_init = apc_class_init,
};
-static void slavio_misc_register_devices(void)
+static void slavio_misc_register_types(void)
{
type_register_static(&slavio_misc_info);
type_register_static(&apc_info);
}
-device_init(slavio_misc_register_devices)
+type_init(slavio_misc_register_types)
diff --git a/hw/slavio_timer.c b/hw/slavio_timer.c
index 3878f6fa5e..97edebb3ba 100644
--- a/hw/slavio_timer.c
+++ b/hw/slavio_timer.c
@@ -427,9 +427,9 @@ static TypeInfo slavio_timer_info = {
.class_init = slavio_timer_class_init,
};
-static void slavio_timer_register_devices(void)
+static void slavio_timer_register_types(void)
{
type_register_static(&slavio_timer_info);
}
-device_init(slavio_timer_register_devices)
+type_init(slavio_timer_register_types)
diff --git a/hw/sm501.c b/hw/sm501.c
index 94c0abf4cb..786e07629c 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -1327,8 +1327,8 @@ static void sm501_draw_crt(SM501State * s)
ram_addr_t page1 = offset + width * src_bpp - 1;
/* check dirty flags for each line */
- update = memory_region_get_dirty(&s->local_mem_region, page0, page1,
- DIRTY_MEMORY_VGA);
+ update = memory_region_get_dirty(&s->local_mem_region, page0,
+ page1 - page0, DIRTY_MEMORY_VGA);
/* draw line and change status */
if (update) {
diff --git a/hw/smbus.c b/hw/smbus.c
index 77626f3645..e3cf6a2cc8 100644
--- a/hw/smbus.c
+++ b/hw/smbus.c
@@ -327,9 +327,9 @@ static TypeInfo smbus_device_type_info = {
.class_init = smbus_device_class_init,
};
-static void smbus_device_register_devices(void)
+static void smbus_device_register_types(void)
{
type_register_static(&smbus_device_type_info);
}
-device_init(smbus_device_register_devices);
+type_init(smbus_device_register_types)
diff --git a/hw/smbus_eeprom.c b/hw/smbus_eeprom.c
index 9d96cbe41a..11adab01b8 100644
--- a/hw/smbus_eeprom.c
+++ b/hw/smbus_eeprom.c
@@ -130,12 +130,12 @@ static TypeInfo smbus_eeprom_info = {
.class_init = smbus_eeprom_class_initfn,
};
-static void smbus_eeprom_register_devices(void)
+static void smbus_eeprom_register_types(void)
{
type_register_static(&smbus_eeprom_info);
}
-device_init(smbus_eeprom_register_devices)
+type_init(smbus_eeprom_register_types)
void smbus_eeprom_init(i2c_bus *smbus, int nb_eeprom,
const uint8_t *eeprom_spd, int eeprom_spd_size)
diff --git a/hw/smc91c111.c b/hw/smc91c111.c
index 1bf2901d1a..1a5213fa56 100644
--- a/hw/smc91c111.c
+++ b/hw/smc91c111.c
@@ -781,7 +781,7 @@ static TypeInfo smc91c111_info = {
.class_init = smc91c111_class_init,
};
-static void smc91c111_register_devices(void)
+static void smc91c111_register_types(void)
{
type_register_static(&smc91c111_info);
}
@@ -802,4 +802,4 @@ void smc91c111_init(NICInfo *nd, uint32_t base, qemu_irq irq)
sysbus_connect_irq(s, 0, irq);
}
-device_init(smc91c111_register_devices)
+type_init(smc91c111_register_types)
diff --git a/hw/spapr_hcall.c b/hw/spapr_hcall.c
index 84281be9e2..6ac7384013 100644
--- a/hw/spapr_hcall.c
+++ b/hw/spapr_hcall.c
@@ -672,7 +672,7 @@ target_ulong spapr_hypercall(CPUState *env, target_ulong opcode,
return H_FUNCTION;
}
-static void hypercall_init(void)
+static void hypercall_register_types(void)
{
/* hcall-pft */
spapr_register_hypercall(H_ENTER, h_enter);
@@ -704,4 +704,5 @@ static void hypercall_init(void)
/* qemu/KVM-PPC specific hcalls */
spapr_register_hypercall(KVMPPC_H_RTAS, h_rtas);
}
-device_init(hypercall_init);
+
+type_init(hypercall_register_types)
diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c
index 79b394132b..77d40479c8 100644
--- a/hw/spapr_llan.c
+++ b/hw/spapr_llan.c
@@ -501,7 +501,7 @@ static TypeInfo spapr_vlan_info = {
.class_init = spapr_vlan_class_init,
};
-static void spapr_vlan_register(void)
+static void spapr_vlan_register_types(void)
{
spapr_register_hypercall(H_REGISTER_LOGICAL_LAN, h_register_logical_lan);
spapr_register_hypercall(H_FREE_LOGICAL_LAN, h_free_logical_lan);
@@ -511,4 +511,5 @@ static void spapr_vlan_register(void)
spapr_register_hypercall(H_MULTICAST_CTRL, h_multicast_ctrl);
type_register_static(&spapr_vlan_info);
}
-device_init(spapr_vlan_register);
+
+type_init(spapr_vlan_register_types)
diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
index ed2e4b33e7..cfdd9ddd41 100644
--- a/hw/spapr_pci.c
+++ b/hw/spapr_pci.c
@@ -242,13 +242,13 @@ static TypeInfo spapr_phb_info = {
.class_init = spapr_phb_class_init,
};
-static void spapr_register_devices(void)
+static void spapr_register_types(void)
{
type_register_static(&spapr_phb_info);
type_register_static(&spapr_main_pci_host_info);
}
-device_init(spapr_register_devices)
+type_init(spapr_register_types)
static uint64_t spapr_io_read(void *opaque, target_phys_addr_t addr,
unsigned size)
diff --git a/hw/spapr_rtas.c b/hw/spapr_rtas.c
index d1ac74cfbd..c0723b3039 100644
--- a/hw/spapr_rtas.c
+++ b/hw/spapr_rtas.c
@@ -288,7 +288,7 @@ int spapr_rtas_device_tree_setup(void *fdt, target_phys_addr_t rtas_addr,
return 0;
}
-static void register_core_rtas(void)
+static void core_rtas_register_types(void)
{
spapr_rtas_register("display-character", rtas_display_character);
spapr_rtas_register("get-time-of-day", rtas_get_time_of_day);
@@ -298,4 +298,5 @@ static void register_core_rtas(void)
rtas_query_cpu_stopped_state);
spapr_rtas_register("start-cpu", rtas_start_cpu);
}
-device_init(register_core_rtas);
+
+type_init(core_rtas_register_types)
diff --git a/hw/spapr_vio.c b/hw/spapr_vio.c
index 64f0009814..ea317efbe4 100644
--- a/hw/spapr_vio.c
+++ b/hw/spapr_vio.c
@@ -778,13 +778,13 @@ static TypeInfo spapr_vio_type_info = {
.class_init = vio_spapr_device_class_init,
};
-static void spapr_vio_register_devices(void)
+static void spapr_vio_register_types(void)
{
type_register_static(&spapr_vio_bridge_info);
type_register_static(&spapr_vio_type_info);
}
-device_init(spapr_vio_register_devices)
+type_init(spapr_vio_register_types)
#ifdef CONFIG_FDT
static int compare_reg(const void *p1, const void *p2)
diff --git a/hw/spapr_vscsi.c b/hw/spapr_vscsi.c
index 9cfce19a73..ffce261f98 100644
--- a/hw/spapr_vscsi.c
+++ b/hw/spapr_vscsi.c
@@ -973,8 +973,9 @@ static TypeInfo spapr_vscsi_info = {
.class_init = spapr_vscsi_class_init,
};
-static void spapr_vscsi_register(void)
+static void spapr_vscsi_register_types(void)
{
type_register_static(&spapr_vscsi_info);
}
-device_init(spapr_vscsi_register);
+
+type_init(spapr_vscsi_register_types)
diff --git a/hw/spapr_vty.c b/hw/spapr_vty.c
index a954e7d29b..3efe24211e 100644
--- a/hw/spapr_vty.c
+++ b/hw/spapr_vty.c
@@ -212,10 +212,11 @@ static VIOsPAPRDevice *vty_lookup(sPAPREnvironment *spapr, target_ulong reg)
return sdev;
}
-static void spapr_vty_register(void)
+static void spapr_vty_register_types(void)
{
spapr_register_hypercall(H_PUT_TERM_CHAR, h_put_term_char);
spapr_register_hypercall(H_GET_TERM_CHAR, h_get_term_char);
type_register_static(&spapr_vty_info);
}
-device_init(spapr_vty_register);
+
+type_init(spapr_vty_register_types)
diff --git a/hw/sparc32_dma.c b/hw/sparc32_dma.c
index f07cc6fdf0..1dbf69e808 100644
--- a/hw/sparc32_dma.c
+++ b/hw/sparc32_dma.c
@@ -307,9 +307,9 @@ static TypeInfo sparc32_dma_info = {
.class_init = sparc32_dma_class_init,
};
-static void sparc32_dma_register_devices(void)
+static void sparc32_dma_register_types(void)
{
type_register_static(&sparc32_dma_info);
}
-device_init(sparc32_dma_register_devices)
+type_init(sparc32_dma_register_types)
diff --git a/hw/spitz.c b/hw/spitz.c
index 4e6540d976..1d6d2b0e1b 100644
--- a/hw/spitz.c
+++ b/hw/spitz.c
@@ -1138,7 +1138,7 @@ static TypeInfo spitz_lcdtg_info = {
.class_init = spitz_lcdtg_class_init,
};
-static void spitz_register_devices(void)
+static void spitz_register_types(void)
{
type_register_static(&corgi_ssp_info);
type_register_static(&spitz_lcdtg_info);
@@ -1146,4 +1146,4 @@ static void spitz_register_devices(void)
type_register_static(&sl_nand_info);
}
-device_init(spitz_register_devices)
+type_init(spitz_register_types)
diff --git a/hw/ssd0303.c b/hw/ssd0303.c
index 685602a584..4e1ee6e12b 100644
--- a/hw/ssd0303.c
+++ b/hw/ssd0303.c
@@ -313,9 +313,9 @@ static TypeInfo ssd0303_info = {
.class_init = ssd0303_class_init,
};
-static void ssd0303_register_devices(void)
+static void ssd0303_register_types(void)
{
type_register_static(&ssd0303_info);
}
-device_init(ssd0303_register_devices)
+type_init(ssd0303_register_types)
diff --git a/hw/ssd0323.c b/hw/ssd0323.c
index 3c43738ae1..b0b2e94a81 100644
--- a/hw/ssd0323.c
+++ b/hw/ssd0323.c
@@ -355,9 +355,9 @@ static TypeInfo ssd0323_info = {
.class_init = ssd0323_class_init,
};
-static void ssd03232_register_devices(void)
+static void ssd03232_register_types(void)
{
type_register_static(&ssd0323_info);
}
-device_init(ssd03232_register_devices)
+type_init(ssd03232_register_types)
diff --git a/hw/ssi-sd.c b/hw/ssi-sd.c
index f2e6cecb71..b519bdb29a 100644
--- a/hw/ssi-sd.c
+++ b/hw/ssi-sd.c
@@ -259,9 +259,9 @@ static TypeInfo ssi_sd_info = {
.class_init = ssi_sd_class_init,
};
-static void ssi_sd_register_devices(void)
+static void ssi_sd_register_types(void)
{
type_register_static(&ssi_sd_info);
}
-device_init(ssi_sd_register_devices)
+type_init(ssi_sd_register_types)
diff --git a/hw/ssi.c b/hw/ssi.c
index ead446c49a..8f2d9bc034 100644
--- a/hw/ssi.c
+++ b/hw/ssi.c
@@ -80,9 +80,9 @@ uint32_t ssi_transfer(SSIBus *bus, uint32_t val)
return ssc->transfer(slave, val);
}
-static void register_ssi_slave(void)
+static void ssi_slave_register_types(void)
{
type_register_static(&ssi_slave_info);
}
-device_init(register_ssi_slave);
+type_init(ssi_slave_register_types)
diff --git a/hw/stellaris.c b/hw/stellaris.c
index 31a65cfb77..562fbbf494 100644
--- a/hw/stellaris.c
+++ b/hw/stellaris.c
@@ -1451,7 +1451,7 @@ static TypeInfo stellaris_adc_info = {
.class_init = stellaris_adc_class_init,
};
-static void stellaris_register_devices(void)
+static void stellaris_register_types(void)
{
type_register_static(&stellaris_i2c_info);
type_register_static(&stellaris_gptm_info);
@@ -1459,4 +1459,4 @@ static void stellaris_register_devices(void)
type_register_static(&stellaris_ssi_bus_info);
}
-device_init(stellaris_register_devices)
+type_init(stellaris_register_types)
diff --git a/hw/stellaris_enet.c b/hw/stellaris_enet.c
index 9b1be8dadc..fbe99cb4a9 100644
--- a/hw/stellaris_enet.c
+++ b/hw/stellaris_enet.c
@@ -441,9 +441,9 @@ static TypeInfo stellaris_enet_info = {
.class_init = stellaris_enet_class_init,
};
-static void stellaris_enet_register_devices(void)
+static void stellaris_enet_register_types(void)
{
type_register_static(&stellaris_enet_info);
}
-device_init(stellaris_enet_register_devices)
+type_init(stellaris_enet_register_types)
diff --git a/hw/strongarm.c b/hw/strongarm.c
index 8d2e7eb6fe..4d5b60fd1f 100644
--- a/hw/strongarm.c
+++ b/hw/strongarm.c
@@ -1609,7 +1609,7 @@ StrongARMState *sa1110_init(MemoryRegion *sysmem,
return s;
}
-static void strongarm_register_devices(void)
+static void strongarm_register_types(void)
{
type_register_static(&strongarm_pic_info);
type_register_static(&strongarm_rtc_sysbus_info);
@@ -1618,4 +1618,5 @@ static void strongarm_register_devices(void)
type_register_static(&strongarm_uart_info);
type_register_static(&strongarm_ssp_info);
}
-device_init(strongarm_register_devices)
+
+type_init(strongarm_register_types)
diff --git a/hw/sun4c_intctl.c b/hw/sun4c_intctl.c
index 081d6cc8bd..8dfa5ecab6 100644
--- a/hw/sun4c_intctl.c
+++ b/hw/sun4c_intctl.c
@@ -223,9 +223,9 @@ static TypeInfo sun4c_intctl_info = {
.class_init = sun4c_intctl_class_init,
};
-static void sun4c_intctl_register_devices(void)
+static void sun4c_intctl_register_types(void)
{
type_register_static(&sun4c_intctl_info);
}
-device_init(sun4c_intctl_register_devices)
+type_init(sun4c_intctl_register_types)
diff --git a/hw/sun4m.c b/hw/sun4m.c
index b79d14c35a..99fb219b3a 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -623,13 +623,6 @@ static TypeInfo idreg_info = {
.class_init = idreg_class_init,
};
-static void idreg_register_devices(void)
-{
- type_register_static(&idreg_info);
-}
-
-device_init(idreg_register_devices);
-
typedef struct AFXState {
SysBusDevice busdev;
MemoryRegion mem;
@@ -672,13 +665,6 @@ static TypeInfo afx_info = {
.class_init = afx_class_init,
};
-static void afx_register_devices(void)
-{
- type_register_static(&afx_info);
-}
-
-device_init(afx_register_devices);
-
typedef struct PROMState {
SysBusDevice busdev;
MemoryRegion prom;
@@ -756,13 +742,6 @@ static TypeInfo prom_info = {
.class_init = prom_class_init,
};
-static void prom_register_devices(void)
-{
- type_register_static(&prom_info);
-}
-
-device_init(prom_register_devices);
-
typedef struct RamDevice
{
SysBusDevice busdev;
@@ -827,13 +806,6 @@ static TypeInfo ram_info = {
.class_init = ram_class_init,
};
-static void ram_register_devices(void)
-{
- type_register_static(&ram_info);
-}
-
-device_init(ram_register_devices);
-
static void cpu_devinit(const char *cpu_model, unsigned int id,
uint64_t prom_addr, qemu_irq **cpu_irqs)
{
@@ -1865,6 +1837,14 @@ static QEMUMachine ss2_machine = {
.use_scsi = 1,
};
+static void sun4m_register_types(void)
+{
+ type_register_static(&idreg_info);
+ type_register_static(&afx_info);
+ type_register_static(&prom_info);
+ type_register_static(&ram_info);
+}
+
static void ss2_machine_init(void)
{
qemu_register_machine(&ss5_machine);
@@ -1881,4 +1861,5 @@ static void ss2_machine_init(void)
qemu_register_machine(&ss2_machine);
}
+type_init(sun4m_register_types)
machine_init(ss2_machine_init);
diff --git a/hw/sun4m_iommu.c b/hw/sun4m_iommu.c
index 727532cb09..ebefa91b7a 100644
--- a/hw/sun4m_iommu.c
+++ b/hw/sun4m_iommu.c
@@ -380,9 +380,9 @@ static TypeInfo iommu_info = {
.class_init = iommu_class_init,
};
-static void iommu_register_devices(void)
+static void iommu_register_types(void)
{
type_register_static(&iommu_info);
}
-device_init(iommu_register_devices)
+type_init(iommu_register_types)
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 79bbd495eb..423108f236 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -580,13 +580,6 @@ static TypeInfo ebus_info = {
.class_init = ebus_class_init,
};
-static void pci_ebus_register(void)
-{
- type_register_static(&ebus_info);
-}
-
-device_init(pci_ebus_register);
-
typedef struct PROMState {
SysBusDevice busdev;
MemoryRegion prom;
@@ -664,13 +657,6 @@ static TypeInfo prom_info = {
.class_init = prom_class_init,
};
-static void prom_register_devices(void)
-{
- type_register_static(&prom_info);
-}
-
-device_init(prom_register_devices);
-
typedef struct RamDevice
{
@@ -728,13 +714,6 @@ static TypeInfo ram_info = {
.class_init = ram_class_init,
};
-static void ram_register_devices(void)
-{
- type_register_static(&ram_info);
-}
-
-device_init(ram_register_devices);
-
static CPUState *cpu_devinit(const char *cpu_model, const struct hwdef *hwdef)
{
CPUState *env;
@@ -957,6 +936,13 @@ static QEMUMachine niagara_machine = {
.max_cpus = 1, // XXX for now
};
+static void sun4u_register_types(void)
+{
+ type_register_static(&ebus_info);
+ type_register_static(&prom_info);
+ type_register_static(&ram_info);
+}
+
static void sun4u_machine_init(void)
{
qemu_register_machine(&sun4u_machine);
@@ -964,4 +950,5 @@ static void sun4u_machine_init(void)
qemu_register_machine(&niagara_machine);
}
+type_init(sun4u_register_types)
machine_init(sun4u_machine_init);
diff --git a/hw/sysbus.c b/hw/sysbus.c
index 282060abb6..db4efccef4 100644
--- a/hw/sysbus.c
+++ b/hw/sysbus.c
@@ -256,9 +256,9 @@ static TypeInfo sysbus_device_type_info = {
.class_init = sysbus_device_class_init,
};
-static void sysbus_register(void)
+static void sysbus_register_types(void)
{
type_register_static(&sysbus_device_type_info);
}
-device_init(sysbus_register);
+type_init(sysbus_register_types)
diff --git a/hw/tcx.c b/hw/tcx.c
index ceb94c74a7..2b66d8619e 100644
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -664,9 +664,9 @@ static TypeInfo tcx_info = {
.class_init = tcx_class_init,
};
-static void tcx_register_devices(void)
+static void tcx_register_types(void)
{
type_register_static(&tcx_info);
}
-device_init(tcx_register_devices)
+type_init(tcx_register_types)
diff --git a/hw/tmp105.c b/hw/tmp105.c
index a3bdd91d40..8e8dbd94eb 100644
--- a/hw/tmp105.c
+++ b/hw/tmp105.c
@@ -245,9 +245,9 @@ static TypeInfo tmp105_info = {
.class_init = tmp105_class_init,
};
-static void tmp105_register_devices(void)
+static void tmp105_register_types(void)
{
type_register_static(&tmp105_info);
}
-device_init(tmp105_register_devices)
+type_init(tmp105_register_types)
diff --git a/hw/tosa.c b/hw/tosa.c
index c0d401759e..6baa17d6b5 100644
--- a/hw/tosa.c
+++ b/hw/tosa.c
@@ -291,10 +291,10 @@ static TypeInfo tosa_ssp_info = {
.class_init = tosa_ssp_class_init,
};
-static void tosa_register_devices(void)
+static void tosa_register_types(void)
{
type_register_static(&tosa_dac_info);
type_register_static(&tosa_ssp_info);
}
-device_init(tosa_register_devices)
+type_init(tosa_register_types)
diff --git a/hw/tusb6010.c b/hw/tusb6010.c
index 0ade670906..5ba8da6d6a 100644
--- a/hw/tusb6010.c
+++ b/hw/tusb6010.c
@@ -805,9 +805,9 @@ static TypeInfo tusb6010_info = {
.class_init = tusb6010_class_init,
};
-static void tusb6010_register_device(void)
+static void tusb6010_register_types(void)
{
type_register_static(&tusb6010_info);
}
-device_init(tusb6010_register_device)
+type_init(tusb6010_register_types)
diff --git a/hw/twl92230.c b/hw/twl92230.c
index 03fdccc8ce..873dc8f068 100644
--- a/hw/twl92230.c
+++ b/hw/twl92230.c
@@ -876,9 +876,9 @@ static TypeInfo twl92230_info = {
.class_init = twl92230_class_init,
};
-static void twl92230_register_devices(void)
+static void twl92230_register_types(void)
{
type_register_static(&twl92230_info);
}
-device_init(twl92230_register_devices)
+type_init(twl92230_register_types)
diff --git a/hw/unin_pci.c b/hw/unin_pci.c
index 17d86aac68..409bcd4cc6 100644
--- a/hw/unin_pci.c
+++ b/hw/unin_pci.c
@@ -467,7 +467,7 @@ static TypeInfo pci_unin_internal_info = {
.class_init = pci_unin_internal_class_init,
};
-static void unin_register_devices(void)
+static void unin_register_types(void)
{
type_register_static(&unin_main_pci_host_info);
type_register_static(&u3_agp_pci_host_info);
@@ -480,4 +480,4 @@ static void unin_register_devices(void)
type_register_static(&pci_unin_internal_info);
}
-device_init(unin_register_devices)
+type_init(unin_register_types)
diff --git a/hw/usb-audio.c b/hw/usb-audio.c
index c60aaff26d..fed136117b 100644
--- a/hw/usb-audio.c
+++ b/hw/usb-audio.c
@@ -705,10 +705,10 @@ static TypeInfo usb_audio_info = {
.class_init = usb_audio_class_init,
};
-static void usb_audio_register_devices(void)
+static void usb_audio_register_types(void)
{
type_register_static(&usb_audio_info);
usb_legacy_register("usb-audio", "audio", NULL);
}
-device_init(usb_audio_register_devices)
+type_init(usb_audio_register_types)
diff --git a/hw/usb-bt.c b/hw/usb-bt.c
index ea6a5a0c01..649bdcf2d7 100644
--- a/hw/usb-bt.c
+++ b/hw/usb-bt.c
@@ -549,8 +549,9 @@ static TypeInfo bt_info = {
.class_init = usb_bt_class_initfn,
};
-static void usb_bt_register_devices(void)
+static void usb_bt_register_types(void)
{
type_register_static(&bt_info);
}
-device_init(usb_bt_register_devices)
+
+type_init(usb_bt_register_types)
diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index e907d0db79..ae79a4527b 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -586,9 +586,9 @@ static TypeInfo usb_device_type_info = {
.class_init = usb_device_class_init,
};
-static void usb_register_devices(void)
+static void usb_register_types(void)
{
type_register_static(&usb_device_type_info);
}
-device_init(usb_register_devices);
+type_init(usb_register_types)
diff --git a/hw/usb-ccid.c b/hw/usb-ccid.c
index fda2d92a06..0b2ac8037a 100644
--- a/hw/usb-ccid.c
+++ b/hw/usb-ccid.c
@@ -1355,10 +1355,11 @@ static TypeInfo ccid_card_type_info = {
.class_init = ccid_card_class_init,
};
-static void ccid_register_devices(void)
+static void ccid_register_types(void)
{
type_register_static(&ccid_card_type_info);
type_register_static(&ccid_info);
usb_legacy_register(CCID_DEV_NAME, "ccid", NULL);
}
-device_init(ccid_register_devices)
+
+type_init(ccid_register_types)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index 6c01ca93a9..e699814305 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -2373,12 +2373,13 @@ static int usb_ehci_initfn(PCIDevice *dev)
return 0;
}
-static void ehci_register(void)
+static void ehci_register_types(void)
{
type_register_static(&ehci_info);
type_register_static(&ich9_ehci_info);
}
-device_init(ehci_register);
+
+type_init(ehci_register_types)
/*
* vim: expandtab ts=4
diff --git a/hw/usb-hid.c b/hw/usb-hid.c
index 53353d3c20..7fc0bd81aa 100644
--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -622,7 +622,7 @@ static TypeInfo usb_keyboard_info = {
.class_init = usb_keyboard_class_initfn,
};
-static void usb_hid_register_devices(void)
+static void usb_hid_register_types(void)
{
type_register_static(&usb_tablet_info);
usb_legacy_register("usb-tablet", "tablet", NULL);
@@ -631,4 +631,5 @@ static void usb_hid_register_devices(void)
type_register_static(&usb_keyboard_info);
usb_legacy_register("usb-kbd", "keyboard", NULL);
}
-device_init(usb_hid_register_devices)
+
+type_init(usb_hid_register_types)
diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 6d1ce065d9..a12856e2e9 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -541,8 +541,9 @@ static TypeInfo hub_info = {
.class_init = usb_hub_class_initfn,
};
-static void usb_hub_register_devices(void)
+static void usb_hub_register_types(void)
{
type_register_static(&hub_info);
}
-device_init(usb_hub_register_devices)
+
+type_init(usb_hub_register_types)
diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index aac1181fe8..c933efe19a 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -668,9 +668,10 @@ static TypeInfo msd_info = {
.class_init = usb_msd_class_initfn,
};
-static void usb_msd_register_devices(void)
+static void usb_msd_register_types(void)
{
type_register_static(&msd_info);
usb_legacy_register("usb-storage", "disk", usb_msd_init);
}
-device_init(usb_msd_register_devices)
+
+type_init(usb_msd_register_types)
diff --git a/hw/usb-net.c b/hw/usb-net.c
index 72c9185ba1..49d5d4db65 100644
--- a/hw/usb-net.c
+++ b/hw/usb-net.c
@@ -1414,9 +1414,10 @@ static TypeInfo net_info = {
.class_init = usb_net_class_initfn,
};
-static void usb_net_register_devices(void)
+static void usb_net_register_types(void)
{
type_register_static(&net_info);
usb_legacy_register("usb-net", "net", usb_net_init);
}
-device_init(usb_net_register_devices)
+
+type_init(usb_net_register_types)
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index ba7231f2df..7aa19fe781 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -1887,9 +1887,10 @@ static TypeInfo ohci_sysbus_info = {
.class_init = ohci_sysbus_class_init,
};
-static void ohci_register(void)
+static void ohci_register_types(void)
{
type_register_static(&ohci_pci_info);
type_register_static(&ohci_sysbus_info);
}
-device_init(ohci_register);
+
+type_init(ohci_register_types)
diff --git a/hw/usb-serial.c b/hw/usb-serial.c
index 1cfb551a05..52676e8f7b 100644
--- a/hw/usb-serial.c
+++ b/hw/usb-serial.c
@@ -626,11 +626,12 @@ static TypeInfo braille_info = {
.class_init = usb_braille_class_initfn,
};
-static void usb_serial_register_devices(void)
+static void usb_serial_register_types(void)
{
type_register_static(&serial_info);
usb_legacy_register("usb-serial", "serial", usb_serial_init);
type_register_static(&braille_info);
usb_legacy_register("usb-braille", "braille", usb_braille_init);
}
-device_init(usb_serial_register_devices)
+
+type_init(usb_serial_register_types)
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index ab64be6047..2280dc792d 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -1318,7 +1318,7 @@ static TypeInfo ich9_uhci3_info = {
.class_init = ich9_uhci3_class_init,
};
-static void uhci_register(void)
+static void uhci_register_types(void)
{
type_register_static(&piix3_uhci_info);
type_register_static(&piix4_uhci_info);
@@ -1327,7 +1327,8 @@ static void uhci_register(void)
type_register_static(&ich9_uhci2_info);
type_register_static(&ich9_uhci3_info);
}
-device_init(uhci_register);
+
+type_init(uhci_register_types)
void usb_uhci_piix3_init(PCIBus *bus, int devfn)
{
diff --git a/hw/usb-wacom.c b/hw/usb-wacom.c
index 73ff241d47..197e2dced5 100644
--- a/hw/usb-wacom.c
+++ b/hw/usb-wacom.c
@@ -372,9 +372,10 @@ static TypeInfo wacom_info = {
.class_init = usb_wacom_class_init,
};
-static void usb_wacom_register_devices(void)
+static void usb_wacom_register_types(void)
{
type_register_static(&wacom_info);
usb_legacy_register("usb-wacom-tablet", "wacom-tablet", NULL);
}
-device_init(usb_wacom_register_devices)
+
+type_init(usb_wacom_register_types)
diff --git a/hw/usb-xhci.c b/hw/usb-xhci.c
index ac7b12bc68..008b0b5718 100644
--- a/hw/usb-xhci.c
+++ b/hw/usb-xhci.c
@@ -2926,8 +2926,9 @@ static TypeInfo xhci_info = {
.class_init = xhci_class_init,
};
-static void xhci_register(void)
+static void xhci_register_types(void)
{
type_register_static(&xhci_info);
}
-device_init(xhci_register);
+
+type_init(xhci_register_types)
diff --git a/hw/versatile_pci.c b/hw/versatile_pci.c
index c4105e977b..ae53a8b37b 100644
--- a/hw/versatile_pci.c
+++ b/hw/versatile_pci.c
@@ -154,11 +154,11 @@ static TypeInfo pci_realview_info = {
.class_init = pci_realview_class_init,
};
-static void versatile_pci_register_devices(void)
+static void versatile_pci_register_types(void)
{
type_register_static(&pci_vpb_info);
type_register_static(&pci_realview_info);
type_register_static(&versatile_pci_host_info);
}
-device_init(versatile_pci_register_devices)
+type_init(versatile_pci_register_types)
diff --git a/hw/versatilepb.c b/hw/versatilepb.c
index 6ea0ce5fb3..1903db6435 100644
--- a/hw/versatilepb.c
+++ b/hw/versatilepb.c
@@ -382,9 +382,9 @@ static TypeInfo vpb_sic_info = {
.class_init = vpb_sic_class_init,
};
-static void versatilepb_register_devices(void)
+static void versatilepb_register_types(void)
{
type_register_static(&vpb_sic_info);
}
-device_init(versatilepb_register_devices)
+type_init(versatilepb_register_types)
diff --git a/hw/vga-isa.c b/hw/vga-isa.c
index 8d3ff0d47b..4bcc4db62f 100644
--- a/hw/vga-isa.c
+++ b/hw/vga-isa.c
@@ -85,8 +85,9 @@ static TypeInfo vga_info = {
.class_init = vga_class_initfn,
};
-static void vga_register(void)
+static void vga_register_types(void)
{
type_register_static(&vga_info);
}
-device_init(vga_register)
+
+type_init(vga_register_types)
diff --git a/hw/vga-pci.c b/hw/vga-pci.c
index 974a7a9d6f..465b643d21 100644
--- a/hw/vga-pci.c
+++ b/hw/vga-pci.c
@@ -96,8 +96,9 @@ static TypeInfo vga_info = {
.class_init = vga_class_init,
};
-static void vga_register(void)
+static void vga_register_types(void)
{
type_register_static(&vga_info);
}
-device_init(vga_register);
+
+type_init(vga_register_types)
diff --git a/hw/vga.c b/hw/vga.c
index d87c4f9f5b..c1029dbd9b 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1777,10 +1777,11 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
if (!(s->cr[VGA_CRTC_MODE] & 2)) {
addr = (addr & ~0x8000) | ((y1 & 2) << 14);
}
+ update = full_update;
page0 = addr;
page1 = addr + bwidth - 1;
- update = memory_region_get_dirty(&s->vram, page0, page1,
- DIRTY_MEMORY_VGA);
+ update |= memory_region_get_dirty(&s->vram, page0, page1 - page0,
+ DIRTY_MEMORY_VGA);
/* explicit invalidation for the hardware cursor */
update |= (s->invalidated_y_table[y >> 5] >> (y & 0x1f)) & 1;
if (update) {
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index 4f2c3e4379..cffee3d470 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -149,12 +149,6 @@ static TypeInfo virtconsole_info = {
.class_init = virtconsole_class_init,
};
-static void virtconsole_register(void)
-{
- type_register_static(&virtconsole_info);
-}
-device_init(virtconsole_register)
-
static Property virtserialport_properties[] = {
DEFINE_PROP_CHR("chardev", VirtConsole, chr),
DEFINE_PROP_END_OF_LIST(),
@@ -179,8 +173,10 @@ static TypeInfo virtserialport_info = {
.class_init = virtserialport_class_init,
};
-static void virtserialport_register(void)
+static void virtconsole_register_types(void)
{
+ type_register_static(&virtconsole_info);
type_register_static(&virtserialport_info);
}
-device_init(virtserialport_register)
+
+type_init(virtconsole_register_types)
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 93fff54782..907b52a25d 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -930,7 +930,7 @@ static TypeInfo virtio_balloon_info = {
.class_init = virtio_balloon_class_init,
};
-static void virtio_pci_register_devices(void)
+static void virtio_pci_register_types(void)
{
type_register_static(&virtio_blk_info);
type_register_static(&virtio_net_info);
@@ -938,4 +938,4 @@ static void virtio_pci_register_devices(void)
type_register_static(&virtio_balloon_info);
}
-device_init(virtio_pci_register_devices)
+type_init(virtio_pci_register_types)
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 61176299a3..e22940ecb2 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -949,9 +949,9 @@ static TypeInfo virtio_serial_port_type_info = {
.class_init = virtio_serial_port_class_init,
};
-static void virtio_serial_register_devices(void)
+static void virtio_serial_register_types(void)
{
type_register_static(&virtio_serial_port_type_info);
}
-device_init(virtio_serial_register_devices);
+type_init(virtio_serial_register_types)
diff --git a/hw/vmmouse.c b/hw/vmmouse.c
index fda4f89a76..6338efa1c3 100644
--- a/hw/vmmouse.c
+++ b/hw/vmmouse.c
@@ -294,8 +294,9 @@ static TypeInfo vmmouse_info = {
.class_init = vmmouse_class_initfn,
};
-static void vmmouse_dev_register(void)
+static void vmmouse_register_types(void)
{
type_register_static(&vmmouse_info);
}
-device_init(vmmouse_dev_register)
+
+type_init(vmmouse_register_types)
diff --git a/hw/vmport.c b/hw/vmport.c
index a2c45e1950..9373be9775 100644
--- a/hw/vmport.c
+++ b/hw/vmport.c
@@ -159,8 +159,9 @@ static TypeInfo vmport_info = {
.class_init = vmport_class_initfn,
};
-static void vmport_dev_register(void)
+static void vmport_register_types(void)
{
type_register_static(&vmport_info);
}
-device_init(vmport_dev_register)
+
+type_init(vmport_register_types)
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index 3f3eb21d02..f8afa3c367 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -1223,8 +1223,9 @@ static TypeInfo vmsvga_info = {
.class_init = vmsvga_class_init,
};
-static void vmsvga_register(void)
+static void vmsvga_register_types(void)
{
type_register_static(&vmsvga_info);
}
-device_init(vmsvga_register);
+
+type_init(vmsvga_register_types)
diff --git a/hw/vt82c686.c b/hw/vt82c686.c
index aa0954f487..fbab0bbc07 100644
--- a/hw/vt82c686.c
+++ b/hw/vt82c686.c
@@ -366,13 +366,6 @@ static TypeInfo via_ac97_info = {
.class_init = via_ac97_class_init,
};
-static void vt82c686b_ac97_register(void)
-{
- type_register_static(&via_ac97_info);
-}
-
-device_init(vt82c686b_ac97_register);
-
static int vt82c686b_mc97_initfn(PCIDevice *dev)
{
VT686MC97State *s = DO_UPCAST(VT686MC97State, dev, dev);
@@ -414,13 +407,6 @@ static TypeInfo via_mc97_info = {
.class_init = via_mc97_class_init,
};
-static void vt82c686b_mc97_register(void)
-{
- type_register_static(&via_mc97_info);
-}
-
-device_init(vt82c686b_mc97_register);
-
/* vt82c686 pm init */
static int vt82c686b_pm_initfn(PCIDevice *dev)
{
@@ -497,13 +483,6 @@ static TypeInfo via_pm_info = {
.class_init = via_pm_class_init,
};
-static void vt82c686b_pm_register(void)
-{
- type_register_static(&via_pm_info);
-}
-
-device_init(vt82c686b_pm_register);
-
static const VMStateDescription vmstate_via = {
.name = "vt82c686b",
.version_id = 1,
@@ -571,8 +550,12 @@ static TypeInfo via_info = {
.class_init = via_class_init,
};
-static void vt82c686b_register(void)
+static void vt82c686b_register_types(void)
{
+ type_register_static(&via_ac97_info);
+ type_register_static(&via_mc97_info);
+ type_register_static(&via_pm_info);
type_register_static(&via_info);
}
-device_init(vt82c686b_register);
+
+type_init(vt82c686b_register_types)
diff --git a/hw/wdt_i6300esb.c b/hw/wdt_i6300esb.c
index 41325f0955..15c69db932 100644
--- a/hw/wdt_i6300esb.c
+++ b/hw/wdt_i6300esb.c
@@ -448,10 +448,10 @@ static TypeInfo i6300esb_info = {
.class_init = i6300esb_class_init,
};
-static void i6300esb_register_devices(void)
+static void i6300esb_register_types(void)
{
watchdog_add_model(&model);
type_register_static(&i6300esb_info);
}
-device_init(i6300esb_register_devices);
+type_init(i6300esb_register_types)
diff --git a/hw/wdt_ib700.c b/hw/wdt_ib700.c
index 8faa2316c9..7f6c21d809 100644
--- a/hw/wdt_ib700.c
+++ b/hw/wdt_ib700.c
@@ -136,10 +136,10 @@ static TypeInfo wdt_ib700_info = {
.class_init = wdt_ib700_class_init,
};
-static void wdt_ib700_register_devices(void)
+static void wdt_ib700_register_types(void)
{
watchdog_add_model(&model);
type_register_static(&wdt_ib700_info);
}
-device_init(wdt_ib700_register_devices);
+type_init(wdt_ib700_register_types)
diff --git a/hw/wm8750.c b/hw/wm8750.c
index 18afa4c1ac..11bcec3410 100644
--- a/hw/wm8750.c
+++ b/hw/wm8750.c
@@ -708,9 +708,9 @@ static TypeInfo wm8750_info = {
.class_init = wm8750_class_init,
};
-static void wm8750_register_devices(void)
+static void wm8750_register_types(void)
{
type_register_static(&wm8750_info);
}
-device_init(wm8750_register_devices)
+type_init(wm8750_register_types)
diff --git a/hw/xen_platform.c b/hw/xen_platform.c
index e7571022e4..5a7c4cc97b 100644
--- a/hw/xen_platform.c
+++ b/hw/xen_platform.c
@@ -396,9 +396,9 @@ static TypeInfo xen_platform_info = {
.class_init = xen_platform_class_init,
};
-static void xen_platform_register(void)
+static void xen_platform_register_types(void)
{
type_register_static(&xen_platform_info);
}
-device_init(xen_platform_register);
+type_init(xen_platform_register_types)
diff --git a/hw/xgmac.c b/hw/xgmac.c
index d395b1cc2d..dd4bdc46f5 100644
--- a/hw/xgmac.c
+++ b/hw/xgmac.c
@@ -425,9 +425,9 @@ static TypeInfo xgmac_enet_info = {
.class_init = xgmac_enet_class_init,
};
-static void xgmac_enet_register(void)
+static void xgmac_enet_register_types(void)
{
type_register_static(&xgmac_enet_info);
}
-device_init(xgmac_enet_register)
+type_init(xgmac_enet_register_types)
diff --git a/hw/xilinx_axidma.c b/hw/xilinx_axidma.c
index e8a53123f9..85dfcbf2b9 100644
--- a/hw/xilinx_axidma.c
+++ b/hw/xilinx_axidma.c
@@ -508,9 +508,9 @@ static TypeInfo axidma_info = {
.class_init = axidma_class_init,
};
-static void xilinx_axidma_register(void)
+static void xilinx_axidma_register_types(void)
{
type_register_static(&axidma_info);
}
-device_init(xilinx_axidma_register)
+type_init(xilinx_axidma_register_types)
diff --git a/hw/xilinx_axienet.c b/hw/xilinx_axienet.c
index 1ce2db4510..7526273b4d 100644
--- a/hw/xilinx_axienet.c
+++ b/hw/xilinx_axienet.c
@@ -894,9 +894,10 @@ static TypeInfo xilinx_enet_info = {
.instance_size = sizeof(struct XilinxAXIEnet),
.class_init = xilinx_enet_class_init,
};
-static void xilinx_enet_register(void)
+
+static void xilinx_enet_register_types(void)
{
type_register_static(&xilinx_enet_info);
}
-device_init(xilinx_enet_register)
+type_init(xilinx_enet_register_types)
diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c
index 499feef488..857b33d172 100644
--- a/hw/xilinx_ethlite.c
+++ b/hw/xilinx_ethlite.c
@@ -249,9 +249,9 @@ static TypeInfo xilinx_ethlite_info = {
.class_init = xilinx_ethlite_class_init,
};
-static void xilinx_ethlite_register(void)
+static void xilinx_ethlite_register_types(void)
{
type_register_static(&xilinx_ethlite_info);
}
-device_init(xilinx_ethlite_register)
+type_init(xilinx_ethlite_register_types)
diff --git a/hw/xilinx_intc.c b/hw/xilinx_intc.c
index 73eed6dc5f..553f8488f6 100644
--- a/hw/xilinx_intc.c
+++ b/hw/xilinx_intc.c
@@ -182,9 +182,9 @@ static TypeInfo xilinx_intc_info = {
.class_init = xilinx_intc_class_init,
};
-static void xilinx_intc_register(void)
+static void xilinx_intc_register_types(void)
{
type_register_static(&xilinx_intc_info);
}
-device_init(xilinx_intc_register)
+type_init(xilinx_intc_register_types)
diff --git a/hw/xilinx_timer.c b/hw/xilinx_timer.c
index c8236d2e2a..3ab2f2bb03 100644
--- a/hw/xilinx_timer.c
+++ b/hw/xilinx_timer.c
@@ -241,9 +241,9 @@ static TypeInfo xilinx_timer_info = {
.class_init = xilinx_timer_class_init,
};
-static void xilinx_timer_register(void)
+static void xilinx_timer_register_types(void)
{
type_register_static(&xilinx_timer_info);
}
-device_init(xilinx_timer_register)
+type_init(xilinx_timer_register_types)
diff --git a/hw/xilinx_uartlite.c b/hw/xilinx_uartlite.c
index 1c2b9087b4..aa0170db49 100644
--- a/hw/xilinx_uartlite.c
+++ b/hw/xilinx_uartlite.c
@@ -225,9 +225,9 @@ static TypeInfo xilinx_uartlite_info = {
.class_init = xilinx_uartlite_class_init,
};
-static void xilinx_uart_register(void)
+static void xilinx_uart_register_types(void)
{
type_register_static(&xilinx_uartlite_info);
}
-device_init(xilinx_uart_register)
+type_init(xilinx_uart_register_types)
diff --git a/hw/xio3130_downstream.c b/hw/xio3130_downstream.c
index 07e4fc1018..319624f212 100644
--- a/hw/xio3130_downstream.c
+++ b/hw/xio3130_downstream.c
@@ -203,12 +203,12 @@ static TypeInfo xio3130_downstream_info = {
.class_init = xio3130_downstream_class_init,
};
-static void xio3130_downstream_register(void)
+static void xio3130_downstream_register_types(void)
{
type_register_static(&xio3130_downstream_info);
}
-device_init(xio3130_downstream_register);
+type_init(xio3130_downstream_register_types)
/*
* Local variables:
diff --git a/hw/xio3130_upstream.c b/hw/xio3130_upstream.c
index 7887c92fcc..34a99bba08 100644
--- a/hw/xio3130_upstream.c
+++ b/hw/xio3130_upstream.c
@@ -177,12 +177,12 @@ static TypeInfo xio3130_upstream_info = {
.class_init = xio3130_upstream_class_init,
};
-static void xio3130_upstream_register(void)
+static void xio3130_upstream_register_types(void)
{
type_register_static(&xio3130_upstream_info);
}
-device_init(xio3130_upstream_register);
+type_init(xio3130_upstream_register_types)
/*
diff --git a/hw/zaurus.c b/hw/zaurus.c
index 055df9b4e2..72838ec440 100644
--- a/hw/zaurus.c
+++ b/hw/zaurus.c
@@ -243,11 +243,12 @@ static TypeInfo scoop_sysbus_info = {
.class_init = scoop_sysbus_class_init,
};
-static void scoop_register(void)
+static void scoop_register_types(void)
{
type_register_static(&scoop_sysbus_info);
}
-device_init(scoop_register);
+
+type_init(scoop_register_types)
/* Write the bootloader parameters memory area. */