From owner-p4-projects@FreeBSD.ORG Sun Dec 23 04:36:22 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5119E16A469; Sun, 23 Dec 2007 04:36:22 +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 0FD4D16A421 for ; Sun, 23 Dec 2007 04:36:22 +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 1163E13C45B for ; Sun, 23 Dec 2007 04:36:22 +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 lBN4aLOJ090193 for ; Sun, 23 Dec 2007 04:36:21 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBN4aLSx090190 for perforce@freebsd.org; Sun, 23 Dec 2007 04:36:21 GMT (envelope-from jb@freebsd.org) Date: Sun, 23 Dec 2007 04:36:21 GMT Message-Id: <200712230436.lBN4aLSx090190@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 131456 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, 23 Dec 2007 04:36:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=131456 Change 131456 by jb@jb_freebsd1 on 2007/12/23 04:36:02 Initialise the CPU mutex and ensure it gets locked around calls that have asserts which check that it is locked. Leave the cyclic_fire() call disabled for now. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/kern/kern_cyclic.c#6 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/kern/kern_cyclic.c#6 (text+ko) ==== @@ -32,8 +32,24 @@ 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 < MAXCPU; i++) + cyclic_cpu[i].cpu_flags &= CPU_ENABLE; + /* Initialise the machine-dependent backend. */ cyclic_machdep_init(); + + mutex_exit(&cpu_lock); } SYSINIT(cyclic_register, SI_SUB_CYCLIC, SI_ORDER_SECOND, cyclic_load, NULL) @@ -41,8 +57,14 @@ static void cyclic_unload(void) { + mutex_enter(&cpu_lock); + /* Uninitialise the machine-dependent backend. */ cyclic_machdep_uninit(); + + mutex_exit(&cpu_lock); + + mutex_destroy(&cpu_lock); } SYSUNINIT(cyclic_unregister, SI_SUB_CYCLIC, SI_ORDER_SECOND, cyclic_unload, NULL); @@ -58,8 +80,10 @@ c->cpu_intr_actv |= (1 << CY_HIGH_LEVEL); +#ifdef DOODAD /* Fire any timers that are due. */ cyclic_fire(c); +#endif c->cpu_intr_actv &= ~(1 << CY_HIGH_LEVEL); }