Skip to content
Snippets Groups Projects
Commit d585d89d authored by Mark Cave-Ayland's avatar Mark Cave-Ayland Committed by Laurent Vivier
Browse files

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: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
Message-Id: <20210924073808.1041-17-mark.cave-ayland@ilande.co.uk>
Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
parent 1fa04232
No related branches found
No related tags found
No related merge requests found
......@@ -398,7 +398,7 @@ static void q800_init(MachineState *machine)
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, NUBUS_SLOT_BASE +
MAC_NUBUS_FIRST_SLOT * NUBUS_SLOT_SIZE);
nubus = NUBUS_BRIDGE(dev)->bus;
nubus = &NUBUS_BRIDGE(dev)->bus;
/* framebuffer in nubus slot #9 */
......
......@@ -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);
......
......@@ -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)
......
......@@ -63,7 +63,7 @@ struct NubusDevice {
struct NubusBridge {
SysBusDevice parent_obj;
NubusBus *bus;
NubusBus bus;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment