k1om: fixing initialization of apic timer interrupts
#include <barrelfish_kpi/asm_inlines_arch.h>
#include <coreboot.h>
#include <kcb.h>
-
+#include <systime.h>
#include <xeon_phi.h>
#include <xeon_phi/xeon_phi.h>
@@ -509,17 +509,15 @@ static void __attribute__ ((noreturn, noinline)) text_init(void)
// do not remove/change this printf: needed by regression harness
printf("Barrelfish CPU driver starting on k1om apic_id %u\n", apic_id);
-
// Initialize local APIC timer
if (kernel_ticks_enabled) {
timing_calibrate();
- bool periodic = true;
- #ifdef CONFIG_ONESHOT_TIMER
- // we probably need a global variable like kernel_ticks_enabled
- periodic = false;
+ apic_timer_init(false, false);
+ apic_timer_set_divide(xapic_by1);
+ kernel_timeslice = ns_to_systime(config_timeslice * 1000000);
+#ifndef CONFIG_ONESHOT_TIMER
+ systime_set_timeout(systime_now() + kernel_timeslice);
#endif
- apic_timer_init(false, periodic);
- timing_apic_timer_set_ms(kernel_timeslice);
} else {
printk(LOG_WARN, "APIC timer disabled: NO timeslicing\n");
apic_mask_timer();
