Commit 3c598766 authored by Jan Beulich's avatar Jan Beulich Committed by H. Peter Anvin

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: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent 917a0153
...@@ -82,22 +82,22 @@ do { \ ...@@ -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 { \ ...@@ -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: \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment