Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/include/atomic.h

    r7a0359b rdf4ed85  
    2727 */
    2828
    29 /** @addtogroup ppc32
     29/** @addtogroup ppc32   
    3030 * @{
    3131 */
     
    3636#define KERN_ppc32_ATOMIC_H_
    3737
    38 #include <trace.h>
     38static inline void atomic_inc(atomic_t *val)
     39{
     40        long tmp;
    3941
    40 NO_TRACE static inline void atomic_inc(atomic_t *val)
    41 {
    42         atomic_count_t tmp;
    43        
    4442        asm volatile (
    4543                "1:\n"
    46                 "       lwarx %[tmp], 0, %[count_ptr]\n"
    47                 "       addic %[tmp], %[tmp], 1\n"
    48                 "       stwcx. %[tmp], 0, %[count_ptr]\n"
    49                 "       bne- 1b"
    50                 : [tmp] "=&r" (tmp),
    51                   "=m" (val->count)
    52                 : [count_ptr] "r" (&val->count),
    53                   "m" (val->count)
     44                "lwarx %0, 0, %2\n"
     45                "addic %0, %0, 1\n"
     46                "stwcx. %0, 0, %2\n"
     47                "bne- 1b"
     48                : "=&r" (tmp), "=m" (val->count)
     49                : "r" (&val->count), "m" (val->count)
    5450                : "cc"
    5551        );
    5652}
    5753
    58 NO_TRACE static inline void atomic_dec(atomic_t *val)
     54static inline void atomic_dec(atomic_t *val)
    5955{
    60         atomic_count_t tmp;
    61        
     56        long tmp;
     57
    6258        asm volatile (
    6359                "1:\n"
    64                 "       lwarx %[tmp], 0, %[count_ptr]\n"
    65                 "       addic %[tmp], %[tmp], -1\n"
    66                 "       stwcx. %[tmp], 0, %[count_ptr]\n"
    67                 "       bne- 1b"
    68                 : [tmp] "=&r" (tmp),
    69                   "=m" (val->count)
    70                 : [count_ptr] "r" (&val->count),
    71                   "m" (val->count)
     60                "lwarx %0, 0, %2\n"
     61                "addic %0, %0, -1\n"
     62                "stwcx. %0, 0, %2\n"
     63                "bne- 1b"
     64                : "=&r" (tmp), "=m" (val->count)
     65                : "r" (&val->count), "m" (val->count)
    7266                : "cc"
    7367        );
    7468}
    7569
    76 NO_TRACE static inline atomic_count_t atomic_postinc(atomic_t *val)
     70static inline long atomic_postinc(atomic_t *val)
    7771{
    7872        atomic_inc(val);
     
    8074}
    8175
    82 NO_TRACE static inline atomic_count_t atomic_postdec(atomic_t *val)
     76static inline long atomic_postdec(atomic_t *val)
    8377{
    8478        atomic_dec(val);
     
    8680}
    8781
    88 NO_TRACE static inline atomic_count_t atomic_preinc(atomic_t *val)
     82static inline long atomic_preinc(atomic_t *val)
    8983{
    9084        atomic_inc(val);
     
    9286}
    9387
    94 NO_TRACE static inline atomic_count_t atomic_predec(atomic_t *val)
     88static inline long atomic_predec(atomic_t *val)
    9589{
    9690        atomic_dec(val);
Note: See TracChangeset for help on using the changeset viewer.