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