1 #include <hal/hwtimer.h>
3 #include <lunaix/generic/isrm.h>
4 #include <lunaix/spike.h>
5 #include <lunaix/process.h>
7 #include "sys/int_handler.h"
8 #include "sys/x86_isa.h"
11 #include "hal/apic_timer.h"
16 exception_install_handler();
22 syscall_hndlr(const struct hart_state* hstate);
29 isrm_bindiv(LUNAIX_SYS_CALL, syscall_hndlr);
33 select_platform_timer()
35 struct hwtimer* timer;
37 timer = apic_hwtimer_context();
38 if (timer->supported(timer)) {
42 // TODO select alternatives...
44 panick("no timer to use.");
50 extern struct x86_tss _tss;
51 #ifdef CONFIG_ARCH_X86_64
52 _tss.rsps[0] = (ptr_t)current_thread->hstate;
54 _tss.esp0 = (u32_t)current_thread->hstate;