Changes between Initial Version and Version 1 of Ticket #27163


Ignore:
Timestamp:
Nov 6, 2010, 2:39:52 AM (13 years ago)
Author:
jeremyhu (Jeremy Huddleston Sequoia)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27163 – Description

    initial v1  
    66/opt/local/var/macports/build/_Users_jeremy_src_macports-trunk_dports_lang_gcc44/work/gcc-4.4.5/boehm-gc/include/private/gc_locks.h:165: error: 'asm' operand has impossible constraints
    77}}}
     8
     9{{{
     10
     11        inline static int GC_test_and_set(volatile unsigned int *addr) {
     12          int oldval;
     13          int temp = 1; /* locked value */
     14
     15          __asm__ __volatile__(
     16               "1:\tlwarx %0,0,%3\n"   /* load and reserve               */
     17               "\tcmpwi %0, 0\n"       /* if load is                     */
     18               "\tbne 2f\n"            /*   non-zero, return already set */
     19               "\tstwcx. %2,0,%1\n"    /* else store conditional         */
     20               "\tbne- 1b\n"           /* retry if lost reservation      */
     21               "\tsync\n"              /* import barrier                 */
     22               "2:\t\n"                /* oldval is zero if we set       */
     23              : "=&r"(oldval), "=p"(addr)
     24              : "r"(temp), "1"(addr)
     25              : "cr0","memory");
     26          return oldval;
     27        }
     28}}}