From bb4255fba0e6cb5c9bd259ae4e4cbaf8301b86f2 Mon Sep 17 00:00:00 2001 From: Cliff Wickman Date: Wed, 4 Jun 2008 15:33:17 -0500 Subject: [PATCH] --- yaml --- r: 99827 b: refs/heads/master c: 73e991f45fe7644711c0c9dd357a1a2c6e222707 h: refs/heads/master i: 99825: 5ef8d90e1ad5ac1fb8ccc328e103d210a5be94bd 99823: 25c92258548e77c6e5e3ac2ac3af8aa4bfaf4e36 v: v3 --- [refs] | 2 +- trunk/include/asm-x86/atomic_64.h | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 43a798d71cc7..cf1d6dccc5ad 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1812924bb1823950c1dc95c478b71b037057356e +refs/heads/master: 73e991f45fe7644711c0c9dd357a1a2c6e222707 diff --git a/trunk/include/asm-x86/atomic_64.h b/trunk/include/asm-x86/atomic_64.h index 3e0cd7d38335..55c0dd9382b8 100644 --- a/trunk/include/asm-x86/atomic_64.h +++ b/trunk/include/asm-x86/atomic_64.h @@ -431,6 +431,32 @@ static inline int atomic64_add_unless(atomic64_t *v, long a, long u) return c != (u); } +/** + * atomic_inc_short - increment of a short integer + * @v: pointer to type int + * + * Atomically adds 1 to @v + * Returns the new value of @u + */ +static inline short int atomic_inc_short(short int *v) +{ + asm(LOCK_PREFIX "addw $1, %0" : "+m" (*v)); + return *v; +} + +/** + * atomic_or_long - OR of two long integers + * @v1: pointer to type unsigned long + * @v2: pointer to type unsigned long + * + * Atomically ORs @v1 and @v2 + * Returns the result of the OR + */ +static inline void atomic_or_long(unsigned long *v1, unsigned long v2) +{ + asm(LOCK_PREFIX "orq %1, %0" : "+m" (*v1) : "r" (v2)); +} + #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) /* These are x86-specific, used by some header files */