aboutsummaryrefslogtreecommitdiff
path: root/hw/nubus/nubus-device.c
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2021-09-24 08:37:53 +0100
committerLaurent Vivier <laurent@vivier.eu>2021-09-29 10:45:19 +0200
commitc10a576c19665a617ce00cb93afd115142b6a7af (patch)
tree92443de6caef818c2fff2d1395ad2b3691618000 /hw/nubus/nubus-device.c
parent03deab99401a57332d8f3bdba319a41eebc1d666 (diff)
downloadqemu-c10a576c19665a617ce00cb93afd115142b6a7af.zip
qemu-c10a576c19665a617ce00cb93afd115142b6a7af.tar.gz
qemu-c10a576c19665a617ce00cb93afd115142b6a7af.tar.bz2
nubus: move slot bitmap checks from NubusDevice realize() to BusClass check_address()
Allow Nubus to manage the slot allocations itself using the BusClass check_address() virtual function rather than managing this during NubusDevice realize(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210924073808.1041-6-mark.cave-ayland@ilande.co.uk> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/nubus/nubus-device.c')
-rw-r--r--hw/nubus/nubus-device.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/hw/nubus/nubus-device.c b/hw/nubus/nubus-device.c
index 2e96d6b..516b13d 100644
--- a/hw/nubus/nubus-device.c
+++ b/hw/nubus/nubus-device.c
@@ -161,27 +161,6 @@ static void nubus_device_realize(DeviceState *dev, Error **errp)
char *name;
hwaddr slot_offset;
- if (nd->slot == -1) {
- /* No slot specified, find first available free slot */
- int s = ctz32(nubus->slot_available_mask);
- if (s != 32) {
- nd->slot = s;
- } else {
- error_setg(errp, "Cannot register nubus card, no free slot "
- "available");
- return;
- }
- } else {
- /* Slot specified, make sure the slot is available */
- if (!(nubus->slot_available_mask & BIT(nd->slot))) {
- error_setg(errp, "Cannot register nubus card, slot %d is "
- "unavailable or already occupied", nd->slot);
- return;
- }
- }
-
- nubus->slot_available_mask &= ~BIT(nd->slot);
-
/* Super */
slot_offset = nd->slot * NUBUS_SUPER_SLOT_SIZE;