提交 34bfbae3 编写于 作者: S Shengjiu Wang 提交者: Russell King

ARM: 8475/1: SWP emulation: Restore original *data when failed

__user_swpX_asm maybe failed in first STREX operation, emulate_swpX
will try again, but the *data has been changed in first time. which
causes the result is wrong.
This patch is to fix this issue. When STREX succeed, change the *data.
if it fail, *data is not changed.
Signed-off-by: NShengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 fa0708b3
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
*/ */
#define __user_swpX_asm(data, addr, res, temp, B) \ #define __user_swpX_asm(data, addr, res, temp, B) \
__asm__ __volatile__( \ __asm__ __volatile__( \
" mov %2, %1\n" \ "0: ldrex"B" %2, [%3]\n" \
"0: ldrex"B" %1, [%3]\n" \ "1: strex"B" %0, %1, [%3]\n" \
"1: strex"B" %0, %2, [%3]\n" \
" cmp %0, #0\n" \ " cmp %0, #0\n" \
" moveq %1, %2\n" \
" movne %0, %4\n" \ " movne %0, %4\n" \
"2:\n" \ "2:\n" \
" .section .text.fixup,\"ax\"\n" \ " .section .text.fixup,\"ax\"\n" \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册