From 73863dd3c9c495ddc22b6144e989f6ddcc3220f6 Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 30 Apr 1998 06:28:57 +0000 Subject: [PATCH] Pass vslock() and vsunlock() a proc *, rather than implicitly operating on curproc. --- sys/arch/newsmips/dev/fb_sub.c | 4 ++-- sys/kern/kern_physio.c | 10 +++++----- sys/kern/kern_sysctl.c | 10 +++++----- sys/uvm/uvm_extern.h | 6 +++--- sys/uvm/uvm_glue.c | 10 ++++++---- sys/vm/vm_extern.h | 6 +++--- sys/vm/vm_glue.c | 12 +++++++----- 7 files changed, 31 insertions(+), 27 deletions(-) diff --git a/sys/arch/newsmips/dev/fb_sub.c b/sys/arch/newsmips/dev/fb_sub.c index 64188ed11b69..1e9918cf1e3b 100644 --- a/sys/arch/newsmips/dev/fb_sub.c +++ b/sys/arch/newsmips/dev/fb_sub.c @@ -300,7 +300,7 @@ fbdolock() for (i = 0; i < segind; i++) if (mseg[i].len && mseg[i].adrs && mseg[i].adrs < (caddr_t)KERNBASE) - vslock(mseg[i].adrs, mseg[i].len); + vslock(curproc, mseg[i].adrs, mseg[i].len); /* make map */ for (i = 0; i < segind; i++) @@ -316,7 +316,7 @@ fbunlock() for (i = 0; i < segind; i++) { if (mseg[i].len && mseg[i].adrs && mseg[i].adrs < (caddr_t)KERNBASE) { - vsunlock(mseg[i].adrs, mseg[i].len, mseg[i].rw); + vsunlock(curproc, mseg[i].adrs, mseg[i].len, mseg[i].rw); #if defined(mips) && defined(CPU_DOUBLE) if (mseg[i].rw == B_READ) clean_kudcache(curproc, diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index c06f8d069ce1..39eb9fe5823a 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_physio.c,v 1.30 1998/02/10 14:09:35 mrg Exp $ */ +/* $NetBSD: kern_physio.c,v 1.31 1998/04/30 06:28:57 thorpej Exp $ */ /*- * Copyright (c) 1994 Christopher G. Demetriou @@ -191,9 +191,9 @@ physio(strategy, bp, dev, flags, minphys, uio) */ PHOLD(p); #if defined(UVM) - uvm_vslock(bp->b_data, todo); + uvm_vslock(p, bp->b_data, todo); #else - vslock(bp->b_data, todo); + vslock(p, bp->b_data, todo); #endif vmapbuf(bp, todo); @@ -226,9 +226,9 @@ physio(strategy, bp, dev, flags, minphys, uio) */ vunmapbuf(bp, todo); #if defined(UVM) - uvm_vsunlock(bp->b_data, todo); + uvm_vsunlock(p, bp->b_data, todo); #else - vsunlock(bp->b_data, todo); + vsunlock(p, bp->b_data, todo); #endif PRELE(p); diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 0932ab5bc2d1..de3fde83b50e 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sysctl.c,v 1.34 1998/03/01 02:22:30 fvdl Exp $ */ +/* $NetBSD: kern_sysctl.c,v 1.35 1998/04/30 06:28:58 thorpej Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -171,9 +171,9 @@ sys___sysctl(p, v, retval) memlock.sl_lock = 1; if (dolock) #if defined(UVM) - uvm_vslock(SCARG(uap, old), oldlen); + uvm_vslock(p, SCARG(uap, old), oldlen); #else - vslock(SCARG(uap, old), oldlen); + vslock(p, SCARG(uap, old), oldlen); #endif savelen = oldlen; } @@ -182,9 +182,9 @@ sys___sysctl(p, v, retval) if (SCARG(uap, old) != NULL) { if (dolock) #if defined(UVM) - uvm_vsunlock(SCARG(uap, old), savelen); + uvm_vsunlock(p, SCARG(uap, old), savelen); #else - vsunlock(SCARG(uap, old), savelen); + vsunlock(p, SCARG(uap, old), savelen); #endif memlock.sl_lock = 0; if (memlock.sl_want) { diff --git a/sys/uvm/uvm_extern.h b/sys/uvm/uvm_extern.h index 400f022299ad..47a95af9437a 100644 --- a/sys/uvm/uvm_extern.h +++ b/sys/uvm/uvm_extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_extern.h,v 1.11 1998/03/30 06:24:42 mycroft Exp $ */ +/* $NetBSD: uvm_extern.h,v 1.12 1998/04/30 06:28:59 thorpej Exp $ */ /* * XXXCDC: "ROUGH DRAFT" QUALITY UVM PRE-RELEASE FILE! @@ -272,8 +272,8 @@ boolean_t uvm_kernacc __P((caddr_t, int, int)); __dead void uvm_scheduler __P((void)) __attribute__((noreturn)); void uvm_swapin __P((struct proc *)); boolean_t uvm_useracc __P((caddr_t, int, int)); -void uvm_vslock __P((caddr_t, u_int)); -void uvm_vsunlock __P((caddr_t, u_int)); +void uvm_vslock __P((struct proc *, caddr_t, u_int)); +void uvm_vsunlock __P((struct proc *, caddr_t, u_int)); /* uvm_init.c */ diff --git a/sys/uvm/uvm_glue.c b/sys/uvm/uvm_glue.c index 816cfedca2bd..b3c647482101 100644 --- a/sys/uvm/uvm_glue.c +++ b/sys/uvm/uvm_glue.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_glue.c,v 1.8 1998/04/09 00:24:05 thorpej Exp $ */ +/* $NetBSD: uvm_glue.c,v 1.9 1998/04/30 06:28:59 thorpej Exp $ */ /* * XXXCDC: "ROUGH DRAFT" QUALITY UVM PRE-RELEASE FILE! @@ -223,11 +223,12 @@ uvm_chgkprot(addr, len, rw) */ void -uvm_vslock(addr, len) +uvm_vslock(p, addr, len) + struct proc *p; caddr_t addr; u_int len; { - uvm_fault_wire(&curproc->p_vmspace->vm_map, trunc_page(addr), + uvm_fault_wire(&p->p_vmspace->vm_map, trunc_page(addr), round_page(addr+len)); } @@ -239,7 +240,8 @@ uvm_vslock(addr, len) */ void -uvm_vsunlock(addr, len) +uvm_vsunlock(p, addr, len) + struct proc *p; caddr_t addr; u_int len; { diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index 296e143700f2..ba664a26ce7b 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: vm_extern.h,v 1.35 1998/03/30 06:24:43 mycroft Exp $ */ +/* $NetBSD: vm_extern.h,v 1.36 1998/04/30 06:28:58 thorpej Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -167,8 +167,8 @@ void vnode_pager_sync __P((struct mount *)); void vnode_pager_umount __P((struct mount *)); boolean_t vnode_pager_uncache __P((struct vnode *)); #if !defined(UVM) -void vslock __P((caddr_t, u_int)); -void vsunlock __P((caddr_t, u_int)); +void vslock __P((struct proc *, caddr_t, u_int)); +void vsunlock __P((struct proc *, caddr_t, u_int)); #endif /* Machine dependent portion */ diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index d27c7335c85f..856eecb297d3 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_glue.c,v 1.73 1998/04/09 00:23:39 thorpej Exp $ */ +/* $NetBSD: vm_glue.c,v 1.74 1998/04/30 06:28:59 thorpej Exp $ */ /* * Copyright (c) 1991, 1993 @@ -173,20 +173,22 @@ chgkprot(addr, len, rw) #endif void -vslock(addr, len) +vslock(p, addr, len) + struct proc *p; caddr_t addr; u_int len; { - vm_map_pageable(&curproc->p_vmspace->vm_map, trunc_page(addr), + vm_map_pageable(&p->p_vmspace->vm_map, trunc_page(addr), round_page(addr+len), FALSE); } void -vsunlock(addr, len) +vsunlock(p, addr, len) + struct proc *p; caddr_t addr; u_int len; { - vm_map_pageable(&curproc->p_vmspace->vm_map, trunc_page(addr), + vm_map_pageable(&p->p_vmspace->vm_map, trunc_page(addr), round_page(addr+len), TRUE); }