217 |
|
// spin locks |
218 |
|
#ifdef __GNUC__ |
219 |
|
|
220 |
< |
#ifdef __powerpc__ |
220 |
> |
#if defined(__powerpc__) || defined(__ppc__) |
221 |
|
#define HAVE_TEST_AND_SET 1 |
222 |
|
static inline int testandset(volatile int *p) |
223 |
|
{ |
224 |
|
int ret; |
225 |
< |
__asm__ __volatile__("0: lwarx %0,0,%1 ;" |
226 |
< |
" xor. %0,%3,%0;" |
227 |
< |
" bne 1f;" |
228 |
< |
" stwcx. %2,0,%1;" |
229 |
< |
" bne- 0b;" |
225 |
> |
__asm__ __volatile__("0: lwarx %0,0,%1\n" |
226 |
> |
" xor. %0,%3,%0\n" |
227 |
> |
" bne 1f\n" |
228 |
> |
" stwcx. %2,0,%1\n" |
229 |
> |
" bne- 0b\n" |
230 |
|
"1: " |
231 |
|
: "=&r" (ret) |
232 |
|
: "r" (p), "r" (1), "r" (0) |