Ignore:
Timestamp:
2011-09-24T14:20:29Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5bf76c1
Parents:
867e2555 (diff), 1ab4aca (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/ia32/include/atomic.h

    r867e2555 r925a21e  
    4242static inline void atomic_inc(atomic_t *val)
    4343{
     44#ifdef __PCC__
     45        asm volatile (
     46                "lock incl %0\n"
     47                : "+m" (val->count)
     48        );
     49#else
    4450        asm volatile (
    4551                "lock incl %[count]\n"
    4652                : [count] "+m" (val->count)
    4753        );
     54#endif
    4855}
    4956
    5057static inline void atomic_dec(atomic_t *val)
    5158{
     59#ifdef __PCC__
     60        asm volatile (
     61                "lock decl %0\n"
     62                : "+m" (val->count)
     63        );
     64#else
    5265        asm volatile (
    5366                "lock decl %[count]\n"
    5467                : [count] "+m" (val->count)
    5568        );
     69#endif
    5670}
    5771
     
    6074        atomic_count_t r = 1;
    6175       
     76#ifdef __PCC__
     77        asm volatile (
     78                "lock xaddl %1, %0\n"
     79                : "+m" (val->count),
     80                  "+r" (r)
     81        );
     82#else
    6283        asm volatile (
    6384                "lock xaddl %[r], %[count]\n"
     
    6586                  [r] "+r" (r)
    6687        );
     88#endif
    6789       
    6890        return r;
     
    7395        atomic_count_t r = -1;
    7496       
     97#ifdef __PCC__
     98        asm volatile (
     99                "lock xaddl %1, %0\n"
     100                : "+m" (val->count),
     101                  "+r" (r)
     102        );
     103#else
    75104        asm volatile (
    76105                "lock xaddl %[r], %[count]\n"
     
    78107                  [r] "+r" (r)
    79108        );
     109#endif
    80110       
    81111        return r;
Note: See TracChangeset for help on using the changeset viewer.