From 53a89e262bd3e97b2da3afec0a60e5466770ae8c Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Mon, 29 Apr 2013 19:03:01 +0200 Subject: target-i386: Move APIC to ICC bus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It allows APIC to be hotplugged. * map APIC's mmio at board level if it is present * do not register mmio region for each APIC, since only one is used/mapped Signed-off-by: Igor Mammedov Signed-off-by: Andreas Färber --- hw/cpu/icc_bus.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'hw/cpu') diff --git a/hw/cpu/icc_bus.c b/hw/cpu/icc_bus.c index 3ac8eebbdf..73a1dc985f 100644 --- a/hw/cpu/icc_bus.c +++ b/hw/cpu/icc_bus.c @@ -80,6 +80,7 @@ typedef struct ICCBridgeState { /*< public >*/ ICCBus icc_bus; + MemoryRegion apic_container; } ICCBridgeState; #define ICC_BRIGDE(obj) OBJECT_CHECK(ICCBridgeState, (obj), TYPE_ICC_BRIDGE) @@ -87,8 +88,17 @@ typedef struct ICCBridgeState { static void icc_bridge_init(Object *obj) { ICCBridgeState *s = ICC_BRIGDE(obj); + SysBusDevice *sb = SYS_BUS_DEVICE(obj); qbus_create_inplace(&s->icc_bus, TYPE_ICC_BUS, DEVICE(s), "icc"); + + /* Do not change order of registering regions, + * APIC must be first registered region, board maps it by 0 index + */ + memory_region_init(&s->apic_container, "icc-apic-container", + APIC_SPACE_SIZE); + sysbus_init_mmio(sb, &s->apic_container); + s->icc_bus.apic_address_space = &s->apic_container; } static const TypeInfo icc_bridge_info = { -- cgit v1.2.1