Changeset c621f4aa in mainline for kernel/arch/arm32/include/atomic.h
- Timestamp:
- 2010-07-25T10:11:13Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 377cce8
- Parents:
- 24a2517 (diff), a2da43c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
kernel/arch/arm32/include/atomic.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/atomic.h
r24a2517 rc621f4aa 38 38 39 39 #include <arch/asm.h> 40 #include <trace.h> 40 41 41 42 /** Atomic addition. … … 47 48 * 48 49 */ 49 static inline long atomic_add(atomic_t *val, int i) 50 NO_TRACE static inline atomic_count_t atomic_add(atomic_t *val, 51 atomic_count_t i) 50 52 { 51 long ret;52 53 53 /* 54 54 * This implementation is for UP pre-ARMv6 systems where we do not have … … 57 57 ipl_t ipl = interrupts_disable(); 58 58 val->count += i; 59 ret = val->count;59 atomic_count_t ret = val->count; 60 60 interrupts_restore(ipl); 61 61 … … 66 66 * 67 67 * @param val Variable to be incremented. 68 * 68 69 */ 69 static inline void atomic_inc(atomic_t *val)70 NO_TRACE static inline void atomic_inc(atomic_t *val) 70 71 { 71 72 atomic_add(val, 1); … … 75 76 * 76 77 * @param val Variable to be decremented. 78 * 77 79 */ 78 static inline void atomic_dec(atomic_t *val) {80 NO_TRACE static inline void atomic_dec(atomic_t *val) { 79 81 atomic_add(val, -1); 80 82 } … … 84 86 * @param val Variable to be incremented. 85 87 * @return Value after incrementation. 88 * 86 89 */ 87 static inline longatomic_preinc(atomic_t *val)90 NO_TRACE static inline atomic_count_t atomic_preinc(atomic_t *val) 88 91 { 89 92 return atomic_add(val, 1); … … 94 97 * @param val Variable to be decremented. 95 98 * @return Value after decrementation. 99 * 96 100 */ 97 static inline longatomic_predec(atomic_t *val)101 NO_TRACE static inline atomic_count_t atomic_predec(atomic_t *val) 98 102 { 99 103 return atomic_add(val, -1); … … 104 108 * @param val Variable to be incremented. 105 109 * @return Value before incrementation. 110 * 106 111 */ 107 static inline longatomic_postinc(atomic_t *val)112 NO_TRACE static inline atomic_count_t atomic_postinc(atomic_t *val) 108 113 { 109 114 return atomic_add(val, 1) - 1; … … 114 119 * @param val Variable to be decremented. 115 120 * @return Value before decrementation. 121 * 116 122 */ 117 static inline longatomic_postdec(atomic_t *val)123 NO_TRACE static inline atomic_count_t atomic_postdec(atomic_t *val) 118 124 { 119 125 return atomic_add(val, -1) + 1;
Note:
See TracChangeset
for help on using the changeset viewer.
