intel_8254_timer.cc (7683:f81f5f27592b) | intel_8254_timer.cc (7823:dac01f14f20f) |
---|---|
1/* 2 * Copyright (c) 2004, 2005 3 * The Regents of The University of Michigan 4 * All Rights Reserved 5 * 6 * This code is part of the M5 simulator. 7 * 8 * Permission is granted to use, copy, create derivative works and --- 267 unchanged lines hidden (view full) --- 276 counter->parent->counterInterrupt(counter->num); 277} 278 279void 280Intel8254Timer::Counter::CounterEvent::setTo(int clocks) 281{ 282 if (clocks == 0) 283 panic("Timer can't be set to go off instantly.\n"); | 1/* 2 * Copyright (c) 2004, 2005 3 * The Regents of The University of Michigan 4 * All Rights Reserved 5 * 6 * This code is part of the M5 simulator. 7 * 8 * Permission is granted to use, copy, create derivative works and --- 267 unchanged lines hidden (view full) --- 276 counter->parent->counterInterrupt(counter->num); 277} 278 279void 280Intel8254Timer::Counter::CounterEvent::setTo(int clocks) 281{ 282 if (clocks == 0) 283 panic("Timer can't be set to go off instantly.\n"); |
284 DPRINTF(Intel8254Timer, "Timer set to curTick + %d\n", | 284 DPRINTF(Intel8254Timer, "Timer set to curTick() + %d\n", |
285 clocks * interval); | 285 clocks * interval); |
286 counter->parent->schedule(this, curTick + clocks * interval); | 286 counter->parent->schedule(this, curTick() + clocks * interval); |
287} 288 289int 290Intel8254Timer::Counter::CounterEvent::clocksLeft() 291{ 292 if (!scheduled()) 293 return -1; | 287} 288 289int 290Intel8254Timer::Counter::CounterEvent::clocksLeft() 291{ 292 if (!scheduled()) 293 return -1; |
294 return (when() - curTick + interval - 1) / interval; | 294 return (when() - curTick() + interval - 1) / interval; |
295} 296 297const char * 298Intel8254Timer::Counter::CounterEvent::description() const 299{ 300 return "Intel 8254 Interval timer"; 301} | 295} 296 297const char * 298Intel8254Timer::Counter::CounterEvent::description() const 299{ 300 return "Intel 8254 Interval timer"; 301} |