diff options
author | jhb <jhb@FreeBSD.org> | 2005-02-08 20:25:07 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-02-08 20:25:07 +0000 |
commit | ad1ee10f6d12f8bbdd826c263511342a4a45857a (patch) | |
tree | 0d346c70694552278e41eaff461d9a620e55ac7e /sys/boot/i386 | |
parent | 1d264321faae4f3aba6b42846e735baa1dab10f3 (diff) | |
download | FreeBSD-src-ad1ee10f6d12f8bbdd826c263511342a4a45857a.zip FreeBSD-src-ad1ee10f6d12f8bbdd826c263511342a4a45857a.tar.gz |
Use the local APIC timer to drive the various kernel clocks on SMP machines
rather than forwarding interrupts from the clock devices around using IPIs:
- Add an IDT vector that pushes a clock frame and calls
lapic_handle_timer().
- Add functions to program the local APIC timer including setting the
divisor, and setting up the timer to either down a periodic countdown
or one-shot countdown.
- Add a lapic_setup_clock() function that the BSP calls from
cpu_init_clocks() to setup the local APIC timer if it is going to be
used. The setup uses a one-shot countdown to calibrate the timer. We
then program the timer on each CPU to fire at a frequency of hz * 3.
stathz is defined as freq / 23 (hz * 3 / 23), and profhz is defined as
freq / 2 (hz * 3 / 2). This gives the clocks relatively prime divisors
while keeping a low LCM for the frequency of the clock interrupts.
Thanks to Peter Jeremy for suggesting this approach.
- Remove the hardclock and statclock forwarding code including the two
associated IPIs. The bitmap IPI handler has now effectively degenerated
to just IPI_AST.
- When the local APIC timer is used we don't turn the RTC on at all, but
we still enable interrupts on the ISA timer 0 (i8254) for timecounting
purposes.
Diffstat (limited to 'sys/boot/i386')
0 files changed, 0 insertions, 0 deletions