From owner-p4-projects@FreeBSD.ORG Mon Jun 9 03:08:29 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4267C106566C; Mon, 9 Jun 2008 03:08:29 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 032CD106564A for ; Mon, 9 Jun 2008 03:08:29 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id EE9028FC17 for ; Mon, 9 Jun 2008 03:08:27 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m5938Ri8051195 for ; Mon, 9 Jun 2008 03:08:27 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5938R35051193 for perforce@freebsd.org; Mon, 9 Jun 2008 03:08:27 GMT (envelope-from jb@freebsd.org) Date: Mon, 9 Jun 2008 03:08:27 GMT Message-Id: <200806090308.m5938R35051193@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 143156 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: Mon, 09 Jun 2008 03:08:29 -0000 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 #include +#include #include #include #include @@ -64,6 +66,11 @@ #include #endif +#ifdef KDTRACE_HOOKS +#include +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