source: scripts/patch/gcc/4.4.1/35-boemhm-ppc.patch@ 30de94a

clfs-3.0.0-sysvinit sysvinit
Last change on this file since 30de94a was 29f6db3, checked in by Jim Gifford <clfs@…>, 15 years ago

Added PPC patch. Fixed Patch Fetching Scripts.

  • Property mode set to 100644
File size: 3.5 KB
  • trunk/boehm-gc/include/private/gc_locks.h

    Fixes 
    In file included from /var/build_system/work/gcc-4.4.1/boehm-gc/include/private/gc_priv.h:98,
                     from /var/build_system/work/gcc-4.4.1/boehm-gc/alloc.c:19:
    /var/build_system/work/gcc-4.4.1/boehm-gc/include/private/gc_locks.h: In function ‘GC_test_and_set’:
    /var/build_system/work/gcc-4.4.1/boehm-gc/include/private/gc_locks.h:165: error: ‘asm’ operand has impossible constraints
    make[3]: *** [alloc.lo] Error 1
    make[3]: Leaving directory `/var/build_system/work/gcc-build/powerpc-unknown-linux-gnu/boehm-gc'
    make[2]: *** [all-recursive] Error 1
    
     
    139139#      define GC_TEST_AND_SET_DEFINED
    140140#    endif
    141141#    if defined(POWERPC)
    142 #     if 0 /* CPP_WORDSZ == 64  totally broken to use int locks with ldarx */
    143         inline static int GC_test_and_set(volatile unsigned int *addr) {
    144           unsigned long oldval;
    145           unsigned long temp = 1; /* locked value */
    146 
    147           __asm__ __volatile__(
    148                "1:\tldarx %0,0,%3\n"   /* load and reserve               */
    149                "\tcmpdi %0, 0\n"       /* if load is                     */
    150                "\tbne 2f\n"            /*   non-zero, return already set */
    151                "\tstdcx. %2,0,%1\n"    /* else store conditional         */
    152                "\tbne- 1b\n"           /* retry if lost reservation      */
    153                "\tsync\n"              /* import barrier                 */
    154                "2:\t\n"                /* oldval is zero if we set       */
    155               : "=&r"(oldval), "=p"(addr)
    156               : "r"(temp), "1"(addr)
    157               : "cr0","memory");
    158           return (int)oldval;
    159         }
     142#     define GC_TEST_AND_SET_DEFINED
     143#     define GC_CLEAR_DEFINED
     144#     if (__GNUC__>4)||((__GNUC__==4)&&(__GNUC_MINOR__>=4))
     145#       define GC_test_and_set(addr) __sync_lock_test_and_set (addr, 1)
     146#       define GC_clear(addr) __sync_lock_release (addr)
    160147#     else
    161148        inline static int GC_test_and_set(volatile unsigned int *addr) {
    162149          int oldval;
    163150          int temp = 1; /* locked value */
    164151
    165152          __asm__ __volatile__(
    166                "1:\tlwarx %0,0,%3\n"   /* load and reserve               */
     153               "\n1:\n"
     154               "\tlwarx %0,%y3\n"      /* load and reserve, 32-bits      */
    167155               "\tcmpwi %0, 0\n"       /* if load is                     */
    168156               "\tbne 2f\n"            /*   non-zero, return already set */
    169                "\tstwcx. %2,0,%1\n"    /* else store conditional         */
     157               "\tstwcx. %2,%y3\n"     /* else store conditional         */
    170158               "\tbne- 1b\n"           /* retry if lost reservation      */
    171159               "\tsync\n"              /* import barrier                 */
    172160               "2:\t\n"                /* oldval is zero if we set       */
    173               : "=&r"(oldval), "=p"(addr)
    174               : "r"(temp), "1"(addr)
     161              : "=&r"(oldval), "=m"(addr)
     162              : "r"(temp), "Z"(addr)
    175163              : "cr0","memory");
    176164          return oldval;
    177165        }
    178 #     endif
    179 #     define GC_TEST_AND_SET_DEFINED
    180166      inline static void GC_clear(volatile unsigned int *addr) {
    181167        __asm__ __volatile__("lwsync" : : : "memory");
    182168        *(addr) = 0;
    183169      }
    184 #     define GC_CLEAR_DEFINED
     170#    endif
    185171#    endif
    186172#    if defined(ALPHA)
    187173        inline static int GC_test_and_set(volatile unsigned int * addr)
Note: See TracBrowser for help on using the repository browser.