minix/kernel/clock.h
Tomas Hruby 451a6890d6 scheduling - time quantum in miliseconds
- Currently the cpu time quantum is timer-ticks based. Thus the
  remaining quantum is decreased only if the processes is interrupted
  by a timer tick. As processes block a lot this typically does not
  happen for normal user processes. Also the quantum depends on the
  frequency of the timer.

- This change makes the quantum miliseconds based. Internally the
  miliseconds are translated into cpu cycles. Everytime userspace
  execution is interrupted by kernel the cycles just consumed by the
  current process are deducted from the remaining quantum.

- It makes the quantum system timer frequency independent.

- The boot processes quantum is loosely derived from the tick-based
  quantas and 60Hz timer and subject to future change

- the 64bit arithmetics is a little ugly, will be changes once we have
  compiler support for 64bit integers (soon)
2010-05-25 08:06:14 +00:00

19 lines
491 B
C

#ifndef __CLOCK_H__
#define __CLOCK_H__
#include "kernel.h"
#include "arch_clock.h"
_PROTOTYPE(int boot_cpu_init_timer, (unsigned freq));
_PROTOTYPE(int bsp_timer_int_handler, (void));
_PROTOTYPE(int ap_timer_int_handler, (void));
_PROTOTYPE(int arch_init_local_timer, (unsigned freq));
_PROTOTYPE(void arch_stop_local_timer, (void));
_PROTOTYPE(int arch_register_local_timer_handler, (irq_handler_t handler));
_PROTOTYPE( u64_t ms_2_cpu_time, (unsigned ms));
#endif /* __CLOCK_H__ */