]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/include/asm/uaccess.h
Merge tag 'late-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[karo-tx-linux.git] / arch / x86 / include / asm / uaccess.h
index 5ee26875baea3a5676d727ef6a67d98811094a33..5838fa911aa03f25138e8996f755b0b4fde34e18 100644 (file)
@@ -153,16 +153,19 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))
  * Careful: we have to cast the result to the type of the pointer
  * for sign reasons.
  *
- * The use of %edx as the register specifier is a bit of a
+ * The use of _ASM_DX as the register specifier is a bit of a
  * simplification, as gcc only cares about it as the starting point
  * and not size: for a 64-bit value it will use %ecx:%edx on 32 bits
  * (%ecx being the next register in gcc's x86 register sequence), and
  * %rdx on 64 bits.
+ *
+ * Clang/LLVM cares about the size of the register, but still wants
+ * the base register for something that ends up being a pair.
  */
 #define get_user(x, ptr)                                               \
 ({                                                                     \
        int __ret_gu;                                                   \
-       register __inttype(*(ptr)) __val_gu asm("%edx");                \
+       register __inttype(*(ptr)) __val_gu asm("%"_ASM_DX);            \
        __chk_user_ptr(ptr);                                            \
        might_fault();                                                  \
        asm volatile("call __get_user_%P3"                              \