Module: xenomai-head
Branch: master
Commit: e63388656f626c8dc2c2b6e2fb276f7a6ac41b00
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=e63388656f626c8dc2c2b6e2fb276f7a6ac41b00

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Aug 11 16:25:27 2009 +0200

nucleus: rework sanity check to allow for unlocked switching

---

 include/nucleus/sched.h |    8 ++++++--
 ksrc/nucleus/shadow.c   |    2 --
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/nucleus/sched.h b/include/nucleus/sched.h
index 125a49c..15dd42b 100644
--- a/include/nucleus/sched.h
+++ b/include/nucleus/sched.h
@@ -210,9 +210,13 @@ struct xnsched *xnsched_finish_unlocked_switch(struct 
xnsched *sched);
 #else /* !CONFIG_XENO_HW_UNLOCKED_SWITCH */
 
 #ifdef CONFIG_SMP
-#define xnsched_finish_unlocked_switch(__sched__)      xnpod_current_sched()
+#define xnsched_finish_unlocked_switch(__sched__)      \
+       ({ XENO_BUGON(NUCLEUS, !irqs_disabled_hw());    \
+               xnpod_current_sched(); })
 #else /* !CONFIG_SMP */
-#define xnsched_finish_unlocked_switch(__sched__)      (__sched__)
+#define xnsched_finish_unlocked_switch(__sched__)      \
+       ({ XENO_BUGON(NUCLEUS, !irqs_disabled_hw());    \
+               (__sched__); })
 #endif /* !CONFIG_SMP */
 
 #define xnsched_resched_after_unlocked_switch()                do { } while(0)
diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index 01268a5..ee59923 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -967,8 +967,6 @@ redo:
                return -ERESTARTSYS;
        }
 
-       XENO_BUGON(NUCLEUS, !irqs_disabled_hw());
-
        /* "current" is now running into the Xenomai domain. */
        sched = xnsched_finish_unlocked_switch(thread->sched);
 


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

Reply via email to