Signed-off-by: Andreas Färber <andreas.faer...@web.de>
---
 hw/isa.h    |    1 +
 hw/serial.c |   11 +++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/hw/isa.h b/hw/isa.h
index 8bd082a..b577fe3 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -47,6 +47,7 @@ void parallel_isa_reconfigure_irq(ISADevice *dev, uint32_t 
isairq);
 
 /* serial.c */
 void serial_isa_reconfigure_iobase(ISADevice *dev, uint32_t base);
+void serial_isa_reconfigure_irq(ISADevice *dev, uint32_t isairq);
 
 /* dma.c */
 int DMA_get_channel_mode (int nchan);
diff --git a/hw/serial.c b/hw/serial.c
index dd91272..714e5b2 100644
--- a/hw/serial.c
+++ b/hw/serial.c
@@ -771,6 +771,17 @@ void serial_isa_reconfigure_iobase(ISADevice *dev, 
uint32_t iobase)
     }
 }
 
+void serial_isa_reconfigure_irq(ISADevice *dev, uint32_t isairq)
+{
+    ISASerialState *isa = DO_UPCAST(ISASerialState, dev, dev);
+
+    if (isairq != isa->isairq) {
+        isa_discard_irq(dev, isa->isairq);
+        isa->isairq = isairq;
+        isa_init_irq(dev, &isa->state.irq, isa->isairq);
+    }
+}
+
 static const int isa_serial_io[MAX_SERIAL_PORTS] = { 0x3f8, 0x2f8, 0x3e8, 
0x2e8 };
 static const int isa_serial_irq[MAX_SERIAL_PORTS] = { 4, 3, 4, 3 };
 
-- 
1.7.5.3


Reply via email to