isa.c (cad2b59c198340a636c5e015fb90e0326a1d3dd7) isa.c (db895a1e6a97e919f9b86d60c969377357b05066)
1/*
2 * QEMU IDE Emulation: ISA Bus support.
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 * Copyright (c) 2006 Openedhand Ltd.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 51 unchanged lines hidden (view full) ---

60 .minimum_version_id_old = 0,
61 .fields = (VMStateField []) {
62 VMSTATE_IDE_BUS(bus, ISAIDEState),
63 VMSTATE_IDE_DRIVES(bus.ifs, ISAIDEState),
64 VMSTATE_END_OF_LIST()
65 }
66};
67
1/*
2 * QEMU IDE Emulation: ISA Bus support.
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 * Copyright (c) 2006 Openedhand Ltd.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 51 unchanged lines hidden (view full) ---

60 .minimum_version_id_old = 0,
61 .fields = (VMStateField []) {
62 VMSTATE_IDE_BUS(bus, ISAIDEState),
63 VMSTATE_IDE_DRIVES(bus.ifs, ISAIDEState),
64 VMSTATE_END_OF_LIST()
65 }
66};
67
68static int isa_ide_initfn(ISADevice *dev)
68static void isa_ide_realizefn(DeviceState *dev, Error **errp)
69{
69{
70 ISADevice *isadev = ISA_DEVICE(dev);
70 ISAIDEState *s = ISA_IDE(dev);
71
71 ISAIDEState *s = ISA_IDE(dev);
72
72 ide_bus_new(&s->bus, DEVICE(dev), 0, 2);
73 ide_init_ioport(&s->bus, dev, s->iobase, s->iobase2);
74 isa_init_irq(dev, &s->irq, s->isairq);
73 ide_bus_new(&s->bus, dev, 0, 2);
74 ide_init_ioport(&s->bus, isadev, s->iobase, s->iobase2);
75 isa_init_irq(isadev, &s->irq, s->isairq);
75 ide_init2(&s->bus, s->irq);
76 ide_init2(&s->bus, s->irq);
76 vmstate_register(&dev->qdev, 0, &vmstate_ide_isa, s);
77 return 0;
77 vmstate_register(dev, 0, &vmstate_ide_isa, s);
78};
79
80ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
81 DriveInfo *hd0, DriveInfo *hd1)
82{
83 DeviceState *dev;
84 ISADevice *isadev;
85 ISAIDEState *s;

--- 22 unchanged lines hidden (view full) ---

108 DEFINE_PROP_HEX32("iobase2", ISAIDEState, iobase2, 0x3f6),
109 DEFINE_PROP_UINT32("irq", ISAIDEState, isairq, 14),
110 DEFINE_PROP_END_OF_LIST(),
111};
112
113static void isa_ide_class_initfn(ObjectClass *klass, void *data)
114{
115 DeviceClass *dc = DEVICE_CLASS(klass);
78};
79
80ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
81 DriveInfo *hd0, DriveInfo *hd1)
82{
83 DeviceState *dev;
84 ISADevice *isadev;
85 ISAIDEState *s;

--- 22 unchanged lines hidden (view full) ---

108 DEFINE_PROP_HEX32("iobase2", ISAIDEState, iobase2, 0x3f6),
109 DEFINE_PROP_UINT32("irq", ISAIDEState, isairq, 14),
110 DEFINE_PROP_END_OF_LIST(),
111};
112
113static void isa_ide_class_initfn(ObjectClass *klass, void *data)
114{
115 DeviceClass *dc = DEVICE_CLASS(klass);
116 ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
117 ic->init = isa_ide_initfn;
116
117 dc->realize = isa_ide_realizefn;
118 dc->fw_name = "ide";
119 dc->reset = isa_ide_reset;
120 dc->props = isa_ide_properties;
121}
122
123static const TypeInfo isa_ide_info = {
124 .name = TYPE_ISA_IDE,
125 .parent = TYPE_ISA_DEVICE,
126 .instance_size = sizeof(ISAIDEState),
127 .class_init = isa_ide_class_initfn,
128};
129
130static void isa_ide_register_types(void)
131{
132 type_register_static(&isa_ide_info);
133}
134
135type_init(isa_ide_register_types)
118 dc->fw_name = "ide";
119 dc->reset = isa_ide_reset;
120 dc->props = isa_ide_properties;
121}
122
123static const TypeInfo isa_ide_info = {
124 .name = TYPE_ISA_IDE,
125 .parent = TYPE_ISA_DEVICE,
126 .instance_size = sizeof(ISAIDEState),
127 .class_init = isa_ide_class_initfn,
128};
129
130static void isa_ide_register_types(void)
131{
132 type_register_static(&isa_ide_info);
133}
134
135type_init(isa_ide_register_types)