projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revise documentation of debugging tools.
[pintos-anon]
/
src
/
devices
/
timer.c
diff --git
a/src/devices/timer.c
b/src/devices/timer.c
index 3724abf944ab4fbf7d53936cdbe822a2a7b9a5a5..c8c41d55cf412948eb71a04b52c748f0c554465d 100644
(file)
--- a/
src/devices/timer.c
+++ b/
src/devices/timer.c
@@
-16,10
+16,6
@@
#error TIMER_FREQ <= 1000 recommended
#endif
#error TIMER_FREQ <= 1000 recommended
#endif
-/* Number of timer ticks that a process gets before being
- preempted. */
-#define TIME_SLICE 1
-
/* Number of timer ticks since OS booted. */
static volatile int64_t ticks;
/* Number of timer ticks since OS booted. */
static volatile int64_t ticks;
@@
-46,7
+42,7
@@
timer_init (void)
outb (0x40, count & 0xff);
outb (0x40, count >> 8);
outb (0x40, count & 0xff);
outb (0x40, count >> 8);
- intr_register
(0x20, 0, INTR_OFF
, timer_interrupt, "8254 Timer");
+ intr_register
_ext (0x20
, timer_interrupt, "8254 Timer");
}
/* Calibrates loops_per_tick, used to implement brief delays. */
}
/* Calibrates loops_per_tick, used to implement brief delays. */
@@
-127,7
+123,7
@@
timer_nsleep (int64_t ns)
void
timer_print_stats (void)
{
void
timer_print_stats (void)
{
- printf ("Timer: %"PRId64" ticks\n", ti
cks
);
+ printf ("Timer: %"PRId64" ticks\n", ti
mer_ticks ()
);
}
\f
/* Timer interrupt handler. */
}
\f
/* Timer interrupt handler. */
@@
-136,8
+132,6
@@
timer_interrupt (struct intr_frame *args UNUSED)
{
ticks++;
thread_tick ();
{
ticks++;
thread_tick ();
- if (ticks % TIME_SLICE == 0)
- intr_yield_on_return ();
}
/* Returns true if LOOPS iterations waits for more than one timer
}
/* Returns true if LOOPS iterations waits for more than one timer