diff options
author | Igor Mammedov <imammedo@redhat.com> | 2013-04-29 19:03:01 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-05-01 13:06:07 +0200 |
commit | 53a89e262bd3e97b2da3afec0a60e5466770ae8c (patch) | |
tree | baf6fba30104868f8a3a20f92b0d74b71aa9a4c6 /hw/cpu | |
parent | 62fc403f11523169eb4264de31279745f48e3ecc (diff) |
target-i386: Move APIC to ICC bus
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 <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/cpu')
-rw-r--r-- | hw/cpu/icc_bus.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 = { |