single shot timer interrupts fix

- accidentaly this wasn't part of the SMP merge and the implementation
  remained uncomplete with the timer keeping ticking periodically

- APIC timer is set for a signel shot and restarted everytime it
  expires. This way we can keep the AP's trully idle

- the timer is restarted a little later before leaving to userspace

- LAPIC_TIMER_ICR is written before LAPIC_LVTTR so the newest value is
  used
This commit is contained in:
Tomas Hruby
2010-10-21 17:07:01 +00:00
parent ebbc730fc3
commit a1eefc013e
3 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -508,14 +508,14 @@ PUBLIC void lapic_set_timer_one_shot(const u32_t usec)
ticks_per_us = (lapic_bus_freq[cpu] / 1000000) * config_apic_timer_x;
lapic_write(LAPIC_TIMER_ICR, usec * ticks_per_us);
lvtt = APIC_TDCR_1;
lapic_write(LAPIC_TIMER_DCR, lvtt);
/* configure timer as one-shot */
lvtt = APIC_TIMER_INT_VECTOR;
lapic_write(LAPIC_LVTTR, lvtt);
lapic_write(LAPIC_TIMER_ICR, usec * ticks_per_us);
}
PUBLIC void lapic_set_timer_periodic(const unsigned freq)