Revision db0f8888 hw/intc/ioapic.c
b/hw/intc/ioapic.c | ||
---|---|---|
36 | 36 |
|
37 | 37 |
static IOAPICCommonState *ioapics[MAX_IOAPICS]; |
38 | 38 |
|
39 |
/* global variable from ioapic_common.c */ |
|
40 |
extern int ioapic_no; |
|
41 |
|
|
39 | 42 |
static void ioapic_service(IOAPICCommonState *s) |
40 | 43 |
{ |
41 | 44 |
uint8_t i; |
... | ... | |
225 | 228 |
.endianness = DEVICE_NATIVE_ENDIAN, |
226 | 229 |
}; |
227 | 230 |
|
228 |
static void ioapic_init(IOAPICCommonState *s, int instance_no)
|
|
231 |
static void ioapic_realize(DeviceState *dev, Error **errp)
|
|
229 | 232 |
{ |
230 |
DeviceState *dev = DEVICE(s);
|
|
233 |
IOAPICCommonState *s = IOAPIC_COMMON(dev);
|
|
231 | 234 |
|
232 | 235 |
memory_region_init_io(&s->io_memory, OBJECT(s), &ioapic_io_ops, s, |
233 | 236 |
"ioapic", 0x1000); |
234 | 237 |
|
235 | 238 |
qdev_init_gpio_in(dev, ioapic_set_irq, IOAPIC_NUM_PINS); |
236 | 239 |
|
237 |
ioapics[instance_no] = s;
|
|
240 |
ioapics[ioapic_no] = s;
|
|
238 | 241 |
} |
239 | 242 |
|
240 | 243 |
static void ioapic_class_init(ObjectClass *klass, void *data) |
... | ... | |
242 | 245 |
IOAPICCommonClass *k = IOAPIC_COMMON_CLASS(klass); |
243 | 246 |
DeviceClass *dc = DEVICE_CLASS(klass); |
244 | 247 |
|
245 |
k->init = ioapic_init;
|
|
248 |
k->realize = ioapic_realize;
|
|
246 | 249 |
dc->reset = ioapic_reset_common; |
247 | 250 |
} |
248 | 251 |
|
Also available in: Unified diff