Changes in kernel/generic/include/synch/spinlock.h [b2fa1204:63e27ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/synch/spinlock.h
rb2fa1204 r63e27ef 36 36 #define KERN_SPINLOCK_H_ 37 37 38 #include < typedefs.h>38 #include <stdbool.h> 39 39 #include <arch/barrier.h> 40 #include <assert.h> 40 41 #include <preemption.h> 41 42 #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 {47 typedef struct spinlock { 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 165 168 #define SPINLOCK_DECLARE(name) 166 169 #define SPINLOCK_EXTERN(name) … … 172 175 #define SPINLOCK_STATIC_INITIALIZE_NAME(name, desc_name) 173 176 174 #define ASSERT_SPINLOCK(expr, lock) ASSERT(expr)177 #define ASSERT_SPINLOCK(expr, lock) assert(expr) 175 178 176 179 #define spinlock_initialize(lock, name) 177 180 178 181 #define spinlock_lock(lock) preemption_disable() 179 #define spinlock_trylock(lock) ( preemption_disable(), 1)182 #define spinlock_trylock(lock) ({ preemption_disable(); 1; }) 180 183 #define spinlock_unlock(lock) preemption_enable() 181 184 #define spinlock_locked(lock) 1
Note:
See TracChangeset
for help on using the changeset viewer.