Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 clear pcb_onfault before calling uvm_faul...



details:   https://anonhg.NetBSD.org/src/rev/35809a435594
branches:  trunk
changeset: 503392:35809a435594
user:      chs <chs%NetBSD.org@localhost>
date:      Mon Feb 05 11:12:05 2001 +0000

description:
clear pcb_onfault before calling uvm_fault() and restore it afterward.
if the fault handler generates a pagefault, we'd like to panic rather
than invoking the onfault handler.

diffstat:

 sys/arch/i386/i386/trap.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r fa108f74ecf6 -r 35809a435594 sys/arch/i386/i386/trap.c
--- a/sys/arch/i386/i386/trap.c Mon Feb 05 10:55:02 2001 +0000
+++ b/sys/arch/i386/i386/trap.c Mon Feb 05 11:12:05 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.153 2000/12/11 05:29:00 mycroft Exp $       */
+/*     $NetBSD: trap.c,v 1.154 2001/02/05 11:12:05 chs Exp $   */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -172,6 +172,7 @@
                    IDTVEC(osyscall)[];
        struct trapframe *vframe;
        int resume;
+       caddr_t onfault;
 
        uvmexp.traps++;
 
@@ -403,7 +404,10 @@
                }
 
                /* Fault the original page in. */
+               onfault = p->p_addr->u_pcb.pcb_onfault;
+               p->p_addr->u_pcb.pcb_onfault = NULL;
                rv = uvm_fault(map, va, 0, ftype);
+               p->p_addr->u_pcb.pcb_onfault = onfault;
                if (rv == KERN_SUCCESS) {
                        if (nss > vm->vm_ssize)
                                vm->vm_ssize = nss;



Home | Main Index | Thread Index | Old Index