Ignore:
File:
1 edited

Legend:

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

    r228666c r88d653c  
    2727 */
    2828
    29 /** @addtogroup mips32
     29/** @addtogroup mips32 
    3030 * @{
    3131 */
     
    5151 *
    5252 * @return Value after addition.
    53  *
    5453 */
    55 static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i)
     54static inline long atomic_add(atomic_t *val, int i)
    5655{
    57         atomic_count_t tmp;
    58         atomic_count_t v;
     56        long tmp, v;
    5957       
    6058        asm volatile (
     
    6664                "       beq %0, %4, 1b\n"   /* if the atomic operation failed, try again */
    6765                "       nop\n"
    68                 : "=&r" (tmp),
    69                   "+m" (val->count),
    70                   "=&r" (v)
    71                 : "r" (i),
    72                   "i" (0)
     66                : "=&r" (tmp), "+m" (val->count), "=&r" (v)
     67                : "r" (i), "i" (0)
    7368        );
    7469       
     
    7671}
    7772
    78 static inline atomic_count_t test_and_set(atomic_t *val)
    79 {
    80         atomic_count_t tmp;
    81         atomic_count_t v;
     73static inline uint32_t test_and_set(atomic_t *val) {
     74        uint32_t tmp, v;
    8275       
    8376        asm volatile (
     
    8982                "       beqz %0, 1b\n"
    9083                "2:\n"
    91                 : "=&r" (tmp),
    92                   "+m" (val->count),
    93                   "=&r" (v)
     84                : "=&r" (tmp), "+m" (val->count), "=&r" (v)
    9485                : "i" (1)
    9586        );
     
    9889}
    9990
    100 static inline void atomic_lock_arch(atomic_t *val)
    101 {
     91static inline void atomic_lock_arch(atomic_t *val) {
    10292        do {
    103                 while (val->count);
     93                while (val->count)
     94                        ;
    10495        } while (test_and_set(val));
    10596}
Note: See TracChangeset for help on using the changeset viewer.