diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1997-01-07 05:37:38 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1997-01-07 05:37:38 +0000 |
commit | 27f65398f872a8be39f3cff5bed8e2185eb72a7a (patch) | |
tree | fc2a736a6fada935798dbe309e8caca05fb26217 /sys/vm | |
parent | e232dfde38d6b0996968d4320bfea8fb18b8a79a (diff) |
Fix for final ptdi panic on i386
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_extern.h | 6 | ||||
-rw-r--r-- | sys/vm/vm_glue.c | 17 | ||||
-rw-r--r-- | sys/vm/vm_mmap.c | 6 |
3 files changed, 16 insertions, 13 deletions
diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index cf93f186b1b..14346cb8a05 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_extern.h,v 1.8 1996/08/02 00:05:58 niklas Exp $ */ +/* $OpenBSD: vm_extern.h,v 1.9 1997/01/07 05:37:35 tholo Exp $ */ /* $NetBSD: vm_extern.h,v 1.20 1996/04/23 12:25:23 christos Exp $ */ /*- @@ -139,8 +139,8 @@ void vmtotal __P((struct vmtotal *)); void vnode_pager_setsize __P((struct vnode *, u_long)); void vnode_pager_umount __P((struct mount *)); boolean_t vnode_pager_uncache __P((struct vnode *)); -void vslock __P((caddr_t, u_int)); -void vsunlock __P((caddr_t, u_int)); +int vslock __P((caddr_t, u_int)); +int vsunlock __P((caddr_t, u_int)); /* Machine dependent portion */ void vmapbuf __P((struct buf *, vm_size_t)); diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 764435ddc34..2851697956f 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_glue.c,v 1.21 1996/11/23 23:19:54 kstailey Exp $ */ +/* $OpenBSD: vm_glue.c,v 1.22 1997/01/07 05:37:36 tholo Exp $ */ /* $NetBSD: vm_glue.c,v 1.55.4.1 1996/06/13 17:25:45 cgd Exp $ */ /* @@ -173,22 +173,25 @@ chgkprot(addr, len, rw) } #endif -void +int vslock(addr, len) caddr_t addr; u_int len; { - vm_map_pageable(&curproc->p_vmspace->vm_map, trunc_page(addr), - round_page(addr+len), FALSE); +#ifdef __i386__ + pmap_prefault(&curproc->p_vmspace->vm_map, (vm_offset_t)addr, len); +#endif + return vm_map_pageable(&curproc->p_vmspace->vm_map, trunc_page(addr), + round_page(addr+len), FALSE); } -void +int vsunlock(addr, len) caddr_t addr; u_int len; { - vm_map_pageable(&curproc->p_vmspace->vm_map, trunc_page(addr), - round_page(addr+len), TRUE); + return vm_map_pageable(&curproc->p_vmspace->vm_map, trunc_page(addr), + round_page(addr+len), TRUE); } /* diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 5008feb1277..0e614e86493 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_mmap.c,v 1.6 1996/04/21 22:33:13 deraadt Exp $ */ +/* $OpenBSD: vm_mmap.c,v 1.7 1997/01/07 05:37:37 tholo Exp $ */ /* $NetBSD: vm_mmap.c,v 1.47 1996/03/16 23:15:23 christos Exp $ */ /* @@ -599,7 +599,7 @@ sys_mlock(p, v, retval) return (error); #endif - error = vm_map_pageable(&p->p_vmspace->vm_map, addr, addr+size, FALSE); + error = vslock((caddr_t)addr, size); return (error == KERN_SUCCESS ? 0 : ENOMEM); } @@ -642,7 +642,7 @@ sys_munlock(p, v, retval) return (error); #endif - error = vm_map_pageable(&p->p_vmspace->vm_map, addr, addr+size, TRUE); + error = vsunlock((caddr_t)addr, size); return (error == KERN_SUCCESS ? 0 : ENOMEM); } |