aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/atomic_64.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-08 06:24:13 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 06:24:13 -0400
commite3ae0acf59244ecf5b023ec99cef4b6b29d649bc (patch)
tree02a8bfdcab61677430ecfe04e9e44e1007c35f0e /include/asm-x86/atomic_64.h
parent4b62ac9a2b859f932afd5625362c927111b7dd9b (diff)
parente7eb8726d0e144f0925972c4ecee945e91a42753 (diff)
Merge branch 'x86/uv' into x86/devel
Diffstat (limited to 'include/asm-x86/atomic_64.h')
-rw-r--r--include/asm-x86/atomic_64.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/asm-x86/atomic_64.h b/include/asm-x86/atomic_64.h
index fe589c153db8..a0095191c02e 100644
--- a/include/asm-x86/atomic_64.h
+++ b/include/asm-x86/atomic_64.h
@@ -425,6 +425,32 @@ static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
425 return c != (u); 425 return c != (u);
426} 426}
427 427
428/**
429 * atomic_inc_short - increment of a short integer
430 * @v: pointer to type int
431 *
432 * Atomically adds 1 to @v
433 * Returns the new value of @u
434 */
435static inline short int atomic_inc_short(short int *v)
436{
437 asm(LOCK_PREFIX "addw $1, %0" : "+m" (*v));
438 return *v;
439}
440
441/**
442 * atomic_or_long - OR of two long integers
443 * @v1: pointer to type unsigned long
444 * @v2: pointer to type unsigned long
445 *
446 * Atomically ORs @v1 and @v2
447 * Returns the result of the OR
448 */
449static inline void atomic_or_long(unsigned long *v1, unsigned long v2)
450{
451 asm(LOCK_PREFIX "orq %1, %0" : "+m" (*v1) : "r" (v2));
452}
453
428#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) 454#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
429 455
430/* These are x86-specific, used by some header files */ 456/* These are x86-specific, used by some header files */