From owner-cvs-src@FreeBSD.ORG Tue Feb 8 20:25:07 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 83B7D16A4CE; Tue, 8 Feb 2005 20:25:07 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6380443D45; Tue, 8 Feb 2005 20:25:07 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j18KP7NM069511; Tue, 8 Feb 2005 20:25:07 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j18KP72E069507; Tue, 8 Feb 2005 20:25:07 GMT (envelope-from jhb) Message-Id: <200502082025.j18KP72E069507@repoman.freebsd.org> From: John Baldwin Date: Tue, 8 Feb 2005 20:25:07 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/i386/i386 apic_vector.s local_apic.c mp_machdep.c src/sys/i386/include apicvar.h smp.h src/sys/i386/isa clock.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2005 20:25:07 -0000 jhb 2005-02-08 20:25:07 UTC FreeBSD src repository Modified files: sys/i386/i386 apic_vector.s local_apic.c mp_machdep.c sys/i386/include apicvar.h smp.h sys/i386/isa clock.c Log: 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. Revision Changes Path 1.103 +24 -0 src/sys/i386/i386/apic_vector.s 1.13 +186 -2 src/sys/i386/i386/local_apic.c 1.244 +0 -67 src/sys/i386/i386/mp_machdep.c 1.11 +4 -4 src/sys/i386/include/apicvar.h 1.81 +0 -2 src/sys/i386/include/smp.h 1.215 +19 -19 src/sys/i386/isa/clock.c