Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ca052a3 authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge Committed by H. Peter Anvin
Browse files

x86: Use correct byte-sized register constraint in __xchg_op()



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: default avatarJeremy Fitzhardinge <jeremy@goop.org>
Link: http://lkml.kernel.org/r/4F7A3315.501@goop.org


Reported-by: default avatarLeigh Scott <leigh123linux@googlemail.com>
Tested-by: default avatarThomas Reitmayr <treitmayr@devbase.at>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
Cc: <stable@vger.kernel.org> v3.3
parent 46ed99d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -43,7 +43,7 @@ extern void __add_wrong_size(void)
		switch (sizeof(*(ptr))) {				\
		switch (sizeof(*(ptr))) {				\
		case __X86_CASE_B:					\
		case __X86_CASE_B:					\
			asm volatile (lock #op "b %b0, %1\n"		\
			asm volatile (lock #op "b %b0, %1\n"		\
				      : "+r" (__ret), "+m" (*(ptr))	\
				      : "+q" (__ret), "+m" (*(ptr))	\
				      : : "memory", "cc");		\
				      : : "memory", "cc");		\
			break;						\
			break;						\
		case __X86_CASE_W:					\
		case __X86_CASE_W:					\