Skip to content

Commit

Permalink
x86: Use correct byte-sized register constraint in __xchg_op()
Browse files Browse the repository at this point in the history
x86-64 can access the low half of any register, but i386 can only do
it with a subset of registers.  'r' causes compilation failures on i386,
but 'q' expresses the constraint properly.

Signed-off-by: Jeremy Fitzhardinge <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Reported-by: Leigh Scott <[email protected]>
Tested-by: Thomas Reitmayr <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
Cc: <[email protected]> v3.3
  • Loading branch information
jsgf authored and H. Peter Anvin committed Apr 6, 2012
1 parent 46ed99d commit 2ca052a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/include/asm/cmpxchg.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern void __add_wrong_size(void)
switch (sizeof(*(ptr))) { \
case __X86_CASE_B: \
asm volatile (lock #op "b %b0, %1\n" \
: "+r" (__ret), "+m" (*(ptr)) \
: "+q" (__ret), "+m" (*(ptr)) \
: : "memory", "cc"); \
break; \
case __X86_CASE_W: \
Expand Down

0 comments on commit 2ca052a

Please sign in to comment.