X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=include%2Fasm-generic%2Flocal.h;h=ab469297272c1da3e8cee1d77a6ab5f70a2805fc;hb=1b73e6ae45d0353a062d7bea707757a235473cf9;hp=de4614840c2cdf4cd8bd7b85502be301c247cedb;hpb=86579dd06deecfa6ac88d5e84e4d63c397cd6f6d;p=powerpc.git diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h index de4614840c..ab46929727 100644 --- a/include/asm-generic/local.h +++ b/include/asm-generic/local.h @@ -1,14 +1,20 @@ #ifndef _ASM_GENERIC_LOCAL_H #define _ASM_GENERIC_LOCAL_H -#include #include #include #include #include -/* An unsigned long type for operations which are atomic for a single - * CPU. Usually used in combination with per-cpu variables. */ +/* + * A signed long type for operations which are atomic for a single CPU. + * Usually used in combination with per-cpu variables. + * + * This is the default implementation, which uses atomic_long_t. Which is + * rather pointless. The whole point behind local_t is that some processors + * can perform atomic adds and subtracts in a manner which is atomic wrt IRQs + * running on this CPU. local_t allows exploitation of such capabilities. + */ /* Implement in terms of atomics. */ @@ -20,7 +26,7 @@ typedef struct #define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } -#define local_read(l) ((unsigned long)atomic_long_read(&(l)->a)) +#define local_read(l) atomic_long_read(&(l)->a) #define local_set(l,i) atomic_long_set((&(l)->a),(i)) #define local_inc(l) atomic_long_inc(&(l)->a) #define local_dec(l) atomic_long_dec(&(l)->a)