diff options
Diffstat (limited to 'include/asm-alpha')
-rw-r--r-- | include/asm-alpha/system.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index fd9dc889f36c..ed221d6408fc 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h | |||
@@ -681,13 +681,18 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
681 | return old; | 681 | return old; |
682 | } | 682 | } |
683 | 683 | ||
684 | #define cmpxchg(ptr,o,n) \ | 684 | #define cmpxchg(ptr, o, n) \ |
685 | ({ \ | 685 | ({ \ |
686 | __typeof__(*(ptr)) _o_ = (o); \ | 686 | __typeof__(*(ptr)) _o_ = (o); \ |
687 | __typeof__(*(ptr)) _n_ = (n); \ | 687 | __typeof__(*(ptr)) _n_ = (n); \ |
688 | (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ | 688 | (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ |
689 | (unsigned long)_n_, sizeof(*(ptr))); \ | 689 | (unsigned long)_n_, sizeof(*(ptr))); \ |
690 | }) | 690 | }) |
691 | #define cmpxchg64(ptr, o, n) \ | ||
692 | ({ \ | ||
693 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ | ||
694 | cmpxchg((ptr), (o), (n)); \ | ||
695 | }) | ||
691 | 696 | ||
692 | static inline unsigned long | 697 | static inline unsigned long |
693 | __cmpxchg_u8_local(volatile char *m, long old, long new) | 698 | __cmpxchg_u8_local(volatile char *m, long old, long new) |
@@ -803,13 +808,19 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new, | |||
803 | return old; | 808 | return old; |
804 | } | 809 | } |
805 | 810 | ||
806 | #define cmpxchg_local(ptr,o,n) \ | 811 | #define cmpxchg_local(ptr, o, n) \ |
807 | ({ \ | 812 | ({ \ |
808 | __typeof__(*(ptr)) _o_ = (o); \ | 813 | __typeof__(*(ptr)) _o_ = (o); \ |
809 | __typeof__(*(ptr)) _n_ = (n); \ | 814 | __typeof__(*(ptr)) _n_ = (n); \ |
810 | (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \ | 815 | (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \ |
811 | (unsigned long)_n_, sizeof(*(ptr))); \ | 816 | (unsigned long)_n_, sizeof(*(ptr))); \ |
812 | }) | 817 | }) |
818 | #define cmpxchg64_local(ptr, o, n) \ | ||
819 | ({ \ | ||
820 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ | ||
821 | cmpxchg_local((ptr), (o), (n)); \ | ||
822 | }) | ||
823 | |||
813 | 824 | ||
814 | #endif /* __ASSEMBLY__ */ | 825 | #endif /* __ASSEMBLY__ */ |
815 | 826 | ||