x86: fix percpu_{to,from}_op()

- the byte operand constraints were wrong for 32-bit
- the to-op's input operands weren't properly parenthesized

[ Impact: fix possible miscompilation or build failure ]

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
Jan Beulich 2009-05-11 16:49:28 +01:00 committed by H. Peter Anvin
parent 917a015362
commit 3c598766a2
1 changed files with 5 additions and 5 deletions

View File

@ -82,22 +82,22 @@ do { \
case 1: \ case 1: \
asm(op "b %1,"__percpu_arg(0) \ asm(op "b %1,"__percpu_arg(0) \
: "+m" (var) \ : "+m" (var) \
: "ri" ((T__)val)); \ : "qi" ((T__)(val))); \
break; \ break; \
case 2: \ case 2: \
asm(op "w %1,"__percpu_arg(0) \ asm(op "w %1,"__percpu_arg(0) \
: "+m" (var) \ : "+m" (var) \
: "ri" ((T__)val)); \ : "ri" ((T__)(val))); \
break; \ break; \
case 4: \ case 4: \
asm(op "l %1,"__percpu_arg(0) \ asm(op "l %1,"__percpu_arg(0) \
: "+m" (var) \ : "+m" (var) \
: "ri" ((T__)val)); \ : "ri" ((T__)(val))); \
break; \ break; \
case 8: \ case 8: \
asm(op "q %1,"__percpu_arg(0) \ asm(op "q %1,"__percpu_arg(0) \
: "+m" (var) \ : "+m" (var) \
: "re" ((T__)val)); \ : "re" ((T__)(val))); \
break; \ break; \
default: __bad_percpu_size(); \ default: __bad_percpu_size(); \
} \ } \
@ -109,7 +109,7 @@ do { \
switch (sizeof(var)) { \ switch (sizeof(var)) { \
case 1: \ case 1: \
asm(op "b "__percpu_arg(1)",%0" \ asm(op "b "__percpu_arg(1)",%0" \
: "=r" (ret__) \ : "=q" (ret__) \
: "m" (var)); \ : "m" (var)); \
break; \ break; \
case 2: \ case 2: \