Source-Changes-HG archive

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

[src/trunk]: src/sys/arch add MD part of SA/pthread pagefault handling on all...



details:   https://anonhg.NetBSD.org/src/rev/94636a24bb2d
branches:  trunk
changeset: 552071:94636a24bb2d
user:      cl <cl%NetBSD.org@localhost>
date:      Wed Sep 17 23:17:39 2003 +0000

description:
add MD part of SA/pthread pagefault handling on all m68k ports

diffstat:

 sys/arch/amiga/amiga/trap.c     |  15 ++++++++++++---
 sys/arch/atari/atari/trap.c     |  15 ++++++++++++---
 sys/arch/cesfic/cesfic/trap.c   |  14 +++++++++++---
 sys/arch/hp300/hp300/trap.c     |  14 +++++++++++---
 sys/arch/luna68k/luna68k/trap.c |  14 +++++++++++---
 sys/arch/mac68k/mac68k/trap.c   |  14 +++++++++++---
 sys/arch/mvme68k/mvme68k/trap.c |  14 +++++++++++---
 sys/arch/news68k/news68k/trap.c |  14 +++++++++++---
 sys/arch/next68k/next68k/trap.c |  14 +++++++++++---
 sys/arch/sun2/sun2/trap.c       |  14 +++++++++++---
 sys/arch/sun3/sun3/trap.c       |  14 +++++++++++---
 sys/arch/x68k/x68k/trap.c       |  14 +++++++++++---
 12 files changed, 134 insertions(+), 36 deletions(-)

diffs (truncated from 609 to 300 lines):

diff -r 883af715bb6f -r 94636a24bb2d sys/arch/amiga/amiga/trap.c
--- a/sys/arch/amiga/amiga/trap.c       Wed Sep 17 22:06:50 2003 +0000
+++ b/sys/arch/amiga/amiga/trap.c       Wed Sep 17 23:17:39 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.93 2003/08/07 16:26:39 agc Exp $    */
+/*     $NetBSD: trap.c,v 1.94 2003/09/17 23:17:39 cl Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
 #include "opt_fpu_emulate.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.93 2003/08/07 16:26:39 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.94 2003/09/17 23:17:39 cl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -407,8 +407,14 @@
             mmutype == MMU_68040 ? (code & SSW_TMMASK) == FC_SUPERD :
             (code & (SSW_DF|FC_SUPERD)) == (SSW_DF|FC_SUPERD))))
                map = kernel_map;
-       else
+       else {
                map = &vm->vm_map;
+               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;
+               }
+       }
 
        if (
 #ifdef M68060
@@ -530,6 +536,7 @@
        if (rv == 0) {
                if (type == T_MMUFLT)
                        return;
+               l->l_flag &= ~L_SA_PAGEFAULT;
                userret(l, fp->f_pc, sticks);
                return;
        }
@@ -542,6 +549,7 @@
                        vm->vm_ssize = nss;
                if (type == T_MMUFLT)
                        return;
+               l->l_flag &= ~L_SA_PAGEFAULT;
                userret(l, fp->f_pc, sticks);
                return;
        }
@@ -568,6 +576,7 @@
        }
        if ((type & T_USER) == 0)
                return;
+       l->l_flag &= ~L_SA_PAGEFAULT;
        userret(l, fp->f_pc, sticks);
 }
 /*
diff -r 883af715bb6f -r 94636a24bb2d sys/arch/atari/atari/trap.c
--- a/sys/arch/atari/atari/trap.c       Wed Sep 17 22:06:50 2003 +0000
+++ b/sys/arch/atari/atari/trap.c       Wed Sep 17 23:17:39 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.69 2003/08/07 16:26:57 agc Exp $    */
+/*     $NetBSD: trap.c,v 1.70 2003/09/17 23:17:41 cl Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.69 2003/08/07 16:26:57 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.70 2003/09/17 23:17:41 cl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_execfmt.h"
@@ -643,8 +643,15 @@
                if (type == T_MMUFLT &&
                    ((l->l_addr->u_pcb.pcb_onfault == 0) || KDFAULT(code)))
                        map = kernel_map;
-               else
+               else {
                        map = vm ? &vm->vm_map : kernel_map;
+                       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;
+                       }
+               }
+
                if (WRFAULT(code))
                        ftype = VM_PROT_WRITE;
                else
@@ -688,6 +695,7 @@
 #endif
                                return;
                        }
+                       l->l_flag &= ~L_SA_PAGEFAULT;
                        goto out;
                }
                if (type == T_MMUFLT) {
@@ -701,6 +709,7 @@
                               type, code);
                        panictrap(type, code, v, &frame);
                }
+               l->l_flag &= ~L_SA_PAGEFAULT;
                ucode = v;
                if (rv == ENOMEM) {
                        printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
diff -r 883af715bb6f -r 94636a24bb2d sys/arch/cesfic/cesfic/trap.c
--- a/sys/arch/cesfic/cesfic/trap.c     Wed Sep 17 22:06:50 2003 +0000
+++ b/sys/arch/cesfic/cesfic/trap.c     Wed Sep 17 23:17:39 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.12 2003/08/07 16:27:15 agc Exp $    */
+/*     $NetBSD: trap.c,v 1.13 2003/09/17 23:17:41 cl Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.12 2003/08/07 16:27:15 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.13 2003/09/17 23:17:41 cl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_execfmt.h"
@@ -638,8 +638,14 @@
                if ((type & T_USER) == 0 &&
                    ((l->l_addr->u_pcb.pcb_onfault == 0) || KDFAULT(code)))
                        map = kernel_map;
-               else
+               else {
                        map = vm ? &vm->vm_map : kernel_map;
+                       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;
+                       }
+               }
 
                if (WRFAULT(code))
                        ftype = VM_PROT_WRITE;
@@ -701,6 +707,7 @@
 #endif
                                return;
                        }
+                       l->l_flag &= ~L_SA_PAGEFAULT;
                        goto out;
                }
                if (type == T_MMUFLT) {
@@ -712,6 +719,7 @@
                               type, code);
                        goto dopanic;
                }
+               l->l_flag &= ~L_SA_PAGEFAULT;
                ucode = v;
                if (rv == ENOMEM) {
                        printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
diff -r 883af715bb6f -r 94636a24bb2d sys/arch/hp300/hp300/trap.c
--- a/sys/arch/hp300/hp300/trap.c       Wed Sep 17 22:06:50 2003 +0000
+++ b/sys/arch/hp300/hp300/trap.c       Wed Sep 17 23:17:39 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.101 2003/08/07 16:27:38 agc Exp $   */
+/*     $NetBSD: trap.c,v 1.102 2003/09/17 23:17:42 cl Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.101 2003/08/07 16:27:38 agc Exp $");                                                  
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.102 2003/09/17 23:17:42 cl Exp $");                                                  
 
 #include "opt_ddb.h"
 #include "opt_execfmt.h"
@@ -625,8 +625,14 @@
                if ((type & T_USER) == 0 &&
                    ((l->l_addr->u_pcb.pcb_onfault == 0) || KDFAULT(code)))
                        map = kernel_map;
-               else
+               else {
                        map = vm ? &vm->vm_map : kernel_map;
+                       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;
+                       }
+               }
 
                if (WRFAULT(code))
                        ftype = VM_PROT_READ | VM_PROT_WRITE;
@@ -688,6 +694,7 @@
 #endif
                                return;
                        }
+                       l->l_flag &= ~L_SA_PAGEFAULT;
                        goto out;
                }
                if (type == T_MMUFLT) {
@@ -699,6 +706,7 @@
                               type, code);
                        goto dopanic;
                }
+               l->l_flag &= ~L_SA_PAGEFAULT;
                ucode = v;
                if (rv == ENOMEM) {
                        printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
diff -r 883af715bb6f -r 94636a24bb2d sys/arch/luna68k/luna68k/trap.c
--- a/sys/arch/luna68k/luna68k/trap.c   Wed Sep 17 22:06:50 2003 +0000
+++ b/sys/arch/luna68k/luna68k/trap.c   Wed Sep 17 23:17:39 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.23 2003/08/07 16:28:09 agc Exp $ */
+/* $NetBSD: trap.c,v 1.24 2003/09/17 23:17:43 cl Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -78,7 +78,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.23 2003/08/07 16:28:09 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.24 2003/09/17 23:17:43 cl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -562,8 +562,14 @@
                if ((type & T_USER) == 0 &&
                    ((l->l_addr->u_pcb.pcb_onfault == 0) || KDFAULT(code)))
                        map = kernel_map;
-               else
+               else {
                        map = vm ? &vm->vm_map : kernel_map;
+                       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;
+                       }
+               }
 
                if (WRFAULT(code))
                        ftype = VM_PROT_WRITE;
@@ -611,6 +617,7 @@
 #endif
                                return;
                        }
+                       l->l_flag &= ~L_SA_PAGEFAULT;
                        goto out;
                }
                if (type == T_MMUFLT) {
@@ -622,6 +629,7 @@
                               type, code);
                        goto dopanic;
                }
+               l->l_flag &= ~L_SA_PAGEFAULT;
                ucode = v;
                if (rv == ENOMEM) {
                        printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
diff -r 883af715bb6f -r 94636a24bb2d sys/arch/mac68k/mac68k/trap.c
--- a/sys/arch/mac68k/mac68k/trap.c     Wed Sep 17 22:06:50 2003 +0000
+++ b/sys/arch/mac68k/mac68k/trap.c     Wed Sep 17 23:17:39 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.104 2003/08/07 16:28:23 agc Exp $   */
+/*     $NetBSD: trap.c,v 1.105 2003/09/17 23:17:43 cl Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.104 2003/08/07 16:28:23 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.105 2003/09/17 23:17:43 cl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_execfmt.h"
@@ -614,8 +614,14 @@
                if (type == T_MMUFLT &&
                    (!l->l_addr->u_pcb.pcb_onfault || KDFAULT(code)))
                        map = kernel_map;
-               else
+               else {
                        map = vm ? &vm->vm_map : kernel_map;
+                       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;
+                       }
+               }
                if (WRFAULT(code))
                        ftype = VM_PROT_WRITE;
                else
@@ -659,6 +665,7 @@
 #endif
                                return;
                        }
+                       l->l_flag &= ~L_SA_PAGEFAULT;
                        goto out;
                }



Home | Main Index | Thread Index | Old Index