From owner-p4-projects@FreeBSD.ORG Sat Jan 5 21:58:25 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2096F16A421; Sat, 5 Jan 2008 21:58:25 +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 DA7C216A41B for ; Sat, 5 Jan 2008 21:58:24 +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 D56DD13C442 for ; Sat, 5 Jan 2008 21:58:24 +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 m05LwOBS035319 for ; Sat, 5 Jan 2008 21:58:24 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m05LwOIo035316 for perforce@freebsd.org; Sat, 5 Jan 2008 21:58:24 GMT (envelope-from jb@freebsd.org) Date: Sat, 5 Jan 2008 21:58:24 GMT Message-Id: <200801052158.m05LwOIo035316@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 132586 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: Sat, 05 Jan 2008 21:58:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=132586 Change 132586 by jb@jb_freebsd1 on 2008/01/05 21:57:24 Update to match the amd64 version. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/i386/dtrace_subr.c#6 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/i386/dtrace_subr.c#6 (text+ko) ==== @@ -163,52 +163,42 @@ (*func)(0, kernelbase); } -#ifdef DOODAD -static int -dtrace_xcall_func(dtrace_xcall_t func, void *arg) -{ - (*func)(arg); - - return (0); -} -#endif void dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) { -#ifdef DOODAD - cpuset_t set; + cpumask_t cpus; + + critical_enter(); + + if (cpu == DTRACE_CPUALL) + cpus = all_cpus; + else + cpus = (cpumask_t) (1 << cpu); - CPUSET_ZERO(set); + /* If the current CPU is in the set, call the function directly: */ + if ((cpus & (1 << curcpu)) != 0) { + (*func)(arg); - if (cpu == DTRACE_CPUALL) { - CPUSET_ALL(set); - } else { - CPUSET_ADD(set, cpu); + /* Mask the current CPU from the set */ + cpus &= ~(1 << curcpu); } - kpreempt_disable(); - xc_sync((xc_arg_t)func, (xc_arg_t)arg, 0, X_CALL_HIPRI, set, - (xc_func_t)dtrace_xcall_func); - kpreempt_enable(); -#else - critical_enter(); - (*func)(arg); + /* If there are any CPUs in the set, cross-call to those CPUs */ + if (cpus != 0) + smp_rendezvous_cpus(cpus, NULL, func, smp_no_rendevous_barrier, arg); + critical_exit(); -#endif } -#ifdef DOODAD void dtrace_sync_func(void) -{} -#endif +{ +} void dtrace_sync(void) { -#ifdef DOODAD dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -#endif } #ifdef DOODAD