diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 14:17:06 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 14:17:06 -0400 |
| commit | db08bf0877f3464fb0c2c37dcdd9f9683192ea26 (patch) | |
| tree | c9d47587ac07cb1622156899414c78f097fcb0c9 /include/asm-generic/system.h | |
| parent | 092e0e7e520a1fca03e13c9f2d157432a8657ff2 (diff) | |
| parent | 35dbc0e020c6587f78a6c17693beca73aead7b54 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
* git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
asm-generic/io.h: allow people to override individual funcs
bitops: remove duplicated extern declarations
bitops: make asm-generic/bitops/find.h more generic
asm-generic: kdebug.h: Checkpatch cleanup
asm-generic: fcntl: make exported headers use strict posix types
asm-generic: cmpxchg does not handle non-long arguments
asm-generic: make atomic_add_unless a function
Diffstat (limited to 'include/asm-generic/system.h')
| -rw-r--r-- | include/asm-generic/system.h | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h index efa403b5e121..4b0b9cbbfae5 100644 --- a/include/asm-generic/system.h +++ b/include/asm-generic/system.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/irqflags.h> | 21 | #include <linux/irqflags.h> |
| 22 | 22 | ||
| 23 | #include <asm/cmpxchg-local.h> | 23 | #include <asm/cmpxchg-local.h> |
| 24 | #include <asm/cmpxchg.h> | ||
| 24 | 25 | ||
| 25 | struct task_struct; | 26 | struct task_struct; |
| 26 | 27 | ||
| @@ -136,25 +137,6 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size) | |||
| 136 | #define xchg(ptr, x) \ | 137 | #define xchg(ptr, x) \ |
| 137 | ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) | 138 | ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) |
| 138 | 139 | ||
| 139 | static inline unsigned long __cmpxchg(volatile unsigned long *m, | ||
| 140 | unsigned long old, unsigned long new) | ||
| 141 | { | ||
| 142 | unsigned long retval; | ||
| 143 | unsigned long flags; | ||
| 144 | |||
| 145 | local_irq_save(flags); | ||
| 146 | retval = *m; | ||
| 147 | if (retval == old) | ||
| 148 | *m = new; | ||
| 149 | local_irq_restore(flags); | ||
| 150 | return retval; | ||
| 151 | } | ||
| 152 | |||
| 153 | #define cmpxchg(ptr, o, n) \ | ||
| 154 | ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \ | ||
| 155 | (unsigned long)(o), \ | ||
| 156 | (unsigned long)(n))) | ||
| 157 | |||
| 158 | #endif /* !__ASSEMBLY__ */ | 140 | #endif /* !__ASSEMBLY__ */ |
| 159 | 141 | ||
| 160 | #endif /* __KERNEL__ */ | 142 | #endif /* __KERNEL__ */ |
