summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-06-19 20:23:54 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-06-19 20:23:54 +0000
commit8e4e0d00306b9b02302711a0e35d18baa2e744d7 (patch)
treec718777d4b28fd776cf317832fe042ff7cfb490c /sys/arch
parent4b8bc04e3636c3d32633962d94c8cd746569ad66 (diff)
Reset pcb_onfault around uvm_fault() calls.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/alpha/trap.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c
index 1b867f144a0..9a7c1bcb91e 100644
--- a/sys/arch/alpha/alpha/trap.c
+++ b/sys/arch/alpha/alpha/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.50 2006/03/19 22:00:29 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.51 2006/06/19 20:23:53 miod Exp $ */
/* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */
/*-
@@ -289,8 +289,8 @@ trap(a0, a1, a2, entry, framep)
const unsigned long a0, a1, a2, entry;
struct trapframe *framep;
{
- register struct proc *p;
- register int i;
+ struct proc *p;
+ int i;
u_int64_t ucode;
u_quad_t sticks;
int user;
@@ -301,6 +301,7 @@ trap(a0, a1, a2, entry, framep)
int typ;
union sigval sv;
vm_prot_t ftype;
+ unsigned long onfault;
uvmexp.traps++;
p = curproc;
@@ -473,15 +474,22 @@ do_fault:
* argument space is lazy-allocated.
*/
if (!user && (a0 >= VM_MIN_KERNEL_ADDRESS ||
- p == NULL || p->p_addr->u_pcb.pcb_onfault == 0))
+ p == NULL || p->p_addr->u_pcb.pcb_onfault == 0)) {
+ vm = NULL;
map = kernel_map;
- else {
+ } else {
vm = p->p_vmspace;
map = &vm->vm_map;
}
va = trunc_page((vaddr_t)a0);
+ if (p != NULL) {
+ onfault = p->p_addr->u_pcb.pcb_onfault;
+ p->p_addr->u_pcb.pcb_onfault = 0;
+ }
rv = uvm_fault(map, va, 0, ftype);
+ if (p != NULL)
+ p->p_addr->u_pcb.pcb_onfault = onfault;
/*
* If this was a stack access we keep track of the
* maximum accessed stack size. Also, if vm_fault