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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Oct 10 11:59:56 2010 +0200

nucleus: move XNSWREP to the information bits

---

 include/nucleus/thread.h |    2 +-
 ksrc/nucleus/synch.c     |    9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/nucleus/thread.h b/include/nucleus/thread.h
index 5fc913a..0b13309 100644
--- a/include/nucleus/thread.h
+++ b/include/nucleus/thread.h
@@ -62,7 +62,6 @@
 #define XNFPU     0x00100000 /**< Thread uses FPU */
 #define XNSHADOW  0x00200000 /**< Shadow thread */
 #define XNROOT    0x00400000 /**< Root thread (that is, Linux/IDLE) */
-#define XNSWREP   0x00800000 /**< Mode switch already reported */
 
 /*! @} */ /* Ends doxygen comment group: nucleus_state_flags */
 
@@ -117,6 +116,7 @@
 #define XNABORT   0x00000200 /**< Thread is being aborted */
 #define XNCANPND  0x00000400 /**< Cancellation request is pending */
 #define XNAMOK    0x00000800 /**< Runaway, watchdog signal pending (shadow 
only) */
+#define XNSWREP   0x00001000 /**< Mode switch already reported */
 
 /* These information flags are available to the real-time interfaces */
 #define XNTHREAD_INFO_SPARE0  0x10000000
diff --git a/ksrc/nucleus/synch.c b/ksrc/nucleus/synch.c
index 7299405..03f0952 100644
--- a/ksrc/nucleus/synch.c
+++ b/ksrc/nucleus/synch.c
@@ -985,13 +985,14 @@ EXPORT_SYMBOL_GPL(xnsynch_release_all_ownerships);
  */
 void xnsynch_detect_relaxed_owner(struct xnsynch *synch, struct xnthread 
*sleeper)
 {
-       if (xnthread_test_state(sleeper, XNTRAPSW|XNSWREP) == XNTRAPSW &&
+       if (xnthread_test_state(sleeper, XNTRAPSW) &&
+           xnthread_test_info(sleeper, XNSWREP) &&
            xnthread_test_state(synch->owner, XNRELAX)) {
-               xnthread_set_state(sleeper, XNSWREP);
+               xnthread_set_info(sleeper, XNSWREP);
                xnshadow_send_sig(sleeper, SIGDEBUG,
                                  SIGDEBUG_MIGRATE_PRIOINV, 1);
        } else
-               xnthread_clear_state(sleeper,  XNSWREP);
+               xnthread_clear_info(sleeper,  XNSWREP);
 }
 
 /*
@@ -1015,7 +1016,7 @@ void xnsynch_detect_claimed_relax(struct xnthread *owner)
                     ht = nextpq(&synch->pendq, ht)) {
                        sleeper = link2thread(ht, plink);
                        if (xnthread_test_state(sleeper, XNTRAPSW)) {
-                               xnthread_set_state(sleeper, XNSWREP);
+                               xnthread_set_info(sleeper, XNSWREP);
                                xnshadow_send_sig(sleeper, SIGDEBUG,
                                                  SIGDEBUG_MIGRATE_PRIOINV, 1);
                        }


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

Reply via email to