isa-bus.c (47b5264eb3e1cd2825e48d28fd0d1b239ed53974) isa-bus.c (db895a1e6a97e919f9b86d60c969377357b05066)
1/*
2 * isa bus support for qdev.
3 *
4 * Copyright (c) 2009 Gerd Hoffmann <kraxel@redhat.com>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

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

114 contents of the portio array. This is how the old code
115 actually handled e.g. the FDC device. */
116 isa_init_ioport(dev, start);
117
118 portio_list_init(piolist, pio_start, opaque, name);
119 portio_list_add(piolist, isabus->address_space_io, start);
120}
121
1/*
2 * isa bus support for qdev.
3 *
4 * Copyright (c) 2009 Gerd Hoffmann <kraxel@redhat.com>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

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

114 contents of the portio array. This is how the old code
115 actually handled e.g. the FDC device. */
116 isa_init_ioport(dev, start);
117
118 portio_list_init(piolist, pio_start, opaque, name);
119 portio_list_add(piolist, isabus->address_space_io, start);
120}
121
122static int isa_qdev_init(DeviceState *qdev)
123{
124 ISADevice *dev = ISA_DEVICE(qdev);
125 ISADeviceClass *klass = ISA_DEVICE_GET_CLASS(dev);
126
127 if (klass->init) {
128 return klass->init(dev);
129 }
130
131 return 0;
132}
133
134static void isa_device_init(Object *obj)
135{
136 ISADevice *dev = ISA_DEVICE(obj);
137
138 dev->isairq[0] = -1;
139 dev->isairq[1] = -1;
140}
141

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

225 .parent = TYPE_SYS_BUS_DEVICE,
226 .instance_size = sizeof(SysBusDevice),
227 .class_init = isabus_bridge_class_init,
228};
229
230static void isa_device_class_init(ObjectClass *klass, void *data)
231{
232 DeviceClass *k = DEVICE_CLASS(klass);
122static void isa_device_init(Object *obj)
123{
124 ISADevice *dev = ISA_DEVICE(obj);
125
126 dev->isairq[0] = -1;
127 dev->isairq[1] = -1;
128}
129

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

213 .parent = TYPE_SYS_BUS_DEVICE,
214 .instance_size = sizeof(SysBusDevice),
215 .class_init = isabus_bridge_class_init,
216};
217
218static void isa_device_class_init(ObjectClass *klass, void *data)
219{
220 DeviceClass *k = DEVICE_CLASS(klass);
233 k->init = isa_qdev_init;
234 k->bus_type = TYPE_ISA_BUS;
235}
236
237static const TypeInfo isa_device_type_info = {
238 .name = TYPE_ISA_DEVICE,
239 .parent = TYPE_DEVICE,
240 .instance_size = sizeof(ISADevice),
241 .instance_init = isa_device_init,

--- 41 unchanged lines hidden ---
221 k->bus_type = TYPE_ISA_BUS;
222}
223
224static const TypeInfo isa_device_type_info = {
225 .name = TYPE_ISA_DEVICE,
226 .parent = TYPE_DEVICE,
227 .instance_size = sizeof(ISADevice),
228 .instance_init = isa_device_init,

--- 41 unchanged lines hidden ---