From owner-p4-projects@FreeBSD.ORG Sun May 14 00:47:59 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 78FB516A404; Sun, 14 May 2006 00:47:59 +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 224E316A402 for ; Sun, 14 May 2006 00:47:59 +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 C78CC43D48 for ; Sun, 14 May 2006 00:47:58 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k4E0lrEB078831 for ; Sun, 14 May 2006 00:47:53 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k4E0lrqQ078827 for perforce@freebsd.org; Sun, 14 May 2006 00:47:53 GMT (envelope-from jb@freebsd.org) Date: Sun, 14 May 2006 00:47:53 GMT Message-Id: <200605140047.k4E0lrqQ078827@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 97114 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: Sun, 14 May 2006 00:47:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=97114 Change 97114 by jb@jb_freebsd2 on 2006/05/14 00:46:59 Use a per-cpu field to track if DTrace is running a probe from an interrupt. This is required so that DTrace can create thread-specific dynamic variables for use with 'self->'. XXX These need to be turned into atomic updates. XXX On Solaris/x86, level 15 interrupts are recursive, so they use XXX the top half of the pc_intr_actv field to count the recursion. XXX Do we need to do that? Affected files ... .. //depot/projects/dtrace/src/sys/cddl/i386/cyclic_machdep.c#3 edit .. //depot/projects/dtrace/src/sys/cddl/kern/kern_cyclic.c#3 edit .. //depot/projects/dtrace/src/sys/sys/pcpu.h#5 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/i386/cyclic_machdep.c#3 (text+ko) ==== @@ -77,7 +77,11 @@ { cpu_t *c = pcpu_find(curcpu); + c->pc_intr_actv |= (1 << CY_LOW_LEVEL); + cyclic_softint(c, CY_LOW_LEVEL); + + c->pc_intr_actv &= ~(1 << CY_LOW_LEVEL); } static void @@ -85,7 +89,11 @@ { cpu_t *c = pcpu_find(curcpu); + c->pc_intr_actv |= (1 << CY_LOCK_LEVEL); + cyclic_softint(c, CY_LOCK_LEVEL); + + c->pc_intr_actv &= ~(1 << CY_LOCK_LEVEL); } /* @@ -180,12 +188,18 @@ static cyc_cookie_t set_level(cyb_arg_t arg, cyc_level_t level) { +#ifdef DOODAD return (intr_disable()); +#else + return (0); +#endif } static void restore_level(cyb_arg_t arg, cyc_cookie_t cookie) { +#ifdef DOODAD intr_restore(cookie); +#endif } static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param) ==== //depot/projects/dtrace/src/sys/cddl/kern/kern_cyclic.c#3 (text+ko) ==== @@ -66,8 +66,12 @@ /* Cyclic timers are hooked into the per-cpu structure. */ struct pcpu *pc = pcpu_find(curcpu); + pc->pc_intr_actv |= (1 << CY_HIGH_LEVEL); + /* Fire any timers that are due. */ cyclic_fire(pc); + + pc->pc_intr_actv &= ~(1 << CY_HIGH_LEVEL); } /* ARGSUSED */ ==== //depot/projects/dtrace/src/sys/sys/pcpu.h#5 (text+ko) ==== @@ -77,6 +77,7 @@ struct device *pc_device; int pc_ncyclic; /* Number of cyclic timers enabled. */ struct cyc_cpu *pc_cyclic; /* Cyclic subsystem data */ + u_int pc_intr_actv; /* Used by DTrace. */ }; SLIST_HEAD(cpuhead, pcpu);