aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/nubus/nubus-device.c36
-rw-r--r--include/hw/nubus/nubus.h1
2 files changed, 19 insertions, 18 deletions
diff --git a/hw/nubus/nubus-device.c b/hw/nubus/nubus-device.c
index be01269..4e23df1 100644
--- a/hw/nubus/nubus-device.c
+++ b/hw/nubus/nubus-device.c
@@ -168,26 +168,26 @@ static void nubus_device_realize(DeviceState *dev, Error **errp)
}
nd->slot = nubus->current_slot++;
- name = g_strdup_printf("nubus-slot-%d", nd->slot);
-
- if (nd->slot < NUBUS_FIRST_SLOT) {
- /* Super */
- slot_offset = (nd->slot - 6) * NUBUS_SUPER_SLOT_SIZE;
-
- memory_region_init(&nd->slot_mem, OBJECT(dev), name,
- NUBUS_SUPER_SLOT_SIZE);
- memory_region_add_subregion(&nubus->super_slot_io, slot_offset,
- &nd->slot_mem);
- } else {
- /* Normal */
- slot_offset = nd->slot * NUBUS_SLOT_SIZE;
-
- memory_region_init(&nd->slot_mem, OBJECT(dev), name, NUBUS_SLOT_SIZE);
- memory_region_add_subregion(&nubus->slot_io, slot_offset,
- &nd->slot_mem);
- }
+ /* Super */
+ slot_offset = nd->slot * NUBUS_SUPER_SLOT_SIZE;
+
+ name = g_strdup_printf("nubus-super-slot-%x", nd->slot);
+ memory_region_init(&nd->super_slot_mem, OBJECT(dev), name,
+ NUBUS_SUPER_SLOT_SIZE);
+ memory_region_add_subregion(&nubus->super_slot_io, slot_offset,
+ &nd->super_slot_mem);
+ g_free(name);
+
+ /* Normal */
+ 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_add_subregion(&nubus->slot_io, slot_offset,
+ &nd->slot_mem);
g_free(name);
+
nubus_register_format_block(nd);
}
diff --git a/include/hw/nubus/nubus.h b/include/hw/nubus/nubus.h
index 424309d..89b0976 100644
--- a/include/hw/nubus/nubus.h
+++ b/include/hw/nubus/nubus.h
@@ -43,6 +43,7 @@ struct NubusDevice {
DeviceState qdev;
int slot;
+ MemoryRegion super_slot_mem;
MemoryRegion slot_mem;
/* Format Block */