From d76120135b9ed5ea34c2038629dc9bc563f46108 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 15 Aug 2011 17:17:29 +0300 Subject: sysbus: add a variant of sysbus_init_mmio_cb with an unmap callback sysbus_init_mmio_cb() uses the destructive IO_MEM_UNASSIGNED to remove a region. Provide an alternative that calls an unmap callback, so the removal may be done non-destructively. Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori --- hw/sysbus.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hw/sysbus.h') diff --git a/hw/sysbus.h b/hw/sysbus.h index 5f62e2da3..16fd96940 100644 --- a/hw/sysbus.h +++ b/hw/sysbus.h @@ -23,6 +23,7 @@ struct SysBusDevice { target_phys_addr_t addr; target_phys_addr_t size; mmio_mapfunc cb; + mmio_mapfunc unmap; ram_addr_t iofunc; MemoryRegion *memory; } mmio[QDEV_MAX_MMIO]; @@ -48,6 +49,8 @@ void sysbus_init_mmio(SysBusDevice *dev, target_phys_addr_t size, ram_addr_t iofunc); void sysbus_init_mmio_cb(SysBusDevice *dev, target_phys_addr_t size, mmio_mapfunc cb); +void sysbus_init_mmio_cb2(SysBusDevice *dev, + mmio_mapfunc cb, mmio_mapfunc unmap); void sysbus_init_mmio_region(SysBusDevice *dev, MemoryRegion *memory); void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p); void sysbus_pass_irq(SysBusDevice *dev, SysBusDevice *target); -- cgit v1.2.3