aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-x86/local.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/include/asm-x86/local.h b/include/asm-x86/local.h
index f5677e208601..f852c62b3319 100644
--- a/include/asm-x86/local.h
+++ b/include/asm-x86/local.h
@@ -7,15 +7,14 @@
7#include <asm/atomic.h> 7#include <asm/atomic.h>
8#include <asm/asm.h> 8#include <asm/asm.h>
9 9
10typedef struct 10typedef struct {
11{
12 atomic_long_t a; 11 atomic_long_t a;
13} local_t; 12} local_t;
14 13
15#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } 14#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
16 15
17#define local_read(l) atomic_long_read(&(l)->a) 16#define local_read(l) atomic_long_read(&(l)->a)
18#define local_set(l,i) atomic_long_set(&(l)->a, (i)) 17#define local_set(l, i) atomic_long_set(&(l)->a, (i))
19 18
20static inline void local_inc(local_t *l) 19static inline void local_inc(local_t *l)
21{ 20{
@@ -137,7 +136,7 @@ static inline long local_add_return(long i, local_t *l)
137 long __i; 136 long __i;
138#ifdef CONFIG_M386 137#ifdef CONFIG_M386
139 unsigned long flags; 138 unsigned long flags;
140 if(unlikely(boot_cpu_data.x86 <= 3)) 139 if (unlikely(boot_cpu_data.x86 <= 3))
141 goto no_xadd; 140 goto no_xadd;
142#endif 141#endif
143 /* Modern 486+ processor */ 142 /* Modern 486+ processor */
@@ -160,11 +159,11 @@ no_xadd: /* Legacy 386 processor */
160 159
161static inline long local_sub_return(long i, local_t *l) 160static inline long local_sub_return(long i, local_t *l)
162{ 161{
163 return local_add_return(-i,l); 162 return local_add_return(-i, l);
164} 163}
165 164
166#define local_inc_return(l) (local_add_return(1,l)) 165#define local_inc_return(l) (local_add_return(1, l))
167#define local_dec_return(l) (local_sub_return(1,l)) 166#define local_dec_return(l) (local_sub_return(1, l))
168 167
169#define local_cmpxchg(l, o, n) \ 168#define local_cmpxchg(l, o, n) \
170 (cmpxchg_local(&((l)->a.counter), (o), (n))) 169 (cmpxchg_local(&((l)->a.counter), (o), (n)))
@@ -202,8 +201,8 @@ static inline long local_sub_return(long i, local_t *l)
202 */ 201 */
203#define __local_inc(l) local_inc(l) 202#define __local_inc(l) local_inc(l)
204#define __local_dec(l) local_dec(l) 203#define __local_dec(l) local_dec(l)
205#define __local_add(i,l) local_add((i),(l)) 204#define __local_add(i, l) local_add((i), (l))
206#define __local_sub(i,l) local_sub((i),(l)) 205#define __local_sub(i, l) local_sub((i), (l))
207 206
208/* Use these for per-cpu local_t variables: on some archs they are 207/* Use these for per-cpu local_t variables: on some archs they are
209 * much more efficient than these naive implementations. Note they take 208 * much more efficient than these naive implementations. Note they take