From 755889bc0b3ab7395b6454921b07ef119c68e1d6 Mon Sep 17 00:00:00 2001 From: chs Date: Mon, 5 Feb 2001 11:12:05 +0000 Subject: [PATCH] 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. --- sys/arch/i386/i386/trap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index ad50cac3fff7..a9b4874074b5 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -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 @@ trap(frame) IDTVEC(osyscall)[]; struct trapframe *vframe; int resume; + caddr_t onfault; uvmexp.traps++; @@ -403,7 +404,10 @@ trap(frame) } /* 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;