mirror of https://github.com/xemu-project/xemu.git
nubus: move NubusBus from mac-nubus-bridge to nubus-bridge
Now that Nubus has its own address space rather than mapping directly into the system bus, move the Nubus reference from MacNubusBridge to NubusBridge. 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-16-mark.cave-ayland@ilande.co.uk> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
f48d613484
commit
1fa04232db
|
@ -398,7 +398,7 @@ static void q800_init(MachineState *machine)
|
||||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, NUBUS_SLOT_BASE +
|
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, NUBUS_SLOT_BASE +
|
||||||
MAC_NUBUS_FIRST_SLOT * NUBUS_SLOT_SIZE);
|
MAC_NUBUS_FIRST_SLOT * NUBUS_SLOT_SIZE);
|
||||||
|
|
||||||
nubus = MAC_NUBUS_BRIDGE(dev)->bus;
|
nubus = NUBUS_BRIDGE(dev)->bus;
|
||||||
|
|
||||||
/* framebuffer in nubus slot #9 */
|
/* framebuffer in nubus slot #9 */
|
||||||
|
|
||||||
|
|
|
@ -16,22 +16,21 @@
|
||||||
static void mac_nubus_bridge_init(Object *obj)
|
static void mac_nubus_bridge_init(Object *obj)
|
||||||
{
|
{
|
||||||
MacNubusBridge *s = MAC_NUBUS_BRIDGE(obj);
|
MacNubusBridge *s = MAC_NUBUS_BRIDGE(obj);
|
||||||
|
NubusBridge *nb = NUBUS_BRIDGE(obj);
|
||||||
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
|
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
|
||||||
|
|
||||||
s->bus = NUBUS_BUS(qbus_create(TYPE_NUBUS_BUS, DEVICE(s), NULL));
|
|
||||||
|
|
||||||
/* Macintosh only has slots 0x9 to 0xe available */
|
/* Macintosh only has slots 0x9 to 0xe available */
|
||||||
s->bus->slot_available_mask = MAKE_64BIT_MASK(MAC_NUBUS_FIRST_SLOT,
|
nb->bus->slot_available_mask = MAKE_64BIT_MASK(MAC_NUBUS_FIRST_SLOT,
|
||||||
MAC_NUBUS_SLOT_NB);
|
MAC_NUBUS_SLOT_NB);
|
||||||
|
|
||||||
/* Aliases for slots 0x9 to 0xe */
|
/* Aliases for slots 0x9 to 0xe */
|
||||||
memory_region_init_alias(&s->super_slot_alias, obj, "super-slot-alias",
|
memory_region_init_alias(&s->super_slot_alias, obj, "super-slot-alias",
|
||||||
&s->bus->nubus_mr,
|
&nb->bus->nubus_mr,
|
||||||
MAC_NUBUS_FIRST_SLOT * NUBUS_SUPER_SLOT_SIZE,
|
MAC_NUBUS_FIRST_SLOT * NUBUS_SUPER_SLOT_SIZE,
|
||||||
MAC_NUBUS_SLOT_NB * NUBUS_SUPER_SLOT_SIZE);
|
MAC_NUBUS_SLOT_NB * NUBUS_SUPER_SLOT_SIZE);
|
||||||
|
|
||||||
memory_region_init_alias(&s->slot_alias, obj, "slot-alias",
|
memory_region_init_alias(&s->slot_alias, obj, "slot-alias",
|
||||||
&s->bus->nubus_mr,
|
&nb->bus->nubus_mr,
|
||||||
NUBUS_SLOT_BASE +
|
NUBUS_SLOT_BASE +
|
||||||
MAC_NUBUS_FIRST_SLOT * NUBUS_SLOT_SIZE,
|
MAC_NUBUS_FIRST_SLOT * NUBUS_SLOT_SIZE,
|
||||||
MAC_NUBUS_SLOT_NB * NUBUS_SLOT_SIZE);
|
MAC_NUBUS_SLOT_NB * NUBUS_SLOT_SIZE);
|
||||||
|
|
|
@ -12,6 +12,14 @@
|
||||||
#include "hw/sysbus.h"
|
#include "hw/sysbus.h"
|
||||||
#include "hw/nubus/nubus.h"
|
#include "hw/nubus/nubus.h"
|
||||||
|
|
||||||
|
|
||||||
|
static void nubus_bridge_init(Object *obj)
|
||||||
|
{
|
||||||
|
NubusBridge *s = NUBUS_BRIDGE(obj);
|
||||||
|
|
||||||
|
s->bus = NUBUS_BUS(qbus_create(TYPE_NUBUS_BUS, DEVICE(s), NULL));
|
||||||
|
}
|
||||||
|
|
||||||
static void nubus_bridge_class_init(ObjectClass *klass, void *data)
|
static void nubus_bridge_class_init(ObjectClass *klass, void *data)
|
||||||
{
|
{
|
||||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||||
|
@ -22,6 +30,7 @@ static void nubus_bridge_class_init(ObjectClass *klass, void *data)
|
||||||
static const TypeInfo nubus_bridge_info = {
|
static const TypeInfo nubus_bridge_info = {
|
||||||
.name = TYPE_NUBUS_BRIDGE,
|
.name = TYPE_NUBUS_BRIDGE,
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
|
.instance_init = nubus_bridge_init,
|
||||||
.instance_size = sizeof(NubusBridge),
|
.instance_size = sizeof(NubusBridge),
|
||||||
.class_init = nubus_bridge_class_init,
|
.class_init = nubus_bridge_class_init,
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,6 @@ OBJECT_DECLARE_SIMPLE_TYPE(MacNubusBridge, MAC_NUBUS_BRIDGE)
|
||||||
struct MacNubusBridge {
|
struct MacNubusBridge {
|
||||||
NubusBridge parent_obj;
|
NubusBridge parent_obj;
|
||||||
|
|
||||||
NubusBus *bus;
|
|
||||||
MemoryRegion super_slot_alias;
|
MemoryRegion super_slot_alias;
|
||||||
MemoryRegion slot_alias;
|
MemoryRegion slot_alias;
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,6 +62,8 @@ struct NubusDevice {
|
||||||
|
|
||||||
struct NubusBridge {
|
struct NubusBridge {
|
||||||
SysBusDevice parent_obj;
|
SysBusDevice parent_obj;
|
||||||
|
|
||||||
|
NubusBus *bus;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue