Mac OS X Support : General PowerPC fix for gcc in interlocked.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Here is an other fix for the powerpc interlocked functions.

Thanks,

Pierre

Modified files:
libs/port/interlocked.c

ChangeLog:
Add register preservation when using lawrx instruction . Also fix ';' ending to '\n' ending for a better compatibility with darwin's ld.
Index: libs/port/interlocked.c
===================================================================
RCS file: /home/wine/wine/libs/port/interlocked.c,v
retrieving revision 1.1
diff -u -r1.1 interlocked.c
--- libs/port/interlocked.c	20 Mar 2003 22:06:16 -0000	1.1
+++ libs/port/interlocked.c	3 May 2003 19:19:56 -0000
@@ -107,11 +107,11 @@
     long ret = 0;
     long scratch;
     __asm__ __volatile__(
-        "0:    lwarx %0,0,%2 ;"
+        "0:    lwarx %0,0,%2 \n"
         "      xor. %1,%4,%0;"
-        "      bne 1f;"
-        "      stwcx. %3,0,%2;"
-        "      bne- 0b;"
+        "      bne 1f\n"
+        "      stwcx. %3,0,%2\n"
+        "      bne- 0b\n"
         "1:    "
         : "=&r"(ret), "=&r"(scratch)
         : "r"(dest), "r"(xchg), "r"(compare)
@@ -124,15 +124,15 @@
     long ret = 0;
     long scratch;
     __asm__ __volatile__(
-        "0:    lwarx %0,0,%2 ;"
-        "      xor. %1,%4,%0;"
-        "      bne 1f;"
-        "      stwcx. %3,0,%2;"
-        "      bne- 0b;"
+        "0:    lwarx %0,0,%2 \n"
+        "      xor. %1,%4,%0\n"
+        "      bne 1f\n"
+        "      stwcx. %3,0,%2\n"
+        "      bne- 0b\n"
         "1:    "
         : "=&r"(ret), "=&r"(scratch)
         : "r"(dest), "r"(xchg), "r"(compare)
-        : "cr0","memory");
+        : "cr0","memory","r0");
     return ret;
 }
 
@@ -141,13 +141,13 @@
     long ret = 0;
     long zero = 0;
     __asm__ __volatile__(
-        "0:    lwarx %0, %3, %1;"
-        "      add %0, %2, %0;"
-        "      stwcx. %0, %3, %1;"
-        "      bne- 0b;"
+        "0:    lwarx %0, %3, %1\n"
+        "      add %0, %2, %0\n"
+        "      stwcx. %0, %3, %1\n"
+        "      bne- 0b\n"
         : "=&r" (ret)
         : "r"(dest), "r"(incr), "r"(zero)
-        : "cr0", "memory"
+        : "cr0", "memory", "r0"
     );
     return ret-incr;
 }
@@ -156,12 +156,12 @@
 {
     long ret = 0;
     __asm__ __volatile__(
-        "0:    lwarx %0,0,%1 ;"
-        "      stwcx. %2,0,%1;"
-        "      bne- 0b;"
+        "0:    lwarx %0,0,%1 \n"
+        "      stwcx. %2,0,%1\n"
+        "      bne- 0b\n"
         : "=&r"(ret)
         : "r"(dest), "r"(val)
-        : "cr0","memory");
+        : "cr0","memory","r0");
     return ret;
 }
 
@@ -169,12 +169,12 @@
 {
     void *ret = NULL;
     __asm__ __volatile__(
-        "0:    lwarx %0,0,%1 ;"
-        "      stwcx. %2,0,%1;"
-        "      bne- 0b;"
+        "0:    lwarx %0,0,%1 \n"
+        "      stwcx. %2,0,%1 \n"
+        "      bne- 0b \n"
         : "=&r"(ret)
         : "r"(dest), "r"(val)
-        : "cr0","memory");
+        : "cr0","memory","r0");
     return ret;
 }

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux