arm, dev: pl011 console interactivity
authorBjoern A. Zeeb <baz21@cam.ac.uk>
Sat, 15 Oct 2016 20:11:04 +0000 (15:11 -0500)
committerBjoern A. Zeeb <baz21@cam.ac.uk>
Sat, 15 Oct 2016 20:11:04 +0000 (15:11 -0500)
Improve PL011 console interactivity

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
src/dev/arm/pl011.cc

index e00ee835111eaf0fe377e9cfa691dd3f0538e2be..40f34e1fd78f5d57836f3a095a863ab95eb53519 100644 (file)
@@ -86,6 +86,11 @@ Pl011::read(PacketPtr pkt)
             // Since we don't simulate a FIFO for incoming data, we
             // assume it's empty and clear RXINTR and RTINTR.
             clearInterrupts(UART_RXINTR | UART_RTINTR);
+            if (term->dataAvailable()) {
+                DPRINTF(Uart, "Re-raising interrupt due to more data "
+                        "after UART_DR read\n");
+                dataAvailable();
+            }
         }
         break;
       case UART_FR:
@@ -224,6 +229,11 @@ Pl011::write(PacketPtr pkt)
       case UART_ICR:
         DPRINTF(Uart, "Clearing interrupts 0x%x\n", data);
         clearInterrupts(data);
+        if (term->dataAvailable()) {
+            DPRINTF(Uart, "Re-raising interrupt due to more data after "
+                    "UART_ICR write\n");
+            dataAvailable();
+        }
         break;
       default:
         panic("Tried to write PL011 at offset %#x that doesn't exist\n", daddr);