Changes in kernel/arch/sparc64/include/atomic.h [7a0359b:40239b9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/atomic.h
r7a0359b r40239b9 39 39 #include <typedefs.h> 40 40 #include <preemption.h> 41 #include <trace.h>42 41 43 42 /** Atomic add operation. … … 51 50 * 52 51 */ 53 NO_TRACE static inline atomic_count_t atomic_add(atomic_t *val, 54 atomic_count_t i) 52 static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i) 55 53 { 56 54 atomic_count_t a; … … 74 72 } 75 73 76 NO_TRACEstatic inline atomic_count_t atomic_preinc(atomic_t *val)74 static inline atomic_count_t atomic_preinc(atomic_t *val) 77 75 { 78 76 return atomic_add(val, 1) + 1; 79 77 } 80 78 81 NO_TRACEstatic inline atomic_count_t atomic_postinc(atomic_t *val)79 static inline atomic_count_t atomic_postinc(atomic_t *val) 82 80 { 83 81 return atomic_add(val, 1); 84 82 } 85 83 86 NO_TRACEstatic inline atomic_count_t atomic_predec(atomic_t *val)84 static inline atomic_count_t atomic_predec(atomic_t *val) 87 85 { 88 86 return atomic_add(val, -1) - 1; 89 87 } 90 88 91 NO_TRACEstatic inline atomic_count_t atomic_postdec(atomic_t *val)89 static inline atomic_count_t atomic_postdec(atomic_t *val) 92 90 { 93 91 return atomic_add(val, -1); 94 92 } 95 93 96 NO_TRACEstatic inline void atomic_inc(atomic_t *val)94 static inline void atomic_inc(atomic_t *val) 97 95 { 98 96 (void) atomic_add(val, 1); 99 97 } 100 98 101 NO_TRACEstatic inline void atomic_dec(atomic_t *val)99 static inline void atomic_dec(atomic_t *val) 102 100 { 103 101 (void) atomic_add(val, -1); 104 102 } 105 103 106 NO_TRACEstatic inline atomic_count_t test_and_set(atomic_t *val)104 static inline atomic_count_t test_and_set(atomic_t *val) 107 105 { 108 106 atomic_count_t v = 1; … … 119 117 } 120 118 121 NO_TRACEstatic inline void atomic_lock_arch(atomic_t *val)119 static inline void atomic_lock_arch(atomic_t *val) 122 120 { 123 121 atomic_count_t tmp1 = 1;
Note:
See TracChangeset
for help on using the changeset viewer.