Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309598
b: refs/heads/master
c: 6b894a4
h: refs/heads/master
v: v3
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed May 30, 2012
1 parent cecc5bb commit 70edf64
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0c44ca71f59447a5e602c45728829d1cb6a1b4b5
refs/heads/master: 6b894a409e8c0fcbd0ea30f5b013e33b9c4b28a1
34 changes: 25 additions & 9 deletions trunk/arch/s390/include/asm/cmpxchg.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,14 @@ static inline unsigned long __cmpxchg(void *ptr, unsigned long old,
return old;
}

#define cmpxchg(ptr, o, n) \
((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
(unsigned long)(n), sizeof(*(ptr))))
#define cmpxchg(ptr, o, n) \
({ \
__typeof__(*(ptr)) __ret; \
__ret = (__typeof__(*(ptr))) \
__cmpxchg((ptr), (unsigned long)(o), (unsigned long)(n), \
sizeof(*(ptr))); \
__ret; \
})

#ifdef CONFIG_64BIT
#define cmpxchg64(ptr, o, n) \
Expand All @@ -184,10 +189,16 @@ static inline unsigned long long __cmpxchg64(void *ptr,
: "memory", "cc");
return rp_old.pair;
}
#define cmpxchg64(ptr, o, n) \
((__typeof__(*(ptr)))__cmpxchg64((ptr), \
(unsigned long long)(o), \
(unsigned long long)(n)))

#define cmpxchg64(ptr, o, n) \
({ \
__typeof__(*(ptr)) __ret; \
__ret = (__typeof__(*(ptr))) \
__cmpxchg64((ptr), \
(unsigned long long)(o), \
(unsigned long long)(n)); \
__ret; \
})
#endif /* CONFIG_64BIT */

#include <asm-generic/cmpxchg-local.h>
Expand Down Expand Up @@ -216,8 +227,13 @@ static inline unsigned long __cmpxchg_local(void *ptr,
* them available.
*/
#define cmpxchg_local(ptr, o, n) \
((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
(unsigned long)(n), sizeof(*(ptr))))
({ \
__typeof__(*(ptr)) __ret; \
__ret = (__typeof__(*(ptr))) \
__cmpxchg_local((ptr), (unsigned long)(o), \
(unsigned long)(n), sizeof(*(ptr))); \
__ret; \
})

#define cmpxchg64_local(ptr, o, n) cmpxchg64((ptr), (o), (n))

Expand Down

0 comments on commit 70edf64

Please sign in to comment.