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_astpending to struct mdlwp and use it.



details:   https://anonhg.NetBSD.org/src/rev/8fcf9648b619
branches:  trunk
changeset: 753598:8fcf9648b619
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Apr 03 07:46:01 2010 +0000

description:
Add md_astpending to struct mdlwp and use it.

diffstat:

 sys/arch/hp700/include/cpu.h      |   6 +++---
 sys/arch/hp700/include/intr.h     |   7 ++-----
 sys/arch/hppa/hppa/hppa_machdep.c |  11 +++++++----
 sys/arch/hppa/hppa/trap.c         |  15 +++++++--------
 sys/arch/hppa/hppa/vm_machdep.c   |   5 +++--
 sys/arch/hppa/include/proc.h      |   5 +++--
 6 files changed, 25 insertions(+), 24 deletions(-)

diffs (177 lines):

diff -r ccebbee09181 -r 8fcf9648b619 sys/arch/hp700/include/cpu.h
--- a/sys/arch/hp700/include/cpu.h      Sat Apr 03 02:08:30 2010 +0000
+++ b/sys/arch/hp700/include/cpu.h      Sat Apr 03 07:46:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.43 2010/04/02 19:33:16 skrll Exp $   */
+/*     $NetBSD: cpu.h,v 1.44 2010/04/03 07:46:01 skrll Exp $   */
 
 /*     $OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $       */
 
@@ -216,8 +216,8 @@
 #define        CLKF_INTR(framep)       ((framep)->cf_flags & TFF_INTR)
 #define        CLKF_USERMODE(framep)   ((framep)->cf_flags & T_USER)
 
-#define        cpu_signotify(l)        (setsoftast())
-#define        cpu_need_proftick(l)    ((l)->l_pflag |= LP_OWEUPC, setsoftast())
+#define        cpu_signotify(l)        (setsoftast(l))
+#define        cpu_need_proftick(l)    ((l)->l_pflag |= LP_OWEUPC, setsoftast(l))
 
 #include <sys/cpu_data.h>
 struct cpu_info {
diff -r ccebbee09181 -r 8fcf9648b619 sys/arch/hp700/include/intr.h
--- a/sys/arch/hp700/include/intr.h     Sat Apr 03 02:08:30 2010 +0000
+++ b/sys/arch/hp700/include/intr.h     Sat Apr 03 07:46:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.16 2010/03/31 12:56:14 skrll Exp $  */
+/*     $NetBSD: intr.h,v 1.17 2010/04/03 07:46:01 skrll Exp $  */
 /*     $OpenBSD: intr.h,v 1.26 2009/12/29 13:11:40 jsing Exp $ */
 
 /*-
@@ -57,9 +57,6 @@
 /* The priority level masks. */
 extern int imask[NIPL];
 
-/* The asynchronous system trap flag. */
-extern volatile int astpending;
-
 /* splraise()/spllower() are in locore.S */
 int splraise(int);
 void spllower(int);
@@ -91,7 +88,7 @@
 
 #include <sys/spl.h>
 
-#define        setsoftast()    (astpending = 1)
+#define        setsoftast(l)   ((l)->l_md.md_astpending = 1)
 #define        setsoftnet()    hp700_intr_schedule(softnetmask)
 
 void   hp700_intr_schedule(int);
diff -r ccebbee09181 -r 8fcf9648b619 sys/arch/hppa/hppa/hppa_machdep.c
--- a/sys/arch/hppa/hppa/hppa_machdep.c Sat Apr 03 02:08:30 2010 +0000
+++ b/sys/arch/hppa/hppa/hppa_machdep.c Sat Apr 03 07:46:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hppa_machdep.c,v 1.20 2010/03/16 16:20:19 skrll Exp $  */
+/*     $NetBSD: hppa_machdep.c,v 1.21 2010/04/03 07:46:02 skrll Exp $  */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.20 2010/03/16 16:20:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.21 2010/04/03 07:46:02 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -351,6 +351,10 @@
        }
 }
 
+/*
+ * Preempt the current LWP if in interrupt from user mode,
+ * or after the current trap/syscall if in system mode.
+ */
 void
 cpu_need_resched(struct cpu_info *ci, int flags)
 {
@@ -359,8 +363,7 @@
        if (ci->ci_want_resched && !immed)
                return;
        ci->ci_want_resched = 1;
-       /* setsoftast(ci->ci_data.cpu_onproc); */
-       setsoftast();
+       setsoftast(ci->ci_data.cpu_onproc);
 
 #ifdef MULTIPROCESSOR
        if (ci->ci_curlwp != ci->ci_data.cpu_idlelwp) {
diff -r ccebbee09181 -r 8fcf9648b619 sys/arch/hppa/hppa/trap.c
--- a/sys/arch/hppa/hppa/trap.c Sat Apr 03 02:08:30 2010 +0000
+++ b/sys/arch/hppa/hppa/trap.c Sat Apr 03 07:46:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.85 2010/03/31 12:56:14 skrll Exp $  */
+/*     $NetBSD: trap.c,v 1.86 2010/04/03 07:46:02 skrll Exp $  */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.85 2010/03/31 12:56:14 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.86 2010/04/03 07:46:02 skrll Exp $");
 
 /* #define INTRDEBUG */
 /* #define TRAPDEBUG */
@@ -174,8 +174,6 @@
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
-volatile int astpending;
-
 void pmap_hptdump(void);
 void syscall(struct trapframe *, int *);
 
@@ -205,11 +203,12 @@
 {
        struct proc *p = l->l_proc;
 
-       if (astpending) {
-               astpending = 0;
-               if (curcpu()->ci_want_resched) {
+       if (l->l_md.md_astpending) {
+               l->l_md.md_astpending = 0;
+               uvmexp.softs++;
+
+               if (curcpu()->ci_want_resched)
                        preempt();
-               }
        }
 
        mi_userret(l);
diff -r ccebbee09181 -r 8fcf9648b619 sys/arch/hppa/hppa/vm_machdep.c
--- a/sys/arch/hppa/hppa/vm_machdep.c   Sat Apr 03 02:08:30 2010 +0000
+++ b/sys/arch/hppa/hppa/vm_machdep.c   Sat Apr 03 07:46:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.43 2010/04/01 12:09:39 skrll Exp $    */
+/*     $NetBSD: vm_machdep.c,v 1.44 2010/04/03 07:46:02 skrll Exp $    */
 
 /*     $OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $    */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.43 2010/04/01 12:09:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.44 2010/04/03 07:46:02 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -93,6 +93,7 @@
        pcb1 = lwp_getpcb(l1);
        pcb2 = lwp_getpcb(l2);
 
+       l2->l_md.md_astpending = 0;
        l2->l_md.md_flags = 0;
 
        /* Flush the parent LWP out of the FPU. */
diff -r ccebbee09181 -r 8fcf9648b619 sys/arch/hppa/include/proc.h
--- a/sys/arch/hppa/include/proc.h      Sat Apr 03 02:08:30 2010 +0000
+++ b/sys/arch/hppa/include/proc.h      Sat Apr 03 07:46:01 2010 +0000
@@ -1,6 +1,6 @@
-/*     $NetBSD: proc.h,v 1.9 2010/03/31 06:40:30 skrll Exp $   */
+/*     $NetBSD: proc.h,v 1.10 2010/04/03 07:46:02 skrll Exp $  */
 
-/*     $OpenBSD: proc.h,v 1.1 1998/07/07 21:32:44 mickey Exp $ */
+/*     $OpenBSD: proc.h,v 1.4 2009/12/29 13:11:40 jsing Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -43,6 +43,7 @@
  */
 struct mdlwp {
        struct          trapframe *md_regs;     /* registers on current frame */
+       volatile int    md_astpending;          /* AST pending for this LWP */
        int             md_flags;               /* machine-dependent flags */
 
        vaddr_t         md_bpva;



Home | Main Index | Thread Index | Old Index