]> granicus.if.org Git - gc/commitdiff
2008-11-18 Mark Probst <mark.probst@gmail.com>
authorMark Probst <mark.probst@gmail.com>
Tue, 18 Nov 2008 14:12:54 +0000 (14:12 +0000)
committerguest <ivmai@mail.ru>
Fri, 29 Jul 2011 11:31:21 +0000 (15:31 +0400)
* include/private/gc_locks.h (test_and_set): The PPC64 case is
wrong, as it operates on 64 bit values, not on 32 bit ones as the
function requires.  The PPC32 case is sufficient.

svn path=/trunk/mono/; revision=119156

ChangeLog
include/private/gc_locks.h

index ed55d6f286916decaaace024ccd9960f189b418b..17234b08d46f7dd2bf84698a66617e69ace6a55b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-18  Mark Probst  <mark.probst@gmail.com>
+
+       * include/private/gc_locks.h (test_and_set): The PPC64 case is
+       wrong, as it operates on 64 bit values, not on 32 bit ones as the
+       function requires.  The PPC32 case is sufficient.
+
 2008-09-29  Geoff Norton  <gnorton@novell.com>
 
        * include/private/gcconfig.h: Make Darwin/ARM use mmap() instead of
index ee38aff5bc57c6acb276d252ec5f40a45bea8c19..922815232e82f7d33897ce851f78b939437e5ac8 100644 (file)
 #      define GC_TEST_AND_SET_DEFINED
 #    endif
 #    if defined(POWERPC)
-#     if CPP_WORDSZ == 64
-        inline static int GC_test_and_set(volatile unsigned int *addr) {
-          unsigned long oldval;
-          unsigned long temp = 1; /* locked value */
-
-          __asm__ __volatile__(
-               "1:\tldarx %0,0,%3\n"   /* load and reserve               */
-               "\tcmpdi %0, 0\n"       /* if load is                     */
-               "\tbne 2f\n"            /*   non-zero, return already set */
-               "\tstdcx. %2,0,%1\n"    /* else store conditional         */
-               "\tbne- 1b\n"           /* retry if lost reservation      */
-               "\tsync\n"              /* import barrier                 */
-               "2:\t\n"                /* oldval is zero if we set       */
-              : "=&r"(oldval), "=p"(addr)
-              : "r"(temp), "1"(addr)
-              : "cr0","memory");
-          return (int)oldval;
-        }
-#     else
         inline static int GC_test_and_set(volatile unsigned int *addr) {
           int oldval;
           int temp = 1; /* locked value */
               : "cr0","memory");
           return oldval;
         }
-#     endif
 #     define GC_TEST_AND_SET_DEFINED
       inline static void GC_clear(volatile unsigned int *addr) {
        __asm__ __volatile__("lwsync" : : : "memory");