summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-02-28 19:28:09 -0800
committerNathan Binkert <nate@binkert.org>2010-02-28 19:28:09 -0800
commitebdd004eb28b684fd8f41f71954127ecb347704c (patch)
tree16bbdacae4902f07a0b39e54e28bb7c3dddb4d4c
parentb1cbd7841acad5fdcd88c2e644b454e95190eb7e (diff)
downloadgem5-ebdd004eb28b684fd8f41f71954127ecb347704c.tar.xz
uart: use integer versions of time instead of messing around with floats
-rw-r--r--src/dev/uart8250.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/dev/uart8250.cc b/src/dev/uart8250.cc
index e3eacaaa2..f131ab69f 100644
--- a/src/dev/uart8250.cc
+++ b/src/dev/uart8250.cc
@@ -90,7 +90,7 @@ Uart8250::IntrEvent::process()
void
Uart8250::IntrEvent::scheduleIntr()
{
- static const Tick interval = (Tick)((Clock::Float::s / 2e9) * 450);
+ static const Tick interval = 225 * Clock::Int::ns;
DPRINTF(Uart, "Scheduling IER interrupt for %#x, at cycle %lld\n", intrBit,
curTick + interval);
if (!scheduled())
@@ -217,8 +217,7 @@ Uart8250::write(PacketPtr pkt)
if (UART_IER_THRI & IER)
{
DPRINTF(Uart, "IER: IER_THRI set, scheduling TX intrrupt\n");
- if (curTick - lastTxInt >
- (Tick)((Clock::Float::s / 2e9) * 450)) {
+ if (curTick - lastTxInt > 225 * Clock::Int::ns) {
DPRINTF(Uart, "-- Interrupting Immediately... %d,%d\n",
curTick, lastTxInt);
txIntrEvent.process();