Changes in kernel/generic/include/synch/spinlock.h [63e27ef:b2fa1204] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/synch/spinlock.h
r63e27ef rb2fa1204 36 36 #define KERN_SPINLOCK_H_ 37 37 38 #include < stdbool.h>38 #include <typedefs.h> 39 39 #include <arch/barrier.h> 40 #include <assert.h>41 40 #include <preemption.h> 42 41 #include <atomic.h> 42 #include <debug.h> 43 43 #include <arch/asm.h> 44 44 45 45 #ifdef CONFIG_SMP 46 46 47 typedef struct spinlock{47 typedef struct { 48 48 atomic_t val; 49 49 … … 80 80 81 81 #define ASSERT_SPINLOCK(expr, lock) \ 82 assert_verbose(expr, (lock)->name)82 ASSERT_VERBOSE(expr, (lock)->name) 83 83 84 84 #define spinlock_lock(lock) spinlock_lock_debug((lock)) … … 98 98 99 99 #define ASSERT_SPINLOCK(expr, lock) \ 100 assert(expr)100 ASSERT(expr) 101 101 102 102 #define spinlock_lock(lock) atomic_lock_arch(&(lock)->val) … … 163 163 /* On UP systems, spinlocks are effectively left out. */ 164 164 165 /* Allow the use of spinlock_t as an incomplete type. */166 typedef struct spinlock spinlock_t;167 168 165 #define SPINLOCK_DECLARE(name) 169 166 #define SPINLOCK_EXTERN(name) … … 175 172 #define SPINLOCK_STATIC_INITIALIZE_NAME(name, desc_name) 176 173 177 #define ASSERT_SPINLOCK(expr, lock) assert(expr)174 #define ASSERT_SPINLOCK(expr, lock) ASSERT(expr) 178 175 179 176 #define spinlock_initialize(lock, name) 180 177 181 178 #define spinlock_lock(lock) preemption_disable() 182 #define spinlock_trylock(lock) ( { preemption_disable(); 1; })179 #define spinlock_trylock(lock) (preemption_disable(), 1) 183 180 #define spinlock_unlock(lock) preemption_enable() 184 181 #define spinlock_locked(lock) 1
Note:
See TracChangeset
for help on using the changeset viewer.