projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3f2bdb
)
timer: Fix timer calibration logic.
author
Farshad Ghanei
<farshadg@buffalo.edu>
Wed, 28 Mar 2018 17:34:35 +0000
(13:34 -0400)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sat, 31 Mar 2018 17:12:01 +0000
(10:12 -0700)
loops_per_tick calculation should get updated with loops_per_tick, not with
high_bit.
src/devices/timer.c
patch
|
blob
|
history
diff --git
a/src/devices/timer.c
b/src/devices/timer.c
index befaaaed5a9a1ac0cd25ab76f8afd96fe6865127..8b923414e65248414512a63f5d27088ee3c3eb44 100644
(file)
--- a/
src/devices/timer.c
+++ b/
src/devices/timer.c
@@
-60,7
+60,7
@@
timer_calibrate (void)
/* Refine the next 8 bits of loops_per_tick. */
high_bit = loops_per_tick;
for (test_bit = high_bit >> 1; test_bit != high_bit >> 10; test_bit >>= 1)
- if (!too_many_loops (
high_bit
| test_bit))
+ if (!too_many_loops (
loops_per_tick
| test_bit))
loops_per_tick |= test_bit;
printf ("%'"PRIu64" loops/s.\n", (uint64_t) loops_per_tick * TIMER_FREQ);