summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/i386/i386/trap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c
index bff9281c051..53a47290602 100644
--- a/sys/arch/i386/i386/trap.c
+++ b/sys/arch/i386/i386/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.47 2001/12/03 14:29:24 mpech Exp $ */
+/* $OpenBSD: trap.c,v 1.48 2002/02/21 23:27:12 deraadt Exp $ */
/* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */
/*-
@@ -417,7 +417,7 @@ trap(frame)
/* FALLTHROUGH */
case T_PAGEFLT|T_USER: { /* page fault */
- vm_offset_t va;
+ vm_offset_t va, fa;
struct vmspace *vm = p->p_vmspace;
struct vm_map *map;
int rv;
@@ -426,7 +426,8 @@ trap(frame)
if (vm == NULL)
goto we_re_toast;
- va = trunc_page((vm_offset_t)rcr2());
+ fa = (vm_offset_t)rcr2();
+ va = trunc_page(fa);
/*
* It is only a kernel address space fault iff:
* 1. (type & T_USER) == 0 and
@@ -485,7 +486,7 @@ trap(frame)
map, va, ftype, rv);
goto we_re_toast;
}
- sv.sival_int = rcr2();
+ sv.sival_int = fa;
trapsignal(p, SIGSEGV, vftype, SEGV_MAPERR, sv);
break;
}