Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amd64/amd64 If p->emul->e_usertrap is set, call it ...



details:   https://anonhg.NetBSD.org/src/rev/abdd346d27e9
branches:  trunk
changeset: 581018:abdd346d27e9
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Fri May 20 12:49:14 2005 +0000

description:
If p->emul->e_usertrap is set, call it for T_USER|T_PAGEFAULT traps to
do possible work.

diffstat:

 sys/arch/amd64/amd64/trap.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r e08a71b670b0 -r abdd346d27e9 sys/arch/amd64/amd64/trap.c
--- a/sys/arch/amd64/amd64/trap.c       Fri May 20 12:48:26 2005 +0000
+++ b/sys/arch/amd64/amd64/trap.c       Fri May 20 12:49:14 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.19 2004/08/28 17:53:00 jdolecek Exp $       */
+/*     $NetBSD: trap.c,v 1.20 2005/05/20 12:49:14 fvdl 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.19 2004/08/28 17:53:00 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.20 2005/05/20 12:49:14 fvdl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -154,6 +154,8 @@
 
 #define        IDTVEC(name)    __CONCAT(X, name)
 
+#undef TRAP_SIGDEBUG
+
 #ifdef TRAP_SIGDEBUG
 static void frame_dump(struct trapframe *);
 #endif
@@ -439,6 +441,9 @@
                extern struct vm_map *kernel_map;
 
                cr2 = rcr2();
+               if (p->p_emul->e_usertrap != NULL &&
+                   (*p->p_emul->e_usertrap)(l, cr2, frame) != 0)
+                       return;
                KERNEL_PROC_LOCK(l);
                if (l->l_flag & L_SA) {
                        l->l_savp->savp_faultaddr = (vaddr_t)cr2;



Home | Main Index | Thread Index | Old Index