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
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
include
/
asm-sparc64
/
atomic.h
diff --git
a/include/asm-sparc64/atomic.h
b/include/asm-sparc64/atomic.h
index
25256bd
..
2f0bec2
100644
(file)
--- a/
include/asm-sparc64/atomic.h
+++ b/
include/asm-sparc64/atomic.h
@@
-8,7
+8,6
@@
#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;
@@
-78,9
+77,15
@@
extern int atomic64_sub_ret(int, atomic64_t *);
({ \
int c, old; \
c = atomic_read(v); \
({ \
int c, old; \
c = atomic_read(v); \
- while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
+ for (;;) { \
+ if (unlikely(c == (u))) \
+ break; \
+ old = atomic_cmpxchg((v), c, c + (a)); \
+ if (likely(old == c)) \
+ break; \
c = old; \
c = old; \
- c != (u); \
+ } \
+ likely(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)