Changes in kernel/generic/include/synch/spinlock.h [78de83de:05882233] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/synch/spinlock.h
r78de83de r05882233 36 36 #define KERN_SPINLOCK_H_ 37 37 38 #include <stdbool.h> 39 #include <barrier.h> 38 40 #include <assert.h> 39 #include <stdatomic.h>40 #include <stdbool.h>41 41 #include <preemption.h> 42 #include <atomic.h> 42 43 #include <arch/asm.h> 43 44 … … 45 46 46 47 typedef struct spinlock { 47 atomic_ flag flag;48 atomic_t val; 48 49 49 50 #ifdef CONFIG_DEBUG_SPINLOCK … … 69 70 spinlock_t lock_name = { \ 70 71 .name = desc_name, \ 71 . flag = ATOMIC_FLAG_INIT\72 .val = { 0 } \ 72 73 } 73 74 … … 75 76 static spinlock_t lock_name = { \ 76 77 .name = desc_name, \ 77 . flag = ATOMIC_FLAG_INIT\78 .val = { 0 } \ 78 79 } 79 80 … … 88 89 #define SPINLOCK_INITIALIZE_NAME(lock_name, desc_name) \ 89 90 spinlock_t lock_name = { \ 90 . flag = ATOMIC_FLAG_INIT\91 .val = { 0 } \ 91 92 } 92 93 93 94 #define SPINLOCK_STATIC_INITIALIZE_NAME(lock_name, desc_name) \ 94 95 static spinlock_t lock_name = { \ 95 . flag = ATOMIC_FLAG_INIT\96 .val = { 0 } \ 96 97 } 97 98 … … 125 126 NO_TRACE static inline void spinlock_unlock_nondebug(spinlock_t *lock) 126 127 { 127 atomic_flag_clear_explicit(&lock->flag, memory_order_release); 128 /* 129 * Prevent critical section code from bleeding out this way down. 130 */ 131 CS_LEAVE_BARRIER(); 132 133 atomic_set(&lock->val, 0); 128 134 preemption_enable(); 129 135 } … … 209 215 .lock = { \ 210 216 .name = desc_name, \ 211 . flag = ATOMIC_FLAG_INIT\217 .val = { 0 } \ 212 218 }, \ 213 219 .guard = false, \ … … 219 225 .lock = { \ 220 226 .name = desc_name, \ 221 . flag = ATOMIC_FLAG_INIT\227 .val = { 0 } \ 222 228 }, \ 223 229 .guard = false, \ … … 230 236 irq_spinlock_t lock_name = { \ 231 237 .lock = { \ 232 . flag = ATOMIC_FLAG_INIT\238 .val = { 0 } \ 233 239 }, \ 234 240 .guard = false, \ … … 239 245 static irq_spinlock_t lock_name = { \ 240 246 .lock = { \ 241 . flag = ATOMIC_FLAG_INIT\247 .val = { 0 } \ 242 248 }, \ 243 249 .guard = false, \
Note:
See TracChangeset
for help on using the changeset viewer.