Ignore:
File:
1 edited

Legend:

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

    r7a0359b r88d653c  
    2727 */
    2828
    29 /** @addtogroup mips32
     29/** @addtogroup mips32 
    3030 * @{
    3131 */
     
    3535#ifndef KERN_mips32_ATOMIC_H_
    3636#define KERN_mips32_ATOMIC_H_
    37 
    38 #include <trace.h>
    3937
    4038#define atomic_inc(x)  ((void) atomic_add(x, 1))
     
    5351 *
    5452 * @return Value after addition.
    55  *
    5653 */
    57 NO_TRACE static inline atomic_count_t atomic_add(atomic_t *val,
    58     atomic_count_t i)
     54static inline long atomic_add(atomic_t *val, int i)
    5955{
    60         atomic_count_t tmp;
    61         atomic_count_t v;
     56        long tmp, v;
    6257       
    6358        asm volatile (
     
    6964                "       beq %0, %4, 1b\n"   /* if the atomic operation failed, try again */
    7065                "       nop\n"
    71                 : "=&r" (tmp),
    72                   "+m" (val->count),
    73                   "=&r" (v)
    74                 : "r" (i),
    75                   "i" (0)
     66                : "=&r" (tmp), "+m" (val->count), "=&r" (v)
     67                : "r" (i), "i" (0)
    7668        );
    7769       
     
    7971}
    8072
    81 NO_TRACE static inline atomic_count_t test_and_set(atomic_t *val)
    82 {
    83         atomic_count_t tmp;
    84         atomic_count_t v;
     73static inline uint32_t test_and_set(atomic_t *val) {
     74        uint32_t tmp, v;
    8575       
    8676        asm volatile (
     
    9282                "       beqz %0, 1b\n"
    9383                "2:\n"
    94                 : "=&r" (tmp),
    95                   "+m" (val->count),
    96                   "=&r" (v)
     84                : "=&r" (tmp), "+m" (val->count), "=&r" (v)
    9785                : "i" (1)
    9886        );
     
    10189}
    10290
    103 NO_TRACE static inline void atomic_lock_arch(atomic_t *val)
    104 {
     91static inline void atomic_lock_arch(atomic_t *val) {
    10592        do {
    106                 while (val->count);
     93                while (val->count)
     94                        ;
    10795        } while (test_and_set(val));
    10896}
Note: See TracChangeset for help on using the changeset viewer.