diff options
author | Steve Reinhardt <steve.reinhardt@amd.com> | 2011-01-07 21:50:29 -0800 |
---|---|---|
committer | Steve Reinhardt <steve.reinhardt@amd.com> | 2011-01-07 21:50:29 -0800 |
commit | 6f1187943cf78c2fd0334bd7e4372ae79a587fa4 (patch) | |
tree | 8d0eac2e2f4d55d48245266d3930ad4e7f92030f /src/dev/arm | |
parent | c22be9f2f016872b05d65c82055ddc936b4aa075 (diff) | |
download | gem5-6f1187943cf78c2fd0334bd7e4372ae79a587fa4.tar.xz |
Replace curTick global variable with accessor functions.
This step makes it easy to replace the accessor functions
(which still access a global variable) with ones that access
per-thread curTick values.
Diffstat (limited to 'src/dev/arm')
-rw-r--r-- | src/dev/arm/pl011.cc | 6 | ||||
-rw-r--r-- | src/dev/arm/pl111.cc | 12 | ||||
-rw-r--r-- | src/dev/arm/rv_ctrl.cc | 2 | ||||
-rw-r--r-- | src/dev/arm/timer_sp804.cc | 6 |
4 files changed, 13 insertions, 13 deletions
diff --git a/src/dev/arm/pl011.cc b/src/dev/arm/pl011.cc index d8ea9409b..dd1c8863e 100644 --- a/src/dev/arm/pl011.cc +++ b/src/dev/arm/pl011.cc @@ -187,7 +187,7 @@ Pl011::write(PacketPtr pkt) DPRINTF(Uart, "TX int enabled, scheduling interruptt\n"); rawInt.txim = 1; if (!intEvent.scheduled()) - schedule(intEvent, curTick + intDelay); + schedule(intEvent, curTick() + intDelay); } break; @@ -217,7 +217,7 @@ Pl011::write(PacketPtr pkt) DPRINTF(Uart, "Writing to IMSC: TX int enabled, scheduling interruptt\n"); rawInt.txim = 1; if (!intEvent.scheduled()) - schedule(intEvent, curTick + intDelay); + schedule(intEvent, curTick() + intDelay); } break; @@ -252,7 +252,7 @@ Pl011::dataAvailable() DPRINTF(Uart, "Data available, scheduling interrupt\n"); if (!intEvent.scheduled()) - schedule(intEvent, curTick + intDelay); + schedule(intEvent, curTick() + intDelay); } void diff --git a/src/dev/arm/pl111.cc b/src/dev/arm/pl111.cc index e78d28141..e597bf272 100644 --- a/src/dev/arm/pl111.cc +++ b/src/dev/arm/pl111.cc @@ -355,7 +355,7 @@ Pl111::readFramebuffer() startAddr = lcdUpbase; } curAddr = 0; - startTime = curTick; + startTime = curTick(); maxAddr = static_cast<Addr>(length*sizeof(uint32_t)); dmaPendingNum =0 ; @@ -388,9 +388,9 @@ Pl111::dmaDone() DPRINTF(PL111, " -- DMA pending number %d\n", dmaPendingNum); if (maxAddr == curAddr && !dmaPendingNum) { - if ((curTick - startTime) > maxFrameTime) + if ((curTick() - startTime) > maxFrameTime) warn("CLCD controller buffer underrun, took %d cycles when should" - " have taken %d\n", curTick - startTime, maxFrameTime); + " have taken %d\n", curTick() - startTime, maxFrameTime); // double buffering so the vnc server doesn't see a tear in the screen memcpy(frameBuffer, dmaBuffer, maxAddr); @@ -400,7 +400,7 @@ Pl111::dmaDone() writeBMP(frameBuffer); DPRINTF(PL111, "-- schedule next dma read event at %d tick \n", - maxFrameTime + curTick); + maxFrameTime + curTick()); schedule(readEvent, nextCycle(startTime + maxFrameTime)); } @@ -415,7 +415,7 @@ Pl111::dmaDone() Tick Pl111::nextCycle() { - Tick nextTick = curTick + clock - 1; + Tick nextTick = curTick() + clock - 1; nextTick -= nextTick%clock; return nextTick; } @@ -427,7 +427,7 @@ Pl111::nextCycle(Tick beginTick) if (nextTick%clock!=0) nextTick = nextTick - (nextTick%clock) + clock; - assert(nextTick >= curTick); + assert(nextTick >= curTick()); return nextTick; } diff --git a/src/dev/arm/rv_ctrl.cc b/src/dev/arm/rv_ctrl.cc index 08ac07233..c0ba4c7aa 100644 --- a/src/dev/arm/rv_ctrl.cc +++ b/src/dev/arm/rv_ctrl.cc @@ -62,7 +62,7 @@ RealViewCtrl::read(PacketPtr pkt) break; case Clock24: Tick clk; - clk = (Tick)(curTick / (24 * SimClock::Float::MHz)); + clk = (Tick)(curTick() / (24 * SimClock::Float::MHz)); pkt->set((uint32_t)(clk)); break; case Flash: diff --git a/src/dev/arm/timer_sp804.cc b/src/dev/arm/timer_sp804.cc index f6bbfb515..04668d268 100644 --- a/src/dev/arm/timer_sp804.cc +++ b/src/dev/arm/timer_sp804.cc @@ -93,7 +93,7 @@ Sp804::Timer::read(PacketPtr pkt, Addr daddr) DPRINTF(Timer, "Event schedule for %d, clock=%d, prescale=%d\n", zeroEvent.when(), clock, control.timerPrescale); Tick time; - time = zeroEvent.when() - curTick; + time = zeroEvent.when() - curTick(); time = time / clock / power(16, control.timerPrescale); DPRINTF(Timer, "-- returning counter at %d\n", time); pkt->set<uint32_t>(time); @@ -188,8 +188,8 @@ Sp804::Timer::restartCounter(uint32_t val) DPRINTF(Timer, "-- Event was already schedule, de-scheduling\n"); parent->deschedule(zeroEvent); } - parent->schedule(zeroEvent, curTick + time); - DPRINTF(Timer, "-- Scheduling new event for: %d\n", curTick + time); + parent->schedule(zeroEvent, curTick() + time); + DPRINTF(Timer, "-- Scheduling new event for: %d\n", curTick() + time); } void |