aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/atomicity.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/atomicity.h')
-rw-r--r--sysdeps/powerpc/atomicity.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/sysdeps/powerpc/atomicity.h b/sysdeps/powerpc/atomicity.h
index 2924b18..6942dfe 100644
--- a/sysdeps/powerpc/atomicity.h
+++ b/sysdeps/powerpc/atomicity.h
@@ -33,11 +33,11 @@ __attribute__ ((unused))
exchange_and_add (volatile uint32_t *mem, int val)
{
int tmp, result;
- __asm__ ("\
-0: lwarx %0,0,%2
- add%I3 %1,%0,%3
- stwcx. %1,0,%2
- bne- 0b
+ __asm__ ("\n\
+0: lwarx %0,0,%2 \n\
+ add%I3 %1,%0,%3 \n\
+ stwcx. %1,0,%2 \n\
+ bne- 0b \n\
" : "=&b"(result), "=&r"(tmp) : "r" (mem), "Ir"(val) : "cr0", "memory");
return result;
}
@@ -47,11 +47,11 @@ __attribute__ ((unused))
atomic_add (volatile uint32_t *mem, int val)
{
int tmp;
- __asm__ ("\
-0: lwarx %0,0,%1
- add%I2 %0,%0,%2
- stwcx. %0,0,%1
- bne- 0b
+ __asm__ ("\n\
+0: lwarx %0,0,%1 \n\
+ add%I2 %0,%0,%2 \n\
+ stwcx. %0,0,%1 \n\
+ bne- 0b \n\
" : "=&b"(tmp) : "r" (mem), "Ir"(val) : "cr0", "memory");
}
@@ -60,14 +60,14 @@ __attribute__ ((unused))
compare_and_swap (volatile long int *p, long int oldval, long int newval)
{
int result;
- __asm__ ("\
-0: lwarx %0,0,%1
- sub%I2c. %0,%0,%2
- cntlzw %0,%0
- bne- 1f
- stwcx. %3,0,%1
- bne- 0b
-1:
+ __asm__ ("\n\
+0: lwarx %0,0,%1 \n\
+ sub%I2c. %0,%0,%2 \n\
+ cntlzw %0,%0 \n\
+ bne- 1f \n\
+ stwcx. %3,0,%1 \n\
+ bne- 0b \n\
+1: \n\
" : "=&b"(result) : "r"(p), "Ir"(oldval), "r"(newval) : "cr0", "memory");
return result >> 5;
}
@@ -77,10 +77,10 @@ __attribute__ ((unused))
always_swap (volatile long int *p, long int newval)
{
long int result;
- __asm__ ("\
-0: lwarx %0,0,%1
- stwcx. %2,0,%1
- bne- 0b
+ __asm__ ("\n\
+0: lwarx %0,0,%1 \n\
+ stwcx. %2,0,%1 \n\
+ bne- 0b \n\
" : "=&r"(result) : "r"(p), "r"(newval) : "cr0", "memory");
return result;
}
@@ -90,13 +90,13 @@ __attribute__ ((unused))
test_and_set (volatile long int *p, long int newval)
{
int result;
- __asm__ ("\
-0: lwarx %0,0,%1
- cmpwi %0,0
- bne- 1f
- stwcx. %2,0,%1
- bne- 0b
-1:
+ __asm__ ("\n\
+0: lwarx %0,0,%1 \n\
+ cmpwi %0,0 \n\
+ bne- 1f \n\
+ stwcx. %2,0,%1 \n\
+ bne- 0b \n\
+1: \n\
" : "=&r"(result) : "r"(p), "r"(newval) : "cr0", "memory");
return result;
}