summaryrefslogtreecommitdiff
path: root/dev/uart8250.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dev/uart8250.cc')
-rw-r--r--dev/uart8250.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/dev/uart8250.cc b/dev/uart8250.cc
index 99e3bd017..bbde14769 100644
--- a/dev/uart8250.cc
+++ b/dev/uart8250.cc
@@ -146,10 +146,14 @@ Uart8250::read(MemReqPtr &req, uint8_t *data)
break;
case 0x2: // Intr Identification Register (IIR)
DPRINTF(Uart, "IIR Read, status = %#x\n", (uint32_t)status);
- if (status)
- *(uint8_t*)data = 0;
+
+ //Tx interrupts are cleared on IIR reads
+ status &= ~TX_INT;
+
+ if (status & RX_INT)
+ *(uint8_t*)data = IIR_RXID;
else
- *(uint8_t*)data = 1;
+ *(uint8_t*)data = IIR_NOPEND;
break;
case 0x3: // Line Control Register (LCR)
*(uint8_t*)data = LCR;