Skip to content

Commit

Permalink
x86: change asm constraint.
Browse files Browse the repository at this point in the history
Our integration efforts broke a build with this function being used
with i386. Reason is "g" can put the operand in an imm32, which according
to The Book (tm), is invalid as the second operand.

This is actually a bug
in x86_64 too, since the x86_64 instruction set reference does not list
it as valid.

We probably didn't trigger this before due to the ammount of
registers available for 64-bit platforms. But that's just my guess.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Glauber Costa authored and Ingo Molnar committed Jul 9, 2008
1 parent 53938a6 commit c28b95d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/asm-x86/uaccess_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
asm("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0" \
: "=&r" (flag), "=r" (roksum) \
: "1" (addr), "g" ((long)(size)), \
"g" (current_thread_info()->addr_limit.seg)); \
"rm" (current_thread_info()->addr_limit.seg)); \
flag; \
})

Expand Down

0 comments on commit c28b95d

Please sign in to comment.