Changes in kernel/arch/mips32/include/atomic.h [228666c:88d653c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/include/atomic.h
r228666c r88d653c 27 27 */ 28 28 29 /** @addtogroup mips32 29 /** @addtogroup mips32 30 30 * @{ 31 31 */ … … 51 51 * 52 52 * @return Value after addition. 53 *54 53 */ 55 static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i)54 static inline long atomic_add(atomic_t *val, int i) 56 55 { 57 atomic_count_t tmp; 58 atomic_count_t v; 56 long tmp, v; 59 57 60 58 asm volatile ( … … 66 64 " beq %0, %4, 1b\n" /* if the atomic operation failed, try again */ 67 65 " 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) 73 68 ); 74 69 … … 76 71 } 77 72 78 static inline atomic_count_t test_and_set(atomic_t *val) 79 { 80 atomic_count_t tmp; 81 atomic_count_t v; 73 static inline uint32_t test_and_set(atomic_t *val) { 74 uint32_t tmp, v; 82 75 83 76 asm volatile ( … … 89 82 " beqz %0, 1b\n" 90 83 "2:\n" 91 : "=&r" (tmp), 92 "+m" (val->count), 93 "=&r" (v) 84 : "=&r" (tmp), "+m" (val->count), "=&r" (v) 94 85 : "i" (1) 95 86 ); … … 98 89 } 99 90 100 static inline void atomic_lock_arch(atomic_t *val) 101 { 91 static inline void atomic_lock_arch(atomic_t *val) { 102 92 do { 103 while (val->count); 93 while (val->count) 94 ; 104 95 } while (test_and_set(val)); 105 96 }
Note:
See TracChangeset
for help on using the changeset viewer.