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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Nov 17 16:21:59 2011 +0100

cobalt: pull generic support for atomic ops

---

 include/asm-generic/atomic.h  |    6 +++---
 include/asm-generic/syscall.h |    4 ++--
 include/asm-nios2/atomic.h    |    7 +++----
 include/asm-powerpc/atomic.h  |    4 ++--
 include/asm-sh/atomic.h       |    4 ++--
 5 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
index 5ab1e70..fdbaba5 100644
--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -1,5 +1,5 @@
-#ifndef ATOMIC_H
-#define ATOMIC_H
+#ifndef _XENO_ASM_GENERIC_ATOMIC_H
+#define _XENO_ASM_GENERIC_ATOMIC_H
 
 #include <asm/xenomai/features.h>
 
@@ -82,4 +82,4 @@ typedef struct { unsigned long counter; } __xnarch_atomic_t;
 
 #endif /* !__KERNEL__ */
 
-#endif /* ATOMIC_H */
+#endif /* _XENO_ASM_GENERIC_ATOMIC_H */
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 23f91e2..b0f63ad 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -152,8 +152,8 @@ extern int nkerrptd;
 
 #define __xn_copy_from_user(dstP, srcP, n)     __copy_from_user_inatomic(dstP, 
srcP, n)
 #define __xn_copy_to_user(dstP, srcP, n)       __copy_to_user_inatomic(dstP, 
srcP, n)
-#define __xn_put_user(src, dstP)               __put_user(src, dstP)
-#define __xn_get_user(dst, srcP)               __get_user(dst, srcP)
+#define __xn_put_user(src, dstP)               __put_user_inatomic(src, dstP)
+#define __xn_get_user(dst, srcP)               __get_user_inatomic(dst, srcP)
 #define __xn_strncpy_from_user(dstP, srcP, n)  wrap_strncpy_from_user(dstP, 
srcP, n)
 
 static inline int __xn_safe_copy_from_user(void *dst, const void __user *src,
diff --git a/include/asm-nios2/atomic.h b/include/asm-nios2/atomic.h
index 3a975cd..d46ef70 100644
--- a/include/asm-nios2/atomic.h
+++ b/include/asm-nios2/atomic.h
@@ -21,6 +21,7 @@
 #define _XENO_ASM_NIOS2_ATOMIC_H
 
 #ifdef __KERNEL__
+
 #include <asm/irqflags.h>
 
 static inline void atomic_set_mask(unsigned long mask, unsigned long *addr)
@@ -32,10 +33,8 @@ static inline void atomic_set_mask(unsigned long mask, 
unsigned long *addr)
        local_irq_restore_hw(flags);
 }
 
-#else /* !__KERNEL__ */
-
-#define xnarch_memory_barrier()     __asm__ __volatile__("": : :"memory")
+#endif /* !__KERNEL__ */
 
-#endif /* __KERNEL__ */
+#include <asm-generic/xenomai/atomic.h>
 
 #endif /* !_XENO_ASM_NIOS2_ATOMIC_H */
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h
index 6b689e0..b8bf03c 100644
--- a/include/asm-powerpc/atomic.h
+++ b/include/asm-powerpc/atomic.h
@@ -23,8 +23,6 @@
 #ifndef _XENO_ASM_POWERPC_ATOMIC_H
 #define _XENO_ASM_POWERPC_ATOMIC_H
 
-typedef unsigned long atomic_flags_t;
-
 #ifdef __KERNEL__
 
 #ifdef CONFIG_PPC64
@@ -65,4 +63,6 @@ void atomic_clear_mask(unsigned long mask, unsigned long 
*ptr);
 
 #endif /* __KERNEL__ */
 
+#include <asm-generic/xenomai/atomic.h>
+
 #endif /* !_XENO_ASM_POWERPC_ATOMIC_H */
diff --git a/include/asm-sh/atomic.h b/include/asm-sh/atomic.h
index a3cb35b..feaaf14 100644
--- a/include/asm-sh/atomic.h
+++ b/include/asm-sh/atomic.h
@@ -67,8 +67,8 @@ static inline unsigned long long load_u64(volatile void *p)
        return ((unsigned long long)u.e.high << 32) | u.e.low;
 }
 
-#define xnarch_memory_barrier()     __asm__ __volatile__("": : :"memory")
+#endif /* !__KERNEL__ */
 
-#endif /* __KERNEL__ */
+#include <asm-generic/xenomai/atomic.h>
 
 #endif /* !_XENO_ASM_SH_ATOMIC_H */


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

Reply via email to