diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 7820068e6e..d27a3c171f 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -131,6 +131,14 @@ void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start) isa_init_ioport(dev, start); } +void isa_unregister_ioport(ISADevice *dev, MemoryRegion *io) +{ + if (dev) { + dev->ioport_id = 0; + } + memory_region_del_subregion(isabus->address_space_io, io); +} + void isa_register_portio_list(ISADevice *dev, PortioList *piolist, uint16_t start, const MemoryRegionPortio *pio_start, diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index ddaae89a85..734787c8a2 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -118,6 +118,12 @@ void isa_build_aml(ISABus *bus, Aml *scope); */ void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start); +/* XBOX */ +/** + * isa_unregister_ioport: Uninstall an I/O port region on the ISA bus. + */ +void isa_unregister_ioport(ISADevice *dev, MemoryRegion *io); + /** * isa_register_portio_list: Initialize a set of ISA io ports *