From owner-p4-projects@FreeBSD.ORG Sun Dec 30 02:18:00 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 796BF16A468; Sun, 30 Dec 2007 02:18:00 +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 3F04216A420 for ; Sun, 30 Dec 2007 02:18:00 +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 2E15913C46A for ; Sun, 30 Dec 2007 02:18:00 +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 lBU2Hx5Q064641 for ; Sun, 30 Dec 2007 02:17:59 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBU2HxEd064629 for perforce@freebsd.org; Sun, 30 Dec 2007 02:17:59 GMT (envelope-from jb@freebsd.org) Date: Sun, 30 Dec 2007 02:17:59 GMT Message-Id: <200712300217.lBU2HxEd064629@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 132005 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, 30 Dec 2007 02:18:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=132005 Change 132005 by jb@jb_freebsd1 on 2007/12/30 02:17:04 Use cpu_lock and solaris_cpu from the opensolaris module from now on. This stuff is shared with at least the dtrace module. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/amd64/cyclic_machdep.c#5 edit .. //depot/projects/dtrace/src/sys/cddl/kern/kern_cyclic.c#9 edit .. //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/os/cyclic.c#12 edit .. //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/sys/cyclic.h#8 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/amd64/cyclic_machdep.c#5 (text+ko) ==== @@ -63,7 +63,7 @@ static void cyclic_swi_low(void *dummy) { - cpu_t *c = &cyclic_cpu[curcpu]; + cpu_t *c = &solaris_cpu[curcpu]; c->cpu_intr_actv |= (1 << CY_LOW_LEVEL); @@ -75,7 +75,7 @@ static void cyclic_swi_lock(void *dummy) { - cpu_t *c = &cyclic_cpu[curcpu]; + cpu_t *c = &solaris_cpu[curcpu]; c->cpu_intr_actv |= (1 << CY_LOCK_LEVEL); @@ -195,7 +195,7 @@ * If the target CPU is the current one, just call the * function. This covers the non-SMP case. */ - if (c == &cyclic_cpu[curcpu]) + if (c == &solaris_cpu[curcpu]) (*func)(param); else printf("%s:%s(%d): Need to have a way to execute the function on another CPU\n",__FUNCTION__,__FILE__,__LINE__); ==== //depot/projects/dtrace/src/sys/cddl/kern/kern_cyclic.c#9 (text+ko) ==== @@ -32,22 +32,8 @@ static void cyclic_load(void *dummy) { - int i; - - mutex_init(&cpu_lock, "Cyclic CPU lock", MUTEX_DEFAULT, NULL); - mutex_enter(&cpu_lock); - /* - * "Enable" all CPUs even though they may not exist just so - * that the asserts work. On FreeBSD, if a CPU exists, it is - * enabled. - */ - for (i = 0; i < SMP_MAXCPU; i++) { - cyclic_cpu[i].cpuid = i; - cyclic_cpu[i].cpu_flags &= CPU_ENABLE; - } - /* Initialise the machine-dependent backend. */ cyclic_machdep_init(); @@ -65,8 +51,6 @@ cyclic_machdep_uninit(); mutex_exit(&cpu_lock); - - mutex_destroy(&cpu_lock); } SYSUNINIT(cyclic_unregister, SI_SUB_CYCLIC, SI_ORDER_SECOND, cyclic_unload, NULL); @@ -78,7 +62,7 @@ static void cyclic_clock(void) { - cpu_t *c = &cyclic_cpu[curcpu]; + cpu_t *c = &solaris_cpu[curcpu]; if (c->cpu_cyclic != NULL) { c->cpu_intr_actv |= (1 << CY_HIGH_LEVEL); @@ -116,3 +100,4 @@ DEV_MODULE(cyclic, cyclic_modevent, NULL); MODULE_VERSION(cyclic, 1); +MODULE_DEPEND(cyclic, opensolaris, 1, 1, 1); ==== //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/os/cyclic.c#12 (text) ==== @@ -568,8 +568,6 @@ #include #include #define gethrtime_unscaled dtrace_gethrtime -static cyclic_cpu_t cyclic_cpu[SMP_MAXCPU]; -kmutex_t cpu_lock; #endif #ifdef CYCLIC_TRACE @@ -1567,7 +1565,7 @@ * FreeBSD doesn't have cpu partitions, so just use the current * CPU for now. */ - cyclic_cpu_t *c = &cyclic_cpu[curcpu]; + solaris_cpu_t *c = &solaris_cpu[curcpu]; #endif return (c->cpu_cyclic); @@ -2649,7 +2647,7 @@ if (pcpu_find(i) == NULL) continue; - c = &cyclic_cpu[i]; + c = &solaris_cpu[i]; #endif if ((cpu = c->cpu_cyclic) == NULL) @@ -2897,8 +2895,8 @@ cyclic_configure(CPU); cyclic_online(CPU); #else - cyclic_configure(&cyclic_cpu[curcpu]); - cyclic_online(&cyclic_cpu[curcpu]); + cyclic_configure(&solaris_cpu[curcpu]); + cyclic_online(&solaris_cpu[curcpu]); #endif } @@ -2930,7 +2928,7 @@ if (pcpu_find(i) == NULL) continue; - c = &cyclic_cpu[i]; + c = &solaris_cpu[i]; #endif if (c->cpu_cyclic == NULL) { cyclic_configure(c); @@ -2958,7 +2956,7 @@ if ((pc = pcpu_find(id)) == NULL) continue; - c = &cyclic_cpu[id]; + c = &solaris_cpu[id]; if (c->cpu_cyclic == NULL) continue; @@ -3386,7 +3384,7 @@ if (pcpu_find(i) == NULL) continue; - c = &cyclic_cpu[i]; + c = &solaris_cpu[i]; #endif cpu = c->cpu_cyclic; be = cpu->cyp_backend; @@ -3454,7 +3452,7 @@ if (pcpu_find(i) == NULL) continue; - c = &cyclic_cpu[i]; + c = &solaris_cpu[i]; #endif cpu = c->cpu_cyclic; ==== //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/sys/cyclic.h#8 (text) ==== @@ -39,16 +39,7 @@ #if defined(sun) #include #else -struct cyc_cpu; #define cpupart_t void -#undef cpu_t -#define cpu_t cyclic_cpu_t -typedef struct { - int cpuid; - struct cyc_cpu *cpu_cyclic; - uint32_t cpu_flags; - uint_t cpu_intr_actv; -} cyclic_cpu_t; #endif #endif /* !_ASM */