qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/9] hw/misc/empty_slot: Allow overide by device wit


From: Philippe Mathieu-Daudé
Subject: [Qemu-devel] [PATCH 3/9] hw/misc/empty_slot: Allow overide by device with higher priority
Date: Tue, 25 Jun 2019 00:00:50 +0200

The 'empty_slot' models a ChipEnable (or ChipSelect) MMIO device
pluggable on a bus.
The bus allow such slots to be not connected ('empty), thus no
bus errors are generated when this range is accessed.

The device is mapped at priority -10000 to allow other devices
to be mapped on top of it.

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
 hw/misc/empty_slot.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c
index 0adf7a26dc..53299cdbd1 100644
--- a/hw/misc/empty_slot.c
+++ b/hw/misc/empty_slot.c
@@ -68,7 +68,11 @@ void empty_slot_init(hwaddr addr, uint64_t slot_size)
 
         qdev_init_nofail(dev);
 
-        sysbus_mmio_map(s, 0, addr);
+        /*
+         * We use a priority lower than the default UNIMPLEMENTED_DEVICE
+         * to be able to plug a UnimplementedDevice on an EmptySlot.
+         */
+        sysbus_mmio_map_overlap(s, 0, addr, -10000);
     }
 }
 
-- 
2.19.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]