Skip to content

Commit

Permalink
[PATCH] x86_64: Make local_t 64bit instead of 32bit
Browse files Browse the repository at this point in the history
For consistency with other architectures

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Mar 25, 2006
1 parent 5d05f4d commit 9494943
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/asm-x86_64/local.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

typedef struct
{
volatile unsigned int counter;
volatile unsigned long counter;
} local_t;

#define LOCAL_INIT(i) { (i) }
Expand All @@ -16,31 +16,31 @@ typedef struct
static __inline__ void local_inc(local_t *v)
{
__asm__ __volatile__(
"incl %0"
"incq %0"
:"=m" (v->counter)
:"m" (v->counter));
}

static __inline__ void local_dec(local_t *v)
{
__asm__ __volatile__(
"decl %0"
"decq %0"
:"=m" (v->counter)
:"m" (v->counter));
}

static __inline__ void local_add(unsigned int i, local_t *v)
{
__asm__ __volatile__(
"addl %1,%0"
"addq %1,%0"
:"=m" (v->counter)
:"ir" (i), "m" (v->counter));
}

static __inline__ void local_sub(unsigned int i, local_t *v)
{
__asm__ __volatile__(
"subl %1,%0"
"subq %1,%0"
:"=m" (v->counter)
:"ir" (i), "m" (v->counter));
}
Expand Down

0 comments on commit 9494943

Please sign in to comment.