add MD part of SA/pthread pagefault handling on i386

This commit is contained in:
cl 2003-09-16 13:57:47 +00:00
parent 465ed898bd
commit abc609d801

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.187 2003/09/12 23:20:26 christos Exp $ */
/* $NetBSD: trap.c,v 1.188 2003/09/16 13:57:47 cl Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.187 2003/09/12 23:20:26 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.188 2003/09/16 13:57:47 cl Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -543,6 +543,11 @@ copyfault:
cr2 = rcr2();
KERNEL_PROC_LOCK(l);
if (l->l_flag & L_SA) {
KDASSERT(p != NULL && p->p_sa != NULL);
p->p_sa->sa_vp_faultaddr = (vaddr_t)cr2;
l->l_flag |= L_SA_PAGEFAULT;
}
faultcommon:
vm = p->p_vmspace;
if (vm == NULL)
@ -605,6 +610,7 @@ copyfault:
KERNEL_UNLOCK();
return;
}
l->l_flag &= ~L_SA_PAGEFAULT;
KERNEL_PROC_UNLOCK(l);
goto out;
}
@ -639,8 +645,10 @@ copyfault:
(*p->p_emul->e_trapsignal)(l, &ksi);
if (type == T_PAGEFLT)
KERNEL_UNLOCK();
else
else {
l->l_flag &= ~L_SA_PAGEFAULT;
KERNEL_PROC_UNLOCK(l);
}
break;
}