Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 May 2006 20:49:29 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 96873 for review
Message-ID:  <200605092049.k49KnTXQ085428@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/param.h>
 #include <sys/systm.h>
@@ -65,6 +67,10 @@
 #include <ddb/ddb.h>
 #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. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605092049.k49KnTXQ085428>