From owner-p4-projects@FreeBSD.ORG Tue May 9 20:49:30 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E05A116A548; Tue, 9 May 2006 20:49:29 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A1D6A16A4FB for ; Tue, 9 May 2006 20:49:29 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A95343D45 for ; Tue, 9 May 2006 20:49:29 +0000 (GMT) (envelope-from jb@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 k49KnTw1085434 for ; Tue, 9 May 2006 20:49:29 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k49KnTXQ085428 for perforce@freebsd.org; Tue, 9 May 2006 20:49:29 GMT (envelope-from jb@freebsd.org) Date: Tue, 9 May 2006 20:49:29 GMT Message-Id: <200605092049.k49KnTXQ085428@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 96873 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 May 2006 20:49:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=96873 Change 96873 by jb@jb_freebsd2 on 2006/05/09 20:48:32 Add the hook for the cyclic timers for use when there isn't a higher performance time based interrupt source like the HPET. This hook allows the cyclic timers to function, but they can be fired no faster than 'hz' per second. If the CPU has a HPET, then the machine-dependent cyclic initialisation code should use that instead and leave the hook here NULL. The HPET was specified by Intel as recently as 2004, so as of today, most i386 systems in the wild won't have it. Affected files ... .. //depot/projects/dtrace/src/sys/i386/i386/local_apic.c#2 edit Differences ... ==== //depot/projects/dtrace/src/sys/i386/i386/local_apic.c#2 (text+ko) ==== @@ -36,7 +36,9 @@ #include "opt_hwpmc_hooks.h" +#include "opt_cyclic.h" #include "opt_ddb.h" +#include "opt_kdtrace.h" #include #include @@ -65,6 +67,10 @@ #include #endif +#if defined(CYCLIC) || defined(KDTRACE) +cyclic_clock_func_t lapic_cyclic_clock_func; +#endif + /* * We can handle up to 60 APICs via our logical cluster IDs, but currently * the physical IDs on Intel processors up to the Pentium 4 are limited to @@ -628,6 +634,19 @@ hardclock(TRAPF_USERMODE(&frame), TRAPF_PC(&frame)); else hardclock_cpu(TRAPF_USERMODE(&frame)); + + /* + * If the cyclic subsystem is configured and a callback + * function has been registered, then call it to process + * the high speed timers. If this function is registered + * here, then there mustn't be a High Performance Event + * Timer (HPET) on the CPU. A HPET provides higher + * performance timer interrupts. + */ +#if defined(CYCLIC) || defined(KDTRACE) + if (lapic_cyclic_clock_func != NULL) + (*lapic_cyclic_clock_func)(); +#endif } /* Fire statclock at stathz. */