Don't raise the UART interrupts if no IRQ is configured

The 82C606 SuperIO allows reconfiguring the interrupt line used for the
UART alarm at runtime, including disabling it altogether.

While at that, correct the type in the serial_setup() prototype to be
the same as serial_t.irq uses.
This commit is contained in:
Lubomir Rintel
2021-09-07 18:25:50 +02:00
parent e641e81de7
commit d152e92648
2 changed files with 3 additions and 3 deletions

View File

@@ -128,7 +128,7 @@ serial_update_ints(serial_t *dev)
dev->iir = 0;
}
if (stat && ((dev->mctrl & 8) || (dev->type == SERIAL_8250_PCJR))) {
if (stat && (dev->irq != 0xff) && ((dev->mctrl & 8) || (dev->type == SERIAL_8250_PCJR))) {
if (dev->type >= SERIAL_NS16450)
picintlevel(1 << dev->irq);
else
@@ -615,7 +615,7 @@ serial_remove(serial_t *dev)
void
serial_setup(serial_t *dev, uint16_t addr, int irq)
serial_setup(serial_t *dev, uint16_t addr, uint8_t irq)
{
serial_log("Adding serial port %i at %04X...\n", dev->inst, addr);