Module Name: src
Committed By: matt
Date: Wed Apr 8 18:10:44 UTC 2015
Modified Files:
src/sys/arch/arm/include: cpu.h
Log Message:
Add basic support for __HAVE_PREEMPTION.
Use atomic ops for ci_astpending if __HAVE_PREEMPTION is defined.
To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 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/include/cpu.h
diff -u src/sys/arch/arm/include/cpu.h:1.86 src/sys/arch/arm/include/cpu.h:1.87
--- src/sys/arch/arm/include/cpu.h:1.86 Wed Apr 8 07:29:44 2015
+++ src/sys/arch/arm/include/cpu.h Wed Apr 8 18:10:44 2015
@@ -137,6 +137,7 @@ static inline void cpu_dosoftints(void);
#ifdef _KMEMUSER
#include <sys/intr.h>
#endif
+#include <sys/atomic.h>
#include <sys/cpu_data.h>
#include <sys/device_if.h>
#include <sys/evcnt.h>
@@ -150,7 +151,7 @@ struct cpu_info {
uint32_t ci_arm_cpurev; /* CPU revision */
uint32_t ci_ctrl; /* The CPU control register */
int ci_cpl; /* current processor level (spl) */
- int ci_astpending; /* */
+ volatile int ci_astpending; /* */
int ci_want_resched; /* resched() was called */
int ci_intr_depth; /* */
struct cpu_softc *ci_softc; /* platform softc */
@@ -276,7 +277,12 @@ void cpu_proc_fork(struct proc *, struct
* Scheduling glue
*/
-#define setsoftast() (curcpu()->ci_astpending = 1)
+#ifdef __HAVE_PREEMPTION
+#define setsoftast() atomic_or_uint(&curcpu()->ci_astpending, \
+ __BIT(0))
+#else
+#define setsoftast() (curcpu()->ci_astpending = __BIT(0))
+#endif
/*
* Notify the current process (p) that it has a signal pending,
@@ -292,6 +298,9 @@ void cpu_proc_fork(struct proc *, struct
*/
#define cpu_need_proftick(l) ((l)->l_pflag |= LP_OWEUPC, setsoftast())
+/* for preeemption. */
+void cpu_set_curpri(int);
+
/*
* We've already preallocated the stack for the idlelwps for additional CPUs.
* This hook allows to return them.