提交 bb3a3bef 编写于 作者: R Rich Felker

fix build breakage from ppc asm constraints change

due to a mistake in my testing procedure, the changes in the previous
commit were not correctly tested and wrongly assumed to be valid. the
lwarx and stwcx. instructions do not accept general ppc memory address
expressions and thus the argument associated with the memory
constraint cannot be used directly.

instead, the memory constraint can be left as an argument that the asm
does not actually use, and the address can be provided in a separate
register constraint.
上级 94252dd3
......@@ -25,13 +25,13 @@ static inline int a_ctz_64(uint64_t x)
static inline int a_cas(volatile int *p, int t, int s)
{
__asm__("1: lwarx %0, 0, %1\n"
__asm__("1: lwarx %0, 0, %4\n"
" cmpw %0, %2\n"
" bne 1f\n"
" stwcx. %3, 0, %1\n"
" stwcx. %3, 0, %4\n"
" bne- 1b\n"
"1: \n"
: "=&r"(t), "+m"(*p) : "r"(t), "r"(s) : "cc", "memory" );
: "=&r"(t), "+m"(*p) : "r"(t), "r"(s), "r"(p) : "cc", "memory" );
return t;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册