VMM: Use the I_POKE_CORE IRQ for posted IRQs
[akaros.git] / kern / arch / x86 / time.c
index e363ae9..ddea6c6 100644 (file)
@@ -18,7 +18,7 @@ system_timing_t system_timing = {0, 0, 0xffff, 0};
 // timer init calibrates both tsc timer and lapic timer using PIT
 void timer_init(void){
        /* some boards have this unmasked early on. */
-       pic_mask_irq(0 + PIC1_OFFSET);
+       pic_mask_irq(0, 0 + PIC1_OFFSET);
        uint64_t tscval[2];
        long timercount[2];
        pit_set_timer(0xffff, TIMER_RATEGEN);
@@ -26,7 +26,7 @@ void timer_init(void){
        tscval[0] = read_tsc();
        udelay_pit(1000000);
        tscval[1] = read_tsc();
-       system_timing.tsc_freq = SINIT(tscval[1] - tscval[0]);
+       system_timing.tsc_freq = tscval[1] - tscval[0];
        cprintf("TSC Frequency: %llu\n", system_timing.tsc_freq);
        __lapic_set_timer(0xffffffff, IdtLAPIC_TIMER, FALSE,
                          LAPIC_TIMER_DIVISOR_BITS);
@@ -52,8 +52,8 @@ void pit_set_timer(uint32_t divisor, uint32_t mode)
        outb(TIMER_MODE, mode); 
        outb(TIMER_CNTR0, divisor & 0xff);
        outb(TIMER_CNTR0, (divisor >> 8) );
-       system_timing.pit_mode = SINIT(mode);
-       system_timing.pit_divisor = SINIT(divisor);
+       system_timing.pit_mode = mode;
+       system_timing.pit_divisor = divisor;
        // cprintf("timer mode set to %d, divisor %d\n",mode, divisor);
 }