Ignore:
Timestamp:
2011-03-21T22:00:17Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
143932e3
Parents:
b50b5af2 (diff), 7308e84 (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 (needs fixes).

File:
1 moved

Legend:

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

    rb50b5af2 r04803bf  
    2727 */
    2828
    29 /** @addtogroup libcppc32       
     29/** @addtogroup libcppc32
    3030 * @{
    3131 */
     
    3636#define LIBC_ppc32_ATOMIC_H_
    3737
     38#define LIBC_ARCH_ATOMIC_H_
     39
     40#include <atomicdflt.h>
     41
    3842static inline void atomic_inc(atomic_t *val)
    3943{
    40         long tmp;
    41 
     44        atomic_count_t tmp;
     45       
    4246        asm volatile (
    4347                "1:\n"
     
    4650                "stwcx. %0, 0, %2\n"
    4751                "bne- 1b"
    48                 : "=&r" (tmp), "=m" (val->count)
    49                 : "r" (&val->count), "m" (val->count)
    50                 : "cc");
     52                : "=&r" (tmp),
     53                  "=m" (val->count)
     54                : "r" (&val->count),
     55                  "m" (val->count)
     56                : "cc"
     57        );
    5158}
    5259
    5360static inline void atomic_dec(atomic_t *val)
    5461{
    55         long tmp;
    56 
     62        atomic_count_t tmp;
     63       
    5764        asm volatile (
    5865                "1:\n"
    5966                "lwarx %0, 0, %2\n"
    6067                "addic %0, %0, -1\n"
    61                 "stwcx. %0, 0, %2\n"
     68                "stwcx. %0, 0, %2\n"
    6269                "bne- 1b"
    63                 : "=&r" (tmp), "=m" (val->count)
    64                 : "r" (&val->count), "m" (val->count)
    65                 : "cc");
     70                : "=&r" (tmp),
     71                  "=m" (val->count)
     72                : "r" (&val->count),
     73                  "m" (val->count)
     74                : "cc"
     75        );
    6676}
    6777
    68 static inline long atomic_postinc(atomic_t *val)
     78static inline atomic_count_t atomic_postinc(atomic_t *val)
    6979{
    7080        atomic_inc(val);
     
    7282}
    7383
    74 static inline long atomic_postdec(atomic_t *val)
     84static inline atomic_count_t atomic_postdec(atomic_t *val)
    7585{
    7686        atomic_dec(val);
     
    7888}
    7989
    80 static inline long atomic_preinc(atomic_t *val)
     90static inline atomic_count_t atomic_preinc(atomic_t *val)
    8191{
    8292        atomic_inc(val);
     
    8494}
    8595
    86 static inline long atomic_predec(atomic_t *val)
     96static inline atomic_count_t atomic_predec(atomic_t *val)
    8797{
    8898        atomic_dec(val);
Note: See TracChangeset for help on using the changeset viewer.