summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-04-30 13:13:03 -0400
committerAli Saidi <saidi@eecs.umich.edu>2007-04-30 13:13:03 -0400
commit58b9047194774ae6ee3cd7c2ef52cc867c8e718e (patch)
tree6f13959d6eb0edaabb63bc6b0b74f77f8a65f993 /src
parentae4208f3a32bc829283a9998aa6f6fcebea7ca77 (diff)
downloadgem5-58b9047194774ae6ee3cd7c2ef52cc867c8e718e.tar.xz
fix console printing bug
--HG-- extra : convert_revision : 5481b72b22e7a2cf3367d777309bc30201f3b1fc
Diffstat (limited to 'src')
-rw-r--r--src/dev/uart8250.cc20
-rw-r--r--src/dev/uart8250.hh1
2 files changed, 16 insertions, 5 deletions
diff --git a/src/dev/uart8250.cc b/src/dev/uart8250.cc
index ddee33695..d178bd1af 100644
--- a/src/dev/uart8250.cc
+++ b/src/dev/uart8250.cc
@@ -68,6 +68,7 @@ Uart8250::IntrEvent::process()
DPRINTF(Uart, "UART InterEvent, interrupting\n");
uart->platform->postConsoleInt();
uart->status |= intrBit;
+ uart->lastTxInt = curTick;
}
else
DPRINTF(Uart, "UART InterEvent, not interrupting\n");
@@ -153,13 +154,13 @@ Uart8250::read(PacketPtr pkt)
if (status & RX_INT) /* Rx data interrupt has a higher priority */
pkt->set(IIR_RXID);
- else if (status & TX_INT)
+ else if (status & TX_INT) {
pkt->set(IIR_TXID);
- else
+ //Tx interrupts are cleared on IIR reads
+ status &= ~TX_INT;
+ } else
pkt->set(IIR_NOPEND);
- //Tx interrupts are cleared on IIR reads
- status &= ~TX_INT;
break;
case 0x3: // Line Control Register (LCR)
pkt->set(LCR);
@@ -222,7 +223,16 @@ Uart8250::write(PacketPtr pkt)
if (UART_IER_THRI & IER)
{
DPRINTF(Uart, "IER: IER_THRI set, scheduling TX intrrupt\n");
- txIntrEvent.scheduleIntr();
+ if (curTick - lastTxInt >
+ (Tick)((Clock::Float::s / 2e9) * 450)) {
+ DPRINTF(Uart, "-- Interrupting Immediately... %d,%d\n",
+ curTick, lastTxInt);
+ txIntrEvent.process();
+ } else {
+ DPRINTF(Uart, "-- Delaying interrupt... %d,%d\n",
+ curTick, lastTxInt);
+ txIntrEvent.scheduleIntr();
+ }
}
else
{
diff --git a/src/dev/uart8250.hh b/src/dev/uart8250.hh
index c28200592..c9c878aed 100644
--- a/src/dev/uart8250.hh
+++ b/src/dev/uart8250.hh
@@ -74,6 +74,7 @@ class Uart8250 : public Uart
protected:
uint8_t IER, DLAB, LCR, MCR;
+ Tick lastTxInt;
class IntrEvent : public Event
{