Commit 58628a7831edac5f7a13baa9d9320c758c5204c8
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
Merge branch 'parisc-3.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc build fix from Helge Deller: "This unbreaks the kernel compilation on parisc with gcc-4.9" * 'parisc-3.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: fix out-of-register compiler error in ldcw inline assembler function
Showing 1 changed file Side-by-side Diff
arch/parisc/include/asm/ldcw.h
... | ... | @@ -33,11 +33,18 @@ |
33 | 33 | |
34 | 34 | #endif /*!CONFIG_PA20*/ |
35 | 35 | |
36 | -/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ | |
36 | +/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. | |
37 | + We don't explicitly expose that "*a" may be written as reload | |
38 | + fails to find a register in class R1_REGS when "a" needs to be | |
39 | + reloaded when generating 64-bit PIC code. Instead, we clobber | |
40 | + memory to indicate to the compiler that the assembly code reads | |
41 | + or writes to items other than those listed in the input and output | |
42 | + operands. This may pessimize the code somewhat but __ldcw is | |
43 | + usually used within code blocks surrounded by memory barriors. */ | |
37 | 44 | #define __ldcw(a) ({ \ |
38 | 45 | unsigned __ret; \ |
39 | - __asm__ __volatile__(__LDCW " 0(%2),%0" \ | |
40 | - : "=r" (__ret), "+m" (*(a)) : "r" (a)); \ | |
46 | + __asm__ __volatile__(__LDCW " 0(%1),%0" \ | |
47 | + : "=r" (__ret) : "r" (a) : "memory"); \ | |
41 | 48 | __ret; \ |
42 | 49 | }) |
43 | 50 |