-#include <kern/cpu_number.h>
-
-#include <kern/assert.h>
-#include <kern/macro_help.h>
-
-timer_t current_timer[NCPUS];
-timer_data_t kernel_timer[NCPUS];
-
-/* Forwards */
-void timer_grab(
- timer_t timer,
- timer_save_t save);
-
-void db_timer_grab(
- timer_t timer,
- timer_save_t save);
-
-void db_thread_read_times(
- thread_t thread,
- time_value_t *user_time_p,
- time_value_t *system_time_p);
-
-/*
- * init_timers initializes all non-thread timers and puts the
- * service routine on the callout queue. All timers must be
- * serviced by the callout routine once an hour.
- */
-void
-init_timers(void)
-{
- register int i;
- register timer_t this_timer;
-
- /*
- * Initialize all the kernel timers and start the one
- * for this cpu (master) slaves start theirs later.
- */
- this_timer = &kernel_timer[0];
- for ( i=0 ; i<NCPUS ; i++, this_timer++) {
- timer_init(this_timer);
- current_timer[i] = (timer_t) 0;
- }
-
- mp_disable_preemption();
- start_timer(&kernel_timer[cpu_number()]);
- mp_enable_preemption();
-}
-
-/*
- * timer_init initializes a single timer.
- */
-void
-timer_init(
- register timer_t this_timer)
-{
- this_timer->low_bits = 0;
- this_timer->high_bits = 0;
- this_timer->tstamp = 0;
- this_timer->high_bits_check = 0;
-}
-
-#if STAT_TIME
-#else /* STAT_TIME */
-
-#ifdef MACHINE_TIMER_ROUTINES
-
-/*
- * Machine-dependent code implements the timer routines.
- */
-
-#else /* MACHINE_TIMER_ROUTINES */
-
-/*
- * start_timer starts the given timer for this cpu. It is called
- * exactly once for each cpu during the boot sequence.
- */
-void
-start_timer(
- register timer_t timer)
-{
- timer->tstamp = get_timestamp();
- mp_disable_preemption();
- current_timer[cpu_number()] = timer;
- mp_enable_preemption();
-}