aboutsummaryrefslogtreecommitdiff
path: root/hw/intc
diff options
context:
space:
mode:
authorxiaoqiang zhao <zxq_yx_007@163.com>2013-11-05 18:16:03 +0800
committerAndreas Färber <afaerber@suse.de>2013-12-24 18:02:18 +0100
commitff6986ce618c69f988e4419efd67ea5cbf7792a5 (patch)
tree016383bf01308755c11212c2be849baea9415f74 /hw/intc
parentd3b0c9e90a9853984c60478dae45bedf8aadf42a (diff)
apic: QOM'ify APIC
Convert 'init' function to QOM's 'realize' for apic, kvm/apic and xen/xen_apic. Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/intc')
-rw-r--r--hw/intc/apic.c6
-rw-r--r--hw/intc/apic_common.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/hw/intc/apic.c b/hw/intc/apic.c
index b5426285db..3d3deb6298 100644
--- a/hw/intc/apic.c
+++ b/hw/intc/apic.c
@@ -871,8 +871,10 @@ static const MemoryRegionOps apic_io_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-static void apic_init(APICCommonState *s)
+static void apic_realize(DeviceState *dev, Error **errp)
{
+ APICCommonState *s = APIC_COMMON(dev);
+
memory_region_init_io(&s->io_memory, OBJECT(s), &apic_io_ops, s, "apic-msi",
APIC_SPACE_SIZE);
@@ -886,7 +888,7 @@ static void apic_class_init(ObjectClass *klass, void *data)
{
APICCommonClass *k = APIC_COMMON_CLASS(klass);
- k->init = apic_init;
+ k->realize = apic_realize;
k->set_base = apic_set_base;
k->set_tpr = apic_set_tpr;
k->get_tpr = apic_get_tpr;
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index de5e190836..28426558ad 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -298,7 +298,7 @@ static int apic_init_common(ICCDevice *dev)
s->idx = apic_no++;
info = APIC_COMMON_GET_CLASS(s);
- info->init(s);
+ info->realize(DEVICE(dev), NULL);
if (!mmio_registered) {
ICCBus *b = ICC_BUS(qdev_get_parent_bus(DEVICE(dev)));
memory_region_add_subregion(b->apic_address_space, 0, &s->io_memory);