sysbus: add a sysbus_mmio_unmap() helper
This will be used to remove the MMIO regions of the POWER9 XIVE interrupt controller when the sPAPR machine is reseted. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20190513084245.25755-9-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
0dc9f5f849
commit
90c20e1e2c
@ -153,6 +153,16 @@ static void sysbus_mmio_map_common(SysBusDevice *dev, int n, hwaddr addr,
|
||||
}
|
||||
}
|
||||
|
||||
void sysbus_mmio_unmap(SysBusDevice *dev, int n)
|
||||
{
|
||||
assert(n >= 0 && n < dev->num_mmio);
|
||||
|
||||
if (dev->mmio[n].addr != (hwaddr)-1) {
|
||||
memory_region_del_subregion(get_system_memory(), dev->mmio[n].memory);
|
||||
dev->mmio[n].addr = (hwaddr)-1;
|
||||
}
|
||||
}
|
||||
|
||||
void sysbus_mmio_map(SysBusDevice *dev, int n, hwaddr addr)
|
||||
{
|
||||
sysbus_mmio_map_common(dev, n, addr, false, 0);
|
||||
|
@ -89,6 +89,7 @@ qemu_irq sysbus_get_connected_irq(SysBusDevice *dev, int n);
|
||||
void sysbus_mmio_map(SysBusDevice *dev, int n, hwaddr addr);
|
||||
void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr,
|
||||
int priority);
|
||||
void sysbus_mmio_unmap(SysBusDevice *dev, int n);
|
||||
void sysbus_add_io(SysBusDevice *dev, hwaddr addr,
|
||||
MemoryRegion *mem);
|
||||
MemoryRegion *sysbus_address_space(SysBusDevice *dev);
|
||||
|
Loading…
Reference in New Issue
Block a user