Skip to content

Commit

Permalink
metag: Fix atomic_*_return inline asm constraints
Browse files Browse the repository at this point in the history
The argument i of atomic_*_return() operations is given to inline asm
with the "bd" constraint, which means "An Op2 register where Op1 is a
data unit register and the instruction supports O2R", however Op1 is
constrained by "da" which allows an address unit register to be used.

Fix the constraint to use "br", meaning "An Op2 register and the
instruction supports O2R", i.e. not requiring Op1 to be a data unit
register.

Fixes: d6dfe25 ("locking,arch,metag: Fold atomic_ops")
Signed-off-by: James Hogan <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
  • Loading branch information
James Hogan committed May 3, 2016
1 parent f5d163a commit 096a8b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/metag/include/asm/atomic_lnkget.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \
" CMPT %0, #HI(0x02000000)\n" \
" BNZ 1b\n" \
: "=&d" (temp), "=&da" (result) \
: "da" (&v->counter), "bd" (i) \
: "da" (&v->counter), "br" (i) \
: "cc"); \
\
smp_mb(); \
Expand Down

0 comments on commit 096a8b6

Please sign in to comment.