aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_fault.c
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2003-01-16 00:02:21 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2003-01-16 00:02:21 +0000
commite3669cee724bf60a23242b7398b866133bdb2485 (patch)
treee3cb42f591e5e313002c7ff53f9f04d2e262afbe /sys/vm/vm_fault.c
parentf5979003290ee119a14b29c2c99bbce53f196942 (diff)
downloadsrc-e3669cee724bf60a23242b7398b866133bdb2485.tar.gz
src-e3669cee724bf60a23242b7398b866133bdb2485.zip
Merge all the various copies of vm_fault_quick() into a single
portable copy.
Notes
Notes: svn path=/head/; revision=109342
Diffstat (limited to 'sys/vm/vm_fault.c')
-rw-r--r--sys/vm/vm_fault.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index e12e362cdd36..abb9ef3a8e0a 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -922,6 +922,24 @@ readrest:
}
/*
+ * vm_fault_quick:
+ *
+ * Ensure that the requested virtual address, which may be in userland,
+ * is valid. Fault-in the page if necessary. Return -1 on failure.
+ */
+int
+vm_fault_quick(caddr_t v, int prot)
+{
+ int r;
+
+ if (prot & VM_PROT_WRITE)
+ r = subyte(v, fubyte(v));
+ else
+ r = fubyte(v);
+ return(r);
+}
+
+/*
* vm_fault_wire:
*
* Wire down a range of virtual addresses in a map.