Changes in kernel/arch/abs32le/include/atomic.h [d99c1d2:7a0359b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/abs32le/include/atomic.h
rd99c1d2 r7a0359b 39 39 #include <arch/barrier.h> 40 40 #include <preemption.h> 41 #include <verify.h> 42 #include <trace.h> 41 43 42 static inline void atomic_inc(atomic_t *val) { 44 NO_TRACE ATOMIC static inline void atomic_inc(atomic_t *val) 45 WRITES(&val->count) 46 REQUIRES_EXTENT_MUTABLE(val) 47 REQUIRES(val->count < ATOMIC_COUNT_MAX) 48 { 43 49 /* On real hardware the increment has to be done 44 50 as an atomic action. */ … … 47 53 } 48 54 49 static inline void atomic_dec(atomic_t *val) { 55 NO_TRACE ATOMIC static inline void atomic_dec(atomic_t *val) 56 WRITES(&val->count) 57 REQUIRES_EXTENT_MUTABLE(val) 58 REQUIRES(val->count > ATOMIC_COUNT_MIN) 59 { 50 60 /* On real hardware the decrement has to be done 51 61 as an atomic action. */ 52 62 53 val->count ++;63 val->count--; 54 64 } 55 65 56 static inline atomic_count_t atomic_postinc(atomic_t *val) 66 NO_TRACE ATOMIC static inline atomic_count_t atomic_postinc(atomic_t *val) 67 WRITES(&val->count) 68 REQUIRES_EXTENT_MUTABLE(val) 69 REQUIRES(val->count < ATOMIC_COUNT_MAX) 57 70 { 58 71 /* On real hardware both the storing of the previous … … 66 79 } 67 80 68 static inline atomic_count_t atomic_postdec(atomic_t *val) 81 NO_TRACE ATOMIC static inline atomic_count_t atomic_postdec(atomic_t *val) 82 WRITES(&val->count) 83 REQUIRES_EXTENT_MUTABLE(val) 84 REQUIRES(val->count > ATOMIC_COUNT_MIN) 69 85 { 70 86 /* On real hardware both the storing of the previous … … 81 97 #define atomic_predec(val) (atomic_postdec(val) - 1) 82 98 83 static inline atomic_count_t test_and_set(atomic_t *val) 99 NO_TRACE ATOMIC static inline atomic_count_t test_and_set(atomic_t *val) 100 WRITES(&val->count) 101 REQUIRES_EXTENT_MUTABLE(val) 84 102 { 103 /* On real hardware the retrieving of the original 104 value and storing 1 have to be done as a single 105 atomic action. */ 106 85 107 atomic_count_t prev = val->count; 86 108 val->count = 1; … … 88 110 } 89 111 90 static inline void atomic_lock_arch(atomic_t *val) 112 NO_TRACE static inline void atomic_lock_arch(atomic_t *val) 113 WRITES(&val->count) 114 REQUIRES_EXTENT_MUTABLE(val) 91 115 { 92 116 do {
Note:
See TracChangeset
for help on using the changeset viewer.