Date: Mon, 9 Jun 2008 03:08:27 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 143156 for review Message-ID: <200806090308.m5938R35051193@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=143156 Change 143156 by jb@freebsd3 on 2008/06/09 03:08:03 Add the cyclic hooks and modify the structure type to suit releng6. Affected files ... .. //depot/projects/dtrace6/src/sys/i386/i386/local_apic.c#3 edit .. //depot/projects/dtrace6/src/sys/sys/dtrace_bsd.h#2 edit Differences ... ==== //depot/projects/dtrace6/src/sys/i386/i386/local_apic.c#3 (text+ko) ==== @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD: src/sys/i386/i386/local_apic.c,v 1.17.2.14 2007/10/05 15:22:36 jhb Exp $"); #include "opt_hwpmc_hooks.h" +#include "opt_kdtrace.h" #include "opt_ddb.h" @@ -51,6 +52,7 @@ #include <vm/pmap.h> #include <machine/apicreg.h> +#include <machine/cpu.h> #include <machine/cputypes.h> #include <machine/frame.h> #include <machine/intr_machdep.h> @@ -64,6 +66,11 @@ #include <ddb/ddb.h> #endif +#ifdef KDTRACE_HOOKS +#include <sys/dtrace_bsd.h> +cyclic_clock_func_t lapic_cyclic_clock_func[MAXCPU]; +#endif + /* Sanity checks on IDT vectors. */ CTASSERT(APIC_IO_INTS + APIC_NUM_IOINTS == APIC_TIMER_INT); CTASSERT(APIC_TIMER_INT < APIC_LOCAL_INTS); @@ -662,6 +669,17 @@ (*la->la_timer_count)++; critical_enter(); +#ifdef KDTRACE_HOOKS + /* + * If the DTrace hooks are configured and a callback function + * has been registered, then call it to process the high speed + * timers. + */ + int cpu = PCPU_GET(cpuid); + if (lapic_cyclic_clock_func[cpu] != NULL) + (*lapic_cyclic_clock_func[cpu])(&frame); +#endif + /* Fire hardclock at hz. */ la->la_hard_ticks += hz; if (la->la_hard_ticks >= lapic_timer_hz) { ==== //depot/projects/dtrace6/src/sys/sys/dtrace_bsd.h#2 (text+ko) ==== @@ -32,6 +32,7 @@ #define _SYS_DTRACE_BSD_H /* Forward definitions: */ +struct clockframe; struct trapframe; struct thread; @@ -39,7 +40,7 @@ * Cyclic clock function type definition used to hook the cyclic * subsystem into the appropriate timer interrupt. */ -typedef void (*cyclic_clock_func_t)(struct trapframe *); +typedef void (*cyclic_clock_func_t)(struct clockframe *); /* * These external variables are actually machine-dependent, so
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806090308.m5938R35051193>