On 24/10/25 21:40, Mark Cave-Ayland wrote:
On 24/10/2025 20:03, Philippe Mathieu-Daudé wrote:
MemoryRegion::name is kind of internal. Use the proper
memory_region_name() accessor, which might return a different
name.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
hw/core/sysbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index ae447c1196a..d33be6b2b52 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -154,7 +154,7 @@ void sysbus_mmio_map(SysBusDevice *dev, int n,
hwaddr addr)
int sysbus_mmio_map_name(SysBusDevice *dev, const char *name, hwaddr
addr)
{
for (int i = 0; i < dev->num_mmio; i++) {
- if (!strcmp(dev->mmio[i].memory->name, name)) {
+ if (!strcmp(memory_region_name(dev->mmio[i].memory), name)) {
sysbus_mmio_map(dev, i, addr);
return i;
}
Interesting. I'm mildly curious as to if you discovered anything that
broke with this change (even though I agree it is correct)?
I'm working on having qdev to absorb sysbus features (MMIO, PIO
and IRQ links); what is left is the qom parenting on the main
sysbus, only used during legacy reset; I hope to convert the
remaining as a cripple reset tree.