Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99827
b: refs/heads/master
c: 73e991f
h: refs/heads/master
i:
  99825: 5ef8d90
  99823: 25c9225
v: v3
  • Loading branch information
Cliff Wickman authored and Ingo Molnar committed Jul 8, 2008
1 parent 1910649 commit bb4255f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1812924bb1823950c1dc95c478b71b037057356e
refs/heads/master: 73e991f45fe7644711c0c9dd357a1a2c6e222707
26 changes: 26 additions & 0 deletions trunk/include/asm-x86/atomic_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit bb4255f

Please sign in to comment.