aboutsummaryrefslogtreecommitdiff
path: root/sys
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
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')
-rw-r--r--sys/alpha/alpha/vm_machdep.c16
-rw-r--r--sys/amd64/amd64/vm_machdep.c17
-rw-r--r--sys/i386/i386/vm_machdep.c17
-rw-r--r--sys/ia64/ia64/vm_machdep.c16
-rw-r--r--sys/powerpc/aim/vm_machdep.c16
-rw-r--r--sys/powerpc/powerpc/vm_machdep.c16
-rw-r--r--sys/sparc64/sparc64/vm_machdep.c15
-rw-r--r--sys/vm/vm_fault.c18
8 files changed, 18 insertions, 113 deletions
diff --git a/sys/alpha/alpha/vm_machdep.c b/sys/alpha/alpha/vm_machdep.c
index 0ab8ca09f8b6..8daa26f45ba8 100644
--- a/sys/alpha/alpha/vm_machdep.c
+++ b/sys/alpha/alpha/vm_machdep.c
@@ -97,22 +97,6 @@
#include <sys/user.h>
/*
- * quick version of vm_fault
- */
-int
-vm_fault_quick(v, prot)
- caddr_t v;
- int prot;
-{
- int r;
- if (prot & VM_PROT_WRITE)
- r = subyte(v, fubyte(v));
- else
- r = fubyte(v);
- return(r);
-}
-
-/*
* Finish a fork operation, with process p2 nearly set up.
* Copy and update the pcb, set up the stack so that the child
* ready to run and return to user mode.
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index eaa117430795..823cad9000a6 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/vm_machdep.c
@@ -96,23 +96,6 @@ static volatile u_int cpu_reset_proxy_active;
extern int _ucodesel, _udatasel;
/*
- * quick version of vm_fault
- */
-int
-vm_fault_quick(v, prot)
- caddr_t v;
- int prot;
-{
- int r;
-
- if (prot & VM_PROT_WRITE)
- r = subyte(v, fubyte(v));
- else
- r = fubyte(v);
- return(r);
-}
-
-/*
* Finish a fork operation, with process p2 nearly set up.
* Copy and update the pcb, set up the stack so that the child
* ready to run and return to user mode.
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index eaa117430795..823cad9000a6 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/vm_machdep.c
@@ -96,23 +96,6 @@ static volatile u_int cpu_reset_proxy_active;
extern int _ucodesel, _udatasel;
/*
- * quick version of vm_fault
- */
-int
-vm_fault_quick(v, prot)
- caddr_t v;
- int prot;
-{
- int r;
-
- if (prot & VM_PROT_WRITE)
- r = subyte(v, fubyte(v));
- else
- r = fubyte(v);
- return(r);
-}
-
-/*
* Finish a fork operation, with process p2 nearly set up.
* Copy and update the pcb, set up the stack so that the child
* ready to run and return to user mode.
diff --git a/sys/ia64/ia64/vm_machdep.c b/sys/ia64/ia64/vm_machdep.c
index d9488353c752..63315f966454 100644
--- a/sys/ia64/ia64/vm_machdep.c
+++ b/sys/ia64/ia64/vm_machdep.c
@@ -96,22 +96,6 @@
#include <i386/include/psl.h>
-/*
- * quick version of vm_fault
- */
-int
-vm_fault_quick(v, prot)
- caddr_t v;
- int prot;
-{
- int r;
- if (prot & VM_PROT_WRITE)
- r = subyte(v, fubyte(v));
- else
- r = fubyte(v);
- return(r);
-}
-
void
cpu_thread_exit(struct thread *td)
{
diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c
index fc0a30f8918d..a6f37f87cdd7 100644
--- a/sys/powerpc/aim/vm_machdep.c
+++ b/sys/powerpc/aim/vm_machdep.c
@@ -100,22 +100,6 @@
#include <sys/user.h>
/*
- * quick version of vm_fault
- */
-int
-vm_fault_quick(v, prot)
- caddr_t v;
- int prot;
-{
- int r;
- if (prot & VM_PROT_WRITE)
- r = subyte(v, fubyte(v));
- else
- r = fubyte(v);
- return(r);
-}
-
-/*
* Finish a fork operation, with process p2 nearly set up.
* Copy and update the pcb, set up the stack so that the child
* ready to run and return to user mode.
diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c
index fc0a30f8918d..a6f37f87cdd7 100644
--- a/sys/powerpc/powerpc/vm_machdep.c
+++ b/sys/powerpc/powerpc/vm_machdep.c
@@ -100,22 +100,6 @@
#include <sys/user.h>
/*
- * quick version of vm_fault
- */
-int
-vm_fault_quick(v, prot)
- caddr_t v;
- int prot;
-{
- int r;
- if (prot & VM_PROT_WRITE)
- r = subyte(v, fubyte(v));
- else
- r = fubyte(v);
- return(r);
-}
-
-/*
* Finish a fork operation, with process p2 nearly set up.
* Copy and update the pcb, set up the stack so that the child
* ready to run and return to user mode.
diff --git a/sys/sparc64/sparc64/vm_machdep.c b/sys/sparc64/sparc64/vm_machdep.c
index ad86559338e7..56f692a204ad 100644
--- a/sys/sparc64/sparc64/vm_machdep.c
+++ b/sys/sparc64/sparc64/vm_machdep.c
@@ -362,18 +362,3 @@ uma_small_free(void *mem, int size, u_int8_t flags)
vm_page_unlock_queues();
}
-/*
- * quick version of vm_fault
- */
-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);
-}
-
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.