aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/atomic.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /include/linux/atomic.h
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'include/linux/atomic.h')
-rw-r--r--include/linux/atomic.h27
1 files changed, 0 insertions, 27 deletions
diff --git a/include/linux/atomic.h b/include/linux/atomic.h
index 5b08a8540ec..42b77b5446d 100644
--- a/include/linux/atomic.h
+++ b/include/linux/atomic.h
@@ -24,9 +24,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
24 * Atomically increments @v by 1, so long as @v is non-zero. 24 * Atomically increments @v by 1, so long as @v is non-zero.
25 * Returns non-zero if @v was non-zero, and zero otherwise. 25 * Returns non-zero if @v was non-zero, and zero otherwise.
26 */ 26 */
27#ifndef atomic_inc_not_zero
28#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 27#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
29#endif
30 28
31/** 29/**
32 * atomic_inc_not_zero_hint - increment if not null 30 * atomic_inc_not_zero_hint - increment if not null
@@ -86,31 +84,6 @@ static inline int atomic_dec_unless_positive(atomic_t *p)
86} 84}
87#endif 85#endif
88 86
89/*
90 * atomic_dec_if_positive - decrement by 1 if old value positive
91 * @v: pointer of type atomic_t
92 *
93 * The function returns the old value of *v minus 1, even if
94 * the atomic variable, v, was not decremented.
95 */
96#ifndef atomic_dec_if_positive
97static inline int atomic_dec_if_positive(atomic_t *v)
98{
99 int c, old, dec;
100 c = atomic_read(v);
101 for (;;) {
102 dec = c - 1;
103 if (unlikely(dec < 0))
104 break;
105 old = atomic_cmpxchg((v), c, dec);
106 if (likely(old == c))
107 break;
108 c = old;
109 }
110 return dec;
111}
112#endif
113
114#ifndef CONFIG_ARCH_HAS_ATOMIC_OR 87#ifndef CONFIG_ARCH_HAS_ATOMIC_OR
115static inline void atomic_or(int i, atomic_t *v) 88static inline void atomic_or(int i, atomic_t *v)
116{ 89{