#include "threads/io.h"
#include "threads/thread.h"
+/* See [8254] for hardware details of the 8254 timer chip. */
+
#if TIMER_FREQ < 19
#error 8254 timer requires TIMER_FREQ >= 19
#endif
{
int64_t start = timer_ticks ();
+ ASSERT (intr_get_level () == INTR_ON);
while (timer_elapsed (start) < ticks)
- if (intr_get_level () == INTR_ON)
- thread_yield ();
+ thread_yield ();
}
/* Returns MS milliseconds in timer ticks, rounding up. */
void
timer_print_stats (void)
{
- printf ("Timer: %"PRId64" ticks.\n", ticks);
+ printf ("Timer: %"PRId64" ticks\n", ticks);
}
\f
/* Timer interrupt handler. */