提交 afa31d8e 编写于 作者: W Will Deacon 提交者: Russell King

ARM: 7811/1: locks: use early clobber in arch_spin_trylock

The res variable is written before we've finished with the input
operands (namely the lock address), so ensure that we mark it as `early
clobber' to avoid unintended register sharing.
Signed-off-by: NWill Deacon <will.deacon@arm.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 e35ac62d
...@@ -107,7 +107,7 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock) ...@@ -107,7 +107,7 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)
" subs %1, %0, %0, ror #16\n" " subs %1, %0, %0, ror #16\n"
" addeq %0, %0, %4\n" " addeq %0, %0, %4\n"
" strexeq %2, %0, [%3]" " strexeq %2, %0, [%3]"
: "=&r" (slock), "=&r" (contended), "=r" (res) : "=&r" (slock), "=&r" (contended), "=&r" (res)
: "r" (&lock->slock), "I" (1 << TICKET_SHIFT) : "r" (&lock->slock), "I" (1 << TICKET_SHIFT)
: "cc"); : "cc");
} while (res); } while (res);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册