qdev: register all types natively through QEMU Object Model
This was done in a mostly automated fashion. I did it in three steps and then rebased it into a single step which avoids repeatedly touching every file in the tree. The first step was a sed-based addition of the parent type to the subclass registration functions. The second step was another sed-based removal of subclass registration functions while also adding virtual functions from the base class into a class_init function as appropriate. Finally, a python script was used to convert the DeviceInfo structures and qdev_register_subclass functions to TypeInfo structures, class_init functions, and type_register_static calls. We are almost fully converted to QOM after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
212ad11168
commit
39bffca203
@ -174,6 +174,7 @@ static Property virtio_9p_properties[] = {
|
||||
|
||||
static void virtio_9p_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = virtio_9p_init_pci;
|
||||
@ -181,19 +182,20 @@ static void virtio_9p_class_init(ObjectClass *klass, void *data)
|
||||
k->device_id = 0x1009;
|
||||
k->revision = VIRTIO_PCI_ABI_VERSION;
|
||||
k->class_id = 0x2;
|
||||
dc->props = virtio_9p_properties;
|
||||
dc->reset = virtio_pci_reset;
|
||||
}
|
||||
|
||||
static DeviceInfo virtio_9p_info = {
|
||||
.name = "virtio-9p-pci",
|
||||
.size = sizeof(VirtIOPCIProxy),
|
||||
.props = virtio_9p_properties,
|
||||
.class_init = virtio_9p_class_init,
|
||||
.reset = virtio_pci_reset,
|
||||
static TypeInfo virtio_9p_info = {
|
||||
.name = "virtio-9p-pci",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(VirtIOPCIProxy),
|
||||
.class_init = virtio_9p_class_init,
|
||||
};
|
||||
|
||||
static void virtio_9p_register_devices(void)
|
||||
{
|
||||
pci_qdev_register(&virtio_9p_info);
|
||||
type_register_static(&virtio_9p_info);
|
||||
virtio_9p_set_fd_limit();
|
||||
}
|
||||
|
||||
|
@ -208,35 +208,39 @@ static const VMStateDescription vmstate_a9mp_priv = {
|
||||
}
|
||||
};
|
||||
|
||||
static Property a9mp_priv_properties[] = {
|
||||
DEFINE_PROP_UINT32("num-cpu", a9mp_priv_state, num_cpu, 1),
|
||||
/* The Cortex-A9MP may have anything from 0 to 224 external interrupt
|
||||
* IRQ lines (with another 32 internal). We default to 64+32, which
|
||||
* is the number provided by the Cortex-A9MP test chip in the
|
||||
* Realview PBX-A9 and Versatile Express A9 development boards.
|
||||
* Other boards may differ and should set this property appropriately.
|
||||
*/
|
||||
DEFINE_PROP_UINT32("num-irq", a9mp_priv_state, num_irq, 96),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void a9mp_priv_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = a9mp_priv_init;
|
||||
dc->props = a9mp_priv_properties;
|
||||
dc->vmsd = &vmstate_a9mp_priv;
|
||||
dc->reset = a9mp_priv_reset;
|
||||
}
|
||||
|
||||
static DeviceInfo a9mp_priv_info = {
|
||||
.name = "a9mpcore_priv",
|
||||
.size = sizeof(a9mp_priv_state),
|
||||
.vmsd = &vmstate_a9mp_priv,
|
||||
.reset = a9mp_priv_reset,
|
||||
.class_init = a9mp_priv_class_init,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_UINT32("num-cpu", a9mp_priv_state, num_cpu, 1),
|
||||
/* The Cortex-A9MP may have anything from 0 to 224 external interrupt
|
||||
* IRQ lines (with another 32 internal). We default to 64+32, which
|
||||
* is the number provided by the Cortex-A9MP test chip in the
|
||||
* Realview PBX-A9 and Versatile Express A9 development boards.
|
||||
* Other boards may differ and should set this property appropriately.
|
||||
*/
|
||||
DEFINE_PROP_UINT32("num-irq", a9mp_priv_state, num_irq, 96),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
}
|
||||
static TypeInfo a9mp_priv_info = {
|
||||
.name = "a9mpcore_priv",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(a9mp_priv_state),
|
||||
.class_init = a9mp_priv_class_init,
|
||||
};
|
||||
|
||||
static void a9mp_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&a9mp_priv_info);
|
||||
type_register_static(&a9mp_priv_info);
|
||||
}
|
||||
|
||||
device_init(a9mp_register_devices)
|
||||
|
18
hw/ac97.c
18
hw/ac97.c
@ -1351,6 +1351,7 @@ static Property ac97_properties[] = {
|
||||
|
||||
static void ac97_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = ac97_initfn;
|
||||
@ -1359,20 +1360,21 @@ static void ac97_class_init(ObjectClass *klass, void *data)
|
||||
k->device_id = PCI_DEVICE_ID_INTEL_82801AA_5;
|
||||
k->revision = 0x01;
|
||||
k->class_id = PCI_CLASS_MULTIMEDIA_AUDIO;
|
||||
dc->desc = "Intel 82801AA AC97 Audio";
|
||||
dc->vmsd = &vmstate_ac97;
|
||||
dc->props = ac97_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo ac97_info = {
|
||||
.name = "AC97",
|
||||
.desc = "Intel 82801AA AC97 Audio",
|
||||
.size = sizeof (AC97LinkState),
|
||||
.vmsd = &vmstate_ac97,
|
||||
.props = ac97_properties,
|
||||
.class_init = ac97_class_init,
|
||||
static TypeInfo ac97_info = {
|
||||
.name = "AC97",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof (AC97LinkState),
|
||||
.class_init = ac97_class_init,
|
||||
};
|
||||
|
||||
static void ac97_register (void)
|
||||
{
|
||||
pci_qdev_register (&ac97_info);
|
||||
type_register_static(&ac97_info);
|
||||
}
|
||||
device_init (ac97_register);
|
||||
|
||||
|
@ -403,6 +403,7 @@ static Property piix4_pm_properties[] = {
|
||||
|
||||
static void piix4_pm_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->no_hotplug = 1;
|
||||
@ -412,21 +413,22 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data)
|
||||
k->device_id = PCI_DEVICE_ID_INTEL_82371AB_3;
|
||||
k->revision = 0x03;
|
||||
k->class_id = PCI_CLASS_BRIDGE_OTHER;
|
||||
dc->desc = "PM";
|
||||
dc->no_user = 1;
|
||||
dc->vmsd = &vmstate_acpi;
|
||||
dc->props = piix4_pm_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo piix4_pm_info = {
|
||||
.name = "PIIX4_PM",
|
||||
.desc = "PM",
|
||||
.size = sizeof(PIIX4PMState),
|
||||
.vmsd = &vmstate_acpi,
|
||||
.no_user = 1,
|
||||
.props = piix4_pm_properties,
|
||||
.class_init = piix4_pm_class_init,
|
||||
static TypeInfo piix4_pm_info = {
|
||||
.name = "PIIX4_PM",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PIIX4PMState),
|
||||
.class_init = piix4_pm_class_init,
|
||||
};
|
||||
|
||||
static void piix4_pm_register(void)
|
||||
{
|
||||
pci_qdev_register(&piix4_pm_info);
|
||||
type_register_static(&piix4_pm_info);
|
||||
}
|
||||
|
||||
device_init(piix4_pm_register);
|
||||
|
11
hw/ads7846.c
11
hw/ads7846.c
@ -161,15 +161,16 @@ static void ads7846_class_init(ObjectClass *klass, void *data)
|
||||
k->transfer = ads7846_transfer;
|
||||
}
|
||||
|
||||
static DeviceInfo ads7846_info = {
|
||||
.name = "ads7846",
|
||||
.size = sizeof(ADS7846State),
|
||||
.class_init = ads7846_class_init,
|
||||
static TypeInfo ads7846_info = {
|
||||
.name = "ads7846",
|
||||
.parent = TYPE_SSI_SLAVE,
|
||||
.instance_size = sizeof(ADS7846State),
|
||||
.class_init = ads7846_class_init,
|
||||
};
|
||||
|
||||
static void ads7846_register_devices(void)
|
||||
{
|
||||
ssi_register_slave(&ads7846_info);
|
||||
type_register_static(&ads7846_info);
|
||||
}
|
||||
|
||||
device_init(ads7846_register_devices)
|
||||
|
@ -810,20 +810,22 @@ static int typhoon_pcihost_init(SysBusDevice *dev)
|
||||
|
||||
static void typhoon_pcihost_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = typhoon_pcihost_init;
|
||||
dc->no_user = 1;
|
||||
}
|
||||
|
||||
static DeviceInfo typhoon_pcihost_info = {
|
||||
.name = "typhoon-pcihost",
|
||||
.size = sizeof(TyphoonState),
|
||||
.no_user = 1,
|
||||
.class_init = typhoon_pcihost_class_init,
|
||||
static TypeInfo typhoon_pcihost_info = {
|
||||
.name = "typhoon-pcihost",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(TyphoonState),
|
||||
.class_init = typhoon_pcihost_class_init,
|
||||
};
|
||||
|
||||
static void typhoon_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&typhoon_pcihost_info);
|
||||
type_register_static(&typhoon_pcihost_info);
|
||||
}
|
||||
device_init(typhoon_register);
|
||||
|
41
hw/apb_pci.c
41
hw/apb_pci.c
@ -447,28 +447,32 @@ static void pbm_pci_host_class_init(ObjectClass *klass, void *data)
|
||||
k->is_bridge = 1;
|
||||
}
|
||||
|
||||
static DeviceInfo pbm_pci_host_info = {
|
||||
.name = "pbm-pci",
|
||||
.size = sizeof(PCIDevice),
|
||||
.class_init = pbm_pci_host_class_init,
|
||||
static TypeInfo pbm_pci_host_info = {
|
||||
.name = "pbm-pci",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIDevice),
|
||||
.class_init = pbm_pci_host_class_init,
|
||||
};
|
||||
|
||||
static void pbm_host_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = pci_pbm_init_device;
|
||||
dc->reset = pci_pbm_reset;
|
||||
}
|
||||
|
||||
static DeviceInfo pbm_host_info = {
|
||||
.name = "pbm",
|
||||
.size = sizeof(APBState),
|
||||
.reset = pci_pbm_reset,
|
||||
.class_init = pbm_host_class_init,
|
||||
static TypeInfo pbm_host_info = {
|
||||
.name = "pbm",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(APBState),
|
||||
.class_init = pbm_host_class_init,
|
||||
};
|
||||
|
||||
static void pbm_pci_bridge_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = apb_pci_bridge_initfn;
|
||||
@ -478,21 +482,22 @@ static void pbm_pci_bridge_class_init(ObjectClass *klass, void *data)
|
||||
k->revision = 0x11;
|
||||
k->config_write = pci_bridge_write_config;
|
||||
k->is_bridge = 1;
|
||||
dc->reset = pci_bridge_reset;
|
||||
dc->vmsd = &vmstate_pci_device;
|
||||
}
|
||||
|
||||
static DeviceInfo pbm_pci_bridge_info = {
|
||||
.name = "pbm-bridge",
|
||||
.size = sizeof(PCIBridge),
|
||||
.vmsd = &vmstate_pci_device,
|
||||
.reset = pci_bridge_reset,
|
||||
.class_init = pbm_pci_bridge_class_init,
|
||||
static TypeInfo pbm_pci_bridge_info = {
|
||||
.name = "pbm-bridge",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIBridge),
|
||||
.class_init = pbm_pci_bridge_class_init,
|
||||
};
|
||||
|
||||
static void pbm_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&pbm_host_info);
|
||||
pci_qdev_register(&pbm_pci_host_info);
|
||||
pci_qdev_register(&pbm_pci_bridge_info);
|
||||
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)
|
||||
|
10
hw/apic.c
10
hw/apic.c
@ -774,14 +774,16 @@ static void apic_class_init(ObjectClass *klass, void *data)
|
||||
k->post_load = apic_post_load;
|
||||
}
|
||||
|
||||
static DeviceInfo apic_info = {
|
||||
.name = "apic",
|
||||
.class_init = apic_class_init,
|
||||
static TypeInfo apic_info = {
|
||||
.name = "apic",
|
||||
.instance_size = sizeof(APICCommonState),
|
||||
.parent = TYPE_APIC_COMMON,
|
||||
.class_init = apic_class_init,
|
||||
};
|
||||
|
||||
static void apic_register_devices(void)
|
||||
{
|
||||
apic_qdev_register(&apic_info);
|
||||
type_register_static(&apic_info);
|
||||
}
|
||||
|
||||
device_init(apic_register_devices)
|
||||
|
@ -295,7 +295,12 @@ static Property apic_properties_common[] = {
|
||||
static void apic_common_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
SysBusDeviceClass *sc = SYS_BUS_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->vmsd = &vmstate_apic_common;
|
||||
dc->reset = apic_reset_common;
|
||||
dc->no_user = 1;
|
||||
dc->props = apic_properties_common;
|
||||
sc->init = apic_init_common;
|
||||
}
|
||||
|
||||
@ -308,16 +313,6 @@ static TypeInfo apic_common_type = {
|
||||
.abstract = true,
|
||||
};
|
||||
|
||||
void apic_qdev_register(DeviceInfo *info)
|
||||
{
|
||||
info->size = sizeof(APICCommonState),
|
||||
info->vmsd = &vmstate_apic_common;
|
||||
info->reset = apic_reset_common;
|
||||
info->no_user = 1;
|
||||
info->props = apic_properties_common;
|
||||
sysbus_qdev_register_subclass(info, TYPE_APIC_COMMON);
|
||||
}
|
||||
|
||||
static void register_devices(void)
|
||||
{
|
||||
type_register_static(&apic_common_type);
|
||||
|
@ -117,7 +117,6 @@ struct APICCommonState {
|
||||
};
|
||||
|
||||
void apic_report_irq_delivered(int delivered);
|
||||
void apic_qdev_register(DeviceInfo *info);
|
||||
bool apic_next_timer(APICCommonState *s, int64_t current_time);
|
||||
|
||||
#endif /* !QEMU_APIC_INTERNAL_H */
|
||||
|
@ -220,28 +220,32 @@ static int applesmc_isa_init(ISADevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property applesmc_isa_properties[] = {
|
||||
DEFINE_PROP_HEX32("iobase", struct AppleSMCStatus, iobase,
|
||||
APPLESMC_DEFAULT_IOBASE),
|
||||
DEFINE_PROP_STRING("osk", struct AppleSMCStatus, osk),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void qdev_applesmc_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
|
||||
ic->init = applesmc_isa_init;
|
||||
dc->reset = qdev_applesmc_isa_reset;
|
||||
dc->props = applesmc_isa_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo applesmc_isa_info = {
|
||||
.name = "isa-applesmc",
|
||||
.size = sizeof(struct AppleSMCStatus),
|
||||
.reset = qdev_applesmc_isa_reset,
|
||||
.class_init = qdev_applesmc_class_init,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_HEX32("iobase", struct AppleSMCStatus, iobase,
|
||||
APPLESMC_DEFAULT_IOBASE),
|
||||
DEFINE_PROP_STRING("osk", struct AppleSMCStatus, osk),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
},
|
||||
static TypeInfo applesmc_isa_info = {
|
||||
.name = "isa-applesmc",
|
||||
.parent = TYPE_ISA_DEVICE,
|
||||
.instance_size = sizeof(struct AppleSMCStatus),
|
||||
.class_init = qdev_applesmc_class_init,
|
||||
};
|
||||
|
||||
static void applesmc_register_devices(void)
|
||||
{
|
||||
isa_qdev_register(&applesmc_isa_info);
|
||||
type_register_static(&applesmc_isa_info);
|
||||
}
|
||||
|
||||
device_init(applesmc_register_devices)
|
||||
|
@ -217,16 +217,18 @@ static Property mpcore_rirq_properties[] = {
|
||||
|
||||
static void mpcore_rirq_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = realview_mpcore_init;
|
||||
dc->props = mpcore_rirq_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo mpcore_rirq_info = {
|
||||
.name = "realview_mpcore",
|
||||
.size = sizeof(mpcore_rirq_state),
|
||||
.props = mpcore_rirq_properties,
|
||||
.class_init = mpcore_rirq_class_init,
|
||||
static TypeInfo mpcore_rirq_info = {
|
||||
.name = "realview_mpcore",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(mpcore_rirq_state),
|
||||
.class_init = mpcore_rirq_class_init,
|
||||
};
|
||||
|
||||
static Property mpcore_priv_properties[] = {
|
||||
@ -236,22 +238,24 @@ static Property mpcore_priv_properties[] = {
|
||||
|
||||
static void mpcore_priv_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = mpcore_priv_init;
|
||||
dc->props = mpcore_priv_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo mpcore_priv_info = {
|
||||
.name = "arm11mpcore_priv",
|
||||
.size = sizeof(mpcore_priv_state),
|
||||
.props = mpcore_priv_properties,
|
||||
.class_init = mpcore_priv_class_init,
|
||||
static TypeInfo mpcore_priv_info = {
|
||||
.name = "arm11mpcore_priv",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(mpcore_priv_state),
|
||||
.class_init = mpcore_priv_class_init,
|
||||
};
|
||||
|
||||
static void arm11mpcore_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&mpcore_rirq_info);
|
||||
sysbus_register_withprop(&mpcore_priv_info);
|
||||
type_register_static(&mpcore_rirq_info);
|
||||
type_register_static(&mpcore_priv_info);
|
||||
}
|
||||
|
||||
device_init(arm11mpcore_register_devices)
|
||||
|
@ -160,29 +160,33 @@ static int l2x0_priv_init(SysBusDevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property l2x0_properties[] = {
|
||||
DEFINE_PROP_UINT32("type", l2x0_state, cache_type, 0x1c100100),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void l2x0_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = l2x0_priv_init;
|
||||
dc->vmsd = &vmstate_l2x0;
|
||||
dc->no_user = 1;
|
||||
dc->props = l2x0_properties;
|
||||
dc->reset = l2x0_priv_reset;
|
||||
}
|
||||
|
||||
static DeviceInfo l2x0_info = {
|
||||
static TypeInfo l2x0_info = {
|
||||
.name = "l2x0",
|
||||
.size = sizeof(l2x0_state),
|
||||
.vmsd = &vmstate_l2x0,
|
||||
.no_user = 1,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_UINT32("type", l2x0_state, cache_type, 0x1c100100),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
},
|
||||
.reset = l2x0_priv_reset,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(l2x0_state),
|
||||
.class_init = l2x0_class_init,
|
||||
};
|
||||
|
||||
static void l2x0_register_device(void)
|
||||
{
|
||||
sysbus_qdev_register(&l2x0_info);
|
||||
type_register_static(&l2x0_info);
|
||||
}
|
||||
|
||||
device_init(l2x0_register_device)
|
||||
|
@ -311,29 +311,33 @@ static const VMStateDescription vmstate_arm_mptimer = {
|
||||
}
|
||||
};
|
||||
|
||||
static Property arm_mptimer_properties[] = {
|
||||
DEFINE_PROP_UINT32("num-cpu", arm_mptimer_state, num_cpu, 0),
|
||||
DEFINE_PROP_END_OF_LIST()
|
||||
};
|
||||
|
||||
static void arm_mptimer_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
sbc->init = arm_mptimer_init;
|
||||
dc->vmsd = &vmstate_arm_mptimer;
|
||||
dc->reset = arm_mptimer_reset;
|
||||
dc->no_user = 1;
|
||||
dc->props = arm_mptimer_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo arm_mptimer_info = {
|
||||
.name = "arm_mptimer",
|
||||
.size = sizeof(arm_mptimer_state),
|
||||
.vmsd = &vmstate_arm_mptimer,
|
||||
.reset = arm_mptimer_reset,
|
||||
.no_user = 1,
|
||||
.class_init = arm_mptimer_class_init,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_UINT32("num-cpu", arm_mptimer_state, num_cpu, 0),
|
||||
DEFINE_PROP_END_OF_LIST()
|
||||
}
|
||||
static TypeInfo arm_mptimer_info = {
|
||||
.name = "arm_mptimer",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(arm_mptimer_state),
|
||||
.class_init = arm_mptimer_class_init,
|
||||
};
|
||||
|
||||
static void arm_mptimer_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&arm_mptimer_info);
|
||||
type_register_static(&arm_mptimer_info);
|
||||
}
|
||||
|
||||
device_init(arm_mptimer_register_devices)
|
||||
|
@ -409,23 +409,25 @@ static Property arm_sysctl_properties[] = {
|
||||
|
||||
static void arm_sysctl_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = arm_sysctl_init1;
|
||||
dc->reset = arm_sysctl_reset;
|
||||
dc->vmsd = &vmstate_arm_sysctl;
|
||||
dc->props = arm_sysctl_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo arm_sysctl_info = {
|
||||
.name = "realview_sysctl",
|
||||
.size = sizeof(arm_sysctl_state),
|
||||
.vmsd = &vmstate_arm_sysctl,
|
||||
.reset = arm_sysctl_reset,
|
||||
.props = arm_sysctl_properties,
|
||||
.class_init = arm_sysctl_class_init,
|
||||
static TypeInfo arm_sysctl_info = {
|
||||
.name = "realview_sysctl",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(arm_sysctl_state),
|
||||
.class_init = arm_sysctl_class_init,
|
||||
};
|
||||
|
||||
static void arm_sysctl_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&arm_sysctl_info);
|
||||
type_register_static(&arm_sysctl_info);
|
||||
}
|
||||
|
||||
device_init(arm_sysctl_register_devices)
|
||||
|
@ -354,34 +354,39 @@ static void icp_pit_class_init(ObjectClass *klass, void *data)
|
||||
sdc->init = icp_pit_init;
|
||||
}
|
||||
|
||||
static DeviceInfo icp_pit_info = {
|
||||
.name = "integrator_pit",
|
||||
.size = sizeof(icp_pit_state),
|
||||
.class_init = icp_pit_class_init,
|
||||
static TypeInfo icp_pit_info = {
|
||||
.name = "integrator_pit",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(icp_pit_state),
|
||||
.class_init = icp_pit_class_init,
|
||||
};
|
||||
|
||||
static Property sp804_properties[] = {
|
||||
DEFINE_PROP_UINT32("freq0", sp804_state, freq0, 1000000),
|
||||
DEFINE_PROP_UINT32("freq1", sp804_state, freq1, 1000000),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void sp804_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
|
||||
DeviceClass *k = DEVICE_CLASS(klass);
|
||||
|
||||
sdc->init = sp804_init;
|
||||
k->props = sp804_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo sp804_info = {
|
||||
.name = "sp804",
|
||||
.size = sizeof(sp804_state),
|
||||
.class_init = sp804_class_init,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_UINT32("freq0", sp804_state, freq0, 1000000),
|
||||
DEFINE_PROP_UINT32("freq1", sp804_state, freq1, 1000000),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
}
|
||||
static TypeInfo sp804_info = {
|
||||
.name = "sp804",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(sp804_state),
|
||||
.class_init = sp804_class_init,
|
||||
};
|
||||
|
||||
static void arm_timer_register_devices(void)
|
||||
{
|
||||
sysbus_qdev_register(&icp_pit_info);
|
||||
sysbus_qdev_register(&sp804_info);
|
||||
type_register_static(&icp_pit_info);
|
||||
type_register_static(&sp804_info);
|
||||
}
|
||||
|
||||
device_init(arm_timer_register_devices)
|
||||
|
14
hw/armv7m.c
14
hw/armv7m.c
@ -252,21 +252,23 @@ static Property bitband_properties[] = {
|
||||
|
||||
static void bitband_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = bitband_init;
|
||||
dc->props = bitband_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo bitband_info = {
|
||||
.name = "ARM,bitband-memory",
|
||||
.size = sizeof(BitBandState),
|
||||
.props = bitband_properties,
|
||||
.class_init = bitband_class_init,
|
||||
static TypeInfo bitband_info = {
|
||||
.name = "ARM,bitband-memory",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(BitBandState),
|
||||
.class_init = bitband_class_init,
|
||||
};
|
||||
|
||||
static void armv7m_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&bitband_info);
|
||||
type_register_static(&bitband_info);
|
||||
}
|
||||
|
||||
device_init(armv7m_register_devices)
|
||||
|
@ -391,31 +391,35 @@ static int armv7m_nvic_init(SysBusDevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property armv7m_nvic_properties[] = {
|
||||
/* The ARM v7m may have anything from 0 to 496 external interrupt
|
||||
* IRQ lines. We default to 64. Other boards may differ and should
|
||||
* set this property appropriately.
|
||||
*/
|
||||
DEFINE_PROP_UINT32("num-irq", nvic_state, num_irq, 64),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void armv7m_nvic_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
sdc->init = armv7m_nvic_init;
|
||||
dc->vmsd = &vmstate_nvic;
|
||||
dc->props = armv7m_nvic_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo armv7m_nvic_priv_info = {
|
||||
.name = "armv7m_nvic",
|
||||
.size = sizeof(nvic_state),
|
||||
.vmsd = &vmstate_nvic,
|
||||
.class_init = armv7m_nvic_class_init,
|
||||
.props = (Property[]) {
|
||||
/* The ARM v7m may have anything from 0 to 496 external interrupt
|
||||
* IRQ lines. We default to 64. Other boards may differ and should
|
||||
* set this property appropriately.
|
||||
*/
|
||||
DEFINE_PROP_UINT32("num-irq", nvic_state, num_irq, 64),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
}
|
||||
static TypeInfo armv7m_nvic_info = {
|
||||
.name = "armv7m_nvic",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(nvic_state),
|
||||
.class_init = armv7m_nvic_class_init,
|
||||
};
|
||||
|
||||
static void armv7m_nvic_register_devices(void)
|
||||
{
|
||||
sysbus_qdev_register(&armv7m_nvic_priv_info);
|
||||
type_register_static(&armv7m_nvic_info);
|
||||
}
|
||||
|
||||
device_init(armv7m_nvic_register_devices)
|
||||
|
@ -223,21 +223,23 @@ static int gpio_i2c_init(SysBusDevice *dev)
|
||||
|
||||
static void gpio_i2c_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = gpio_i2c_init;
|
||||
dc->desc = "Virtual GPIO to I2C bridge";
|
||||
}
|
||||
|
||||
static DeviceInfo gpio_i2c_info = {
|
||||
.name = "gpio_i2c",
|
||||
.desc = "Virtual GPIO to I2C bridge",
|
||||
.size = sizeof(GPIOI2CState),
|
||||
.class_init = gpio_i2c_class_init,
|
||||
static TypeInfo gpio_i2c_info = {
|
||||
.name = "gpio_i2c",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(GPIOI2CState),
|
||||
.class_init = gpio_i2c_class_init,
|
||||
};
|
||||
|
||||
static void bitbang_i2c_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&gpio_i2c_info);
|
||||
type_register_static(&gpio_i2c_info);
|
||||
}
|
||||
|
||||
device_init(bitbang_i2c_register)
|
||||
|
32
hw/bonito.c
32
hw/bonito.c
@ -768,6 +768,7 @@ PCIBus *bonito_init(qemu_irq *pic)
|
||||
|
||||
static void bonito_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = bonito_initfn;
|
||||
@ -775,34 +776,37 @@ static void bonito_class_init(ObjectClass *klass, void *data)
|
||||
k->device_id = 0x00d5;
|
||||
k->revision = 0x01;
|
||||
k->class_id = PCI_CLASS_BRIDGE_HOST;
|
||||
dc->desc = "Host bridge";
|
||||
dc->no_user = 1;
|
||||
dc->vmsd = &vmstate_bonito;
|
||||
}
|
||||
|
||||
static DeviceInfo bonito_info = {
|
||||
.name = "Bonito",
|
||||
.desc = "Host bridge",
|
||||
.size = sizeof(PCIBonitoState),
|
||||
.vmsd = &vmstate_bonito,
|
||||
.no_user = 1,
|
||||
.class_init = bonito_class_init,
|
||||
static TypeInfo bonito_info = {
|
||||
.name = "Bonito",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIBonitoState),
|
||||
.class_init = bonito_class_init,
|
||||
};
|
||||
|
||||
static void bonito_pcihost_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = bonito_pcihost_initfn;
|
||||
dc->no_user = 1;
|
||||
}
|
||||
|
||||
static DeviceInfo bonito_pcihost_info = {
|
||||
.name = "Bonito-pcihost",
|
||||
.size = sizeof(BonitoState),
|
||||
.no_user = 1,
|
||||
.class_init = bonito_pcihost_class_init,
|
||||
static TypeInfo bonito_pcihost_info = {
|
||||
.name = "Bonito-pcihost",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(BonitoState),
|
||||
.class_init = bonito_pcihost_class_init,
|
||||
};
|
||||
|
||||
static void bonito_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&bonito_pcihost_info);
|
||||
pci_qdev_register(&bonito_info);
|
||||
type_register_static(&bonito_pcihost_info);
|
||||
type_register_static(&bonito_info);
|
||||
}
|
||||
device_init(bonito_register);
|
||||
|
@ -564,36 +564,39 @@ static int emulated_exitfn(CCIDCardState *base)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property emulated_card_properties[] = {
|
||||
DEFINE_PROP_STRING("backend", EmulatedState, backend_str),
|
||||
DEFINE_PROP_STRING("cert1", EmulatedState, cert1),
|
||||
DEFINE_PROP_STRING("cert2", EmulatedState, cert2),
|
||||
DEFINE_PROP_STRING("cert3", EmulatedState, cert3),
|
||||
DEFINE_PROP_STRING("db", EmulatedState, db),
|
||||
DEFINE_PROP_UINT8("debug", EmulatedState, debug, 0),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void emulated_class_initfn(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
CCIDCardClass *cc = CCID_CARD_CLASS(klass);
|
||||
|
||||
cc->initfn = emulated_initfn;
|
||||
cc->exitfn = emulated_exitfn;
|
||||
cc->get_atr = emulated_get_atr;
|
||||
cc->apdu_from_guest = emulated_apdu_from_guest;
|
||||
dc->desc = "emulated smartcard";
|
||||
dc->props = emulated_card_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo emulated_card_info = {
|
||||
.name = EMULATED_DEV_NAME,
|
||||
.desc = "emulated smartcard",
|
||||
.size = sizeof(EmulatedState),
|
||||
.unplug = qdev_simple_unplug_cb,
|
||||
.class_init = emulated_class_initfn,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_STRING("backend", EmulatedState, backend_str),
|
||||
DEFINE_PROP_STRING("cert1", EmulatedState, cert1),
|
||||
DEFINE_PROP_STRING("cert2", EmulatedState, cert2),
|
||||
DEFINE_PROP_STRING("cert3", EmulatedState, cert3),
|
||||
DEFINE_PROP_STRING("db", EmulatedState, db),
|
||||
DEFINE_PROP_UINT8("debug", EmulatedState, debug, 0),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
},
|
||||
static TypeInfo emulated_card_info = {
|
||||
.name = EMULATED_DEV_NAME,
|
||||
.parent = TYPE_CCID_CARD,
|
||||
.instance_size = sizeof(EmulatedState),
|
||||
.class_init = emulated_class_initfn,
|
||||
};
|
||||
|
||||
static void ccid_card_emulated_register_devices(void)
|
||||
{
|
||||
ccid_card_qdev_register(&emulated_card_info);
|
||||
type_register_static(&emulated_card_info);
|
||||
}
|
||||
|
||||
device_init(ccid_card_emulated_register_devices)
|
||||
|
@ -316,32 +316,36 @@ static VMStateDescription passthru_vmstate = {
|
||||
}
|
||||
};
|
||||
|
||||
static Property passthru_card_properties[] = {
|
||||
DEFINE_PROP_CHR("chardev", PassthruState, cs),
|
||||
DEFINE_PROP_UINT8("debug", PassthruState, debug, 0),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void passthru_class_initfn(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
CCIDCardClass *cc = CCID_CARD_CLASS(klass);
|
||||
|
||||
cc->initfn = passthru_initfn;
|
||||
cc->exitfn = passthru_exitfn;
|
||||
cc->get_atr = passthru_get_atr;
|
||||
cc->apdu_from_guest = passthru_apdu_from_guest;
|
||||
dc->desc = "passthrough smartcard";
|
||||
dc->vmsd = &passthru_vmstate;
|
||||
dc->props = passthru_card_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo passthru_card_info = {
|
||||
.name = PASSTHRU_DEV_NAME,
|
||||
.desc = "passthrough smartcard",
|
||||
.size = sizeof(PassthruState),
|
||||
.vmsd = &passthru_vmstate,
|
||||
.class_init = passthru_class_initfn,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_CHR("chardev", PassthruState, cs),
|
||||
DEFINE_PROP_UINT8("debug", PassthruState, debug, 0),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
},
|
||||
static TypeInfo passthru_card_info = {
|
||||
.name = PASSTHRU_DEV_NAME,
|
||||
.parent = TYPE_CCID_CARD,
|
||||
.instance_size = sizeof(PassthruState),
|
||||
.class_init = passthru_class_initfn,
|
||||
};
|
||||
|
||||
static void ccid_card_passthru_register_devices(void)
|
||||
{
|
||||
ccid_card_qdev_register(&passthru_card_info);
|
||||
type_register_static(&passthru_card_info);
|
||||
}
|
||||
|
||||
device_init(ccid_card_passthru_register_devices)
|
||||
|
@ -54,7 +54,6 @@ void ccid_card_send_apdu_to_guest(CCIDCardState *card,
|
||||
void ccid_card_card_removed(CCIDCardState *card);
|
||||
void ccid_card_card_inserted(CCIDCardState *card);
|
||||
void ccid_card_card_error(CCIDCardState *card, uint64_t error);
|
||||
void ccid_card_qdev_register(DeviceInfo *card);
|
||||
|
||||
/*
|
||||
* support guest visible insertion/removal of ccid devices based on actual
|
||||
|
@ -2901,20 +2901,22 @@ static int vga_initfn(ISADevice *dev)
|
||||
static void isa_cirrus_vga_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
ISADeviceClass *k = ISA_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = vga_initfn;
|
||||
dc->vmsd = &vmstate_cirrus_vga;
|
||||
k->init = vga_initfn;
|
||||
}
|
||||
|
||||
static DeviceInfo isa_cirrus_vga_info = {
|
||||
.name = "isa-cirrus-vga",
|
||||
.size = sizeof(ISACirrusVGAState),
|
||||
.vmsd = &vmstate_cirrus_vga,
|
||||
static TypeInfo isa_cirrus_vga_info = {
|
||||
.name = "isa-cirrus-vga",
|
||||
.parent = TYPE_ISA_DEVICE,
|
||||
.instance_size = sizeof(ISACirrusVGAState),
|
||||
.class_init = isa_cirrus_vga_class_init,
|
||||
};
|
||||
|
||||
static void isa_cirrus_vga_register(void)
|
||||
{
|
||||
isa_qdev_register(&isa_cirrus_vga_info);
|
||||
type_register_static(&isa_cirrus_vga_info);
|
||||
}
|
||||
device_init(isa_cirrus_vga_register)
|
||||
|
||||
@ -2965,6 +2967,7 @@ DeviceState *pci_cirrus_vga_init(PCIBus *bus)
|
||||
|
||||
static void cirrus_vga_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->no_hotplug = 1;
|
||||
@ -2973,18 +2976,19 @@ static void cirrus_vga_class_init(ObjectClass *klass, void *data)
|
||||
k->vendor_id = PCI_VENDOR_ID_CIRRUS;
|
||||
k->device_id = CIRRUS_ID_CLGD5446;
|
||||
k->class_id = PCI_CLASS_DISPLAY_VGA;
|
||||
dc->desc = "Cirrus CLGD 54xx VGA";
|
||||
dc->vmsd = &vmstate_pci_cirrus_vga;
|
||||
}
|
||||
|
||||
static DeviceInfo cirrus_vga_info = {
|
||||
.name = "cirrus-vga",
|
||||
.desc = "Cirrus CLGD 54xx VGA",
|
||||
.size = sizeof(PCICirrusVGAState),
|
||||
.vmsd = &vmstate_pci_cirrus_vga,
|
||||
.class_init = cirrus_vga_class_init,
|
||||
static TypeInfo cirrus_vga_info = {
|
||||
.name = "cirrus-vga",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCICirrusVGAState),
|
||||
.class_init = cirrus_vga_class_init,
|
||||
};
|
||||
|
||||
static void cirrus_vga_register(void)
|
||||
{
|
||||
pci_qdev_register(&cirrus_vga_info);
|
||||
type_register_static(&cirrus_vga_info);
|
||||
}
|
||||
device_init(cirrus_vga_register);
|
||||
|
@ -7,21 +7,23 @@ static int container_initfn(SysBusDevice *dev)
|
||||
|
||||
static void container_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = container_initfn;
|
||||
dc->no_user = 1;
|
||||
}
|
||||
|
||||
static DeviceInfo container_info = {
|
||||
.name = "container",
|
||||
.size = sizeof(SysBusDevice),
|
||||
.no_user = 1,
|
||||
.class_init = container_class_init,
|
||||
static TypeInfo container_info = {
|
||||
.name = "container",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(SysBusDevice),
|
||||
.class_init = container_class_init,
|
||||
};
|
||||
|
||||
static void container_init(void)
|
||||
{
|
||||
sysbus_register_withprop(&container_info);
|
||||
type_register_static(&container_info);
|
||||
}
|
||||
|
||||
device_init(container_init);
|
||||
|
18
hw/cs4231.c
18
hw/cs4231.c
@ -157,23 +157,25 @@ static Property cs4231_properties[] = {
|
||||
|
||||
static void cs4231_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = cs4231_init1;
|
||||
dc->reset = cs_reset;
|
||||
dc->vmsd = &vmstate_cs4231;
|
||||
dc->props = cs4231_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo cs4231_info = {
|
||||
.name = "SUNW,CS4231",
|
||||
.size = sizeof(CSState),
|
||||
.vmsd = &vmstate_cs4231,
|
||||
.reset = cs_reset,
|
||||
.props = cs4231_properties,
|
||||
.class_init = cs4231_class_init,
|
||||
static TypeInfo cs4231_info = {
|
||||
.name = "SUNW,CS4231",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(CSState),
|
||||
.class_init = cs4231_class_init,
|
||||
};
|
||||
|
||||
static void cs4231_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&cs4231_info);
|
||||
type_register_static(&cs4231_info);
|
||||
}
|
||||
|
||||
device_init(cs4231_register_devices)
|
||||
|
30
hw/cs4231a.c
30
hw/cs4231a.c
@ -665,28 +665,32 @@ int cs4231a_init (ISABus *bus)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property cs4231a_properties[] = {
|
||||
DEFINE_PROP_HEX32 ("iobase", CSState, port, 0x534),
|
||||
DEFINE_PROP_UINT32 ("irq", CSState, irq, 9),
|
||||
DEFINE_PROP_UINT32 ("dma", CSState, dma, 3),
|
||||
DEFINE_PROP_END_OF_LIST (),
|
||||
};
|
||||
|
||||
static void cs4231a_class_initfn(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
|
||||
ic->init = cs4231a_initfn;
|
||||
dc->desc = "Crystal Semiconductor CS4231A";
|
||||
dc->vmsd = &vmstate_cs4231a;
|
||||
dc->props = cs4231a_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo cs4231a_info = {
|
||||
.name = "cs4231a",
|
||||
.desc = "Crystal Semiconductor CS4231A",
|
||||
.size = sizeof (CSState),
|
||||
.vmsd = &vmstate_cs4231a,
|
||||
.class_init = cs4231a_class_initfn,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_HEX32 ("iobase", CSState, port, 0x534),
|
||||
DEFINE_PROP_UINT32 ("irq", CSState, irq, 9),
|
||||
DEFINE_PROP_UINT32 ("dma", CSState, dma, 3),
|
||||
DEFINE_PROP_END_OF_LIST (),
|
||||
},
|
||||
static TypeInfo cs4231a_info = {
|
||||
.name = "cs4231a",
|
||||
.parent = TYPE_ISA_DEVICE,
|
||||
.instance_size = sizeof (CSState),
|
||||
.class_init = cs4231a_class_initfn,
|
||||
};
|
||||
|
||||
static void cs4231a_register (void)
|
||||
{
|
||||
isa_qdev_register (&cs4231a_info);
|
||||
type_register_static(&cs4231a_info);
|
||||
}
|
||||
device_init (cs4231a_register)
|
||||
|
@ -87,27 +87,31 @@ static int debugcon_isa_initfn(ISADevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property debugcon_isa_properties[] = {
|
||||
DEFINE_PROP_HEX32("iobase", ISADebugconState, iobase, 0xe9),
|
||||
DEFINE_PROP_CHR("chardev", ISADebugconState, state.chr),
|
||||
DEFINE_PROP_HEX32("readback", ISADebugconState, state.readback, 0xe9),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void debugcon_isa_class_initfn(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
|
||||
ic->init = debugcon_isa_initfn;
|
||||
dc->props = debugcon_isa_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo debugcon_isa_info = {
|
||||
.name = "isa-debugcon",
|
||||
.size = sizeof(ISADebugconState),
|
||||
.class_init = debugcon_isa_class_initfn,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_HEX32("iobase", ISADebugconState, iobase, 0xe9),
|
||||
DEFINE_PROP_CHR("chardev", ISADebugconState, state.chr),
|
||||
DEFINE_PROP_HEX32("readback", ISADebugconState, state.readback, 0xe9),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
},
|
||||
static TypeInfo debugcon_isa_info = {
|
||||
.name = "isa-debugcon",
|
||||
.parent = TYPE_ISA_DEVICE,
|
||||
.instance_size = sizeof(ISADebugconState),
|
||||
.class_init = debugcon_isa_class_initfn,
|
||||
};
|
||||
|
||||
static void debugcon_register_devices(void)
|
||||
{
|
||||
isa_qdev_register(&debugcon_isa_info);
|
||||
type_register_static(&debugcon_isa_info);
|
||||
}
|
||||
|
||||
device_init(debugcon_register_devices)
|
||||
|
40
hw/dec_pci.c
40
hw/dec_pci.c
@ -52,6 +52,7 @@ static int dec_map_irq(PCIDevice *pci_dev, int irq_num)
|
||||
|
||||
static void dec_21154_pci_bridge_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = pci_bridge_initfn;
|
||||
@ -60,15 +61,16 @@ static void dec_21154_pci_bridge_class_init(ObjectClass *klass, void *data)
|
||||
k->device_id = PCI_DEVICE_ID_DEC_21154;
|
||||
k->config_write = pci_bridge_write_config;
|
||||
k->is_bridge = 1;
|
||||
dc->desc = "DEC 21154 PCI-PCI bridge";
|
||||
dc->reset = pci_bridge_reset;
|
||||
dc->vmsd = &vmstate_pci_device;
|
||||
}
|
||||
|
||||
static DeviceInfo dec_21154_pci_bridge_info = {
|
||||
.name = "dec-21154-p2p-bridge",
|
||||
.desc = "DEC 21154 PCI-PCI bridge",
|
||||
.size = sizeof(PCIBridge),
|
||||
.vmsd = &vmstate_pci_device,
|
||||
.reset = pci_bridge_reset,
|
||||
.class_init = dec_21154_pci_bridge_class_init,
|
||||
static TypeInfo dec_21154_pci_bridge_info = {
|
||||
.name = "dec-21154-p2p-bridge",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIBridge),
|
||||
.class_init = dec_21154_pci_bridge_class_init,
|
||||
};
|
||||
|
||||
PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
|
||||
@ -117,10 +119,11 @@ static void dec_21154_pci_host_class_init(ObjectClass *klass, void *data)
|
||||
k->is_bridge = 1;
|
||||
}
|
||||
|
||||
static DeviceInfo dec_21154_pci_host_info = {
|
||||
.name = "dec-21154",
|
||||
.size = sizeof(PCIDevice),
|
||||
.class_init = dec_21154_pci_host_class_init,
|
||||
static TypeInfo dec_21154_pci_host_info = {
|
||||
.name = "dec-21154",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIDevice),
|
||||
.class_init = dec_21154_pci_host_class_init,
|
||||
};
|
||||
|
||||
static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data)
|
||||
@ -130,17 +133,18 @@ static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data)
|
||||
sdc->init = pci_dec_21154_device_init;
|
||||
}
|
||||
|
||||
static DeviceInfo pci_dec_21154_device_info = {
|
||||
.name = "dec-21154-sysbus",
|
||||
.size = sizeof(DECState),
|
||||
.class_init = pci_dec_21154_device_class_init,
|
||||
static TypeInfo pci_dec_21154_device_info = {
|
||||
.name = "dec-21154-sysbus",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(DECState),
|
||||
.class_init = pci_dec_21154_device_class_init,
|
||||
};
|
||||
|
||||
static void dec_register_devices(void)
|
||||
{
|
||||
sysbus_qdev_register(&pci_dec_21154_device_info);
|
||||
pci_qdev_register(&dec_21154_pci_host_info);
|
||||
pci_qdev_register(&dec_21154_pci_bridge_info);
|
||||
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)
|
||||
|
16
hw/ds1225y.c
16
hw/ds1225y.c
@ -142,22 +142,24 @@ static Property nvram_sysbus_properties[] = {
|
||||
|
||||
static void nvram_sysbus_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = nvram_sysbus_initfn;
|
||||
dc->vmsd = &vmstate_nvram;
|
||||
dc->props = nvram_sysbus_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo nvram_sysbus_info = {
|
||||
.name = "ds1225y",
|
||||
.size = sizeof(SysBusNvRamState),
|
||||
.vmsd = &vmstate_nvram,
|
||||
.props = nvram_sysbus_properties,
|
||||
.class_init = nvram_sysbus_class_init,
|
||||
static TypeInfo nvram_sysbus_info = {
|
||||
.name = "ds1225y",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(SysBusNvRamState),
|
||||
.class_init = nvram_sysbus_class_init,
|
||||
};
|
||||
|
||||
static void nvram_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&nvram_sysbus_info);
|
||||
type_register_static(&nvram_sysbus_info);
|
||||
}
|
||||
|
||||
device_init(nvram_register)
|
||||
|
11
hw/ds1338.c
11
hw/ds1338.c
@ -128,15 +128,16 @@ static void ds1338_class_init(ObjectClass *klass, void *data)
|
||||
k->send = ds1338_send;
|
||||
}
|
||||
|
||||
static DeviceInfo ds1338_info = {
|
||||
.name = "ds1338",
|
||||
.size = sizeof(DS1338State),
|
||||
.class_init = ds1338_class_init,
|
||||
static TypeInfo ds1338_info = {
|
||||
.name = "ds1338",
|
||||
.parent = TYPE_I2C_SLAVE,
|
||||
.instance_size = sizeof(DS1338State),
|
||||
.class_init = ds1338_class_init,
|
||||
};
|
||||
|
||||
static void ds1338_register_devices(void)
|
||||
{
|
||||
i2c_register_slave(&ds1338_info);
|
||||
type_register_static(&ds1338_info);
|
||||
}
|
||||
|
||||
device_init(ds1338_register_devices)
|
||||
|
20
hw/e1000.c
20
hw/e1000.c
@ -1204,6 +1204,7 @@ static Property e1000_properties[] = {
|
||||
|
||||
static void e1000_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = pci_e1000_init;
|
||||
@ -1213,21 +1214,22 @@ static void e1000_class_init(ObjectClass *klass, void *data)
|
||||
k->device_id = E1000_DEVID;
|
||||
k->revision = 0x03;
|
||||
k->class_id = PCI_CLASS_NETWORK_ETHERNET;
|
||||
dc->desc = "Intel Gigabit Ethernet";
|
||||
dc->reset = qdev_e1000_reset;
|
||||
dc->vmsd = &vmstate_e1000;
|
||||
dc->props = e1000_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo e1000_info = {
|
||||
.name = "e1000",
|
||||
.desc = "Intel Gigabit Ethernet",
|
||||
.size = sizeof(E1000State),
|
||||
.reset = qdev_e1000_reset,
|
||||
.vmsd = &vmstate_e1000,
|
||||
.props = e1000_properties,
|
||||
.class_init = e1000_class_init,
|
||||
static TypeInfo e1000_info = {
|
||||
.name = "e1000",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(E1000State),
|
||||
.class_init = e1000_class_init,
|
||||
};
|
||||
|
||||
static void e1000_register_devices(void)
|
||||
{
|
||||
pci_qdev_register(&e1000_info);
|
||||
type_register_static(&e1000_info);
|
||||
}
|
||||
|
||||
device_init(e1000_register_devices)
|
||||
|
@ -315,24 +315,26 @@ static Property ecc_properties[] = {
|
||||
|
||||
static void ecc_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = ecc_init1;
|
||||
dc->reset = ecc_reset;
|
||||
dc->vmsd = &vmstate_ecc;
|
||||
dc->props = ecc_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo ecc_info = {
|
||||
.name = "eccmemctl",
|
||||
.size = sizeof(ECCState),
|
||||
.vmsd = &vmstate_ecc,
|
||||
.reset = ecc_reset,
|
||||
.props = ecc_properties,
|
||||
.class_init = ecc_class_init,
|
||||
static TypeInfo ecc_info = {
|
||||
.name = "eccmemctl",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(ECCState),
|
||||
.class_init = ecc_class_init,
|
||||
};
|
||||
|
||||
|
||||
static void ecc_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&ecc_info);
|
||||
type_register_static(&ecc_info);
|
||||
}
|
||||
|
||||
device_init(ecc_register_devices)
|
||||
|
@ -128,8 +128,8 @@
|
||||
#define DRVR_INT 0x0200 /* Driver generated interrupt. */
|
||||
|
||||
typedef struct {
|
||||
DeviceInfo qdev;
|
||||
|
||||
const char *name;
|
||||
const char *desc;
|
||||
uint16_t device_id;
|
||||
uint8_t revision;
|
||||
uint16_t subsystem_vendor_id;
|
||||
@ -1905,8 +1905,8 @@ static int e100_nic_init(PCIDevice *pci_dev)
|
||||
|
||||
static E100PCIDeviceInfo e100_devices[] = {
|
||||
{
|
||||
.qdev.name = "i82550",
|
||||
.qdev.desc = "Intel i82550 Ethernet",
|
||||
.name = "i82550",
|
||||
.desc = "Intel i82550 Ethernet",
|
||||
.device = i82550,
|
||||
/* TODO: check device id. */
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82551IT,
|
||||
@ -1918,8 +1918,8 @@ static E100PCIDeviceInfo e100_devices[] = {
|
||||
.has_extended_tcb_support = true,
|
||||
.power_management = true,
|
||||
},{
|
||||
.qdev.name = "i82551",
|
||||
.qdev.desc = "Intel i82551 Ethernet",
|
||||
.name = "i82551",
|
||||
.desc = "Intel i82551 Ethernet",
|
||||
.device = i82551,
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82551IT,
|
||||
/* Revision ID: 0x0f, 0x10. */
|
||||
@ -1929,29 +1929,29 @@ static E100PCIDeviceInfo e100_devices[] = {
|
||||
.has_extended_tcb_support = true,
|
||||
.power_management = true,
|
||||
},{
|
||||
.qdev.name = "i82557a",
|
||||
.qdev.desc = "Intel i82557A Ethernet",
|
||||
.name = "i82557a",
|
||||
.desc = "Intel i82557A Ethernet",
|
||||
.device = i82557A,
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82557,
|
||||
.revision = 0x01,
|
||||
.power_management = false,
|
||||
},{
|
||||
.qdev.name = "i82557b",
|
||||
.qdev.desc = "Intel i82557B Ethernet",
|
||||
.name = "i82557b",
|
||||
.desc = "Intel i82557B Ethernet",
|
||||
.device = i82557B,
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82557,
|
||||
.revision = 0x02,
|
||||
.power_management = false,
|
||||
},{
|
||||
.qdev.name = "i82557c",
|
||||
.qdev.desc = "Intel i82557C Ethernet",
|
||||
.name = "i82557c",
|
||||
.desc = "Intel i82557C Ethernet",
|
||||
.device = i82557C,
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82557,
|
||||
.revision = 0x03,
|
||||
.power_management = false,
|
||||
},{
|
||||
.qdev.name = "i82558a",
|
||||
.qdev.desc = "Intel i82558A Ethernet",
|
||||
.name = "i82558a",
|
||||
.desc = "Intel i82558A Ethernet",
|
||||
.device = i82558A,
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82557,
|
||||
.revision = 0x04,
|
||||
@ -1959,8 +1959,8 @@ static E100PCIDeviceInfo e100_devices[] = {
|
||||
.has_extended_tcb_support = true,
|
||||
.power_management = true,
|
||||
},{
|
||||
.qdev.name = "i82558b",
|
||||
.qdev.desc = "Intel i82558B Ethernet",
|
||||
.name = "i82558b",
|
||||
.desc = "Intel i82558B Ethernet",
|
||||
.device = i82558B,
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82557,
|
||||
.revision = 0x05,
|
||||
@ -1968,8 +1968,8 @@ static E100PCIDeviceInfo e100_devices[] = {
|
||||
.has_extended_tcb_support = true,
|
||||
.power_management = true,
|
||||
},{
|
||||
.qdev.name = "i82559a",
|
||||
.qdev.desc = "Intel i82559A Ethernet",
|
||||
.name = "i82559a",
|
||||
.desc = "Intel i82559A Ethernet",
|
||||
.device = i82559A,
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82557,
|
||||
.revision = 0x06,
|
||||
@ -1977,8 +1977,8 @@ static E100PCIDeviceInfo e100_devices[] = {
|
||||
.has_extended_tcb_support = true,
|
||||
.power_management = true,
|
||||
},{
|
||||
.qdev.name = "i82559b",
|
||||
.qdev.desc = "Intel i82559B Ethernet",
|
||||
.name = "i82559b",
|
||||
.desc = "Intel i82559B Ethernet",
|
||||
.device = i82559B,
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82557,
|
||||
.revision = 0x07,
|
||||
@ -1986,8 +1986,8 @@ static E100PCIDeviceInfo e100_devices[] = {
|
||||
.has_extended_tcb_support = true,
|
||||
.power_management = true,
|
||||
},{
|
||||
.qdev.name = "i82559c",
|
||||
.qdev.desc = "Intel i82559C Ethernet",
|
||||
.name = "i82559c",
|
||||
.desc = "Intel i82559C Ethernet",
|
||||
.device = i82559C,
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82557,
|
||||
#if 0
|
||||
@ -2003,8 +2003,8 @@ static E100PCIDeviceInfo e100_devices[] = {
|
||||
.has_extended_tcb_support = true,
|
||||
.power_management = true,
|
||||
},{
|
||||
.qdev.name = "i82559er",
|
||||
.qdev.desc = "Intel i82559ER Ethernet",
|
||||
.name = "i82559er",
|
||||
.desc = "Intel i82559ER Ethernet",
|
||||
.device = i82559ER,
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82551IT,
|
||||
.revision = 0x09,
|
||||
@ -2012,8 +2012,8 @@ static E100PCIDeviceInfo e100_devices[] = {
|
||||
.has_extended_tcb_support = true,
|
||||
.power_management = true,
|
||||
},{
|
||||
.qdev.name = "i82562",
|
||||
.qdev.desc = "Intel i82562 Ethernet",
|
||||
.name = "i82562",
|
||||
.desc = "Intel i82562 Ethernet",
|
||||
.device = i82562,
|
||||
/* TODO: check device id. */
|
||||
.device_id = PCI_DEVICE_ID_INTEL_82551IT,
|
||||
@ -2024,8 +2024,8 @@ static E100PCIDeviceInfo e100_devices[] = {
|
||||
.power_management = true,
|
||||
},{
|
||||
/* Toshiba Tecra 8200. */
|
||||
.qdev.name = "i82801",
|
||||
.qdev.desc = "Intel i82801 Ethernet",
|
||||
.name = "i82801",
|
||||
.desc = "Intel i82801 Ethernet",
|
||||
.device = i82801,
|
||||
.device_id = 0x2449,
|
||||
.revision = 0x03,
|
||||
@ -2048,7 +2048,7 @@ static E100PCIDeviceInfo *eepro100_get_class_by_name(const char *typename)
|
||||
* do this in a much more elegant fashion.
|
||||
*/
|
||||
for (i = 0; i < ARRAY_SIZE(e100_devices); i++) {
|
||||
if (strcmp(e100_devices[i].qdev.name, typename) == 0) {
|
||||
if (strcmp(e100_devices[i].name, typename) == 0) {
|
||||
info = &e100_devices[i];
|
||||
break;
|
||||
}
|
||||
@ -2063,13 +2063,21 @@ static E100PCIDeviceInfo *eepro100_get_class(EEPRO100State *s)
|
||||
return eepro100_get_class_by_name(object_get_typename(OBJECT(s)));
|
||||
}
|
||||
|
||||
static Property e100_properties[] = {
|
||||
DEFINE_NIC_PROPERTIES(EEPRO100State, conf),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void eepro100_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
E100PCIDeviceInfo *info;
|
||||
|
||||
info = eepro100_get_class_by_name(object_class_get_name(klass));
|
||||
|
||||
dc->props = e100_properties;
|
||||
dc->desc = info->desc;
|
||||
k->vendor_id = PCI_VENDOR_ID_INTEL;
|
||||
k->class_id = PCI_CLASS_NETWORK_ETHERNET;
|
||||
k->romfile = "pxe-eepro100.rom";
|
||||
@ -2081,22 +2089,19 @@ static void eepro100_class_init(ObjectClass *klass, void *data)
|
||||
k->subsystem_id = info->subsystem_id;
|
||||
}
|
||||
|
||||
static Property e100_properties[] = {
|
||||
DEFINE_NIC_PROPERTIES(EEPRO100State, conf),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void eepro100_register_devices(void)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < ARRAY_SIZE(e100_devices); i++) {
|
||||
DeviceInfo *info = &e100_devices[i].qdev;
|
||||
TypeInfo type_info = {};
|
||||
E100PCIDeviceInfo *info = &e100_devices[i];
|
||||
|
||||
info->class_init = eepro100_class_init;
|
||||
info->size = sizeof(EEPRO100State);
|
||||
info->props = e100_properties;
|
||||
type_info.name = info->name;
|
||||
type_info.parent = TYPE_PCI_DEVICE;
|
||||
type_info.class_init = eepro100_class_init;
|
||||
type_info.instance_size = sizeof(EEPRO100State);
|
||||
|
||||
pci_qdev_register(info);
|
||||
type_register(&type_info);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,15 +83,16 @@ static void empty_slot_class_init(ObjectClass *klass, void *data)
|
||||
k->init = empty_slot_init1;
|
||||
}
|
||||
|
||||
static DeviceInfo empty_slot_info = {
|
||||
.name = "empty_slot",
|
||||
.size = sizeof(EmptySlot),
|
||||
.class_init = empty_slot_class_init,
|
||||
static TypeInfo empty_slot_info = {
|
||||
.name = "empty_slot",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(EmptySlot),
|
||||
.class_init = empty_slot_class_init,
|
||||
};
|
||||
|
||||
static void empty_slot_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&empty_slot_info);
|
||||
type_register_static(&empty_slot_info);
|
||||
}
|
||||
|
||||
device_init(empty_slot_register_devices);
|
||||
|
16
hw/es1370.c
16
hw/es1370.c
@ -1033,6 +1033,7 @@ int es1370_init (PCIBus *bus)
|
||||
|
||||
static void es1370_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = es1370_initfn;
|
||||
@ -1042,19 +1043,20 @@ static void es1370_class_init(ObjectClass *klass, void *data)
|
||||
k->class_id = PCI_CLASS_MULTIMEDIA_AUDIO;
|
||||
k->subsystem_vendor_id = 0x4942;
|
||||
k->subsystem_id = 0x4c4c;
|
||||
dc->desc = "ENSONIQ AudioPCI ES1370";
|
||||
dc->vmsd = &vmstate_es1370;
|
||||
}
|
||||
|
||||
static DeviceInfo es1370_info = {
|
||||
.name = "ES1370",
|
||||
.desc = "ENSONIQ AudioPCI ES1370",
|
||||
.size = sizeof (ES1370State),
|
||||
.vmsd = &vmstate_es1370,
|
||||
.class_init = es1370_class_init,
|
||||
static TypeInfo es1370_info = {
|
||||
.name = "ES1370",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof (ES1370State),
|
||||
.class_init = es1370_class_init,
|
||||
};
|
||||
|
||||
static void es1370_register (void)
|
||||
{
|
||||
pci_qdev_register (&es1370_info);
|
||||
type_register_static(&es1370_info);
|
||||
}
|
||||
device_init (es1370_register);
|
||||
|
||||
|
18
hw/escc.c
18
hw/escc.c
@ -915,23 +915,25 @@ static Property escc_properties[] = {
|
||||
|
||||
static void escc_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = escc_init1;
|
||||
dc->reset = escc_reset;
|
||||
dc->vmsd = &vmstate_escc;
|
||||
dc->props = escc_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo escc_info = {
|
||||
.name = "escc",
|
||||
.size = sizeof(SerialState),
|
||||
.vmsd = &vmstate_escc,
|
||||
.reset = escc_reset,
|
||||
.props = escc_properties,
|
||||
.class_init = escc_class_init,
|
||||
static TypeInfo escc_info = {
|
||||
.name = "escc",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(SerialState),
|
||||
.class_init = escc_class_init,
|
||||
};
|
||||
|
||||
static void escc_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&escc_info);
|
||||
type_register_static(&escc_info);
|
||||
}
|
||||
|
||||
device_init(escc_register_devices)
|
||||
|
18
hw/esp.c
18
hw/esp.c
@ -759,23 +759,25 @@ static Property esp_properties[] = {
|
||||
|
||||
static void esp_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = esp_init1;
|
||||
dc->reset = esp_hard_reset;
|
||||
dc->vmsd = &vmstate_esp;
|
||||
dc->props = esp_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo esp_info = {
|
||||
.name = "esp",
|
||||
.size = sizeof(ESPState),
|
||||
.vmsd = &vmstate_esp,
|
||||
.reset = esp_hard_reset,
|
||||
.props = esp_properties,
|
||||
.class_init = esp_class_init,
|
||||
static TypeInfo esp_info = {
|
||||
.name = "esp",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(ESPState),
|
||||
.class_init = esp_class_init,
|
||||
};
|
||||
|
||||
static void esp_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&esp_info);
|
||||
type_register_static(&esp_info);
|
||||
}
|
||||
|
||||
device_init(esp_register_devices)
|
||||
|
@ -623,21 +623,23 @@ static Property etraxfs_eth_properties[] = {
|
||||
|
||||
static void etraxfs_eth_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = fs_eth_init;
|
||||
dc->props = etraxfs_eth_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo etraxfs_eth_info = {
|
||||
.name = "etraxfs-eth",
|
||||
.size = sizeof(struct fs_eth),
|
||||
.props = etraxfs_eth_properties,
|
||||
.class_init = etraxfs_eth_class_init,
|
||||
static TypeInfo etraxfs_eth_info = {
|
||||
.name = "etraxfs-eth",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(struct fs_eth),
|
||||
.class_init = etraxfs_eth_class_init,
|
||||
};
|
||||
|
||||
static void etraxfs_eth_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&etraxfs_eth_info);
|
||||
type_register_static(&etraxfs_eth_info);
|
||||
}
|
||||
|
||||
device_init(etraxfs_eth_register)
|
||||
|
@ -158,21 +158,23 @@ static Property etraxfs_pic_properties[] = {
|
||||
|
||||
static void etraxfs_pic_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = etraxfs_pic_init;
|
||||
dc->props = etraxfs_pic_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo etraxfs_pic_info = {
|
||||
.name = "etraxfs,pic",
|
||||
.size = sizeof(struct etrax_pic),
|
||||
.props = etraxfs_pic_properties,
|
||||
.class_init = etraxfs_pic_class_init,
|
||||
static TypeInfo etraxfs_pic_info = {
|
||||
.name = "etraxfs,pic",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(struct etrax_pic),
|
||||
.class_init = etraxfs_pic_class_init,
|
||||
};
|
||||
|
||||
static void etraxfs_pic_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&etraxfs_pic_info);
|
||||
type_register_static(&etraxfs_pic_info);
|
||||
}
|
||||
|
||||
device_init(etraxfs_pic_register)
|
||||
|
@ -226,21 +226,23 @@ static int etraxfs_ser_init(SysBusDevice *dev)
|
||||
|
||||
static void etraxfs_ser_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = etraxfs_ser_init;
|
||||
dc->reset = etraxfs_ser_reset;
|
||||
}
|
||||
|
||||
static DeviceInfo etraxfs_ser_info = {
|
||||
.name = "etraxfs,serial",
|
||||
.size = sizeof(struct etrax_serial),
|
||||
.reset = etraxfs_ser_reset,
|
||||
.class_init = etraxfs_ser_class_init,
|
||||
static TypeInfo etraxfs_ser_info = {
|
||||
.name = "etraxfs,serial",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(struct etrax_serial),
|
||||
.class_init = etraxfs_ser_class_init,
|
||||
};
|
||||
|
||||
static void etraxfs_serial_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&etraxfs_ser_info);
|
||||
type_register_static(&etraxfs_ser_info);
|
||||
}
|
||||
|
||||
device_init(etraxfs_serial_register)
|
||||
|
@ -336,15 +336,16 @@ static void etraxfs_timer_class_init(ObjectClass *klass, void *data)
|
||||
sdc->init = etraxfs_timer_init;
|
||||
}
|
||||
|
||||
static DeviceInfo etraxfs_timer_info = {
|
||||
.name = "etraxfs,timer",
|
||||
.size = sizeof (struct etrax_timer),
|
||||
.class_init = etraxfs_timer_class_init,
|
||||
static TypeInfo etraxfs_timer_info = {
|
||||
.name = "etraxfs,timer",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof (struct etrax_timer),
|
||||
.class_init = etraxfs_timer_class_init,
|
||||
};
|
||||
|
||||
static void etraxfs_timer_register(void)
|
||||
{
|
||||
sysbus_qdev_register(&etraxfs_timer_info);
|
||||
type_register_static(&etraxfs_timer_info);
|
||||
}
|
||||
|
||||
device_init(etraxfs_timer_register)
|
||||
|
72
hw/fdc.c
72
hw/fdc.c
@ -1959,27 +1959,31 @@ static const VMStateDescription vmstate_isa_fdc ={
|
||||
}
|
||||
};
|
||||
|
||||
static Property isa_fdc_properties[] = {
|
||||
DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.drives[0].bs),
|
||||
DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.drives[1].bs),
|
||||
DEFINE_PROP_INT32("bootindexA", FDCtrlISABus, bootindexA, -1),
|
||||
DEFINE_PROP_INT32("bootindexB", FDCtrlISABus, bootindexB, -1),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void isabus_fdc_class_init1(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
|
||||
ic->init = isabus_fdc_init1;
|
||||
dc->fw_name = "fdc";
|
||||
dc->no_user = 1;
|
||||
dc->reset = fdctrl_external_reset_isa;
|
||||
dc->vmsd = &vmstate_isa_fdc;
|
||||
dc->props = isa_fdc_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo isa_fdc_info = {
|
||||
.class_init = isabus_fdc_class_init1,
|
||||
.name = "isa-fdc",
|
||||
.fw_name = "fdc",
|
||||
.size = sizeof(FDCtrlISABus),
|
||||
.no_user = 1,
|
||||
.vmsd = &vmstate_isa_fdc,
|
||||
.reset = fdctrl_external_reset_isa,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.drives[0].bs),
|
||||
DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.drives[1].bs),
|
||||
DEFINE_PROP_INT32("bootindexA", FDCtrlISABus, bootindexA, -1),
|
||||
DEFINE_PROP_INT32("bootindexB", FDCtrlISABus, bootindexB, -1),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
},
|
||||
static TypeInfo isa_fdc_info = {
|
||||
.name = "isa-fdc",
|
||||
.parent = TYPE_ISA_DEVICE,
|
||||
.instance_size = sizeof(FDCtrlISABus),
|
||||
.class_init = isabus_fdc_class_init1,
|
||||
};
|
||||
|
||||
static const VMStateDescription vmstate_sysbus_fdc ={
|
||||
@ -2000,18 +2004,20 @@ static Property sysbus_fdc_properties[] = {
|
||||
|
||||
static void sysbus_fdc_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = sysbus_fdc_init1;
|
||||
dc->reset = fdctrl_external_reset_sysbus;
|
||||
dc->vmsd = &vmstate_sysbus_fdc;
|
||||
dc->props = sysbus_fdc_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo sysbus_fdc_info = {
|
||||
.name = "sysbus-fdc",
|
||||
.size = sizeof(FDCtrlSysBus),
|
||||
.vmsd = &vmstate_sysbus_fdc,
|
||||
.reset = fdctrl_external_reset_sysbus,
|
||||
.props = sysbus_fdc_properties,
|
||||
.class_init = sysbus_fdc_class_init,
|
||||
static TypeInfo sysbus_fdc_info = {
|
||||
.name = "sysbus-fdc",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(FDCtrlSysBus),
|
||||
.class_init = sysbus_fdc_class_init,
|
||||
};
|
||||
|
||||
static Property sun4m_fdc_properties[] = {
|
||||
@ -2021,25 +2027,27 @@ static Property sun4m_fdc_properties[] = {
|
||||
|
||||
static void sun4m_fdc_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = sun4m_fdc_init1;
|
||||
dc->reset = fdctrl_external_reset_sysbus;
|
||||
dc->vmsd = &vmstate_sysbus_fdc;
|
||||
dc->props = sun4m_fdc_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo sun4m_fdc_info = {
|
||||
.name = "SUNW,fdtwo",
|
||||
.size = sizeof(FDCtrlSysBus),
|
||||
.vmsd = &vmstate_sysbus_fdc,
|
||||
.reset = fdctrl_external_reset_sysbus,
|
||||
.props = sun4m_fdc_properties,
|
||||
.class_init = sun4m_fdc_class_init,
|
||||
static TypeInfo sun4m_fdc_info = {
|
||||
.name = "SUNW,fdtwo",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(FDCtrlSysBus),
|
||||
.class_init = sun4m_fdc_class_init,
|
||||
};
|
||||
|
||||
static void fdc_register_devices(void)
|
||||
{
|
||||
isa_qdev_register(&isa_fdc_info);
|
||||
sysbus_register_withprop(&sysbus_fdc_info);
|
||||
sysbus_register_withprop(&sun4m_fdc_info);
|
||||
type_register_static(&isa_fdc_info);
|
||||
type_register_static(&sysbus_fdc_info);
|
||||
type_register_static(&sun4m_fdc_info);
|
||||
}
|
||||
|
||||
device_init(fdc_register_devices)
|
||||
|
20
hw/fw_cfg.c
20
hw/fw_cfg.c
@ -539,24 +539,26 @@ static Property fw_cfg_properties[] = {
|
||||
|
||||
static void fw_cfg_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = fw_cfg_init1;
|
||||
dc->no_user = 1;
|
||||
dc->reset = fw_cfg_reset;
|
||||
dc->vmsd = &vmstate_fw_cfg;
|
||||
dc->props = fw_cfg_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo fw_cfg_info = {
|
||||
.name = "fw_cfg",
|
||||
.size = sizeof(FWCfgState),
|
||||
.vmsd = &vmstate_fw_cfg,
|
||||
.reset = fw_cfg_reset,
|
||||
.no_user = 1,
|
||||
.props = fw_cfg_properties,
|
||||
.class_init = fw_cfg_class_init,
|
||||
static TypeInfo fw_cfg_info = {
|
||||
.name = "fw_cfg",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(FWCfgState),
|
||||
.class_init = fw_cfg_class_init,
|
||||
};
|
||||
|
||||
static void fw_cfg_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&fw_cfg_info);
|
||||
type_register_static(&fw_cfg_info);
|
||||
}
|
||||
|
||||
device_init(fw_cfg_register_devices)
|
||||
|
20
hw/g364fb.c
20
hw/g364fb.c
@ -556,24 +556,26 @@ static Property g364fb_sysbus_properties[] = {
|
||||
|
||||
static void g364fb_sysbus_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = g364fb_sysbus_init;
|
||||
dc->desc = "G364 framebuffer";
|
||||
dc->reset = g364fb_sysbus_reset;
|
||||
dc->vmsd = &vmstate_g364fb;
|
||||
dc->props = g364fb_sysbus_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo g364fb_sysbus_info = {
|
||||
.name = "sysbus-g364",
|
||||
.desc = "G364 framebuffer",
|
||||
.size = sizeof(G364SysBusState),
|
||||
.vmsd = &vmstate_g364fb,
|
||||
.reset = g364fb_sysbus_reset,
|
||||
.props = g364fb_sysbus_properties,
|
||||
.class_init = g364fb_sysbus_class_init,
|
||||
static TypeInfo g364fb_sysbus_info = {
|
||||
.name = "sysbus-g364",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(G364SysBusState),
|
||||
.class_init = g364fb_sysbus_class_init,
|
||||
};
|
||||
|
||||
static void g364fb_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&g364fb_sysbus_info);
|
||||
type_register_static(&g364fb_sysbus_info);
|
||||
}
|
||||
|
||||
device_init(g364fb_register);
|
||||
|
@ -124,39 +124,43 @@ static int grackle_pci_host_init(PCIDevice *d)
|
||||
static void grackle_pci_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = grackle_pci_host_init;
|
||||
k->vendor_id = PCI_VENDOR_ID_MOTOROLA;
|
||||
k->device_id = PCI_DEVICE_ID_MOTOROLA_MPC106;
|
||||
k->revision = 0x00;
|
||||
k->class_id = PCI_CLASS_BRIDGE_HOST;
|
||||
dc->no_user = 1;
|
||||
}
|
||||
|
||||
static DeviceInfo grackle_pci_info = {
|
||||
.name = "grackle",
|
||||
.size = sizeof(PCIDevice),
|
||||
.no_user = 1,
|
||||
static TypeInfo grackle_pci_info = {
|
||||
.name = "grackle",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIDevice),
|
||||
.class_init = grackle_pci_class_init,
|
||||
};
|
||||
|
||||
static void pci_grackle_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = pci_grackle_init_device;
|
||||
dc->no_user = 1;
|
||||
}
|
||||
|
||||
static DeviceInfo grackle_pci_host_info = {
|
||||
.name = "grackle-pcihost",
|
||||
.size = sizeof(GrackleState),
|
||||
.no_user = 1,
|
||||
.class_init = pci_grackle_class_init,
|
||||
static TypeInfo grackle_pci_host_info = {
|
||||
.name = "grackle-pcihost",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(GrackleState),
|
||||
.class_init = pci_grackle_class_init,
|
||||
};
|
||||
|
||||
static void grackle_register_devices(void)
|
||||
{
|
||||
sysbus_qdev_register(&grackle_pci_host_info);
|
||||
pci_qdev_register(&grackle_pci_info);
|
||||
type_register_static(&grackle_pci_info);
|
||||
type_register_static(&grackle_pci_host_info);
|
||||
}
|
||||
|
||||
device_init(grackle_register_devices)
|
||||
|
@ -249,21 +249,23 @@ static Property grlib_gptimer_properties[] = {
|
||||
|
||||
static void grlib_gptimer_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = grlib_apbuart_init;
|
||||
dc->props = grlib_gptimer_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo grlib_gptimer_info = {
|
||||
.name = "grlib,apbuart",
|
||||
.size = sizeof(UART),
|
||||
.props = grlib_gptimer_properties,
|
||||
.class_init = grlib_gptimer_class_init,
|
||||
static TypeInfo grlib_gptimer_info = {
|
||||
.name = "grlib,apbuart",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(UART),
|
||||
.class_init = grlib_gptimer_class_init,
|
||||
};
|
||||
|
||||
static void grlib_gptimer_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&grlib_gptimer_info);
|
||||
type_register_static(&grlib_gptimer_info);
|
||||
}
|
||||
|
||||
device_init(grlib_gptimer_register)
|
||||
|
@ -381,22 +381,24 @@ static Property grlib_gptimer_properties[] = {
|
||||
|
||||
static void grlib_gptimer_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = grlib_gptimer_init;
|
||||
dc->reset = grlib_gptimer_reset;
|
||||
dc->props = grlib_gptimer_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo grlib_gptimer_info = {
|
||||
.name = "grlib,gptimer",
|
||||
.reset = grlib_gptimer_reset,
|
||||
.size = sizeof(GPTimerUnit),
|
||||
.props = grlib_gptimer_properties,
|
||||
.class_init = grlib_gptimer_class_init,
|
||||
static TypeInfo grlib_gptimer_info = {
|
||||
.name = "grlib,gptimer",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(GPTimerUnit),
|
||||
.class_init = grlib_gptimer_class_init,
|
||||
};
|
||||
|
||||
static void grlib_gptimer_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&grlib_gptimer_info);
|
||||
type_register_static(&grlib_gptimer_info);
|
||||
}
|
||||
|
||||
device_init(grlib_gptimer_register)
|
||||
|
@ -362,22 +362,24 @@ static Property grlib_irqmp_properties[] = {
|
||||
|
||||
static void grlib_irqmp_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = grlib_irqmp_init;
|
||||
dc->reset = grlib_irqmp_reset;
|
||||
dc->props = grlib_irqmp_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo grlib_irqmp_info = {
|
||||
.name = "grlib,irqmp",
|
||||
.reset = grlib_irqmp_reset,
|
||||
.size = sizeof(IRQMP),
|
||||
.props = grlib_irqmp_properties,
|
||||
.class_init = grlib_irqmp_class_init,
|
||||
static TypeInfo grlib_irqmp_info = {
|
||||
.name = "grlib,irqmp",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(IRQMP),
|
||||
.class_init = grlib_irqmp_class_init,
|
||||
};
|
||||
|
||||
static void grlib_irqmp_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&grlib_irqmp_info);
|
||||
type_register_static(&grlib_irqmp_info);
|
||||
}
|
||||
|
||||
device_init(grlib_irqmp_register)
|
||||
|
22
hw/gt64xxx.c
22
hw/gt64xxx.c
@ -1147,10 +1147,11 @@ static void gt64120_pci_class_init(ObjectClass *klass, void *data)
|
||||
k->class_id = PCI_CLASS_BRIDGE_HOST;
|
||||
}
|
||||
|
||||
static DeviceInfo gt64120_pci_info = {
|
||||
.name = "gt64120_pci",
|
||||
.size = sizeof(PCIDevice),
|
||||
.class_init = gt64120_pci_class_init,
|
||||
static TypeInfo gt64120_pci_info = {
|
||||
.name = "gt64120_pci",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIDevice),
|
||||
.class_init = gt64120_pci_class_init,
|
||||
};
|
||||
|
||||
static void gt64120_class_init(ObjectClass *klass, void *data)
|
||||
@ -1160,16 +1161,17 @@ static void gt64120_class_init(ObjectClass *klass, void *data)
|
||||
sdc->init = gt64120_init;
|
||||
}
|
||||
|
||||
static DeviceInfo gt64120_info = {
|
||||
.name = "gt64120",
|
||||
.size = sizeof(GT64120State),
|
||||
.class_init = gt64120_class_init,
|
||||
static TypeInfo gt64120_info = {
|
||||
.name = "gt64120",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(GT64120State),
|
||||
.class_init = gt64120_class_init,
|
||||
};
|
||||
|
||||
static void gt64120_pci_register_devices(void)
|
||||
{
|
||||
sysbus_qdev_register(>64120_info);
|
||||
pci_qdev_register(>64120_pci_info);
|
||||
type_register_static(>64120_info);
|
||||
type_register_static(>64120_pci_info);
|
||||
}
|
||||
|
||||
device_init(gt64120_pci_register_devices)
|
||||
|
32
hw/gus.c
32
hw/gus.c
@ -299,29 +299,33 @@ int GUS_init (ISABus *bus)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property gus_properties[] = {
|
||||
DEFINE_PROP_UINT32 ("freq", GUSState, freq, 44100),
|
||||
DEFINE_PROP_HEX32 ("iobase", GUSState, port, 0x240),
|
||||
DEFINE_PROP_UINT32 ("irq", GUSState, emu.gusirq, 7),
|
||||
DEFINE_PROP_UINT32 ("dma", GUSState, emu.gusdma, 3),
|
||||
DEFINE_PROP_END_OF_LIST (),
|
||||
};
|
||||
|
||||
static void gus_class_initfn(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
|
||||
ic->init = gus_initfn;
|
||||
dc->desc = "Gravis Ultrasound GF1";
|
||||
dc->vmsd = &vmstate_gus;
|
||||
dc->props = gus_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo gus_info = {
|
||||
.name = "gus",
|
||||
.desc = "Gravis Ultrasound GF1",
|
||||
.size = sizeof (GUSState),
|
||||
.vmsd = &vmstate_gus,
|
||||
.class_init = gus_class_initfn,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_UINT32 ("freq", GUSState, freq, 44100),
|
||||
DEFINE_PROP_HEX32 ("iobase", GUSState, port, 0x240),
|
||||
DEFINE_PROP_UINT32 ("irq", GUSState, emu.gusirq, 7),
|
||||
DEFINE_PROP_UINT32 ("dma", GUSState, emu.gusdma, 3),
|
||||
DEFINE_PROP_END_OF_LIST (),
|
||||
},
|
||||
static TypeInfo gus_info = {
|
||||
.name = "gus",
|
||||
.parent = TYPE_ISA_DEVICE,
|
||||
.instance_size = sizeof (GUSState),
|
||||
.class_init = gus_class_initfn,
|
||||
};
|
||||
|
||||
static void gus_register (void)
|
||||
{
|
||||
isa_qdev_register (&gus_info);
|
||||
type_register_static(&gus_info);
|
||||
}
|
||||
device_init (gus_register)
|
||||
|
@ -908,45 +908,49 @@ static int hda_audio_init_duplex(HDACodecDevice *hda)
|
||||
|
||||
static void hda_audio_output_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
HDACodecDeviceClass *k = HDA_CODEC_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = hda_audio_init_output;
|
||||
k->exit = hda_audio_exit;
|
||||
k->command = hda_audio_command;
|
||||
k->stream = hda_audio_stream;
|
||||
dc->desc = "HDA Audio Codec, output-only";
|
||||
dc->vmsd = &vmstate_hda_audio;
|
||||
dc->props = hda_audio_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo hda_audio_output_info = {
|
||||
.name = "hda-output",
|
||||
.desc = "HDA Audio Codec, output-only",
|
||||
.size = sizeof(HDAAudioState),
|
||||
.vmsd = &vmstate_hda_audio,
|
||||
.props = hda_audio_properties,
|
||||
.class_init = hda_audio_output_class_init,
|
||||
static TypeInfo hda_audio_output_info = {
|
||||
.name = "hda-output",
|
||||
.parent = TYPE_HDA_CODEC_DEVICE,
|
||||
.instance_size = sizeof(HDAAudioState),
|
||||
.class_init = hda_audio_output_class_init,
|
||||
};
|
||||
|
||||
static void hda_audio_duplex_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
HDACodecDeviceClass *k = HDA_CODEC_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = hda_audio_init_duplex;
|
||||
k->exit = hda_audio_exit;
|
||||
k->command = hda_audio_command;
|
||||
k->stream = hda_audio_stream;
|
||||
dc->desc = "HDA Audio Codec, duplex";
|
||||
dc->vmsd = &vmstate_hda_audio;
|
||||
dc->props = hda_audio_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo hda_audio_duplex_info = {
|
||||
.name = "hda-duplex",
|
||||
.desc = "HDA Audio Codec, duplex",
|
||||
.size = sizeof(HDAAudioState),
|
||||
.vmsd = &vmstate_hda_audio,
|
||||
.props = hda_audio_properties,
|
||||
.class_init = hda_audio_duplex_class_init,
|
||||
static TypeInfo hda_audio_duplex_info = {
|
||||
.name = "hda-duplex",
|
||||
.parent = TYPE_HDA_CODEC_DEVICE,
|
||||
.instance_size = sizeof(HDAAudioState),
|
||||
.class_init = hda_audio_duplex_class_init,
|
||||
};
|
||||
|
||||
static void hda_audio_register(void)
|
||||
{
|
||||
hda_codec_register(&hda_audio_output_info);
|
||||
hda_codec_register(&hda_audio_duplex_info);
|
||||
type_register_static(&hda_audio_output_info);
|
||||
type_register_static(&hda_audio_duplex_info);
|
||||
}
|
||||
device_init(hda_audio_register);
|
||||
|
@ -162,22 +162,24 @@ static int highbank_regs_init(SysBusDevice *dev)
|
||||
static void highbank_regs_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
sbc->init = highbank_regs_init;
|
||||
dc->desc = "Calxeda Highbank registers";
|
||||
dc->vmsd = &vmstate_highbank_regs;
|
||||
dc->reset = highbank_regs_reset;
|
||||
}
|
||||
|
||||
static DeviceInfo highbank_regs_info = {
|
||||
.name = "highbank-regs",
|
||||
.desc = "Calxeda Highbank registers",
|
||||
.size = sizeof(HighbankRegsState),
|
||||
.vmsd = &vmstate_highbank_regs,
|
||||
.class_init = highbank_regs_class_init,
|
||||
.reset = highbank_regs_reset,
|
||||
static TypeInfo highbank_regs_info = {
|
||||
.name = "highbank-regs",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(HighbankRegsState),
|
||||
.class_init = highbank_regs_class_init,
|
||||
};
|
||||
|
||||
static void highbank_regs_register_device(void)
|
||||
{
|
||||
sysbus_qdev_register(&highbank_regs_info);
|
||||
type_register_static(&highbank_regs_info);
|
||||
}
|
||||
|
||||
device_init(highbank_regs_register_device)
|
||||
|
20
hw/hpet.c
20
hw/hpet.c
@ -703,24 +703,26 @@ static Property hpet_device_properties[] = {
|
||||
|
||||
static void hpet_device_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = hpet_init;
|
||||
dc->no_user = 1;
|
||||
dc->reset = hpet_reset;
|
||||
dc->vmsd = &vmstate_hpet;
|
||||
dc->props = hpet_device_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo hpet_device_info = {
|
||||
.name = "hpet",
|
||||
.size = sizeof(HPETState),
|
||||
.no_user = 1,
|
||||
.vmsd = &vmstate_hpet,
|
||||
.reset = hpet_reset,
|
||||
.props = hpet_device_properties,
|
||||
.class_init = hpet_device_class_init,
|
||||
static TypeInfo hpet_device_info = {
|
||||
.name = "hpet",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(HPETState),
|
||||
.class_init = hpet_device_class_init,
|
||||
};
|
||||
|
||||
static void hpet_register_device(void)
|
||||
{
|
||||
sysbus_register_withprop(&hpet_device_info);
|
||||
type_register_static(&hpet_device_info);
|
||||
}
|
||||
|
||||
device_init(hpet_register_device)
|
||||
|
21
hw/i2c.c
21
hw/i2c.c
@ -204,19 +204,6 @@ static int i2c_slave_qdev_init(DeviceState *dev, DeviceInfo *base)
|
||||
return sc->init(s);
|
||||
}
|
||||
|
||||
void i2c_register_slave_subclass(DeviceInfo *info, const char *parent)
|
||||
{
|
||||
assert(info->size >= sizeof(I2CSlave));
|
||||
info->init = i2c_slave_qdev_init;
|
||||
info->bus_info = &i2c_bus_info;
|
||||
qdev_register_subclass(info, parent);
|
||||
}
|
||||
|
||||
void i2c_register_slave(DeviceInfo *info)
|
||||
{
|
||||
i2c_register_slave_subclass(info, TYPE_I2C_SLAVE);
|
||||
}
|
||||
|
||||
DeviceState *i2c_create_slave(i2c_bus *bus, const char *name, uint8_t addr)
|
||||
{
|
||||
DeviceState *dev;
|
||||
@ -227,12 +214,20 @@ DeviceState *i2c_create_slave(i2c_bus *bus, const char *name, uint8_t addr)
|
||||
return dev;
|
||||
}
|
||||
|
||||
static void i2c_slave_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *k = DEVICE_CLASS(klass);
|
||||
k->init = i2c_slave_qdev_init;
|
||||
k->bus_info = &i2c_bus_info;
|
||||
}
|
||||
|
||||
static TypeInfo i2c_slave_type_info = {
|
||||
.name = TYPE_I2C_SLAVE,
|
||||
.parent = TYPE_DEVICE,
|
||||
.instance_size = sizeof(I2CSlave),
|
||||
.abstract = true,
|
||||
.class_size = sizeof(I2CSlaveClass),
|
||||
.class_init = i2c_slave_class_init,
|
||||
};
|
||||
|
||||
static void i2c_slave_register_devices(void)
|
||||
|
3
hw/i2c.h
3
hw/i2c.h
@ -62,9 +62,6 @@ int i2c_recv(i2c_bus *bus);
|
||||
#define I2C_SLAVE_FROM_QDEV(dev) DO_UPCAST(I2CSlave, qdev, dev)
|
||||
#define FROM_I2C_SLAVE(type, dev) DO_UPCAST(type, i2c, dev)
|
||||
|
||||
void i2c_register_slave(DeviceInfo *type);
|
||||
void i2c_register_slave_subclass(DeviceInfo *info, const char *parent);
|
||||
|
||||
DeviceState *i2c_create_slave(i2c_bus *bus, const char *name, uint8_t addr);
|
||||
|
||||
/* wm8750.c */
|
||||
|
22
hw/i82374.c
22
hw/i82374.c
@ -135,27 +135,31 @@ static int i82374_isa_init(ISADevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property i82374_properties[] = {
|
||||
DEFINE_PROP_HEX32("iobase", ISAi82374State, iobase, 0x400),
|
||||
DEFINE_PROP_END_OF_LIST()
|
||||
};
|
||||
|
||||
static void i82374_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
ISADeviceClass *k = ISA_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = i82374_isa_init;
|
||||
k->init = i82374_isa_init;
|
||||
dc->vmsd = &vmstate_isa_i82374;
|
||||
dc->props = i82374_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo i82374_isa_info = {
|
||||
static TypeInfo i82374_isa_info = {
|
||||
.name = "i82374",
|
||||
.size = sizeof(ISAi82374State),
|
||||
.vmsd = &vmstate_isa_i82374,
|
||||
.parent = TYPE_ISA_DEVICE,
|
||||
.instance_size = sizeof(ISAi82374State),
|
||||
.class_init = i82374_class_init,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_HEX32("iobase", ISAi82374State, iobase, 0x400),
|
||||
DEFINE_PROP_END_OF_LIST()
|
||||
},
|
||||
};
|
||||
|
||||
static void i82374_register_devices(void)
|
||||
{
|
||||
isa_qdev_register(&i82374_isa_info);
|
||||
type_register_static(&i82374_isa_info);
|
||||
}
|
||||
|
||||
device_init(i82374_register_devices)
|
||||
|
22
hw/i82378.c
22
hw/i82378.c
@ -238,9 +238,16 @@ static int pci_i82378_init(PCIDevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property i82378_properties[] = {
|
||||
DEFINE_PROP_HEX32("iobase", PCIi82378State, isa_io_base, 0x80000000),
|
||||
DEFINE_PROP_HEX32("membase", PCIi82378State, isa_mem_base, 0xc0000000),
|
||||
DEFINE_PROP_END_OF_LIST()
|
||||
};
|
||||
|
||||
static void pci_i82378_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = pci_i82378_init;
|
||||
k->vendor_id = PCI_VENDOR_ID_INTEL;
|
||||
@ -249,23 +256,20 @@ static void pci_i82378_class_init(ObjectClass *klass, void *data)
|
||||
k->class_id = PCI_CLASS_BRIDGE_ISA;
|
||||
k->subsystem_vendor_id = 0x0;
|
||||
k->subsystem_id = 0x0;
|
||||
dc->vmsd = &vmstate_pci_i82378;
|
||||
dc->props = i82378_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo pci_i82378_info = {
|
||||
static TypeInfo pci_i82378_info = {
|
||||
.name = "i82378",
|
||||
.size = sizeof(PCIi82378State),
|
||||
.vmsd = &vmstate_pci_i82378,
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIi82378State),
|
||||
.class_init = pci_i82378_class_init,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_HEX32("iobase", PCIi82378State, isa_io_base, 0x80000000),
|
||||
DEFINE_PROP_HEX32("membase", PCIi82378State, isa_mem_base, 0xc0000000),
|
||||
DEFINE_PROP_END_OF_LIST()
|
||||
},
|
||||
};
|
||||
|
||||
static void i82378_register_devices(void)
|
||||
{
|
||||
pci_qdev_register(&pci_i82378_info);
|
||||
type_register_static(&pci_i82378_info);
|
||||
}
|
||||
|
||||
device_init(i82378_register_devices)
|
||||
|
30
hw/i8254.c
30
hw/i8254.c
@ -535,28 +535,32 @@ static int pit_initfn(ISADevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property pit_properties[] = {
|
||||
DEFINE_PROP_UINT32("irq", PITState, irq, -1),
|
||||
DEFINE_PROP_HEX32("iobase", PITState, iobase, -1),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void pit_class_initfn(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
|
||||
ic->init = pit_initfn;
|
||||
dc->no_user = 1;
|
||||
dc->reset = pit_reset;
|
||||
dc->vmsd = &vmstate_pit;
|
||||
dc->props = pit_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo pit_info = {
|
||||
.name = "isa-pit",
|
||||
.size = sizeof(PITState),
|
||||
.vmsd = &vmstate_pit,
|
||||
.reset = pit_reset,
|
||||
.no_user = 1,
|
||||
.class_init = pit_class_initfn,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_UINT32("irq", PITState, irq, -1),
|
||||
DEFINE_PROP_HEX32("iobase", PITState, iobase, -1),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
},
|
||||
static TypeInfo pit_info = {
|
||||
.name = "isa-pit",
|
||||
.parent = TYPE_ISA_DEVICE,
|
||||
.instance_size = sizeof(PITState),
|
||||
.class_init = pit_class_initfn,
|
||||
};
|
||||
|
||||
static void pit_register(void)
|
||||
{
|
||||
isa_qdev_register(&pit_info);
|
||||
type_register_static(&pit_info);
|
||||
}
|
||||
device_init(pit_register)
|
||||
|
11
hw/i8259.c
11
hw/i8259.c
@ -475,19 +475,22 @@ qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq)
|
||||
static void i8259_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
PICCommonClass *k = PIC_COMMON_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = pic_init;
|
||||
dc->reset = pic_reset;
|
||||
}
|
||||
|
||||
static DeviceInfo i8259_info = {
|
||||
.name = "isa-i8259",
|
||||
.reset = pic_reset,
|
||||
static TypeInfo i8259_info = {
|
||||
.name = "isa-i8259",
|
||||
.instance_size = sizeof(PICCommonState),
|
||||
.parent = TYPE_PIC_COMMON,
|
||||
.class_init = i8259_class_init,
|
||||
};
|
||||
|
||||
static void pic_register(void)
|
||||
{
|
||||
pic_qdev_register(&i8259_info);
|
||||
type_register_static(&i8259_info);
|
||||
}
|
||||
|
||||
device_init(pic_register)
|
||||
|
@ -133,19 +133,14 @@ static Property pic_properties_common[] = {
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
void pic_qdev_register(DeviceInfo *info)
|
||||
{
|
||||
info->size = sizeof(PICCommonState);
|
||||
info->vmsd = &vmstate_pic_common;
|
||||
info->no_user = 1;
|
||||
info->props = pic_properties_common;
|
||||
isa_qdev_register_subclass(info, TYPE_PIC_COMMON);
|
||||
}
|
||||
|
||||
static void pic_common_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->vmsd = &vmstate_pic_common;
|
||||
dc->no_user = 1;
|
||||
dc->props = pic_properties_common;
|
||||
ic->init = pic_init_common;
|
||||
}
|
||||
|
||||
|
@ -78,6 +78,5 @@ void pic_reset_common(PICCommonState *s);
|
||||
|
||||
ISADevice *i8259_init_chip(const char *name, ISABus *bus, bool master);
|
||||
|
||||
void pic_qdev_register(DeviceInfo *info);
|
||||
|
||||
#endif /* !QEMU_I8259_INTERNAL_H */
|
||||
|
@ -1239,27 +1239,31 @@ static int sysbus_ahci_init(SysBusDevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property sysbus_ahci_properties[] = {
|
||||
DEFINE_PROP_UINT32("num-ports", SysbusAHCIState, num_ports, 1),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void sysbus_ahci_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
sbc->init = sysbus_ahci_init;
|
||||
dc->vmsd = &vmstate_sysbus_ahci;
|
||||
dc->props = sysbus_ahci_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo sysbus_ahci_info = {
|
||||
.name = "sysbus-ahci",
|
||||
.size = sizeof(SysbusAHCIState),
|
||||
.vmsd = &vmstate_sysbus_ahci,
|
||||
.class_init = sysbus_ahci_class_init,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_UINT32("num-ports", SysbusAHCIState, num_ports, 1),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
},
|
||||
static TypeInfo sysbus_ahci_info = {
|
||||
.name = "sysbus-ahci",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(SysbusAHCIState),
|
||||
.class_init = sysbus_ahci_class_init,
|
||||
};
|
||||
|
||||
static void sysbus_ahci_register(void)
|
||||
{
|
||||
sysbus_qdev_register(&sysbus_ahci_info);
|
||||
type_register_static(&sysbus_ahci_info);
|
||||
}
|
||||
|
||||
device_init(sysbus_ahci_register);
|
||||
|
@ -332,6 +332,7 @@ static Property cmd646_ide_properties[] = {
|
||||
|
||||
static void cmd646_ide_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = pci_cmd646_ide_initfn;
|
||||
@ -340,17 +341,18 @@ static void cmd646_ide_class_init(ObjectClass *klass, void *data)
|
||||
k->device_id = PCI_DEVICE_ID_CMD_646;
|
||||
k->revision = 0x07;
|
||||
k->class_id = PCI_CLASS_STORAGE_IDE;
|
||||
dc->props = cmd646_ide_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo cmd646_ide_info = {
|
||||
.name = "cmd646-ide",
|
||||
.size = sizeof(PCIIDEState),
|
||||
.props = cmd646_ide_properties,
|
||||
.class_init = cmd646_ide_class_init,
|
||||
static TypeInfo cmd646_ide_info = {
|
||||
.name = "cmd646-ide",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIIDEState),
|
||||
.class_init = cmd646_ide_class_init,
|
||||
};
|
||||
|
||||
static void cmd646_ide_register(void)
|
||||
{
|
||||
pci_qdev_register(&cmd646_ide_info);
|
||||
type_register_static(&cmd646_ide_info);
|
||||
}
|
||||
device_init(cmd646_ide_register);
|
||||
|
17
hw/ide/ich.c
17
hw/ide/ich.c
@ -148,6 +148,7 @@ static void pci_ich9_write_config(PCIDevice *pci, uint32_t addr,
|
||||
|
||||
static void ich_ahci_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = pci_ich9_ahci_init;
|
||||
@ -157,18 +158,20 @@ static void ich_ahci_class_init(ObjectClass *klass, void *data)
|
||||
k->device_id = PCI_DEVICE_ID_INTEL_82801IR;
|
||||
k->revision = 0x02;
|
||||
k->class_id = PCI_CLASS_STORAGE_SATA;
|
||||
dc->alias = "ahci";
|
||||
dc->vmsd = &vmstate_ahci;
|
||||
}
|
||||
|
||||
static DeviceInfo ich_ahci_info = {
|
||||
.name = "ich9-ahci",
|
||||
.alias = "ahci",
|
||||
.size = sizeof(AHCIPCIState),
|
||||
.vmsd = &vmstate_ahci,
|
||||
.class_init = ich_ahci_class_init,
|
||||
static TypeInfo ich_ahci_info = {
|
||||
.name = "ich9-ahci",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(AHCIPCIState),
|
||||
.class_init = ich_ahci_class_init,
|
||||
};
|
||||
|
||||
static void ich_ahci_register(void)
|
||||
{
|
||||
pci_qdev_register(&ich_ahci_info);
|
||||
type_register_static(&ich_ahci_info);
|
||||
type_register_static_alias(&ich_ahci_info, "ahci");
|
||||
}
|
||||
device_init(ich_ahci_register);
|
||||
|
30
hw/ide/isa.c
30
hw/ide/isa.c
@ -94,29 +94,33 @@ ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
|
||||
return dev;
|
||||
}
|
||||
|
||||
static Property isa_ide_properties[] = {
|
||||
DEFINE_PROP_HEX32("iobase", ISAIDEState, iobase, 0x1f0),
|
||||
DEFINE_PROP_HEX32("iobase2", ISAIDEState, iobase2, 0x3f6),
|
||||
DEFINE_PROP_UINT32("irq", ISAIDEState, isairq, 14),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void isa_ide_class_initfn(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
|
||||
ic->init = isa_ide_initfn;
|
||||
dc->fw_name = "ide";
|
||||
dc->reset = isa_ide_reset;
|
||||
dc->props = isa_ide_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo isa_ide_info = {
|
||||
.name = "isa-ide",
|
||||
.fw_name = "ide",
|
||||
.size = sizeof(ISAIDEState),
|
||||
.class_init = isa_ide_class_initfn,
|
||||
.reset = isa_ide_reset,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_HEX32("iobase", ISAIDEState, iobase, 0x1f0),
|
||||
DEFINE_PROP_HEX32("iobase2", ISAIDEState, iobase2, 0x3f6),
|
||||
DEFINE_PROP_UINT32("irq", ISAIDEState, isairq, 14),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
},
|
||||
static TypeInfo isa_ide_info = {
|
||||
.name = "isa-ide",
|
||||
.parent = TYPE_ISA_DEVICE,
|
||||
.instance_size = sizeof(ISAIDEState),
|
||||
.class_init = isa_ide_class_initfn,
|
||||
};
|
||||
|
||||
static void isa_ide_register_devices(void)
|
||||
{
|
||||
isa_qdev_register(&isa_ide_info);
|
||||
type_register_static(&isa_ide_info);
|
||||
}
|
||||
|
||||
device_init(isa_ide_register_devices)
|
||||
|
@ -239,6 +239,7 @@ PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
|
||||
|
||||
static void piix3_ide_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->no_hotplug = 1;
|
||||
@ -247,35 +248,39 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data)
|
||||
k->vendor_id = PCI_VENDOR_ID_INTEL;
|
||||
k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1;
|
||||
k->class_id = PCI_CLASS_STORAGE_IDE;
|
||||
dc->no_user = 1;
|
||||
}
|
||||
|
||||
static DeviceInfo piix3_ide_info = {
|
||||
.name = "piix3-ide",
|
||||
.size = sizeof(PCIIDEState),
|
||||
.no_user = 1,
|
||||
.class_init = piix3_ide_class_init,
|
||||
static TypeInfo piix3_ide_info = {
|
||||
.name = "piix3-ide",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIIDEState),
|
||||
.class_init = piix3_ide_class_init,
|
||||
};
|
||||
|
||||
static void piix3_ide_xen_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = pci_piix_ide_initfn;
|
||||
k->vendor_id = PCI_VENDOR_ID_INTEL;
|
||||
k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1;
|
||||
k->class_id = PCI_CLASS_STORAGE_IDE;
|
||||
dc->no_user = 1;
|
||||
dc->unplug = pci_piix3_xen_ide_unplug;
|
||||
}
|
||||
|
||||
static DeviceInfo piix3_ide_xen_info = {
|
||||
.name = "piix3-ide-xen",
|
||||
.size = sizeof(PCIIDEState),
|
||||
.no_user = 1,
|
||||
.class_init = piix3_ide_xen_class_init,
|
||||
.unplug = pci_piix3_xen_ide_unplug,
|
||||
static TypeInfo piix3_ide_xen_info = {
|
||||
.name = "piix3-ide-xen",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIIDEState),
|
||||
.class_init = piix3_ide_xen_class_init,
|
||||
};
|
||||
|
||||
static void piix4_ide_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->no_hotplug = 1;
|
||||
@ -284,19 +289,20 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data)
|
||||
k->vendor_id = PCI_VENDOR_ID_INTEL;
|
||||
k->device_id = PCI_DEVICE_ID_INTEL_82371AB;
|
||||
k->class_id = PCI_CLASS_STORAGE_IDE;
|
||||
dc->no_user = 1;
|
||||
}
|
||||
|
||||
static DeviceInfo piix4_ide_info = {
|
||||
.name = "piix4-ide",
|
||||
.size = sizeof(PCIIDEState),
|
||||
.no_user = 1,
|
||||
.class_init = piix4_ide_class_init,
|
||||
static TypeInfo piix4_ide_info = {
|
||||
.name = "piix4-ide",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIIDEState),
|
||||
.class_init = piix4_ide_class_init,
|
||||
};
|
||||
|
||||
static void piix_ide_register(void)
|
||||
{
|
||||
pci_qdev_register(&piix3_ide_info);
|
||||
pci_qdev_register(&piix3_ide_xen_info);
|
||||
pci_qdev_register(&piix4_ide_info);
|
||||
type_register_static(&piix3_ide_info);
|
||||
type_register_static(&piix3_ide_xen_info);
|
||||
type_register_static(&piix4_ide_info);
|
||||
}
|
||||
device_init(piix_ide_register);
|
||||
|
@ -91,13 +91,6 @@ err:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void ide_qdev_register(DeviceInfo *info)
|
||||
{
|
||||
info->init = ide_qdev_init;
|
||||
info->bus_info = &ide_bus_info;
|
||||
qdev_register_subclass(info, TYPE_IDE_DEVICE);
|
||||
}
|
||||
|
||||
IDEDevice *ide_create_drive(IDEBus *bus, int unit, DriveInfo *drive)
|
||||
{
|
||||
DeviceState *dev;
|
||||
@ -182,73 +175,93 @@ static int ide_drive_initfn(IDEDevice *dev)
|
||||
DEFINE_PROP_STRING("ver", IDEDrive, dev.version), \
|
||||
DEFINE_PROP_STRING("serial", IDEDrive, dev.serial)
|
||||
|
||||
static Property ide_hd_properties[] = {
|
||||
DEFINE_IDE_DEV_PROPERTIES(),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void ide_hd_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
IDEDeviceClass *k = IDE_DEVICE_CLASS(klass);
|
||||
k->init = ide_hd_initfn;
|
||||
dc->fw_name = "drive";
|
||||
dc->desc = "virtual IDE disk";
|
||||
dc->props = ide_hd_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo ide_hd_info = {
|
||||
.name = "ide-hd",
|
||||
.fw_name = "drive",
|
||||
.desc = "virtual IDE disk",
|
||||
.size = sizeof(IDEDrive),
|
||||
.class_init = ide_hd_class_init,
|
||||
.props = (Property[]) {
|
||||
DEFINE_IDE_DEV_PROPERTIES(),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
}
|
||||
static TypeInfo ide_hd_info = {
|
||||
.name = "ide-hd",
|
||||
.parent = TYPE_IDE_DEVICE,
|
||||
.instance_size = sizeof(IDEDrive),
|
||||
.class_init = ide_hd_class_init,
|
||||
};
|
||||
|
||||
static Property ide_cd_properties[] = {
|
||||
DEFINE_IDE_DEV_PROPERTIES(),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void ide_cd_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
IDEDeviceClass *k = IDE_DEVICE_CLASS(klass);
|
||||
k->init = ide_cd_initfn;
|
||||
dc->fw_name = "drive";
|
||||
dc->desc = "virtual IDE CD-ROM";
|
||||
dc->props = ide_cd_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo ide_cd_info = {
|
||||
.name = "ide-cd",
|
||||
.fw_name = "drive",
|
||||
.desc = "virtual IDE CD-ROM",
|
||||
.size = sizeof(IDEDrive),
|
||||
.class_init = ide_cd_class_init,
|
||||
.props = (Property[]) {
|
||||
DEFINE_IDE_DEV_PROPERTIES(),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
}
|
||||
static TypeInfo ide_cd_info = {
|
||||
.name = "ide-cd",
|
||||
.parent = TYPE_IDE_DEVICE,
|
||||
.instance_size = sizeof(IDEDrive),
|
||||
.class_init = ide_cd_class_init,
|
||||
};
|
||||
|
||||
static Property ide_drive_properties[] = {
|
||||
DEFINE_IDE_DEV_PROPERTIES(),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void ide_drive_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
IDEDeviceClass *k = IDE_DEVICE_CLASS(klass);
|
||||
k->init = ide_drive_initfn;
|
||||
dc->fw_name = "drive";
|
||||
dc->desc = "virtual IDE disk or CD-ROM (legacy)";
|
||||
dc->props = ide_drive_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo ide_drive_info = {
|
||||
.name = "ide-drive", /* legacy -device ide-drive */
|
||||
.fw_name = "drive",
|
||||
.desc = "virtual IDE disk or CD-ROM (legacy)",
|
||||
.size = sizeof(IDEDrive),
|
||||
.class_init = ide_drive_class_init,
|
||||
.props = (Property[]) {
|
||||
DEFINE_IDE_DEV_PROPERTIES(),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
}
|
||||
static TypeInfo ide_drive_info = {
|
||||
.name = "ide-drive",
|
||||
.parent = TYPE_IDE_DEVICE,
|
||||
.instance_size = sizeof(IDEDrive),
|
||||
.class_init = ide_drive_class_init,
|
||||
};
|
||||
|
||||
static void ide_device_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *k = DEVICE_CLASS(klass);
|
||||
k->init = ide_qdev_init;
|
||||
k->bus_info = &ide_bus_info;
|
||||
}
|
||||
|
||||
static TypeInfo ide_device_type_info = {
|
||||
.name = TYPE_IDE_DEVICE,
|
||||
.parent = TYPE_DEVICE,
|
||||
.instance_size = sizeof(IDEDevice),
|
||||
.abstract = true,
|
||||
.class_size = sizeof(IDEDeviceClass),
|
||||
.class_init = ide_device_class_init,
|
||||
};
|
||||
|
||||
static void ide_dev_register(void)
|
||||
{
|
||||
ide_qdev_register(&ide_hd_info);
|
||||
ide_qdev_register(&ide_cd_info);
|
||||
ide_qdev_register(&ide_drive_info);
|
||||
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);
|
||||
|
14
hw/ide/via.c
14
hw/ide/via.c
@ -215,6 +215,7 @@ void vt82c686b_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
|
||||
|
||||
static void via_ide_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = vt82c686b_ide_initfn;
|
||||
@ -223,17 +224,18 @@ static void via_ide_class_init(ObjectClass *klass, void *data)
|
||||
k->device_id = PCI_DEVICE_ID_VIA_IDE;
|
||||
k->revision = 0x06;
|
||||
k->class_id = PCI_CLASS_STORAGE_IDE;
|
||||
dc->no_user = 1;
|
||||
}
|
||||
|
||||
static DeviceInfo via_ide_info = {
|
||||
.name = "via-ide",
|
||||
.size = sizeof(PCIIDEState),
|
||||
.no_user = 1,
|
||||
.class_init = via_ide_class_init,
|
||||
static TypeInfo via_ide_info = {
|
||||
.name = "via-ide",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIIDEState),
|
||||
.class_init = via_ide_class_init,
|
||||
};
|
||||
|
||||
static void via_ide_register(void)
|
||||
{
|
||||
pci_qdev_register(&via_ide_info);
|
||||
type_register_static(&via_ide_info);
|
||||
}
|
||||
device_init(via_ide_register);
|
||||
|
@ -525,16 +525,18 @@ static Property core_properties[] = {
|
||||
|
||||
static void core_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = integratorcm_init;
|
||||
dc->props = core_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo core_info = {
|
||||
.name = "integrator_core",
|
||||
.size = sizeof(integratorcm_state),
|
||||
.props = core_properties,
|
||||
.class_init = core_class_init,
|
||||
static TypeInfo core_info = {
|
||||
.name = "integrator_core",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(integratorcm_state),
|
||||
.class_init = core_class_init,
|
||||
};
|
||||
|
||||
static void icp_pic_class_init(ObjectClass *klass, void *data)
|
||||
@ -544,16 +546,17 @@ static void icp_pic_class_init(ObjectClass *klass, void *data)
|
||||
sdc->init = icp_pic_init;
|
||||
}
|
||||
|
||||
static DeviceInfo icp_pic_info = {
|
||||
.name = "integrator_pic",
|
||||
.size = sizeof(icp_pic_state),
|
||||
.class_init = icp_pic_class_init,
|
||||
static TypeInfo icp_pic_info = {
|
||||
.name = "integrator_pic",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(icp_pic_state),
|
||||
.class_init = icp_pic_class_init,
|
||||
};
|
||||
|
||||
static void integratorcp_register_devices(void)
|
||||
{
|
||||
sysbus_qdev_register(&icp_pic_info);
|
||||
sysbus_register_withprop(&core_info);
|
||||
type_register_static(&icp_pic_info);
|
||||
type_register_static(&core_info);
|
||||
}
|
||||
|
||||
device_init(integratorcp_register_devices)
|
||||
|
@ -74,14 +74,6 @@ static int hda_codec_dev_exit(DeviceState *qdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void hda_codec_register(DeviceInfo *info)
|
||||
{
|
||||
info->init = hda_codec_dev_init;
|
||||
info->exit = hda_codec_dev_exit;
|
||||
info->bus_info = &hda_codec_bus_info;
|
||||
qdev_register_subclass(info, TYPE_HDA_CODEC_DEVICE);
|
||||
}
|
||||
|
||||
HDACodecDevice *hda_codec_find(HDACodecBus *bus, uint32_t cad)
|
||||
{
|
||||
DeviceState *qdev;
|
||||
@ -1255,6 +1247,7 @@ static Property intel_hda_properties[] = {
|
||||
|
||||
static void intel_hda_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = intel_hda_init;
|
||||
@ -1264,29 +1257,39 @@ static void intel_hda_class_init(ObjectClass *klass, void *data)
|
||||
k->device_id = 0x2668;
|
||||
k->revision = 1;
|
||||
k->class_id = PCI_CLASS_MULTIMEDIA_HD_AUDIO;
|
||||
dc->desc = "Intel HD Audio Controller";
|
||||
dc->reset = intel_hda_reset;
|
||||
dc->vmsd = &vmstate_intel_hda;
|
||||
dc->props = intel_hda_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo intel_hda_info = {
|
||||
.name = "intel-hda",
|
||||
.desc = "Intel HD Audio Controller",
|
||||
.size = sizeof(IntelHDAState),
|
||||
.vmsd = &vmstate_intel_hda,
|
||||
.reset = intel_hda_reset,
|
||||
.props = intel_hda_properties,
|
||||
.class_init = intel_hda_class_init,
|
||||
static TypeInfo intel_hda_info = {
|
||||
.name = "intel-hda",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(IntelHDAState),
|
||||
.class_init = intel_hda_class_init,
|
||||
};
|
||||
|
||||
static void hda_codec_device_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *k = DEVICE_CLASS(klass);
|
||||
k->init = hda_codec_dev_init;
|
||||
k->exit = hda_codec_dev_exit;
|
||||
k->bus_info = &hda_codec_bus_info;
|
||||
}
|
||||
|
||||
static TypeInfo hda_codec_device_type_info = {
|
||||
.name = TYPE_HDA_CODEC_DEVICE,
|
||||
.parent = TYPE_DEVICE,
|
||||
.instance_size = sizeof(HDACodecDevice),
|
||||
.abstract = true,
|
||||
.class_size = sizeof(HDACodecDeviceClass),
|
||||
.class_init = hda_codec_device_class_init,
|
||||
};
|
||||
|
||||
static void intel_hda_register(void)
|
||||
{
|
||||
pci_qdev_register(&intel_hda_info);
|
||||
type_register_static(&intel_hda_info);
|
||||
type_register_static(&hda_codec_device_type_info);
|
||||
}
|
||||
device_init(intel_hda_register);
|
||||
|
@ -48,7 +48,6 @@ struct HDACodecDevice {
|
||||
void hda_codec_bus_init(DeviceState *dev, HDACodecBus *bus,
|
||||
hda_codec_response_func response,
|
||||
hda_codec_xfer_func xfer);
|
||||
void hda_codec_register(DeviceInfo *info);
|
||||
HDACodecDevice *hda_codec_find(HDACodecBus *bus, uint32_t cad);
|
||||
|
||||
void hda_codec_response(HDACodecDevice *dev, bool solicited, uint32_t response);
|
||||
|
14
hw/ioapic.c
14
hw/ioapic.c
@ -238,20 +238,22 @@ static void ioapic_init(IOAPICCommonState *s, int instance_no)
|
||||
static void ioapic_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
IOAPICCommonClass *k = IOAPIC_COMMON_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = ioapic_init;
|
||||
dc->reset = ioapic_reset_common;
|
||||
}
|
||||
|
||||
static DeviceInfo ioapic_info = {
|
||||
.name = "ioapic",
|
||||
.size = sizeof(IOAPICCommonState),
|
||||
.reset = ioapic_reset_common,
|
||||
.class_init = ioapic_class_init,
|
||||
static TypeInfo ioapic_info = {
|
||||
.name = "ioapic",
|
||||
.parent = TYPE_IOAPIC_COMMON,
|
||||
.instance_size = sizeof(IOAPICCommonState),
|
||||
.class_init = ioapic_class_init,
|
||||
};
|
||||
|
||||
static void ioapic_register_devices(void)
|
||||
{
|
||||
ioapic_qdev_register(&ioapic_info);
|
||||
type_register_static(&ioapic_info);
|
||||
}
|
||||
|
||||
device_init(ioapic_register_devices)
|
||||
|
@ -96,8 +96,11 @@ static const VMStateDescription vmstate_ioapic_common = {
|
||||
static void ioapic_common_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
SysBusDeviceClass *sc = SYS_BUS_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
sc->init = ioapic_init_common;
|
||||
dc->vmsd = &vmstate_ioapic_common;
|
||||
dc->no_user = 1;
|
||||
}
|
||||
|
||||
static TypeInfo ioapic_common_type = {
|
||||
@ -109,13 +112,6 @@ static TypeInfo ioapic_common_type = {
|
||||
.abstract = true,
|
||||
};
|
||||
|
||||
void ioapic_qdev_register(DeviceInfo *info)
|
||||
{
|
||||
info->vmsd = &vmstate_ioapic_common;
|
||||
info->no_user = 1;
|
||||
sysbus_qdev_register_subclass(info, TYPE_IOAPIC_COMMON);
|
||||
}
|
||||
|
||||
static void register_devices(void)
|
||||
{
|
||||
type_register_static(&ioapic_common_type);
|
||||
|
@ -97,7 +97,6 @@ struct IOAPICCommonState {
|
||||
uint64_t ioredtbl[IOAPIC_NUM_PINS];
|
||||
};
|
||||
|
||||
void ioapic_qdev_register(DeviceInfo *info);
|
||||
void ioapic_reset_common(DeviceState *dev);
|
||||
|
||||
#endif /* !QEMU_IOAPIC_INTERNAL_H */
|
||||
|
20
hw/ioh3420.c
20
hw/ioh3420.c
@ -213,6 +213,7 @@ static Property ioh3420_properties[] = {
|
||||
|
||||
static void ioh3420_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->is_express = 1;
|
||||
@ -223,21 +224,22 @@ static void ioh3420_class_init(ObjectClass *klass, void *data)
|
||||
k->vendor_id = PCI_VENDOR_ID_INTEL;
|
||||
k->device_id = PCI_DEVICE_ID_IOH_EPORT;
|
||||
k->revision = PCI_DEVICE_ID_IOH_REV;
|
||||
dc->desc = "Intel IOH device id 3420 PCIE Root Port";
|
||||
dc->reset = ioh3420_reset;
|
||||
dc->vmsd = &vmstate_ioh3420;
|
||||
dc->props = ioh3420_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo ioh3420_info = {
|
||||
.name = "ioh3420",
|
||||
.desc = "Intel IOH device id 3420 PCIE Root Port",
|
||||
.size = sizeof(PCIESlot),
|
||||
.reset = ioh3420_reset,
|
||||
.vmsd = &vmstate_ioh3420,
|
||||
.props = ioh3420_properties,
|
||||
.class_init = ioh3420_class_init,
|
||||
static TypeInfo ioh3420_info = {
|
||||
.name = "ioh3420",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PCIESlot),
|
||||
.class_init = ioh3420_class_init,
|
||||
};
|
||||
|
||||
static void ioh3420_register(void)
|
||||
{
|
||||
pci_qdev_register(&ioh3420_info);
|
||||
type_register_static(&ioh3420_info);
|
||||
}
|
||||
|
||||
device_init(ioh3420_register);
|
||||
|
36
hw/isa-bus.c
36
hw/isa-bus.c
@ -125,18 +125,6 @@ static int isa_qdev_init(DeviceState *qdev, DeviceInfo *base)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void isa_qdev_register_subclass(DeviceInfo *info, const char *parent)
|
||||
{
|
||||
info->init = isa_qdev_init;
|
||||
info->bus_info = &isa_bus_info;
|
||||
qdev_register_subclass(info, parent);
|
||||
}
|
||||
|
||||
void isa_qdev_register(DeviceInfo *info)
|
||||
{
|
||||
isa_qdev_register_subclass(info, TYPE_ISA_DEVICE);
|
||||
}
|
||||
|
||||
ISADevice *isa_create(ISABus *bus, const char *name)
|
||||
{
|
||||
DeviceState *dev;
|
||||
@ -191,30 +179,40 @@ static int isabus_bridge_init(SysBusDevice *dev)
|
||||
|
||||
static void isabus_bridge_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = isabus_bridge_init;
|
||||
dc->fw_name = "isa";
|
||||
dc->no_user = 1;
|
||||
}
|
||||
|
||||
static DeviceInfo isabus_bridge_info = {
|
||||
.name = "isabus-bridge",
|
||||
.fw_name = "isa",
|
||||
.size = sizeof(SysBusDevice),
|
||||
.no_user = 1,
|
||||
.class_init = isabus_bridge_class_init,
|
||||
static TypeInfo isabus_bridge_info = {
|
||||
.name = "isabus-bridge",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(SysBusDevice),
|
||||
.class_init = isabus_bridge_class_init,
|
||||
};
|
||||
|
||||
static void isa_device_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *k = DEVICE_CLASS(klass);
|
||||
k->init = isa_qdev_init;
|
||||
k->bus_info = &isa_bus_info;
|
||||
}
|
||||
|
||||
static TypeInfo isa_device_type_info = {
|
||||
.name = TYPE_ISA_DEVICE,
|
||||
.parent = TYPE_DEVICE,
|
||||
.instance_size = sizeof(ISADevice),
|
||||
.abstract = true,
|
||||
.class_size = sizeof(ISADeviceClass),
|
||||
.class_init = isa_device_class_init,
|
||||
};
|
||||
|
||||
static void isabus_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&isabus_bridge_info);
|
||||
type_register_static(&isabus_bridge_info);
|
||||
type_register_static(&isa_device_type_info);
|
||||
}
|
||||
|
||||
|
2
hw/isa.h
2
hw/isa.h
@ -41,8 +41,6 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space_io);
|
||||
void isa_bus_irqs(ISABus *bus, qemu_irq *irqs);
|
||||
qemu_irq isa_get_irq(ISADevice *dev, int isairq);
|
||||
void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
|
||||
void isa_qdev_register(DeviceInfo *info);
|
||||
void isa_qdev_register_subclass(DeviceInfo *info, const char *parent);
|
||||
MemoryRegion *isa_address_space(ISADevice *dev);
|
||||
ISADevice *isa_create(ISABus *bus, const char *name);
|
||||
ISADevice *isa_try_create(ISABus *bus, const char *name);
|
||||
|
16
hw/ivshmem.c
16
hw/ivshmem.c
@ -779,6 +779,7 @@ static Property ivshmem_properties[] = {
|
||||
|
||||
static void ivshmem_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = pci_ivshmem_init;
|
||||
@ -786,19 +787,20 @@ static void ivshmem_class_init(ObjectClass *klass, void *data)
|
||||
k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
|
||||
k->device_id = 0x1110;
|
||||
k->class_id = PCI_CLASS_MEMORY_RAM;
|
||||
dc->reset = ivshmem_reset;
|
||||
dc->props = ivshmem_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo ivshmem_info = {
|
||||
.name = "ivshmem",
|
||||
.size = sizeof(IVShmemState),
|
||||
.reset = ivshmem_reset,
|
||||
.props = ivshmem_properties,
|
||||
.class_init = ivshmem_class_init,
|
||||
static TypeInfo ivshmem_info = {
|
||||
.name = "ivshmem",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(IVShmemState),
|
||||
.class_init = ivshmem_class_init,
|
||||
};
|
||||
|
||||
static void ivshmem_register_devices(void)
|
||||
{
|
||||
pci_qdev_register(&ivshmem_info);
|
||||
type_register_static(&ivshmem_info);
|
||||
}
|
||||
|
||||
device_init(ivshmem_register_devices)
|
||||
|
@ -132,14 +132,15 @@ static void kvm_apic_class_init(ObjectClass *klass, void *data)
|
||||
k->external_nmi = kvm_apic_external_nmi;
|
||||
}
|
||||
|
||||
static DeviceInfo kvm_apic_info = {
|
||||
static TypeInfo kvm_apic_info = {
|
||||
.name = "kvm-apic",
|
||||
.parent = TYPE_APIC_COMMON,
|
||||
.class_init = kvm_apic_class_init,
|
||||
};
|
||||
|
||||
static void kvm_apic_register_device(void)
|
||||
{
|
||||
apic_qdev_register(&kvm_apic_info);
|
||||
type_register_static(&kvm_apic_info);
|
||||
}
|
||||
|
||||
device_init(kvm_apic_register_device)
|
||||
|
@ -94,17 +94,19 @@ static const VMStateDescription kvmclock_vmsd = {
|
||||
|
||||
static void kvmclock_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = kvmclock_init;
|
||||
dc->no_user = 1;
|
||||
dc->vmsd = &kvmclock_vmsd;
|
||||
}
|
||||
|
||||
static DeviceInfo kvmclock_info = {
|
||||
.name = "kvmclock",
|
||||
.size = sizeof(KVMClockState),
|
||||
.vmsd = &kvmclock_vmsd,
|
||||
.no_user = 1,
|
||||
.class_init = kvmclock_class_init,
|
||||
static TypeInfo kvmclock_info = {
|
||||
.name = "kvmclock",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(KVMClockState),
|
||||
.class_init = kvmclock_class_init,
|
||||
};
|
||||
|
||||
/* Note: Must be called after VCPU initialization. */
|
||||
@ -120,7 +122,7 @@ void kvmclock_create(void)
|
||||
static void kvmclock_register_device(void)
|
||||
{
|
||||
if (kvm_enabled()) {
|
||||
sysbus_register_withprop(&kvmclock_info);
|
||||
type_register_static(&kvmclock_info);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -115,21 +115,23 @@ qemu_irq *kvm_i8259_init(ISABus *bus)
|
||||
static void kvm_i8259_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
PICCommonClass *k = PIC_COMMON_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->reset = kvm_pic_reset;
|
||||
k->init = kvm_pic_init;
|
||||
k->pre_save = kvm_pic_get;
|
||||
k->post_load = kvm_pic_put;
|
||||
}
|
||||
|
||||
static DeviceInfo kvm_i8259_info = {
|
||||
static TypeInfo kvm_i8259_info = {
|
||||
.name = "kvm-i8259",
|
||||
.reset = kvm_pic_reset,
|
||||
.parent = TYPE_PIC_COMMON,
|
||||
.class_init = kvm_i8259_class_init,
|
||||
};
|
||||
|
||||
static void kvm_pic_register(void)
|
||||
{
|
||||
pic_qdev_register(&kvm_i8259_info);
|
||||
type_register_static(&kvm_i8259_info);
|
||||
}
|
||||
|
||||
device_init(kvm_pic_register)
|
||||
|
@ -93,29 +93,33 @@ static void kvm_ioapic_init(IOAPICCommonState *s, int instance_no)
|
||||
qdev_init_gpio_in(&s->busdev.qdev, kvm_ioapic_set_irq, IOAPIC_NUM_PINS);
|
||||
}
|
||||
|
||||
static Property kvm_ioapic_properties[] = {
|
||||
DEFINE_PROP_UINT32("gsi_base", KVMIOAPICState, kvm_gsi_base, 0),
|
||||
DEFINE_PROP_END_OF_LIST()
|
||||
};
|
||||
|
||||
static void kvm_ioapic_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
IOAPICCommonClass *k = IOAPIC_COMMON_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = kvm_ioapic_init;
|
||||
k->pre_save = kvm_ioapic_get;
|
||||
k->post_load = kvm_ioapic_put;
|
||||
dc->reset = kvm_ioapic_reset;
|
||||
dc->props = kvm_ioapic_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo kvm_ioapic_info = {
|
||||
static TypeInfo kvm_ioapic_info = {
|
||||
.name = "kvm-ioapic",
|
||||
.size = sizeof(KVMIOAPICState),
|
||||
.reset = kvm_ioapic_reset,
|
||||
.parent = TYPE_IOAPIC_COMMON,
|
||||
.instance_size = sizeof(KVMIOAPICState),
|
||||
.class_init = kvm_ioapic_class_init,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_UINT32("gsi_base", KVMIOAPICState, kvm_gsi_base, 0),
|
||||
DEFINE_PROP_END_OF_LIST()
|
||||
},
|
||||
};
|
||||
|
||||
static void kvm_ioapic_register_device(void)
|
||||
{
|
||||
ioapic_qdev_register(&kvm_ioapic_info);
|
||||
type_register_static(&kvm_ioapic_info);
|
||||
}
|
||||
|
||||
device_init(kvm_ioapic_register_device)
|
||||
|
18
hw/lan9118.c
18
hw/lan9118.c
@ -1245,23 +1245,25 @@ static Property lan9118_properties[] = {
|
||||
|
||||
static void lan9118_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = lan9118_init1;
|
||||
dc->reset = lan9118_reset;
|
||||
dc->props = lan9118_properties;
|
||||
dc->vmsd = &vmstate_lan9118;
|
||||
}
|
||||
|
||||
static DeviceInfo lan9118_info = {
|
||||
.name = "lan9118",
|
||||
.size = sizeof(lan9118_state),
|
||||
.reset = lan9118_reset,
|
||||
.vmsd = &vmstate_lan9118,
|
||||
.props = lan9118_properties,
|
||||
.class_init = lan9118_class_init,
|
||||
static TypeInfo lan9118_info = {
|
||||
.name = "lan9118",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(lan9118_state),
|
||||
.class_init = lan9118_class_init,
|
||||
};
|
||||
|
||||
static void lan9118_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&lan9118_info);
|
||||
type_register_static(&lan9118_info);
|
||||
}
|
||||
|
||||
/* Legacy helper function. Should go away when machine config files are
|
||||
|
20
hw/lance.c
20
hw/lance.c
@ -145,23 +145,25 @@ static Property lance_properties[] = {
|
||||
|
||||
static void lance_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = lance_init;
|
||||
dc->fw_name = "ethernet";
|
||||
dc->reset = lance_reset;
|
||||
dc->vmsd = &vmstate_lance;
|
||||
dc->props = lance_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo lance_info = {
|
||||
.name = "lance",
|
||||
.fw_name = "ethernet",
|
||||
.size = sizeof(SysBusPCNetState),
|
||||
.reset = lance_reset,
|
||||
.vmsd = &vmstate_lance,
|
||||
.props = lance_properties,
|
||||
.class_init = lance_class_init,
|
||||
static TypeInfo lance_info = {
|
||||
.name = "lance",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(SysBusPCNetState),
|
||||
.class_init = lance_class_init,
|
||||
};
|
||||
|
||||
static void lance_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&lance_info);
|
||||
type_register_static(&lance_info);
|
||||
}
|
||||
device_init(lance_register_devices)
|
||||
|
@ -136,22 +136,24 @@ static const VMStateDescription vmstate_lm32_juart = {
|
||||
|
||||
static void lm32_juart_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = lm32_juart_init;
|
||||
dc->reset = juart_reset;
|
||||
dc->vmsd = &vmstate_lm32_juart;
|
||||
}
|
||||
|
||||
static DeviceInfo lm32_juart_info = {
|
||||
.name = "lm32-juart",
|
||||
.size = sizeof(LM32JuartState),
|
||||
.vmsd = &vmstate_lm32_juart,
|
||||
.reset = juart_reset,
|
||||
.class_init = lm32_juart_class_init,
|
||||
static TypeInfo lm32_juart_info = {
|
||||
.name = "lm32-juart",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(LM32JuartState),
|
||||
.class_init = lm32_juart_class_init,
|
||||
};
|
||||
|
||||
static void lm32_juart_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&lm32_juart_info);
|
||||
type_register_static(&lm32_juart_info);
|
||||
}
|
||||
|
||||
device_init(lm32_juart_register)
|
||||
|
@ -176,22 +176,24 @@ static const VMStateDescription vmstate_lm32_pic = {
|
||||
|
||||
static void lm32_pic_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = lm32_pic_init;
|
||||
dc->reset = pic_reset;
|
||||
dc->vmsd = &vmstate_lm32_pic;
|
||||
}
|
||||
|
||||
static DeviceInfo lm32_pic_info = {
|
||||
.name = "lm32-pic",
|
||||
.size = sizeof(LM32PicState),
|
||||
.vmsd = &vmstate_lm32_pic,
|
||||
.reset = pic_reset,
|
||||
.class_init = lm32_pic_class_init,
|
||||
static TypeInfo lm32_pic_info = {
|
||||
.name = "lm32-pic",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(LM32PicState),
|
||||
.class_init = lm32_pic_class_init,
|
||||
};
|
||||
|
||||
static void lm32_pic_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&lm32_pic_info);
|
||||
type_register_static(&lm32_pic_info);
|
||||
}
|
||||
|
||||
device_init(lm32_pic_register)
|
||||
|
@ -148,23 +148,25 @@ static Property lm32_sys_properties[] = {
|
||||
|
||||
static void lm32_sys_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = lm32_sys_init;
|
||||
dc->reset = sys_reset;
|
||||
dc->vmsd = &vmstate_lm32_sys;
|
||||
dc->props = lm32_sys_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo lm32_sys_info = {
|
||||
.name = "lm32-sys",
|
||||
.size = sizeof(LM32SysState),
|
||||
.vmsd = &vmstate_lm32_sys,
|
||||
.reset = sys_reset,
|
||||
.props = lm32_sys_properties,
|
||||
.class_init = lm32_sys_class_init,
|
||||
static TypeInfo lm32_sys_info = {
|
||||
.name = "lm32-sys",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(LM32SysState),
|
||||
.class_init = lm32_sys_class_init,
|
||||
};
|
||||
|
||||
static void lm32_sys_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&lm32_sys_info);
|
||||
type_register_static(&lm32_sys_info);
|
||||
}
|
||||
|
||||
device_init(lm32_sys_register)
|
||||
|
@ -206,23 +206,25 @@ static Property lm32_timer_properties[] = {
|
||||
|
||||
static void lm32_timer_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = lm32_timer_init;
|
||||
dc->reset = timer_reset;
|
||||
dc->vmsd = &vmstate_lm32_timer;
|
||||
dc->props = lm32_timer_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo lm32_timer_info = {
|
||||
.name = "lm32-timer",
|
||||
.size = sizeof(LM32TimerState),
|
||||
.vmsd = &vmstate_lm32_timer,
|
||||
.reset = timer_reset,
|
||||
.props = lm32_timer_properties,
|
||||
.class_init = lm32_timer_class_init,
|
||||
static TypeInfo lm32_timer_info = {
|
||||
.name = "lm32-timer",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(LM32TimerState),
|
||||
.class_init = lm32_timer_class_init,
|
||||
};
|
||||
|
||||
static void lm32_timer_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&lm32_timer_info);
|
||||
type_register_static(&lm32_timer_info);
|
||||
}
|
||||
|
||||
device_init(lm32_timer_register)
|
||||
|
@ -273,22 +273,24 @@ static const VMStateDescription vmstate_lm32_uart = {
|
||||
|
||||
static void lm32_uart_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = lm32_uart_init;
|
||||
dc->reset = uart_reset;
|
||||
dc->vmsd = &vmstate_lm32_uart;
|
||||
}
|
||||
|
||||
static DeviceInfo lm32_uart_info = {
|
||||
.name = "lm32-uart",
|
||||
.size = sizeof(LM32UartState),
|
||||
.vmsd = &vmstate_lm32_uart,
|
||||
.reset = uart_reset,
|
||||
.class_init = lm32_uart_class_init,
|
||||
static TypeInfo lm32_uart_info = {
|
||||
.name = "lm32-uart",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(LM32UartState),
|
||||
.class_init = lm32_uart_class_init,
|
||||
};
|
||||
|
||||
static void lm32_uart_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&lm32_uart_info);
|
||||
type_register_static(&lm32_uart_info);
|
||||
}
|
||||
|
||||
device_init(lm32_uart_register)
|
||||
|
14
hw/lm832x.c
14
hw/lm832x.c
@ -496,24 +496,26 @@ void lm832x_key_event(DeviceState *dev, int key, int state)
|
||||
|
||||
static void lm8323_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
|
||||
|
||||
k->init = lm8323_init;
|
||||
k->event = lm_i2c_event;
|
||||
k->recv = lm_i2c_rx;
|
||||
k->send = lm_i2c_tx;
|
||||
dc->vmsd = &vmstate_lm_kbd;
|
||||
}
|
||||
|
||||
static DeviceInfo lm8323_info = {
|
||||
.name = "lm8323",
|
||||
.size = sizeof(LM823KbdState),
|
||||
.vmsd = &vmstate_lm_kbd,
|
||||
.class_init = lm8323_class_init,
|
||||
static TypeInfo lm8323_info = {
|
||||
.name = "lm8323",
|
||||
.parent = TYPE_I2C_SLAVE,
|
||||
.instance_size = sizeof(LM823KbdState),
|
||||
.class_init = lm8323_class_init,
|
||||
};
|
||||
|
||||
static void lm832x_register_devices(void)
|
||||
{
|
||||
i2c_register_slave(&lm8323_info);
|
||||
type_register_static(&lm8323_info);
|
||||
}
|
||||
|
||||
device_init(lm832x_register_devices)
|
||||
|
@ -2122,6 +2122,7 @@ static int lsi_scsi_init(PCIDevice *dev)
|
||||
|
||||
static void lsi_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = lsi_scsi_init;
|
||||
@ -2130,20 +2131,22 @@ static void lsi_class_init(ObjectClass *klass, void *data)
|
||||
k->device_id = PCI_DEVICE_ID_LSI_53C895A;
|
||||
k->class_id = PCI_CLASS_STORAGE_SCSI;
|
||||
k->subsystem_id = 0x1000;
|
||||
dc->alias = "lsi";
|
||||
dc->reset = lsi_scsi_reset;
|
||||
dc->vmsd = &vmstate_lsi_scsi;
|
||||
}
|
||||
|
||||
static DeviceInfo lsi_info = {
|
||||
.name = "lsi53c895a",
|
||||
.alias = "lsi",
|
||||
.size = sizeof(LSIState),
|
||||
.reset = lsi_scsi_reset,
|
||||
.vmsd = &vmstate_lsi_scsi,
|
||||
.class_init = lsi_class_init,
|
||||
static TypeInfo lsi_info = {
|
||||
.name = "lsi53c895a",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(LSIState),
|
||||
.class_init = lsi_class_init,
|
||||
};
|
||||
|
||||
static void lsi53c895a_register_devices(void)
|
||||
{
|
||||
pci_qdev_register(&lsi_info);
|
||||
type_register_static(&lsi_info);
|
||||
type_register_static_alias(&lsi_info, "lsi");
|
||||
}
|
||||
|
||||
device_init(lsi53c895a_register_devices);
|
||||
|
46
hw/m48t59.c
46
hw/m48t59.c
@ -720,24 +720,28 @@ static int m48t59_init1(SysBusDevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Property m48t59_isa_properties[] = {
|
||||
DEFINE_PROP_UINT32("size", M48t59ISAState, state.size, -1),
|
||||
DEFINE_PROP_UINT32("type", M48t59ISAState, state.type, -1),
|
||||
DEFINE_PROP_HEX32( "io_base", M48t59ISAState, state.io_base, 0),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void m48t59_init_class_isa1(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
|
||||
ic->init = m48t59_init_isa1;
|
||||
dc->no_user = 1;
|
||||
dc->reset = m48t59_reset_isa;
|
||||
dc->props = m48t59_isa_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo m48t59_isa_info = {
|
||||
.class_init = m48t59_init_class_isa1,
|
||||
.name = "m48t59_isa",
|
||||
.size = sizeof(M48t59ISAState),
|
||||
.reset = m48t59_reset_isa,
|
||||
.no_user = 1,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_UINT32("size", M48t59ISAState, state.size, -1),
|
||||
DEFINE_PROP_UINT32("type", M48t59ISAState, state.type, -1),
|
||||
DEFINE_PROP_HEX32( "io_base", M48t59ISAState, state.io_base, 0),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
}
|
||||
static TypeInfo m48t59_isa_info = {
|
||||
.name = "m48t59_isa",
|
||||
.parent = TYPE_ISA_DEVICE,
|
||||
.instance_size = sizeof(M48t59ISAState),
|
||||
.class_init = m48t59_init_class_isa1,
|
||||
};
|
||||
|
||||
static Property m48t59_properties[] = {
|
||||
@ -749,23 +753,25 @@ static Property m48t59_properties[] = {
|
||||
|
||||
static void m48t59_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = m48t59_init1;
|
||||
dc->reset = m48t59_reset_sysbus;
|
||||
dc->props = m48t59_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo m48t59_info = {
|
||||
.name = "m48t59",
|
||||
.size = sizeof(M48t59SysBusState),
|
||||
.reset = m48t59_reset_sysbus,
|
||||
.props = m48t59_properties,
|
||||
.class_init = m48t59_class_init,
|
||||
static TypeInfo m48t59_info = {
|
||||
.name = "m48t59",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(M48t59SysBusState),
|
||||
.class_init = m48t59_class_init,
|
||||
};
|
||||
|
||||
static void m48t59_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&m48t59_info);
|
||||
isa_qdev_register(&m48t59_isa_info);
|
||||
type_register_static(&m48t59_info);
|
||||
type_register_static(&m48t59_isa_info);
|
||||
}
|
||||
|
||||
device_init(m48t59_register_devices)
|
||||
|
11
hw/macio.c
11
hw/macio.c
@ -90,15 +90,16 @@ static void macio_class_init(ObjectClass *klass, void *data)
|
||||
k->class_id = PCI_CLASS_OTHERS << 8;
|
||||
}
|
||||
|
||||
static DeviceInfo macio_info = {
|
||||
.name = "macio",
|
||||
.size = sizeof(MacIOState),
|
||||
.class_init = macio_class_init,
|
||||
static TypeInfo macio_info = {
|
||||
.name = "macio",
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(MacIOState),
|
||||
.class_init = macio_class_init,
|
||||
};
|
||||
|
||||
static void macio_register(void)
|
||||
{
|
||||
pci_qdev_register(&macio_info);
|
||||
type_register_static(&macio_info);
|
||||
}
|
||||
|
||||
device_init(macio_register);
|
||||
|
@ -279,23 +279,25 @@ static Property mv88w8618_audio_properties[] = {
|
||||
|
||||
static void mv88w8618_audio_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = mv88w8618_audio_init;
|
||||
dc->reset = mv88w8618_audio_reset;
|
||||
dc->vmsd = &mv88w8618_audio_vmsd;
|
||||
dc->props = mv88w8618_audio_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo mv88w8618_audio_info = {
|
||||
.name = "mv88w8618_audio",
|
||||
.size = sizeof(mv88w8618_audio_state),
|
||||
.reset = mv88w8618_audio_reset,
|
||||
.vmsd = &mv88w8618_audio_vmsd,
|
||||
.props = mv88w8618_audio_properties,
|
||||
.class_init = mv88w8618_audio_class_init,
|
||||
static TypeInfo mv88w8618_audio_info = {
|
||||
.name = "mv88w8618_audio",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(mv88w8618_audio_state),
|
||||
.class_init = mv88w8618_audio_class_init,
|
||||
};
|
||||
|
||||
static void mv88w8618_register_devices(void)
|
||||
{
|
||||
sysbus_register_withprop(&mv88w8618_audio_info);
|
||||
type_register_static(&mv88w8618_audio_info);
|
||||
}
|
||||
|
||||
device_init(mv88w8618_register_devices)
|
||||
|
22
hw/max111x.c
22
hw/max111x.c
@ -161,10 +161,11 @@ static void max1110_class_init(ObjectClass *klass, void *data)
|
||||
k->transfer = max111x_transfer;
|
||||
}
|
||||
|
||||
static DeviceInfo max1110_info = {
|
||||
.name = "max1110",
|
||||
.size = sizeof(MAX111xState),
|
||||
.class_init = max1110_class_init,
|
||||
static TypeInfo max1110_info = {
|
||||
.name = "max1110",
|
||||
.parent = TYPE_SSI_SLAVE,
|
||||
.instance_size = sizeof(MAX111xState),
|
||||
.class_init = max1110_class_init,
|
||||
};
|
||||
|
||||
static void max1111_class_init(ObjectClass *klass, void *data)
|
||||
@ -175,16 +176,17 @@ static void max1111_class_init(ObjectClass *klass, void *data)
|
||||
k->transfer = max111x_transfer;
|
||||
}
|
||||
|
||||
static DeviceInfo max1111_info = {
|
||||
.name = "max1111",
|
||||
.size = sizeof(MAX111xState),
|
||||
.class_init = max1111_class_init,
|
||||
static TypeInfo max1111_info = {
|
||||
.name = "max1111",
|
||||
.parent = TYPE_SSI_SLAVE,
|
||||
.instance_size = sizeof(MAX111xState),
|
||||
.class_init = max1111_class_init,
|
||||
};
|
||||
|
||||
static void max111x_register_devices(void)
|
||||
{
|
||||
ssi_register_slave(&max1110_info);
|
||||
ssi_register_slave(&max1111_info);
|
||||
type_register_static(&max1110_info);
|
||||
type_register_static(&max1111_info);
|
||||
}
|
||||
|
||||
device_init(max111x_register_devices)
|
||||
|
16
hw/max7310.c
16
hw/max7310.c
@ -187,25 +187,27 @@ static int max7310_init(I2CSlave *i2c)
|
||||
|
||||
static void max7310_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
|
||||
|
||||
k->init = max7310_init;
|
||||
k->event = max7310_event;
|
||||
k->recv = max7310_rx;
|
||||
k->send = max7310_tx;
|
||||
dc->reset = max7310_reset;
|
||||
dc->vmsd = &vmstate_max7310;
|
||||
}
|
||||
|
||||
static DeviceInfo max7310_info = {
|
||||
.name = "max7310",
|
||||
.size = sizeof(MAX7310State),
|
||||
.vmsd = &vmstate_max7310,
|
||||
.reset = max7310_reset,
|
||||
.class_init = max7310_class_init,
|
||||
static TypeInfo max7310_info = {
|
||||
.name = "max7310",
|
||||
.parent = TYPE_I2C_SLAVE,
|
||||
.instance_size = sizeof(MAX7310State),
|
||||
.class_init = max7310_class_init,
|
||||
};
|
||||
|
||||
static void max7310_register_devices(void)
|
||||
{
|
||||
i2c_register_slave(&max7310_info);
|
||||
type_register_static(&max7310_info);
|
||||
}
|
||||
|
||||
device_init(max7310_register_devices)
|
||||
|
@ -709,28 +709,32 @@ ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
|
||||
return dev;
|
||||
}
|
||||
|
||||
static Property mc146818rtc_properties[] = {
|
||||
DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980),
|
||||
DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
|
||||
lost_tick_policy, LOST_TICK_DISCARD),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void rtc_class_initfn(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
|
||||
ic->init = rtc_initfn;
|
||||
dc->no_user = 1;
|
||||
dc->vmsd = &vmstate_rtc;
|
||||
dc->props = mc146818rtc_properties;
|
||||
}
|
||||
|
||||
static DeviceInfo mc146818rtc_info = {
|
||||
.name = "mc146818rtc",
|
||||
.size = sizeof(RTCState),
|
||||
.no_user = 1,
|
||||
.vmsd = &vmstate_rtc,
|
||||
.class_init = rtc_class_initfn,
|
||||
.props = (Property[]) {
|
||||
DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980),
|
||||
DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
|
||||
lost_tick_policy, LOST_TICK_DISCARD),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
}
|
||||
static TypeInfo mc146818rtc_info = {
|
||||
.name = "mc146818rtc",
|
||||
.parent = TYPE_ISA_DEVICE,
|
||||
.instance_size = sizeof(RTCState),
|
||||
.class_init = rtc_class_initfn,
|
||||
};
|
||||
|
||||
static void mc146818rtc_register(void)
|
||||
{
|
||||
isa_qdev_register(&mc146818rtc_info);
|
||||
type_register_static(&mc146818rtc_info);
|
||||
}
|
||||
device_init(mc146818rtc_register)
|
||||
|
@ -321,22 +321,24 @@ static const VMStateDescription vmstate_milkymist_ac97 = {
|
||||
|
||||
static void milkymist_ac97_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = milkymist_ac97_init;
|
||||
dc->reset = milkymist_ac97_reset;
|
||||
dc->vmsd = &vmstate_milkymist_ac97;
|
||||
}
|
||||
|
||||
static DeviceInfo milkymist_ac97_info = {
|
||||
.name = "milkymist-ac97",
|
||||
.size = sizeof(MilkymistAC97State),
|
||||
.vmsd = &vmstate_milkymist_ac97,
|
||||
.reset = milkymist_ac97_reset,
|
||||
.class_init = milkymist_ac97_class_init,
|
||||
static TypeInfo milkymist_ac97_info = {
|
||||
.name = "milkymist-ac97",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(MilkymistAC97State),
|
||||
.class_init = milkymist_ac97_class_init,
|
||||
};
|
||||
|
||||
static void milkymist_ac97_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&milkymist_ac97_info);
|
||||
type_register_static(&milkymist_ac97_info);
|
||||
}
|
||||
|
||||
device_init(milkymist_ac97_register)
|
||||
|
@ -147,22 +147,24 @@ static const VMStateDescription vmstate_milkymist_hpdmc = {
|
||||
|
||||
static void milkymist_hpdmc_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = milkymist_hpdmc_init;
|
||||
dc->reset = milkymist_hpdmc_reset;
|
||||
dc->vmsd = &vmstate_milkymist_hpdmc;
|
||||
}
|
||||
|
||||
static DeviceInfo milkymist_hpdmc_info = {
|
||||
.name = "milkymist-hpdmc",
|
||||
.size = sizeof(MilkymistHpdmcState),
|
||||
.vmsd = &vmstate_milkymist_hpdmc,
|
||||
.reset = milkymist_hpdmc_reset,
|
||||
.class_init = milkymist_hpdmc_class_init,
|
||||
static TypeInfo milkymist_hpdmc_info = {
|
||||
.name = "milkymist-hpdmc",
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(MilkymistHpdmcState),
|
||||
.class_init = milkymist_hpdmc_class_init,
|
||||
};
|
||||
|
||||
static void milkymist_hpdmc_register(void)
|
||||
{
|
||||
sysbus_register_withprop(&milkymist_hpdmc_info);
|
||||
type_register_static(&milkymist_hpdmc_info);
|
||||
}
|
||||
|
||||
device_init(milkymist_hpdmc_register)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user