Module: xenomai-jki
Branch: for-forge
Commit: d8539198106d3e82598a27f80a6bab4e7a8bf6be
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=d8539198106d3e82598a27f80a6bab4e7a8bf6be

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Fri Jul  3 08:02:37 2015 +0200

cobalt/kernel: Replace xnsched_lock with __xnsched_lock

There is no need for a nklock-taking variant of xnsched_lock anymore.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

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

diff --git a/include/cobalt/kernel/rtdm/driver.h 
b/include/cobalt/kernel/rtdm/driver.h
index 5fd3199..ced2a52 100644
--- a/include/cobalt/kernel/rtdm/driver.h
+++ b/include/cobalt/kernel/rtdm/driver.h
@@ -436,7 +436,7 @@ void rtdm_toseq_init(rtdm_toseq_t *timeout_seq, 
nanosecs_rel_t timeout);
 #define cobalt_atomic_enter(context)                   \
        do {                                            \
                xnlock_get_irqsave(&nklock, (context)); \
-               __xnsched_lock();                       \
+               xnsched_lock();                         \
        } while (0)
 
 /**
@@ -502,7 +502,7 @@ rtdm_execute_atomically(void) { }
                                                        \
        rtdm_execute_atomically();                      \
        xnlock_get_irqsave(&nklock, __rtdm_s);          \
-       __xnsched_lock();                               \
+       xnsched_lock();                                 \
        code_block;                                     \
        __xnsched_unlock();                             \
        xnlock_put_irqrestore(&nklock, __rtdm_s);       \
@@ -553,7 +553,7 @@ static inline void rtdm_lock_get(rtdm_lock_t *lock)
 {
        XENO_BUG_ON(COBALT, !spltest());
        spin_lock(lock);
-       __xnsched_lock();
+       xnsched_lock();
 }
 
 /**
@@ -584,7 +584,7 @@ static inline rtdm_lockctx_t 
__rtdm_lock_get_irqsave(rtdm_lock_t *lock)
 
        context = ipipe_test_and_stall_head();
        spin_lock(lock);
-       __xnsched_lock();
+       xnsched_lock();
 
        return context;
 }
diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h
index ca0f732..c39c820 100644
--- a/include/cobalt/kernel/sched.h
+++ b/include/cobalt/kernel/sched.h
@@ -306,7 +306,7 @@ void ___xnsched_unlock(struct xnsched *sched);
 
 void ___xnsched_unlock_fully(struct xnsched *sched);
 
-static inline void __xnsched_lock(void)
+static inline void xnsched_lock(void)
 {
        struct xnsched *sched;
 
@@ -333,17 +333,6 @@ static inline void __xnsched_unlock_fully(void)
        ___xnsched_unlock_fully(sched);
 }
 
-static inline void xnsched_lock(void)
-{
-       struct xnsched *sched;
-       spl_t s;
-
-       xnlock_get_irqsave(&nklock, s);
-       sched = xnsched_current();
-       ___xnsched_lock(sched);
-       xnlock_put_irqrestore(&nklock, s);
-}
-
 static inline void xnsched_unlock(void)
 {
        struct xnsched *sched;
diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index cb3df39..b1c3733 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -754,7 +754,7 @@ int xnthread_set_mode(int clrmask, int setmask)
 
        if (setmask & XNLOCK) {
                if (lock_count == 0)
-                       __xnsched_lock();
+                       xnsched_lock();
        } else if (clrmask & XNLOCK) {
                if (lock_count > 0)
                        __xnsched_unlock_fully();


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

Reply via email to