Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Make setsoftast take a cpu_info *



details:   https://anonhg.NetBSD.org/src/rev/3e3573d23b94
branches:  trunk
changeset: 337473:3e3573d23b94
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Apr 15 21:26:47 2015 +0000

description:
Make setsoftast take a cpu_info *

diffstat:

 sys/arch/arm/arm/arm_machdep.c |  15 +++++++--------
 sys/arch/arm/include/cpu.h     |  10 +++++-----
 2 files changed, 12 insertions(+), 13 deletions(-)

diffs (76 lines):

diff -r 0e6b361a3831 -r 3e3573d23b94 sys/arch/arm/arm/arm_machdep.c
--- a/sys/arch/arm/arm/arm_machdep.c    Wed Apr 15 19:13:46 2015 +0000
+++ b/sys/arch/arm/arm/arm_machdep.c    Wed Apr 15 21:26:47 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm_machdep.c,v 1.46 2015/04/08 18:10:08 matt Exp $    */
+/*     $NetBSD: arm_machdep.c,v 1.47 2015/04/15 21:26:48 matt Exp $    */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.46 2015/04/08 18:10:08 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.47 2015/04/15 21:26:48 matt Exp $");
 
 #include <sys/exec.h>
 #include <sys/proc.h>
@@ -274,18 +274,17 @@
 #endif /* __HAVE_PREEMPTION */
                return;
        }
-#ifdef __HAVE_PREEMPTION
-       atomic_or_uint(&ci->ci_astpending, __BIT(0));
-#else
-       ci->ci_astpending = __BIT(0);
-#endif
 #ifdef MULTIPROCESSOR
-       if (ci == curcpu() || !immed)
+       if (ci == cur_ci || !immed) {
+               setsoftast(ci);
                return;
+       }
        ipi = IPI_AST;
 
    send_ipi:
        intr_ipi_send(ci->ci_kcpuset, ipi);
+#else
+       setsoftast(ci);
 #endif /* MULTIPROCESSOR */
 }
 
diff -r 0e6b361a3831 -r 3e3573d23b94 sys/arch/arm/include/cpu.h
--- a/sys/arch/arm/include/cpu.h        Wed Apr 15 19:13:46 2015 +0000
+++ b/sys/arch/arm/include/cpu.h        Wed Apr 15 21:26:47 2015 +0000
@@ -283,10 +283,9 @@
  */
 
 #ifdef __HAVE_PREEMPTION
-#define setsoftast()           atomic_or_uint(&curcpu()->ci_astpending, \
-                                   __BIT(0))
+#define setsoftast(ci)         atomic_or_uint(&(ci)->ci_astpending, __BIT(0))
 #else
-#define setsoftast()           (curcpu()->ci_astpending = __BIT(0))
+#define setsoftast(ci)         ((ci)->ci_astpending = __BIT(0))
 #endif
 
 /*
@@ -294,14 +293,15 @@
  * process as soon as possible.
  */
 
-#define cpu_signotify(l)               setsoftast()
+#define cpu_signotify(l)               setsoftast((l)->l_cpu)
 
 /*
  * Give a profiling tick to the current process when the user profiling
  * buffer pages are invalid.  On the i386, request an ast to send us
  * through trap(), marking the proc as needing a profiling tick.
  */
-#define        cpu_need_proftick(l)    ((l)->l_pflag |= LP_OWEUPC, setsoftast())
+#define        cpu_need_proftick(l)    ((l)->l_pflag |= LP_OWEUPC, \
+                                setsoftast((l)->l_cpu))
 
 /* for preeemption. */
 void   cpu_set_curpri(int);



Home | Main Index | Thread Index | Old Index