1 #include <hal/hwtimer.h>
3 #include <asm-generic/isrm.h>
4 #include <lunaix/spike.h>
5 #include <lunaix/process.h>
10 #include "hal/apic_timer.h"
15 exception_install_handler();
21 syscall_hndlr(const struct hart_state* hstate);
28 isrm_bindiv(LUNAIX_SYS_CALL, syscall_hndlr);
32 select_platform_timer()
34 struct hwtimer* timer;
36 timer = apic_hwtimer_context();
37 if (timer->supported(timer)) {
41 // TODO select alternatives...
43 fail("no timer to use.");
49 extern struct x86_tss _tss;
50 #ifdef CONFIG_ARCH_X86_64
51 _tss.rsps[0] = (ptr_t)current_thread->hstate;
53 _tss.esp0 = (u32_t)current_thread->hstate;