Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/741e3011b3b0
branches:  trunk
changeset: 552033:741e3011b3b0
user:      cl <cl%NetBSD.org@localhost>
date:      Tue Sep 16 13:59:59 2003 +0000

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

diffstat:

 sys/arch/sparc/sparc/trap.c |  23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diffs (74 lines):

diff -r 0e901c494a91 -r 741e3011b3b0 sys/arch/sparc/sparc/trap.c
--- a/sys/arch/sparc/sparc/trap.c       Tue Sep 16 13:57:47 2003 +0000
+++ b/sys/arch/sparc/sparc/trap.c       Tue Sep 16 13:59:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.140 2003/09/07 20:41:05 uwe Exp $ */
+/*     $NetBSD: trap.c,v 1.141 2003/09/16 13:59:59 cl Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.140 2003/09/07 20:41:05 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.141 2003/09/16 13:59:59 cl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ktrace.h"
@@ -920,8 +920,14 @@
                                return;
                        goto kfault;
                }
-       } else
+       } else {
                l->l_md.md_tf = tf;
+               if (l->l_flag & L_SA) {
+                       KDASSERT(p != NULL && p->p_sa != NULL);
+                       p->p_sa->sa_vp_faultaddr = (vaddr_t)v;
+                       l->l_flag |= L_SA_PAGEFAULT;
+               }
+       }
 
        /*
         * mmu_pagein returns -1 if the page is already valid, in which
@@ -1004,6 +1010,7 @@
        }
 out:
        if ((psr & PSR_PS) == 0) {
+               l->l_flag &= ~L_SA_PAGEFAULT;
                KERNEL_PROC_UNLOCK(l);
                userret(l, pc, sticks);
                share_fpu(l, tf);
@@ -1158,6 +1165,7 @@
                 * Attempt to handle early fault. Ignores ASI 8,9 issue...may
                 * do a useless VM read.
                 * XXX: Is this really necessary?
+                * XXX: If it's necessary, add SA_PAGEFAULT handling
                 */
                if (cpuinfo.cpu_type == CPUTYP_HS_MBUS) {
                        /* On HS, we have va for both */
@@ -1217,8 +1225,14 @@
                        }
                        goto kfault;
                }
-       } else
+       } else {
                l->l_md.md_tf = tf;
+               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;
+               }
+       }
 
        vm = p->p_vmspace;
 
@@ -1276,6 +1290,7 @@
        }
 out:
        if ((psr & PSR_PS) == 0) {
+               l->l_flag &= ~L_SA_PAGEFAULT;
                KERNEL_PROC_UNLOCK(l);
 out_nounlock:
                userret(l, pc, sticks);



Home | Main Index | Thread Index | Old Index