Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha/alpha add MD part of SA/pthread pagefault han...



details:   https://anonhg.NetBSD.org/src/rev/b3faf410a73c
branches:  trunk
changeset: 552098:b3faf410a73c
user:      cl <cl%NetBSD.org@localhost>
date:      Thu Sep 18 22:36:32 2003 +0000

description:
add MD part of SA/pthread pagefault handling on alpha

diffstat:

 sys/arch/alpha/alpha/trap.c |  19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diffs (56 lines):

diff -r 6957f9723e15 -r b3faf410a73c sys/arch/alpha/alpha/trap.c
--- a/sys/arch/alpha/alpha/trap.c       Thu Sep 18 21:59:27 2003 +0000
+++ b/sys/arch/alpha/alpha/trap.c       Thu Sep 18 22:36:32 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.82 2003/09/18 05:26:41 skd Exp $ */
+/* $NetBSD: trap.c,v 1.83 2003/09/18 22:36:32 cl Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.82 2003/09/18 05:26:41 skd Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.83 2003/09/18 22:36:32 cl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -400,9 +400,14 @@
                                break;
                        }
        
-                       if (user)
+                       if (user) {
                                KERNEL_PROC_LOCK(l);
-                       else {
+                               if (l->l_flag & L_SA) {
+                                       KDASSERT(l->l_proc != NULL && l->l_proc->p_sa != NULL);
+                                       l->l_proc->p_sa->sa_vp_faultaddr = (vaddr_t)a0;
+                                       l->l_flag |= L_SA_PAGEFAULT;
+                               }
+                       } else {
                                struct cpu_info *ci = curcpu();
 
                                if (l == NULL) {
@@ -484,9 +489,10 @@
                                        rv = EFAULT;
                        }
                        if (rv == 0) {
-                               if (user)
+                               if (user) {
+                                       l->l_flag &= ~L_SA_PAGEFAULT;
                                        KERNEL_PROC_UNLOCK(l);
-                               else
+                               } else
                                        KERNEL_UNLOCK();
                                goto out;
                        }
@@ -514,6 +520,7 @@
                                i = SIGKILL;
                        } else
                                i = SIGSEGV;
+                       l->l_flag &= ~L_SA_PAGEFAULT;
                        KERNEL_PROC_UNLOCK(l);
                        break;
                    }



Home | Main Index | Thread Index | Old Index