On 24/10/25 21:03, Philippe Mathieu-Daudé wrote:
Similarly to sysbus_has_mmio() and sysbus_mmio_get_region(),
add sysbus_has_pio() and sysbus_pio_get_address() for PIO.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
include/hw/sysbus.h | 2 ++
hw/core/sysbus.c | 11 +++++++++++
2 files changed, 13 insertions(+)
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index d33be6b2b52..1dbc345a3ef 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -206,6 +206,17 @@ void sysbus_init_ioports(SysBusDevice *dev, uint32_t
ioport, uint32_t size)
}
}
+bool sysbus_has_pio(const SysBusDevice *dev, unsigned int n)
+{
+ return (n < dev->num_pio);
+}
+
+uint32_t sysbus_pio_get_address(const SysBusDevice *dev, int n)
+{
+ assert(n >= 0 && n < QDEV_MAX_PIO);
+ return dev->pio[n];
+}
Actually not needed, will remove in v2.