-/*
- * thread_read_times reads the user and system times from a thread.
- * Time accumulated since last timestamp is not included. Should
- * be called at splsched() to avoid having user and system times
- * be out of step. Doesn't care if caller locked thread.
- *
- * Needs to be kept coherent with thread_read_times ahead.
- */
-void
-thread_read_times(
- thread_t thread,
- time_value_t *user_time_p,
- time_value_t *system_time_p)
-{
- timer_save_data_t temp;
- register timer_t timer;
-
- timer = &thread->user_timer;
- timer_grab(timer, &temp);
-
-#ifdef TIMER_ADJUST
- TIMER_ADJUST(&temp);
-#endif /* TIMER_ADJUST */
- user_time_p->seconds = temp.high + temp.low/1000000;
- user_time_p->microseconds = temp.low % 1000000;
-
- timer = &thread->system_timer;
- timer_grab(timer, &temp);
-
-#ifdef TIMER_ADJUST
- TIMER_ADJUST(&temp);
-#endif /* TIMER_ADJUST */
- system_time_p->seconds = temp.high + temp.low/1000000;
- system_time_p->microseconds = temp.low % 1000000;
-}
-
-/*
- * Db_thread_read_times: A version of thread_read_times that
- * can be called by the debugger. This version does not call
- * timer_grab, which can block. Please keep it up to date with
- * thread_read_times above.
- *
- */
-void
-db_thread_read_times(
- thread_t thread,
- time_value_t *user_time_p,
- time_value_t *system_time_p)
-{
- timer_save_data_t temp;
- register timer_t timer;
-
- timer = &thread->user_timer;
- db_timer_grab(timer, &temp);
-
-#ifdef TIMER_ADJUST
- TIMER_ADJUST(&temp);
-#endif /* TIMER_ADJUST */
- user_time_p->seconds = temp.high + temp.low/1000000;
- user_time_p->microseconds = temp.low % 1000000;
-
- timer = &thread->system_timer;
- timer_grab(timer, &temp);
-
-#ifdef TIMER_ADJUST
- TIMER_ADJUST(&temp);
-#endif /* TIMER_ADJUST */
- system_time_p->seconds = temp.high + temp.low/1000000;
- system_time_p->microseconds = temp.low % 1000000;
-}
-
-/*
- * timer_delta takes the difference of a saved timer value
- * and the current one, and updates the saved value to current.
- * The difference is returned as a function value. See
- * TIMER_DELTA macro (timer.h) for optimization to this.
- */
-
-unsigned
-timer_delta(
- register timer_t timer,
- timer_save_t save)
-{
- timer_save_data_t new_save;
- register unsigned result;