kernel/proc/timer.c
/*
 * Top half of timer handling.
 * Called from within timer interrupt.  Updates the quanta used of all running
 * processes and advances the hard_clock (the wall time).
 */
Top half of timer handling.
Called from within timer interrupt.  Updates the quanta used of all running
processes and advances the hard_clock (the wall time).
Top half of timer handling . Called from within timer interrupt . Updates the quanta used of all running processes and advances the hard_clock ( the wall time ) .
void TimerTopHalf(void) {
  int t;
  for (t = 0; t < max_cpu; t++) {
    if (cpu_table[t].current_process != NULL) {
      cpu_table[t].current_process->quanta_used++;
    }
    cpu_table[t].reschedule_request = TRUE;
  }
  SpinLock(&timer_slock);
  hardclock_time++;
  SpinUnlock(&timer_slock);
  TaskWakeupFromISR(&timer_rendez);
}
void TimerTopHalf ( void ) { int t ; for ( t = 0 ; t < max_cpu ; t ++ ) { if ( cpu_table [ t ] . current_process != NULL ) { cpu_table [ t ] . current_process -> quanta_used ++ ; } cpu_table [ t ] . reschedule_request = TRUE ; } SpinLock ( & timer_slock ) ; hardclock_time ++ ; SpinUnlock ( & timer_slock ) ; TaskWakeupFromISR ( & timer_rendez ) ; }
Top half of timer handling.
Top half of timer handling .