From owner-p4-projects@FreeBSD.ORG Fri Apr 18 10:30:22 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EB55B37B404; Fri, 18 Apr 2003 10:30:21 -0700 (PDT) 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 7F52437B405 for ; Fri, 18 Apr 2003 10:30:21 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DF8D43FE9 for ; Fri, 18 Apr 2003 10:30:20 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3IHUK0U011499 for ; Fri, 18 Apr 2003 10:30:20 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3IHUJlN011490 for perforce@freebsd.org; Fri, 18 Apr 2003 10:30:19 -0700 (PDT) Date: Fri, 18 Apr 2003 10:30:19 -0700 (PDT) Message-Id: <200304181730.h3IHUJlN011490@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 29196 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2003 17:30:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=29196 Change 29196 by jhb@jhb_laptop on 2003/04/18 10:29:19 IFC @29195. Look back round one of proc locking commits. Affected files ... .. //depot/projects/smpng/sys/alpha/alpha/vm_machdep.c#21 integrate .. //depot/projects/smpng/sys/alpha/include/_limits.h#1 branch .. //depot/projects/smpng/sys/alpha/include/proc.h#7 integrate .. //depot/projects/smpng/sys/arm/include/_limits.h#1 branch .. //depot/projects/smpng/sys/compat/linprocfs/linprocfs.c#26 integrate .. //depot/projects/smpng/sys/compat/linux/linux_misc.c#37 integrate .. //depot/projects/smpng/sys/compat/linux/linux_signal.c#10 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_misc.c#23 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_signal.c#9 integrate .. //depot/projects/smpng/sys/dev/pccard/pccarddevs#23 integrate .. //depot/projects/smpng/sys/dev/pccard/pccarddevs.h#23 integrate .. //depot/projects/smpng/sys/dev/sound/pci/emu10k1.c#10 integrate .. //depot/projects/smpng/sys/dev/wl/if_wl.c#13 integrate .. //depot/projects/smpng/sys/fs/procfs/procfs.c#8 integrate .. //depot/projects/smpng/sys/fs/procfs/procfs_ctl.c#17 integrate .. //depot/projects/smpng/sys/fs/procfs/procfs_ioctl.c#10 integrate .. //depot/projects/smpng/sys/fs/procfs/procfs_status.c#15 integrate .. //depot/projects/smpng/sys/gnu/dev/sound/pci/emu10k1.h#2 integrate .. //depot/projects/smpng/sys/gnu/i386/fpemul/fpu_entry.c#4 integrate .. //depot/projects/smpng/sys/i386/i386/genassym.c#22 integrate .. //depot/projects/smpng/sys/i386/include/_limits.h#1 branch .. //depot/projects/smpng/sys/i386/linux/linux_sysvec.c#30 integrate .. //depot/projects/smpng/sys/i386/svr4/svr4_machdep.c#11 integrate .. //depot/projects/smpng/sys/ia64/include/_limits.h#1 branch .. //depot/projects/smpng/sys/kern/kern_acct.c#26 integrate .. //depot/projects/smpng/sys/kern/kern_condvar.c#27 integrate .. //depot/projects/smpng/sys/kern/kern_context.c#3 integrate .. //depot/projects/smpng/sys/kern/kern_exit.c#61 integrate .. //depot/projects/smpng/sys/kern/kern_fork.c#56 integrate .. //depot/projects/smpng/sys/kern/kern_idle.c#13 integrate .. //depot/projects/smpng/sys/kern/kern_intr.c#28 integrate .. //depot/projects/smpng/sys/kern/kern_jail.c#26 integrate .. //depot/projects/smpng/sys/kern/kern_kthread.c#10 integrate .. //depot/projects/smpng/sys/kern/kern_mutex.c#68 integrate .. //depot/projects/smpng/sys/kern/kern_shutdown.c#35 integrate .. //depot/projects/smpng/sys/kern/kern_sig.c#58 integrate .. //depot/projects/smpng/sys/kern/kern_thr.c#5 integrate .. //depot/projects/smpng/sys/kern/kern_thread.c#25 integrate .. //depot/projects/smpng/sys/kern/sched_ule.c#6 integrate .. //depot/projects/smpng/sys/kern/subr_prf.c#28 integrate .. //depot/projects/smpng/sys/kern/subr_trap.c#50 integrate .. //depot/projects/smpng/sys/kern/sys_process.c#26 integrate .. //depot/projects/smpng/sys/kern/tty.c#33 integrate .. //depot/projects/smpng/sys/kern/vfs_aio.c#38 integrate .. //depot/projects/smpng/sys/kern/vfs_subr.c#48 integrate .. //depot/projects/smpng/sys/netgraph/ng_message.h#3 integrate .. //depot/projects/smpng/sys/pci/if_dc.c#33 integrate .. //depot/projects/smpng/sys/pci/if_dcreg.h#12 integrate .. //depot/projects/smpng/sys/pci/if_pcn.c#15 integrate .. //depot/projects/smpng/sys/pci/if_rl.c#27 integrate .. //depot/projects/smpng/sys/pci/if_sf.c#17 integrate .. //depot/projects/smpng/sys/pci/if_sis.c#23 integrate .. //depot/projects/smpng/sys/pci/if_sk.c#16 integrate .. //depot/projects/smpng/sys/pci/if_ste.c#19 integrate .. //depot/projects/smpng/sys/pci/if_ti.c#25 integrate .. //depot/projects/smpng/sys/pci/if_tl.c#14 integrate .. //depot/projects/smpng/sys/pci/if_vr.c#16 integrate .. //depot/projects/smpng/sys/pci/if_wb.c#15 integrate .. //depot/projects/smpng/sys/pci/if_xl.c#26 integrate .. //depot/projects/smpng/sys/powerpc/include/_limits.h#1 branch .. //depot/projects/smpng/sys/powerpc/include/bus.h#9 integrate .. //depot/projects/smpng/sys/powerpc/powermac/ata_macio.c#4 integrate .. //depot/projects/smpng/sys/powerpc/powermac/macio.c#5 integrate .. //depot/projects/smpng/sys/powerpc/powermac/uninorth.c#3 integrate .. //depot/projects/smpng/sys/powerpc/psim/ata_iobus.c#3 integrate .. //depot/projects/smpng/sys/powerpc/psim/iobus.c#3 integrate .. //depot/projects/smpng/sys/sparc64/include/_limits.h#1 branch .. //depot/projects/smpng/sys/sys/proc.h#78 integrate .. //depot/projects/smpng/sys/vm/uma_core.c#28 integrate .. //depot/projects/smpng/sys/vm/vm_glue.c#22 integrate .. //depot/projects/smpng/sys/vm/vm_mmap.c#27 integrate .. //depot/projects/smpng/sys/vm/vnode_pager.c#28 integrate .. //depot/projects/smpng/sys/x86_64/include/_limits.h#1 branch Differences ... ==== //depot/projects/smpng/sys/alpha/alpha/vm_machdep.c#21 (text+ko) ==== @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $FreeBSD: src/sys/alpha/alpha/vm_machdep.c,v 1.83 2003/02/20 20:54:42 phk Exp $ + * $FreeBSD: src/sys/alpha/alpha/vm_machdep.c,v 1.84 2003/04/17 21:57:16 jhb Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -119,7 +119,9 @@ td2->td_pcb = (struct pcb *) (td2->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; td2->td_md.md_flags = td1->td_md.md_flags & MDTD_FPUSED; + PROC_LOCK(p2); p2->p_md.md_uac = p1->p_md.md_uac; + PROC_UNLOCK(p2); /* * Cache the physical address of the pcb, so we can ==== //depot/projects/smpng/sys/alpha/include/proc.h#7 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/alpha/include/proc.h,v 1.15 2002/07/31 19:37:02 jhb Exp $ */ +/* $FreeBSD: src/sys/alpha/include/proc.h,v 1.16 2003/04/17 21:57:16 jhb Exp $ */ /* From: NetBSD: proc.h,v 1.3 1997/04/06 08:47:36 cgd Exp */ /* @@ -62,7 +62,7 @@ #define MDP_UAC_MASK (MDP_UAC_NOPRINT | MDP_UAC_NOFIX | MDP_UAC_SIGBUS) struct mdproc { - u_int md_uac; /* Unaligned Access Check flags. */ + u_int md_uac; /* (c) Unaligned Access Check flags. */ }; #endif /* !_MACHINE_PROC_H_ */ ==== //depot/projects/smpng/sys/compat/linprocfs/linprocfs.c#26 (text+ko) ==== @@ -38,7 +38,7 @@ * * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 * - * $FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.63 2003/04/16 19:46:26 jhb Exp $ + * $FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.64 2003/04/17 21:58:45 jhb Exp $ */ #include @@ -549,12 +549,13 @@ struct thread *td2; int i; - mtx_lock_spin(&sched_lock); + PROC_LOCK(p); td2 = FIRST_THREAD_IN_PROC(p); /* XXXKSE pretend only one thread */ if (P_SHOULDSTOP(p)) { state = "T (stopped)"; } else { + mtx_lock_spin(&sched_lock); switch(p->p_state) { case PRS_NEW: state = "I (idle)"; @@ -584,10 +585,9 @@ state = "? (unknown)"; break; } + mtx_unlock_spin(&sched_lock); } - mtx_unlock_spin(&sched_lock); - PROC_LOCK(p); fill_kinfo_proc(p, &kp); sbuf_printf(sb, "Name:\t%s\n", p->p_comm); /* XXX escape */ sbuf_printf(sb, "State:\t%s\n", state); ==== //depot/projects/smpng/sys/compat/linux/linux_misc.c#37 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.141 2003/04/16 20:43:10 jhb Exp $ + * $FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.142 2003/04/17 22:02:46 jhb Exp $ */ #include "opt_mac.h" @@ -164,6 +164,7 @@ { struct itimerval it, old_it; struct timeval tv; + struct proc *p; #ifdef DEBUG if (ldebug(alarm)) @@ -177,18 +178,19 @@ it.it_value.tv_usec = 0; it.it_interval.tv_sec = 0; it.it_interval.tv_usec = 0; - PROC_LOCK(td->td_proc); - old_it = td->td_proc->p_realtimer; + p = td->td_proc; + PROC_LOCK(p); + old_it = p->p_realtimer; getmicrouptime(&tv); if (timevalisset(&old_it.it_value)) - callout_stop(&td->td_proc->p_itcallout); + callout_stop(&p->p_itcallout); if (it.it_value.tv_sec != 0) { - callout_reset(&td->td_proc->p_itcallout, tvtohz(&it.it_value), - realitexpire, td->td_proc); + callout_reset(&p->p_itcallout, tvtohz(&it.it_value), + realitexpire, p); timevaladd(&it.it_value, &tv); } - td->td_proc->p_realtimer = it; - PROC_UNLOCK(td->td_proc); + p->p_realtimer = it; + PROC_UNLOCK(p); if (timevalcmp(&old_it.it_value, &tv, >)) { timevalsub(&old_it.it_value, &tv); if (old_it.it_value.tv_usec != 0) @@ -809,6 +811,7 @@ struct rusage *rusage; } */ tmp; int error, tmpstat; + struct proc *p; #ifdef DEBUG if (ldebug(wait4)) @@ -828,9 +831,10 @@ if ((error = wait4(td, &tmp)) != 0) return error; - PROC_LOCK(td->td_proc); - SIGDELSET(td->td_proc->p_siglist, SIGCHLD); - PROC_UNLOCK(td->td_proc); + p = td->td_proc; + PROC_LOCK(p); + SIGDELSET(p->p_siglist, SIGCHLD); + PROC_UNLOCK(p); if (args->status) { if ((error = copyin(args->status, &tmpstat, sizeof(int))) != 0) ==== //depot/projects/smpng/sys/compat/linux/linux_signal.c#10 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/linux/linux_signal.c,v 1.40 2003/03/31 22:49:14 jeff Exp $ + * $FreeBSD: src/sys/compat/linux/linux_signal.c,v 1.41 2003/04/17 22:07:56 jhb Exp $ */ #include @@ -396,8 +396,8 @@ bset = p->p_siglist; SIGSETOR(bset, td->td_siglist); SIGSETAND(bset, td->td_sigmask); + PROC_UNLOCK(p); bsd_to_linux_sigset(&bset, &lset); - PROC_UNLOCK(p); mask = lset.__bits[0]; return (copyout(&mask, args->mask, sizeof(mask))); } ==== //depot/projects/smpng/sys/compat/svr4/svr4_misc.c#23 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/svr4/svr4_misc.c,v 1.61 2003/03/02 16:54:32 des Exp $ + * $FreeBSD: src/sys/compat/svr4/svr4_misc.c,v 1.62 2003/04/17 22:09:08 jhb Exp $ */ /* @@ -1272,10 +1272,8 @@ continue; } nfound++; - mtx_lock_spin(&sched_lock); if ((q->p_state == PRS_ZOMBIE) && ((uap->options & (SVR4_WEXITED|SVR4_WTRAPPED)))) { - mtx_unlock_spin(&sched_lock); PROC_UNLOCK(q); sx_sunlock(&proctree_lock); *retval = 0; @@ -1396,7 +1394,6 @@ if (P_SHOULDSTOP(q) && ((q->p_flag & P_WAITED) == 0) && (q->p_flag & P_TRACED || (uap->options & (SVR4_WSTOPPED|SVR4_WCONTINUED)))) { - mtx_unlock_spin(&sched_lock); DPRINTF(("jobcontrol %d\n", q->p_pid)); if (((uap->options & SVR4_WNOWAIT)) == 0) q->p_flag |= P_WAITED; @@ -1405,7 +1402,6 @@ return svr4_setinfo(q, W_STOPCODE(q->p_xstat), uap->info); } - mtx_unlock_spin(&sched_lock); PROC_UNLOCK(q); } ==== //depot/projects/smpng/sys/compat/svr4/svr4_signal.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/svr4/svr4_signal.c,v 1.25 2003/03/31 22:49:14 jeff Exp $ + * $FreeBSD: src/sys/compat/svr4/svr4_signal.c,v 1.26 2003/04/17 22:02:46 jhb Exp $ */ #include @@ -554,21 +554,21 @@ struct thread *td; struct svr4_sys_sigpending_args *uap; { + struct proc *p; sigset_t bss; - int *retval; svr4_sigset_t sss; - DPRINTF(("@@@ svr4_sys_sigpending(%d)\n", td->td_proc->p_pid)); - retval = td->td_retval; + p = td->td_proc; + DPRINTF(("@@@ svr4_sys_sigpending(%d)\n", p->p_pid)); switch (uap->what) { case 1: /* sigpending */ if (uap->mask == NULL) return 0; - PROC_LOCK(td->td_proc); - bss = td->td_proc->p_siglist; + PROC_LOCK(p); + bss = p->p_siglist; SIGSETOR(bss, td->td_siglist); SIGSETAND(bss, td->td_sigmask); - PROC_UNLOCK(td->td_proc); + PROC_UNLOCK(p); bsd_to_svr4_sigset(&bss, &sss); break; ==== //depot/projects/smpng/sys/dev/pccard/pccarddevs#23 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.47 2003/04/10 07:21:11 imp Exp $ +$FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.48 2003/04/18 14:52:14 sanpei Exp $ /* $NetBSD: pcmciadevs,v 1.182 2003/04/09 02:09:55 christos Exp $ */ /* $OpenBSD: pcmciadevs,v 1.93 2002/06/21 08:31:10 henning Exp $ */ @@ -109,7 +109,7 @@ vendor CONTEC 0xc001 Contec vendor MACNICA 0xc00b MACNICA vendor ROLAND 0xc00c Roland -vendor COREGA 0xc00f Corega K.K. +vendor COREGA2 0xc00f Corega K.K. vendor ALLIEDTELESIS 0xc00f Allied Telesis K.K. vendor HAGIWARASYSCOM 0xc012 Hagiwara SYS-COM vendor RATOC 0xc015 RATOC System Inc. @@ -424,6 +424,7 @@ vendor AMD -1 AMD vendor BILLIONTON -1 Billionton Systems Inc. vendor CNET -1 CNet +vendor COREGA -1 Corega K.K. vendor DIGITAL -1 Digital Equipment Corporation vendor DLINK -1 D-Link vendor DYNALINK -1 DynaLink ==== //depot/projects/smpng/sys/dev/pccard/pccarddevs.h#23 (text+ko) ==== @@ -1,10 +1,10 @@ -/* $FreeBSD: src/sys/dev/pccard/pccarddevs.h,v 1.47 2003/04/10 07:21:11 imp Exp $ */ +/* $FreeBSD: src/sys/dev/pccard/pccarddevs.h,v 1.48 2003/04/18 15:35:52 sanpei Exp $ */ /* * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.46 2003/04/10 06:58:40 imp Exp + * FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.48 2003/04/18 14:52:14 sanpei Exp */ /* $NetBSD: pcmciadevs,v 1.182 2003/04/09 02:09:55 christos Exp $ */ /* $OpenBSD: pcmciadevs,v 1.93 2002/06/21 08:31:10 henning Exp $ */ @@ -116,7 +116,7 @@ #define PCMCIA_VENDOR_CONTEC 0xc001 /* Contec */ #define PCMCIA_VENDOR_MACNICA 0xc00b /* MACNICA */ #define PCMCIA_VENDOR_ROLAND 0xc00c /* Roland */ -#define PCMCIA_VENDOR_COREGA 0xc00f /* Corega K.K. */ +#define PCMCIA_VENDOR_COREGA2 0xc00f /* Corega K.K. */ #define PCMCIA_VENDOR_ALLIEDTELESIS 0xc00f /* Allied Telesis K.K. */ #define PCMCIA_VENDOR_HAGIWARASYSCOM 0xc012 /* Hagiwara SYS-COM */ #define PCMCIA_VENDOR_RATOC 0xc015 /* RATOC System Inc. */ @@ -751,6 +751,7 @@ #define PCMCIA_VENDOR_AMD 0xffffffff /* AMD */ #define PCMCIA_VENDOR_BILLIONTON 0xffffffff /* Billionton Systems Inc. */ #define PCMCIA_VENDOR_CNET 0xffffffff /* CNet */ +#define PCMCIA_VENDOR_COREGA 0xffffffff /* Corega K.K. */ #define PCMCIA_VENDOR_DIGITAL 0xffffffff /* Digital Equipment Corporation */ #define PCMCIA_VENDOR_DLINK 0xffffffff /* D-Link */ #define PCMCIA_VENDOR_DYNALINK 0xffffffff /* DynaLink */ @@ -1013,13 +1014,6 @@ #define PCMCIA_CIS_SVEC_LANCARD { "SVEC", "FD605 PCMCIA EtherNet Card", "V1-1", NULL } #define PCMCIA_PRODUCT_SVEC_LANCARD 0xffffffff #define PCMCIA_STR_SVEC_LANCARD "SVEC PCMCIA Lan Card" -/* - * vendor ID of PN650TX is LINKSYS (0x0149) and product ID is 0xc1ab, but - * it conflicts with LINKSYS Combo EthernetCard. - */ -#define PCMCIA_CIS_SVEC_PN650TX { NULL, NULL, NULL, NULL } -#define PCMCIA_PRODUCT_SVEC_PN650TX -1 -#define PCMCIA_STR_SVEC_PN650TX "SVEC PN650TX 10/100 Dual Speed Fast Ethernet PC Card" #define PCMCIA_CIS_SYNERGY21_S21810 { "PCMCIA", "Ethernet", "A", "004743118001" } #define PCMCIA_PRODUCT_SYNERGY21_S21810 0xffffffff #define PCMCIA_STR_SYNERGY21_S21810 "Synergy 21 S21810+ NE2000 Compatible Card" ==== //depot/projects/smpng/sys/dev/sound/pci/emu10k1.c#10 (text+ko) ==== @@ -32,7 +32,7 @@ #include #include -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/emu10k1.c,v 1.33 2003/02/26 16:11:18 cognet Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/emu10k1.c,v 1.34 2003/04/18 04:13:38 obrien Exp $"); /* -------------------------------------------------------------------- */ @@ -1243,7 +1243,7 @@ u_int32_t spcs, ch, tmp, i; /* disable audio and lock cache */ - emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE | HCFG_MUTEBUTTONENABLE, 4); + emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, 4); /* reset recording buffers */ emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE); @@ -1365,7 +1365,7 @@ * Lock Sound Memory = 0 * Auto Mute = 1 */ - tmp = HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE | HCFG_AUTOMUTE; + tmp = HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE; if (sc->rev >= 6) tmp |= HCFG_JOYENABLE; emu_wr(sc, HCFG, tmp, 4); @@ -1401,7 +1401,7 @@ } /* disable audio and lock cache */ - emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE | HCFG_MUTEBUTTONENABLE, 4); + emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, 4); emu_wrptr(sc, 0, PTB, 0); /* reset recording buffers */ ==== //depot/projects/smpng/sys/dev/wl/if_wl.c#13 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/wl/if_wl.c,v 1.50 2003/04/16 17:42:38 jhay Exp $ */ +/* $FreeBSD: src/sys/dev/wl/if_wl.c,v 1.53 2003/04/17 17:51:24 jhay Exp $ */ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -389,7 +389,7 @@ short base; char *str = "wl%d: board out of range [0..%d]\n"; u_char inbuf[100]; - unsigned long junk, sirq; + unsigned long junk, oldpri, sirq; int error, irq; error = ISA_PNP_PROBE(device_get_parent(device), device, wl_ids); @@ -408,10 +408,12 @@ */ #define PCMD(base, hacr) outw((base), (hacr)) + oldpri = splimp(); PCMD(base, HACR_RESET); /* reset the board */ DELAY(DELAYCONST); /* >> 4 clocks at 6MHz */ PCMD(base, HACR_RESET); /* reset the board */ DELAY(DELAYCONST); /* >> 4 clocks at 6MHz */ + splx(oldpri); /* clear reset command and set PIO#1 in autoincrement mode */ PCMD(base, HACR_DEFAULT); @@ -798,6 +800,7 @@ struct wl_softc *sc = xsc; struct ifnet *ifp = &sc->wl_if; int stat; + u_long oldpri; #ifdef WLDEBUG if (sc->wl_if.if_flags & IFF_DEBUG) @@ -805,6 +808,8 @@ #endif if (TAILQ_FIRST(&ifp->if_addrhead) == (struct ifaddr *)0) return; + WL_LOCK(sc); + oldpri = splimp(); if ((stat = wlhwrst(sc)) == TRUE) { sc->wl_if.if_flags |= IFF_RUNNING; /* same as DSF_RUNNING */ /* @@ -821,6 +826,8 @@ } else { printf("wl%d init(): trouble resetting board.\n", sc->unit); } + splx(oldpri); + WL_UNLOCK(sc); } /* @@ -1112,7 +1119,14 @@ */ mlen = 0; mb_p = mtod(m, u_char *); - bytes_in_mbuf = MCLBYTES; + bytes_in_mbuf = m->m_len; + + /* Put the ethernet header inside the mbuf. */ + bcopy(&fd.destination[0], mb_p, 14); + mb_p += 14; + mlen += 14; + bytes_in_mbuf -= 14; + bytes = min(bytes_in_mbuf, bytes_in_msg); for (;;) { if (bytes & 1) { @@ -1137,6 +1151,7 @@ return 0; } mb_p += bytes; + bytes_in_mbuf -= bytes; bytes_in_msg -= bytes; if (bytes_in_msg == 0) { if (rbd.status & RBD_SW_EOF || rbd.next_rbd_offset == I82586NULL) { @@ -1222,7 +1237,7 @@ struct wl_softc *sc = ifp->if_softc; short base = sc->base; short mode = 0; - int error = 0; + int opri, error = 0; struct thread *td = curthread; /* XXX */ int irq, irqval, i, isroot; caddr_t up; @@ -1236,6 +1251,7 @@ if (sc->wl_if.if_flags & IFF_DEBUG) printf("wl%d: entered wlioctl()\n",unit); #endif + opri = splimp(); switch (cmd) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_ALLMULTI) { @@ -1444,6 +1460,7 @@ error = ether_ioctl(ifp, cmd, data); break; } + splx(opri); WL_UNLOCK(sc); return (error); } @@ -2393,7 +2410,7 @@ wlsetpsa(struct wl_softc *sc) { short base = sc->base; - int i; + int i, oldpri; u_short crc; crc = wlpsacrc(sc->psa); /* calculate CRC of PSA */ @@ -2401,6 +2418,8 @@ sc->psa[WLPSA_CRCHIGH] = (crc >> 8) & 0xff; sc->psa[WLPSA_CRCOK] = 0x55; /* default to 'bad' until programming complete */ + oldpri = splimp(); /* ick, long pause */ + PCMD(base, HACR_DEFAULT & ~HACR_16BITS); PCMD(base, HACR_DEFAULT & ~HACR_16BITS); @@ -2419,6 +2438,8 @@ PCMD(base, HACR_DEFAULT); PCMD(base, HACR_DEFAULT); + + splx(oldpri); } /* ==== //depot/projects/smpng/sys/fs/procfs/procfs.c#8 (text+ko) ==== @@ -37,7 +37,7 @@ * * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95 * - * $FreeBSD: src/sys/fs/procfs/procfs.c,v 1.8 2002/10/26 14:38:19 rwatson Exp $ + * $FreeBSD: src/sys/fs/procfs/procfs.c,v 1.9 2003/04/17 22:12:12 jhb Exp $ */ #include @@ -93,6 +93,9 @@ int procfs_attr(PFS_ATTR_ARGS) { + + PROC_LOCK_ASSERT(p, MA_OWNED); + /* XXX inefficient, split into separate functions */ if (p->p_flag & P_SUGID) vap->va_mode = 0; @@ -106,8 +109,6 @@ strcmp(pn->pn_name, "fpregs") == 0) vap->va_mode = 0600; - /* p is locked by caller */ - PROC_LOCK_ASSERT(p, MA_OWNED); vap->va_uid = p->p_ucred->cr_uid; vap->va_gid = p->p_ucred->cr_gid; @@ -121,6 +122,7 @@ int procfs_notsystem(PFS_VIS_ARGS) { + PROC_LOCK_ASSERT(p, MA_OWNED); return ((p->p_flag & P_SYSTEM) == 0); } ==== //depot/projects/smpng/sys/fs/procfs/procfs_ctl.c#17 (text+ko) ==== @@ -38,7 +38,7 @@ * * From: * $Id: procfs_ctl.c,v 3.2 1993/12/15 09:40:17 jsp Exp $ - * $FreeBSD: src/sys/fs/procfs/procfs_ctl.c,v 1.48 2003/03/02 15:13:06 des Exp $ + * $FreeBSD: src/sys/fs/procfs/procfs_ctl.c,v 1.49 2003/04/17 22:14:30 jhb Exp $ */ #include @@ -263,8 +263,8 @@ * or some other trap. */ case PROCFS_CTL_RUN: + p->p_flag &= ~P_STOPPED_SIG; /* this uses SIGSTOP */ PROC_UNLOCK(p); - p->p_flag &= ~P_STOPPED_SIG; /* this uses SIGSTOP */ break; /* @@ -349,9 +349,9 @@ /* XXXKSE: */ FIX_SSTEP(FIRST_THREAD_IN_PROC(p)); #endif - mtx_lock_spin(&sched_lock); /* XXXKSE: */ p->p_flag &= ~P_STOPPED_SIG; + mtx_lock_spin(&sched_lock); thread_unsuspend(p); mtx_unlock_spin(&sched_lock); } else ==== //depot/projects/smpng/sys/fs/procfs/procfs_ioctl.c#10 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/fs/procfs/procfs_ioctl.c,v 1.8 2002/09/11 08:13:52 julian Exp $ + * $FreeBSD: src/sys/fs/procfs/procfs_ioctl.c,v 1.9 2003/04/17 22:13:46 jhb Exp $ */ #include @@ -92,18 +92,15 @@ break; } #if 0 - mtx_lock_spin(&sched_lock); p->p_step = 0; if (P_SHOULDSTOP(p)) { p->p_xstat = sig; p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SIG); + mtx_lock_spin(&sched_lock); thread_unsuspend(p); mtx_unlock_spin(&sched_lock); - } else { - mtx_unlock_spin(&sched_lock); - if (sig) - psignal(p, sig); - } + } else if (sig) + psignal(p, sig); #else if (sig) psignal(p, sig); @@ -126,6 +123,7 @@ procfs_close(PFS_CLOSE_ARGS) { if (p != NULL && (p->p_pfsflags & PF_LINGER) == 0) { + PROC_LOCK_ASSERT(p, MA_OWNED); p->p_pfsflags = 0; p->p_stops = 0; p->p_step = 0; ==== //depot/projects/smpng/sys/fs/procfs/procfs_status.c#15 (text+ko) ==== @@ -38,7 +38,7 @@ * * From: * $Id: procfs_status.c,v 3.1 1993/12/15 09:40:17 jsp Exp $ - * $FreeBSD: src/sys/fs/procfs/procfs_status.c,v 1.46 2003/02/27 02:05:16 julian Exp $ + * $FreeBSD: src/sys/fs/procfs/procfs_status.c,v 1.47 2003/04/17 22:16:58 jhb Exp $ */ #include @@ -70,6 +70,7 @@ struct thread *tdfirst; struct tty *tp; struct ucred *cr; + const char *wmesg; char *pc; char *sep; int pid, ppid, pgid, sid; @@ -95,7 +96,7 @@ sbuf_putc(sb, *pc); } while (*++pc); sbuf_printf(sb, " %d %d %d %d ", pid, ppid, pgid, sid); - if ((p->p_flag&P_CONTROLT) && (tp = sess->s_ttyp)) + if ((p->p_flag & P_CONTROLT) && (tp = sess->s_ttyp)) sbuf_printf(sb, "%d,%d ", major(tp->t_dev), minor(tp->t_dev)); else sbuf_printf(sb, "%d,%d ", -1, -1); @@ -115,6 +116,18 @@ } mtx_lock_spin(&sched_lock); + if (p->p_flag & P_THREADED) + wmesg = "-kse- "; + else { + tdfirst = FIRST_THREAD_IN_PROC(p); + if (tdfirst->td_wchan != NULL) { + KASSERT(tdfirst->td_wmesg != NULL, + ("wchan %p has no wmesg", tdfirst->td_wchan)); + wmesg = tdfirst->td_wmesg; + } else + wmesg = "nochan"; + } + if (p->p_sflag & PS_INMEM) { struct timeval ut, st; @@ -130,14 +143,7 @@ sbuf_printf(sb, " -1,-1 -1,-1 -1,-1"); } - if (p->p_flag & P_THREADED) - sbuf_printf(sb, " %s", "-kse- "); - else { - tdfirst = FIRST_THREAD_IN_PROC(p); /* XXX diff from td? */ - sbuf_printf(sb, " %s", - (tdfirst->td_wchan && tdfirst->td_wmesg) ? - tdfirst->td_wmesg : "nochan"); - } + sbuf_printf(sb, " %s", wmesg); cr = p->p_ucred; ==== //depot/projects/smpng/sys/gnu/dev/sound/pci/emu10k1.h#2 (text+ko) ==== @@ -31,7 +31,7 @@ * * ********************************************************************** - * $FreeBSD: src/sys/gnu/dev/sound/pci/emu10k1.h,v 1.5 2001/05/24 18:19:00 bde Exp $ + * $FreeBSD: src/sys/gnu/dev/sound/pci/emu10k1.h,v 1.6 2003/04/18 04:13:38 obrien Exp $ */ @@ -184,7 +184,7 @@ /* async audio source */ #define HCFG_LOCKSOUNDCACHE 0x00000008 /* 1 = Cancel bustmaster accesses to soundcache */ /* NOTE: This should generally never be used. */ -#define HCFG_LOCKTANKCACHE 0x00000004 /* 1 = Cancel bustmaster accesses to tankcache */ +#define HCFG_LOCKTANKCACHE_MASK 0x00000004 /* 1 = Cancel bustmaster accesses to tankcache */ /* NOTE: This should generally never be used. */ #define HCFG_MUTEBUTTONENABLE 0x00000002 /* 1 = Master mute button sets AUDIOENABLE = 0. */ /* NOTE: This is a 'cheap' way to implement a */ @@ -260,7 +260,7 @@ #define AC97_RECORDSELECT 0x1a #define AC97_RECORDGAIN 0x1c #define AC97_RECORDGAINMIC 0x1e -#define AC97_GENERALPUPOSE 0x20 +#define AC97_GENERALPURPOSE 0x20 #define AC97_3DCONTROL 0x22 #define AC97_MODEMRATE 0x24 #define AC97_POWERDOWN 0x26 @@ -371,7 +371,7 @@ #define MAP_PTI_MASK 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */ #define ENVVOL 0x10 /* Volume envelope register */ -#define ENVVOL_MASK 0x0000ffff /* Current value of volume envelope state variable */ +#define ENVVOL_MASK 0x0000ffff /* Current value of volume envelope state variable */ /* 0x8000-n == 666*n usec delay */ #define ATKHLDV 0x11 /* Volume envelope hold and attack register */ ==== //depot/projects/smpng/sys/gnu/i386/fpemul/fpu_entry.c#4 (text+ko) ==== @@ -55,7 +55,7 @@ * * W. Metzenthen June 1994. * - * $FreeBSD: src/sys/gnu/i386/fpemul/fpu_entry.c,v 1.27 2001/11/12 21:58:23 keramida Exp $ + * $FreeBSD: src/sys/gnu/i386/fpemul/fpu_entry.c,v 1.28 2003/04/17 22:02:47 jhb Exp $ * */ @@ -198,7 +198,7 @@ static int math_emulate(struct trapframe * tframe) { - + struct proc *p; unsigned char FPU_modrm; unsigned short code; #ifdef LOOKAHEAD_LIMIT @@ -232,10 +232,11 @@ #endif FPU_lookahead = FPU_LOOKAHEAD; - PROC_LOCK(curthread->td_proc); - if (curproc->p_flag & P_TRACED) + p = curthread->td_proc; + PROC_LOCK(p); + if (p->p_flag & P_TRACED) FPU_lookahead = 0; - PROC_UNLOCK(curthread->td_proc); + PROC_UNLOCK(p); do_another_FPU_instruction: ==== //depot/projects/smpng/sys/i386/i386/genassym.c#22 (text+ko) ==== @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91 - * $FreeBSD: src/sys/i386/i386/genassym.c,v 1.139 2003/04/10 17:35:43 julian Exp $ + * $FreeBSD: src/sys/i386/i386/genassym.c,v 1.140 2003/04/17 22:17:28 jhb Exp $ */ #include "opt_compat.h" @@ -80,11 +80,9 @@ ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); ASSYM(P_SFLAG, offsetof(struct proc, p_sflag)); -ASSYM(P_STATE, offsetof(struct proc, p_state)); ASSYM(P_UAREA, offsetof(struct proc, p_uarea)); ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); -ASSYM(TD_WCHAN, offsetof(struct thread, td_wchan)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_INTR_NESTING_LEVEL, offsetof(struct thread, td_intr_nesting_level)); ==== //depot/projects/smpng/sys/i386/linux/linux_sysvec.c#30 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/linux/linux_sysvec.c,v 1.120 2003/03/31 22:49:15 jeff Exp $ + * $FreeBSD: src/sys/i386/linux/linux_sysvec.c,v 1.121 2003/04/17 22:18:07 jhb Exp $ */ /* XXX we use functions that might not exist. */ @@ -288,7 +288,6 @@ p->p_sigstk.ss_size - sizeof(struct l_rt_sigframe)); } else fp = (struct l_rt_sigframe *)regs->tf_esp - 1; - PROC_UNLOCK(p); /* * Build the argument list for the signal handler. @@ -315,7 +314,6 @@ frame.sf_sc.uc_flags = 0; /* XXX ??? */ frame.sf_sc.uc_link = NULL; /* XXX ??? */ - PROC_LOCK(p); frame.sf_sc.uc_stack.ss_sp = p->p_sigstk.ss_sp; frame.sf_sc.uc_stack.ss_size = p->p_sigstk.ss_size; frame.sf_sc.uc_stack.ss_flags = (p->p_flag & P_ALTSTACK) ==== //depot/projects/smpng/sys/i386/svr4/svr4_machdep.c#11 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/svr4/svr4_machdep.c,v 1.30 2003/03/31 22:49:15 jeff Exp $ + * $FreeBSD: src/sys/i386/svr4/svr4_machdep.c,v 1.31 2003/04/17 22:19:47 jhb Exp $ */ #include @@ -216,8 +216,10 @@ * set to 0 right now? */ - if ((uc->uc_flags & SVR4_UC_CPU) == 0) + if ((uc->uc_flags & SVR4_UC_CPU) == 0) { + PROC_UNLOCK(p); return 0; + } DPRINTF(("svr4_setcontext(%d)\n", p->p_pid)); @@ -244,8 +246,10 @@ * the trap, rather than doing all of the checking here. */ if (((r[SVR4_X86_EFL] ^ tf->tf_eflags) & PSL_USERSTATIC) != 0 || - !USERMODE(r[SVR4_X86_CS], r[SVR4_X86_EFL])) + !USERMODE(r[SVR4_X86_CS], r[SVR4_X86_EFL])) { + PROC_UNLOCK(p); return (EINVAL); + } #if defined(__NetBSD__) /* %fs and %gs were restored by the trampoline. */ ==== //depot/projects/smpng/sys/kern/kern_acct.c#26 (text+ko) ==== @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)kern_acct.c 8.1 (Berkeley) 6/14/93 - * $FreeBSD: src/sys/kern/kern_acct.c,v 1.62 2003/03/13 23:07:09 jhb Exp $ + * $FreeBSD: src/sys/kern/kern_acct.c,v 1.63 2003/04/17 22:20:30 jhb Exp $ */ #include "opt_mac.h" @@ -238,6 +238,7 @@ * Get process accounting information. */ + PROC_LOCK(p); /* (1) The name of the command that ran */ bcopy(p->p_comm, acct.ac_comm, sizeof acct.ac_comm); @@ -272,17 +273,16 @@ acct.ac_gid = p->p_ucred->cr_rgid; /* (7) The terminal from which the process was started */ - PROC_LOCK(p); SESS_LOCK(p->p_session); if ((p->p_flag & P_CONTROLT) && p->p_pgrp->pg_session->s_ttyp) acct.ac_tty = dev2udev(p->p_pgrp->pg_session->s_ttyp->t_dev); else acct.ac_tty = NOUDEV; SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); /* (8) The boolean flags that tell how the process terminated, etc. */ acct.ac_flag = p->p_acflag; + PROC_UNLOCK(p); /* * Write the accounting information to the file. ==== //depot/projects/smpng/sys/kern/kern_condvar.c#27 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/kern/kern_condvar.c,v 1.39 2003/03/31 22:41:47 julian Exp $ + * $FreeBSD: src/sys/kern/kern_condvar.c,v 1.40 2003/04/17 22:21:05 jhb Exp $ */ #include "opt_ktrace.h" @@ -291,9 +291,9 @@ else rval = ERESTART; } - PROC_UNLOCK(p); if (p->p_flag & P_WEXIT) rval = EINTR; + PROC_UNLOCK(p); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) @@ -454,10 +454,9 @@ else rval = ERESTART; } - PROC_UNLOCK(p); - if (p->p_flag & P_WEXIT) rval = EINTR; + PROC_UNLOCK(p); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) ==== //depot/projects/smpng/sys/kern/kern_context.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ * */ /* - * $FreeBSD: src/sys/kern/kern_context.c,v 1.3 2003/04/01 23:25:18 jake Exp $ + * $FreeBSD: src/sys/kern/kern_context.c,v 1.4 2003/04/17 22:21:57 jhb Exp $ */ >>> TRUNCATED FOR MAIL (1000 lines) <<<