Module: xenomai-3
Branch: next
Commit: e9f50225e93ebb2439f35ec966b6a758b30a1119
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e9f50225e93ebb2439f35ec966b6a758b30a1119

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sat Nov 14 18:07:15 2015 +0100

cobalt/sched: detect preemptible switch support in pipeline

CONFIG_XENO_ARCH_UNLOCKED_SWITCH is merely an alias for
CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH, which is only meaningful to the
ARM architecture, now that PowerPC dropped such support.

Use the pipeline symbol directly to make the dependency explicit.

---

 include/cobalt/kernel/sched.h |    8 ++++----
 kernel/cobalt/sched.c         |   16 ++++++++--------
 kernel/cobalt/thread.c        |    2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h
index fe1df7d..d5d93c2 100644
--- a/include/cobalt/kernel/sched.h
+++ b/include/cobalt/kernel/sched.h
@@ -93,7 +93,7 @@ struct xnsched {
        struct xntimer rrbtimer;
        /*!< Root thread control block. */
        struct xnthread rootcb;
-#ifdef CONFIG_XENO_ARCH_UNLOCKED_SWITCH
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
        struct xnthread *last;
 #endif
 #ifdef CONFIG_XENO_ARCH_FPU
@@ -329,7 +329,7 @@ static inline int xnsched_primary_p(void)
        return !xnsched_unblockable_p();
 }
 
-#ifdef CONFIG_XENO_ARCH_UNLOCKED_SWITCH
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
 
 struct xnsched *xnsched_finish_unlocked_switch(struct xnsched *sched);
 
@@ -341,7 +341,7 @@ int xnsched_maybe_resched_after_unlocked_switch(struct 
xnsched *sched)
        return sched->status & XNRESCHED;
 }
 
-#else /* !CONFIG_XENO_ARCH_UNLOCKED_SWITCH */
+#else /* !CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH */
 
 static inline struct xnsched *
 xnsched_finish_unlocked_switch(struct xnsched *sched)
@@ -358,7 +358,7 @@ xnsched_maybe_resched_after_unlocked_switch(struct xnsched 
*sched)
        return 0;
 }
 
-#endif /* !CONFIG_XENO_ARCH_UNLOCKED_SWITCH */
+#endif /* !CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH */
 
 #ifdef CONFIG_XENO_OPT_WATCHDOG
 static inline void xnsched_reset_watchdog(struct xnsched *sched)
diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c
index 29d8a68..d124f79 100644
--- a/kernel/cobalt/sched.c
+++ b/kernel/cobalt/sched.c
@@ -293,7 +293,7 @@ struct xnthread *xnsched_pick_next(struct xnsched *sched)
 #endif /* CONFIG_XENO_OPT_SCHED_CLASSES */
 }
 
-#ifdef CONFIG_XENO_ARCH_UNLOCKED_SWITCH
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
 
 struct xnsched *xnsched_finish_unlocked_switch(struct xnsched *sched)
 {
@@ -319,7 +319,7 @@ struct xnsched *xnsched_finish_unlocked_switch(struct 
xnsched *sched)
        return sched;
 }
 
-#endif /* CONFIG_XENO_ARCH_UNLOCKED_SWITCH */
+#endif /* CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH */
 
 void xnsched_lock(void)
 {
@@ -494,16 +494,16 @@ void xnsched_migrate(struct xnthread *thread, struct 
xnsched *sched)
        xnsched_set_resched(thread->sched);
        migrate_thread(thread, sched);
 
-#ifdef CONFIG_XENO_ARCH_UNLOCKED_SWITCH
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
        /*
         * Mark the thread in flight, xnsched_finish_unlocked_switch()
         * will put the thread on the remote runqueue.
         */
        xnthread_set_state(thread, XNMIGRATE);
-#else /* !CONFIG_XENO_ARCH_UNLOCKED_SWITCH */
+#else
        /* Move thread to the remote runnable queue. */
        xnsched_putback(thread);
-#endif /* !CONFIG_XENO_ARCH_UNLOCKED_SWITCH */
+#endif
 }
 
 /*
@@ -709,11 +709,11 @@ struct xnthread *xnsched_rt_pick(struct xnsched *sched)
 static inline void switch_context(struct xnsched *sched,
                                  struct xnthread *prev, struct xnthread *next)
 {
-#ifdef CONFIG_XENO_ARCH_UNLOCKED_SWITCH
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
        sched->last = prev;
        sched->status |= XNINSW;
        xnlock_clear_irqon(&nklock);
-#endif /* !CONFIG_XENO_ARCH_UNLOCKED_SWITCH */
+#endif
 
        xnarch_switch_to(prev, next);
 }
@@ -788,7 +788,7 @@ static inline void enter_root(struct xnthread *root)
 {
        struct xnarchtcb *rootcb __maybe_unused = xnthread_archtcb(root);
 
-#ifdef CONFIG_XENO_ARCH_UNLOCKED_SWITCH
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
        if (rootcb->core.mm == NULL)
                set_ti_thread_flag(rootcb->core.tip, TIF_MMSWITCH_INT);
 #endif
diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index f134890..3d5d588 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -409,7 +409,7 @@ EXPORT_SYMBOL_GPL(xnthread_prepare_wait);
 static inline int moving_target(struct xnsched *sched, struct xnthread *thread)
 {
        int ret = 0;
-#ifdef CONFIG_XENO_ARCH_UNLOCKED_SWITCH
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
        /*
         * When deleting a thread in the course of a context switch or
         * in flight to another CPU with nklock unlocked on a distant


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to