Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 374271
b: refs/heads/master
c: f21dda0
h: refs/heads/master
i:
  374269: 6eb0789
  374267: 896fcda
  374263: fb1a54b
  374255: 59af2cd
  374239: 8a2a100
  374207: 72b2e4d
  374143: dbcdd99
  374015: 4bed1b9
  373759: aff92e1
v: v3
  • Loading branch information
Helge Deller committed May 6, 2013
1 parent f84daa6 commit 6e6a6ef
Show file tree
Hide file tree
Showing 3 changed files with 25 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: bbbfde782084b4f0d85ddffb88f1cf4650ff40e4
refs/heads/master: f21dda025ab00da197ac30b6c6690c380d838683
1 change: 1 addition & 0 deletions trunk/arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ config PARISC
select BUG
select HAVE_PERF_EVENTS
select GENERIC_ATOMIC64 if !64BIT
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
select HAVE_GENERIC_HARDIRQS
select BROKEN_RODATA
select GENERIC_IRQ_PROBE
Expand Down
23 changes: 23 additions & 0 deletions trunk/arch/parisc/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,29 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)

#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)

/*
* atomic64_dec_if_positive - decrement by 1 if old value positive
* @v: pointer of type atomic_t
*
* The function returns the old value of *v minus 1, even if
* the atomic variable, v, was not decremented.
*/
static inline long atomic64_dec_if_positive(atomic64_t *v)
{
long c, old, dec;
c = atomic64_read(v);
for (;;) {
dec = c - 1;
if (unlikely(dec < 0))
break;
old = atomic64_cmpxchg((v), c, dec);
if (likely(old == c))
break;
c = old;
}
return dec;
}

#endif /* !CONFIG_64BIT */


Expand Down

0 comments on commit 6e6a6ef

Please sign in to comment.