diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-02-21 23:27:13 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-02-21 23:27:13 +0000 |
commit | 8bd547c6275f08309f29c18ef0c0d66768adf858 (patch) | |
tree | f4058df709712ef6b48c811ff9c7628c73b9b0b9 /sys/arch/i386 | |
parent | 0d541fd9920e006280e60dadcdbd301c0b0e1d66 (diff) |
for a SIGSEGV, only read cr2 once, not twice (and now si_addr is not just the fault page)
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/trap.c | 9 |
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; } |