mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-09 08:17:53 -06:00
nubus-device: expose separate super slot memory region
According to "Designing Cards and Drivers for the Macintosh Family" each physical nubus slot can access 2 separate address ranges: a super slot memory region which is 256MB and a standard slot memory region which is 16MB. Currently a Nubus device uses the physical slot number to determine whether it is using a standard slot memory region or a super slot memory region rather than exposing both memory regions for use as required. 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-4-mark.cave-ayland@ilande.co.uk> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
e2c49c0515
commit
90be1dea50
2 changed files with 18 additions and 17 deletions
|
@ -168,26 +168,26 @@ static void nubus_device_realize(DeviceState *dev, Error **errp)
|
||||||
}
|
}
|
||||||
|
|
||||||
nd->slot = nubus->current_slot++;
|
nd->slot = nubus->current_slot++;
|
||||||
name = g_strdup_printf("nubus-slot-%d", nd->slot);
|
|
||||||
|
|
||||||
if (nd->slot < NUBUS_FIRST_SLOT) {
|
|
||||||
/* Super */
|
/* Super */
|
||||||
slot_offset = (nd->slot - 6) * NUBUS_SUPER_SLOT_SIZE;
|
slot_offset = nd->slot * NUBUS_SUPER_SLOT_SIZE;
|
||||||
|
|
||||||
memory_region_init(&nd->slot_mem, OBJECT(dev), name,
|
name = g_strdup_printf("nubus-super-slot-%x", nd->slot);
|
||||||
|
memory_region_init(&nd->super_slot_mem, OBJECT(dev), name,
|
||||||
NUBUS_SUPER_SLOT_SIZE);
|
NUBUS_SUPER_SLOT_SIZE);
|
||||||
memory_region_add_subregion(&nubus->super_slot_io, slot_offset,
|
memory_region_add_subregion(&nubus->super_slot_io, slot_offset,
|
||||||
&nd->slot_mem);
|
&nd->super_slot_mem);
|
||||||
} else {
|
g_free(name);
|
||||||
|
|
||||||
/* Normal */
|
/* Normal */
|
||||||
slot_offset = nd->slot * NUBUS_SLOT_SIZE;
|
slot_offset = nd->slot * NUBUS_SLOT_SIZE;
|
||||||
|
|
||||||
|
name = g_strdup_printf("nubus-slot-%x", nd->slot);
|
||||||
memory_region_init(&nd->slot_mem, OBJECT(dev), name, NUBUS_SLOT_SIZE);
|
memory_region_init(&nd->slot_mem, OBJECT(dev), name, NUBUS_SLOT_SIZE);
|
||||||
memory_region_add_subregion(&nubus->slot_io, slot_offset,
|
memory_region_add_subregion(&nubus->slot_io, slot_offset,
|
||||||
&nd->slot_mem);
|
&nd->slot_mem);
|
||||||
}
|
|
||||||
|
|
||||||
g_free(name);
|
g_free(name);
|
||||||
|
|
||||||
nubus_register_format_block(nd);
|
nubus_register_format_block(nd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ struct NubusDevice {
|
||||||
DeviceState qdev;
|
DeviceState qdev;
|
||||||
|
|
||||||
int slot;
|
int slot;
|
||||||
|
MemoryRegion super_slot_mem;
|
||||||
MemoryRegion slot_mem;
|
MemoryRegion slot_mem;
|
||||||
|
|
||||||
/* Format Block */
|
/* Format Block */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue