X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-x86_64%2Flocal.h;h=3e72c41727c53af2f7ea75666aab6da56be79a5f;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=cd17945bf2181d1bd574b44818601e018ee806aa;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/include/asm-x86_64/local.h b/include/asm-x86_64/local.h index cd17945bf..3e72c4172 100644 --- a/include/asm-x86_64/local.h +++ b/include/asm-x86_64/local.h @@ -5,7 +5,7 @@ typedef struct { - volatile long counter; + volatile unsigned int counter; } local_t; #define LOCAL_INIT(i) { (i) } @@ -13,34 +13,34 @@ typedef struct #define local_read(v) ((v)->counter) #define local_set(v,i) (((v)->counter) = (i)) -static inline void local_inc(local_t *v) +static __inline__ void local_inc(local_t *v) { __asm__ __volatile__( - "incq %0" + "incl %0" :"=m" (v->counter) :"m" (v->counter)); } -static inline void local_dec(local_t *v) +static __inline__ void local_dec(local_t *v) { __asm__ __volatile__( - "decq %0" + "decl %0" :"=m" (v->counter) :"m" (v->counter)); } -static inline void local_add(long i, local_t *v) +static __inline__ void local_add(unsigned int i, local_t *v) { __asm__ __volatile__( - "addq %1,%0" + "addl %1,%0" :"=m" (v->counter) :"ir" (i), "m" (v->counter)); } -static inline void local_sub(long i, local_t *v) +static __inline__ void local_sub(unsigned int i, local_t *v) { __asm__ __volatile__( - "subq %1,%0" + "subl %1,%0" :"=m" (v->counter) :"ir" (i), "m" (v->counter)); }