aboutsummaryrefslogtreecommitdiff
path: root/hw/nubus
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2021-09-24 08:38:04 +0100
committerLaurent Vivier <laurent@vivier.eu>2021-09-29 10:45:19 +0200
commitd585d89de172bbfaa4a2331c882c46ed186ede2a (patch)
tree6d67a3f30c88ff18e348372f7f7ed97389386dd0 /hw/nubus
parent1fa04232db5946d9648ffc03718aad9b6de87c38 (diff)
nubus-bridge: embed the NubusBus object directly within nubus-bridge
Since nubus-bridge is a container for NubusBus then it should be embedded directly within the bridge device using qbus_create_inplace(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20210924073808.1041-17-mark.cave-ayland@ilande.co.uk> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/nubus')
-rw-r--r--hw/nubus/mac-nubus-bridge.c9
-rw-r--r--hw/nubus/nubus-bridge.c3
2 files changed, 7 insertions, 5 deletions
diff --git a/hw/nubus/mac-nubus-bridge.c b/hw/nubus/mac-nubus-bridge.c
index db8640eed2..a0da5a8b2f 100644
--- a/hw/nubus/mac-nubus-bridge.c
+++ b/hw/nubus/mac-nubus-bridge.c
@@ -18,19 +18,20 @@ static void mac_nubus_bridge_init(Object *obj)
MacNubusBridge *s = MAC_NUBUS_BRIDGE(obj);
NubusBridge *nb = NUBUS_BRIDGE(obj);
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
+ NubusBus *bus = &nb->bus;
/* Macintosh only has slots 0x9 to 0xe available */
- nb->bus->slot_available_mask = MAKE_64BIT_MASK(MAC_NUBUS_FIRST_SLOT,
- MAC_NUBUS_SLOT_NB);
+ bus->slot_available_mask = MAKE_64BIT_MASK(MAC_NUBUS_FIRST_SLOT,
+ MAC_NUBUS_SLOT_NB);
/* Aliases for slots 0x9 to 0xe */
memory_region_init_alias(&s->super_slot_alias, obj, "super-slot-alias",
- &nb->bus->nubus_mr,
+ &bus->nubus_mr,
MAC_NUBUS_FIRST_SLOT * NUBUS_SUPER_SLOT_SIZE,
MAC_NUBUS_SLOT_NB * NUBUS_SUPER_SLOT_SIZE);
memory_region_init_alias(&s->slot_alias, obj, "slot-alias",
- &nb->bus->nubus_mr,
+ &bus->nubus_mr,
NUBUS_SLOT_BASE +
MAC_NUBUS_FIRST_SLOT * NUBUS_SLOT_SIZE,
MAC_NUBUS_SLOT_NB * NUBUS_SLOT_SIZE);
diff --git a/hw/nubus/nubus-bridge.c b/hw/nubus/nubus-bridge.c
index 3b68d4435c..1adda7f5a6 100644
--- a/hw/nubus/nubus-bridge.c
+++ b/hw/nubus/nubus-bridge.c
@@ -16,8 +16,9 @@
static void nubus_bridge_init(Object *obj)
{
NubusBridge *s = NUBUS_BRIDGE(obj);
+ NubusBus *bus = &s->bus;
- s->bus = NUBUS_BUS(qbus_create(TYPE_NUBUS_BUS, DEVICE(s), NULL));
+ qbus_create_inplace(bus, sizeof(s->bus), TYPE_NUBUS_BUS, DEVICE(s), NULL);
}
static void nubus_bridge_class_init(ObjectClass *klass, void *data)