1/* 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * The Mach Operating System project at Carnegie-Mellon University. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 45 unchanged lines hidden (view full) --- 54 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 55 * School of Computer Science 56 * Carnegie Mellon University 57 * Pittsburgh PA 15213-3890 58 * 59 * any improvements or extensions that they make and grant Carnegie the 60 * rights to redistribute these changes. 61 * |
62 * $FreeBSD: head/sys/vm/vm_glue.c 103767 2002-09-21 22:07:17Z jake $ |
63 */ 64 65#include "opt_vm.h" 66 67#include <sys/param.h> 68#include <sys/systm.h> 69#include <sys/lock.h> 70#include <sys/mutex.h> --- 73 unchanged lines hidden (view full) --- 144 */ 145int 146useracc(addr, len, rw) 147 caddr_t addr; 148 int len, rw; 149{ 150 boolean_t rv; 151 vm_prot_t prot; |
152 vm_map_t map; |
153 154 KASSERT((rw & ~VM_PROT_ALL) == 0, 155 ("illegal ``rw'' argument to useracc (%x)\n", rw)); 156 prot = rw; |
157 map = &curproc->p_vmspace->vm_map; 158 if ((vm_offset_t)addr + len > vm_map_max(map) || 159 (vm_offset_t)addr + len < (vm_offset_t)addr) { |
160 return (FALSE); 161 } |
162 rv = vm_map_check_protection(map, trunc_page((vm_offset_t)addr), 163 round_page((vm_offset_t)addr + len), prot); |
164 return (rv == TRUE); 165} 166 167/* 168 * MPSAFE 169 */ 170void 171vslock(addr, len) --- 694 unchanged lines hidden --- |