diff options
Diffstat (limited to 'include/asm-generic/local.h')
-rw-r--r-- | include/asm-generic/local.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h index de4614840c2c..9291c24f5819 100644 --- a/include/asm-generic/local.h +++ b/include/asm-generic/local.h | |||
@@ -7,8 +7,15 @@ | |||
7 | #include <asm/atomic.h> | 7 | #include <asm/atomic.h> |
8 | #include <asm/types.h> | 8 | #include <asm/types.h> |
9 | 9 | ||
10 | /* An unsigned long type for operations which are atomic for a single | 10 | /* |
11 | * CPU. Usually used in combination with per-cpu variables. */ | 11 | * A signed long type for operations which are atomic for a single CPU. |
12 | * Usually used in combination with per-cpu variables. | ||
13 | * | ||
14 | * This is the default implementation, which uses atomic_long_t. Which is | ||
15 | * rather pointless. The whole point behind local_t is that some processors | ||
16 | * can perform atomic adds and subtracts in a manner which is atomic wrt IRQs | ||
17 | * running on this CPU. local_t allows exploitation of such capabilities. | ||
18 | */ | ||
12 | 19 | ||
13 | /* Implement in terms of atomics. */ | 20 | /* Implement in terms of atomics. */ |
14 | 21 | ||
@@ -20,7 +27,7 @@ typedef struct | |||
20 | 27 | ||
21 | #define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } | 28 | #define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } |
22 | 29 | ||
23 | #define local_read(l) ((unsigned long)atomic_long_read(&(l)->a)) | 30 | #define local_read(l) atomic_long_read(&(l)->a) |
24 | #define local_set(l,i) atomic_long_set((&(l)->a),(i)) | 31 | #define local_set(l,i) atomic_long_set((&(l)->a),(i)) |
25 | #define local_inc(l) atomic_long_inc(&(l)->a) | 32 | #define local_inc(l) atomic_long_inc(&(l)->a) |
26 | #define local_dec(l) atomic_long_dec(&(l)->a) | 33 | #define local_dec(l) atomic_long_dec(&(l)->a) |