Module Name: src
Committed By: matt
Date: Wed Apr 15 21:26:48 UTC 2015
Modified Files:
src/sys/arch/arm/arm: arm_machdep.c
src/sys/arch/arm/include: cpu.h
Log Message:
Make setsoftast take a cpu_info *
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/arm/arm_machdep.c
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/arm/include/cpu.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/arm/arm_machdep.c
diff -u src/sys/arch/arm/arm/arm_machdep.c:1.46 src/sys/arch/arm/arm/arm_machdep.c:1.47
--- src/sys/arch/arm/arm/arm_machdep.c:1.46 Wed Apr 8 18:10:08 2015
+++ src/sys/arch/arm/arm/arm_machdep.c Wed Apr 15 21:26:48 2015
@@ -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 @@ cpu_need_resched(struct cpu_info *ci, in
#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 */
}
Index: src/sys/arch/arm/include/cpu.h
diff -u src/sys/arch/arm/include/cpu.h:1.89 src/sys/arch/arm/include/cpu.h:1.90
--- src/sys/arch/arm/include/cpu.h:1.89 Tue Apr 14 22:36:54 2015
+++ src/sys/arch/arm/include/cpu.h Wed Apr 15 21:26:47 2015
@@ -283,10 +283,9 @@ void cpu_proc_fork(struct proc *, struct
*/
#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 @@ void cpu_proc_fork(struct proc *, struct
* 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);