Skip to content

Commit fe09d9c

Browse files
agnersRussell King
authored and
Russell King
committed
ARM: 8852/1: uaccess: use unified assembler language syntax
Convert the conditional infix to a postfix to make sure this inline assembly is unified syntax. Since gcc assumes non-unified syntax when emitting ARM instructions, make sure to define the syntax as unified. This allows to use LLVM's integrated assembler. Additionally, for GCC ".syntax unified" for inline assembly. When compiling non-Thumb2 GCC always emits a ".syntax divided" at the beginning of the inline assembly which makes the assembler fail. Since GCC 5 there is the -masm-syntax-unified GCC option which make GCC assume unified syntax asm and hence emits ".syntax unified" even in ARM mode. However, the option is broken since GCC version 6 (see GCC PR88648 [1]). Work around by adding ".syntax unified" as part of the inline assembly. [0] https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#index-masm-syntax-unified [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88648 Signed-off-by: Stefan Agner <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent a6c9e96 commit fe09d9c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm/include/asm/uaccess.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ static inline void __user *__uaccess_mask_range_ptr(const void __user *ptr,
112112
unsigned long tmp;
113113

114114
asm volatile(
115+
" .syntax unified\n"
115116
" sub %1, %3, #1\n"
116117
" subs %1, %1, %0\n"
117118
" addhs %1, %1, #1\n"
118-
" subhss %1, %1, %2\n"
119+
" subshs %1, %1, %2\n"
119120
" movlo %0, #0\n"
120121
: "+r" (safe_ptr), "=&r" (tmp)
121122
: "r" (size), "r" (current_thread_info()->addr_limit)

0 commit comments

Comments
 (0)