Date: Sun, 14 May 2006 00:47:53 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 97114 for review Message-ID: <200605140047.k4E0lrqQ078827@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605140047.k4E0lrqQ078827>