~dannf/qemu-linaro/qemu-highbank-ppa

« back to all changes in this revision

Viewing changes to hw/sun4u.c

  • Committer: Steve Langasek
  • Date: 2012-03-15 21:13:19 UTC
  • mfrom: (0.1.15)
  • Revision ID: steve.langasek@canonical.com-20120315211319-f1j3ot1ihx30b2s9
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
573
573
    k->class_id = PCI_CLASS_BRIDGE_OTHER;
574
574
}
575
575
 
576
 
static DeviceInfo ebus_info = {
577
 
    .name = "ebus",
578
 
    .size = sizeof(EbusState),
579
 
    .class_init = ebus_class_init,
 
576
static TypeInfo ebus_info = {
 
577
    .name          = "ebus",
 
578
    .parent        = TYPE_PCI_DEVICE,
 
579
    .instance_size = sizeof(EbusState),
 
580
    .class_init    = ebus_class_init,
580
581
};
581
582
 
582
 
static void pci_ebus_register(void)
583
 
{
584
 
    pci_qdev_register(&ebus_info);
585
 
}
586
 
 
587
 
device_init(pci_ebus_register);
588
 
 
589
583
typedef struct PROMState {
590
584
    SysBusDevice busdev;
591
585
    MemoryRegion prom;
649
643
 
650
644
static void prom_class_init(ObjectClass *klass, void *data)
651
645
{
 
646
    DeviceClass *dc = DEVICE_CLASS(klass);
652
647
    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
653
648
 
654
649
    k->init = prom_init1;
 
650
    dc->props = prom_properties;
655
651
}
656
652
 
657
 
static DeviceInfo prom_info = {
658
 
    .name = "openprom",
659
 
    .size = sizeof(PROMState),
660
 
    .props = prom_properties,
661
 
    .class_init = prom_class_init,
 
653
static TypeInfo prom_info = {
 
654
    .name          = "openprom",
 
655
    .parent        = TYPE_SYS_BUS_DEVICE,
 
656
    .instance_size = sizeof(PROMState),
 
657
    .class_init    = prom_class_init,
662
658
};
663
659
 
664
 
static void prom_register_devices(void)
665
 
{
666
 
    sysbus_register_withprop(&prom_info);
667
 
}
668
 
 
669
 
device_init(prom_register_devices);
670
 
 
671
660
 
672
661
typedef struct RamDevice
673
662
{
711
700
 
712
701
static void ram_class_init(ObjectClass *klass, void *data)
713
702
{
 
703
    DeviceClass *dc = DEVICE_CLASS(klass);
714
704
    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
715
705
 
716
706
    k->init = ram_init1;
 
707
    dc->props = ram_properties;
717
708
}
718
709
 
719
 
static DeviceInfo ram_info = {
720
 
    .name = "memory",
721
 
    .size = sizeof(RamDevice),
722
 
    .props = ram_properties,
723
 
    .class_init = ram_class_init,
 
710
static TypeInfo ram_info = {
 
711
    .name          = "memory",
 
712
    .parent        = TYPE_SYS_BUS_DEVICE,
 
713
    .instance_size = sizeof(RamDevice),
 
714
    .class_init    = ram_class_init,
724
715
};
725
716
 
726
 
static void ram_register_devices(void)
727
 
{
728
 
    sysbus_register_withprop(&ram_info);
729
 
}
730
 
 
731
 
device_init(ram_register_devices);
732
 
 
733
717
static CPUState *cpu_devinit(const char *cpu_model, const struct hwdef *hwdef)
734
718
{
735
719
    CPUState *env;
952
936
    .max_cpus = 1, // XXX for now
953
937
};
954
938
 
 
939
static void sun4u_register_types(void)
 
940
{
 
941
    type_register_static(&ebus_info);
 
942
    type_register_static(&prom_info);
 
943
    type_register_static(&ram_info);
 
944
}
 
945
 
955
946
static void sun4u_machine_init(void)
956
947
{
957
948
    qemu_register_machine(&sun4u_machine);
959
950
    qemu_register_machine(&niagara_machine);
960
951
}
961
952
 
 
953
type_init(sun4u_register_types)
962
954
machine_init(sun4u_machine_init);