summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/rwsem.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2011-08-23 23:59:58 (GMT)
committerH. Peter Anvin <hpa@linux.intel.com>2011-08-29 20:44:12 (GMT)
commit8b8bc2f7311c3223213dbe346d9cc2e299fdb5eb (patch)
tree50a2f0faa3762084336be4f97c03a97b14b22262 /arch/x86/include/asm/rwsem.h
parent433b3520616be694e0aa777089346c8718c91a7b (diff)
downloadlinux-8b8bc2f7311c3223213dbe346d9cc2e299fdb5eb.tar.xz
x86: Use xadd helper more widely
This covers the trivial cases from open-coded xadd to the xadd macros. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Link: http://lkml.kernel.org/r/4E5BCC40.3030501@goop.org Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/include/asm/rwsem.h')
-rw-r--r--arch/x86/include/asm/rwsem.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h
index df4cd32..2dbe4a7 100644
--- a/arch/x86/include/asm/rwsem.h
+++ b/arch/x86/include/asm/rwsem.h
@@ -204,13 +204,7 @@ static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
*/
static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
{
- long tmp = delta;
-
- asm volatile(LOCK_PREFIX "xadd %0,%1"
- : "+r" (tmp), "+m" (sem->count)
- : : "memory");
-
- return tmp + delta;
+ return delta + xadd(&sem->count, delta);
}
#endif /* __KERNEL__ */