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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Nov  4 19:32:59 2014 +0100

cobalt/kernel: fixups for kernel 3.16

---

 kernel/cobalt/apc.c                                  |    2 +-
 kernel/cobalt/include/asm-generic/xenomai/wrappers.h |    5 +++++
 kernel/cobalt/posix/clock.c                          |    2 +-
 kernel/cobalt/posix/process.c                        |    8 ++++----
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/kernel/cobalt/apc.c b/kernel/cobalt/apc.c
index 0956dbc..a3714da 100644
--- a/kernel/cobalt/apc.c
+++ b/kernel/cobalt/apc.c
@@ -153,7 +153,7 @@ void xnapc_free(int apc)
 {
        BUG_ON(apc < 0 || apc >= BITS_PER_LONG);
        clear_bit(apc, &xnarch_machdata.apc_map);
-       smp_mb__after_clear_bit();
+       smp_mb__after_atomic();
 }
 EXPORT_SYMBOL_GPL(xnapc_free);
 
diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h 
b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
index ccebb48..efba9b0 100644
--- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
+++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
@@ -48,4 +48,9 @@
 #define get_current_uuid() from_kuid_munged(current_user_ns(), current_uid())
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)
+#define smp_mb__before_atomic()  smp_mb()
+#define smp_mb__after_atomic()   smp_mb()
+#endif
+
 #endif /* _COBALT_ASM_GENERIC_WRAPPERS_H */
diff --git a/kernel/cobalt/posix/clock.c b/kernel/cobalt/posix/clock.c
index 48de8e8..8c0f9c9 100644
--- a/kernel/cobalt/posix/clock.c
+++ b/kernel/cobalt/posix/clock.c
@@ -344,7 +344,7 @@ void cobalt_clock_deregister(struct xnclock *clock)
 {
        trace_cobalt_clock_deregister(clock->name, clock->id);
        clear_bit(clock->id, cobalt_clock_extids);
-       smp_mb__after_clear_bit();
+       smp_mb__after_atomic();
        external_clocks[clock->id] = NULL;
        xnclock_deregister(clock);
 }
diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c
index 46e2f66..39f4e26 100644
--- a/kernel/cobalt/posix/process.c
+++ b/kernel/cobalt/posix/process.c
@@ -976,17 +976,17 @@ static inline void init_hostrt(void) { }
 
 static inline void lock_timers(void)
 {
-       smp_mb__before_atomic_inc();
+       smp_mb__before_atomic();
        atomic_inc(&nkclklk);
-       smp_mb__after_atomic_inc();
+       smp_mb__after_atomic();
 }
 
 static inline void unlock_timers(void)
 {
        XENO_BUGON(COBALT, atomic_read(&nkclklk) == 0);
-       smp_mb__before_atomic_dec();
+       smp_mb__before_atomic();
        atomic_dec(&nkclklk);
-       smp_mb__after_atomic_dec();
+       smp_mb__after_atomic();
 }
 
 static int handle_taskexit_event(struct task_struct *p) /* p == current */


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

Reply via email to