Changes in kernel/arch/ppc32/include/atomic.h [7a0359b:228666c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/include/atomic.h
r7a0359b r228666c 36 36 #define KERN_ppc32_ATOMIC_H_ 37 37 38 #include <trace.h> 39 40 NO_TRACE static inline void atomic_inc(atomic_t *val) 38 static inline void atomic_inc(atomic_t *val) 41 39 { 42 40 atomic_count_t tmp; … … 44 42 asm volatile ( 45 43 "1:\n" 46 " lwarx %[tmp], 0, %[count_ptr]\n"47 " addic %[tmp], %[tmp], 1\n"48 " stwcx. %[tmp], 0, %[count_ptr]\n"49 " 50 : [tmp]"=&r" (tmp),44 "lwarx %0, 0, %2\n" 45 "addic %0, %0, 1\n" 46 "stwcx. %0, 0, %2\n" 47 "bne- 1b" 48 : "=&r" (tmp), 51 49 "=m" (val->count) 52 : [count_ptr]"r" (&val->count),50 : "r" (&val->count), 53 51 "m" (val->count) 54 52 : "cc" … … 56 54 } 57 55 58 NO_TRACEstatic inline void atomic_dec(atomic_t *val)56 static inline void atomic_dec(atomic_t *val) 59 57 { 60 58 atomic_count_t tmp; … … 62 60 asm volatile ( 63 61 "1:\n" 64 " lwarx %[tmp], 0, %[count_ptr]\n"65 " addic %[tmp], %[tmp], -1\n"66 " stwcx. %[tmp], 0, %[count_ptr]\n"67 " 68 : [tmp]"=&r" (tmp),62 "lwarx %0, 0, %2\n" 63 "addic %0, %0, -1\n" 64 "stwcx. %0, 0, %2\n" 65 "bne- 1b" 66 : "=&r" (tmp), 69 67 "=m" (val->count) 70 : [count_ptr]"r" (&val->count),68 : "r" (&val->count), 71 69 "m" (val->count) 72 70 : "cc" … … 74 72 } 75 73 76 NO_TRACEstatic inline atomic_count_t atomic_postinc(atomic_t *val)74 static inline atomic_count_t atomic_postinc(atomic_t *val) 77 75 { 78 76 atomic_inc(val); … … 80 78 } 81 79 82 NO_TRACEstatic inline atomic_count_t atomic_postdec(atomic_t *val)80 static inline atomic_count_t atomic_postdec(atomic_t *val) 83 81 { 84 82 atomic_dec(val); … … 86 84 } 87 85 88 NO_TRACEstatic inline atomic_count_t atomic_preinc(atomic_t *val)86 static inline atomic_count_t atomic_preinc(atomic_t *val) 89 87 { 90 88 atomic_inc(val); … … 92 90 } 93 91 94 NO_TRACEstatic inline atomic_count_t atomic_predec(atomic_t *val)92 static inline atomic_count_t atomic_predec(atomic_t *val) 95 93 { 96 94 atomic_dec(val);
Note:
See TracChangeset
for help on using the changeset viewer.