git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
include
/
asm-sparc64
/
atomic.h
diff --git
a/include/asm-sparc64/atomic.h
b/include/asm-sparc64/atomic.h
index
2f0bec2
..
25256bd
100644
(file)
--- a/
include/asm-sparc64/atomic.h
+++ b/
include/asm-sparc64/atomic.h
@@
-8,6
+8,7
@@
#ifndef __ARCH_SPARC64_ATOMIC__
#define __ARCH_SPARC64_ATOMIC__
#ifndef __ARCH_SPARC64_ATOMIC__
#define __ARCH_SPARC64_ATOMIC__
+#include <linux/config.h>
#include <linux/types.h>
typedef struct { volatile int counter; } atomic_t;
#include <linux/types.h>
typedef struct { volatile int counter; } atomic_t;
@@
-77,15
+78,9
@@
extern int atomic64_sub_ret(int, atomic64_t *);
({ \
int c, old; \
c = atomic_read(v); \
({ \
int c, old; \
c = atomic_read(v); \
- for (;;) { \
- if (unlikely(c == (u))) \
- break; \
- old = atomic_cmpxchg((v), c, c + (a)); \
- if (likely(old == c)) \
- break; \
+ while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
c = old; \
c = old; \
- } \
- likely(c != (u)); \
+ c != (u); \
})
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
})
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)