Changes in kernel/generic/include/synch/spinlock.h [cc106e4:b2fa1204] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/synch/spinlock.h
rcc106e4 rb2fa1204 45 45 #ifdef CONFIG_SMP 46 46 47 typedef struct spinlock{47 typedef struct { 48 48 atomic_t val; 49 49 … … 137 137 #ifdef CONFIG_DEBUG_SPINLOCK 138 138 139 #include < print.h>139 #include <log.h> 140 140 141 141 #define DEADLOCK_THRESHOLD 100000000 … … 146 146 if ((pname)++ > (value)) { \ 147 147 (pname) = 0; \ 148 printf("Deadlock probe %s: exceeded threshold %u\n" \ 148 log(LF_OTHER, LVL_WARN, \ 149 "Deadlock probe %s: exceeded threshold %u\n" \ 149 150 "cpu%u: function=%s, line=%u\n", \ 150 151 #pname, (value), CPU->id, __func__, __LINE__); \ … … 162 163 /* On UP systems, spinlocks are effectively left out. */ 163 164 164 /* Allow the use of spinlock_t as an incomplete type. */165 typedef struct spinlock spinlock_t;166 167 165 #define SPINLOCK_DECLARE(name) 168 166 #define SPINLOCK_EXTERN(name) … … 179 177 180 178 #define spinlock_lock(lock) preemption_disable() 181 #define spinlock_trylock(lock) ( { preemption_disable(); 1; })179 #define spinlock_trylock(lock) (preemption_disable(), 1) 182 180 #define spinlock_unlock(lock) preemption_enable() 183 181 #define spinlock_locked(lock) 1
Note:
See TracChangeset
for help on using the changeset viewer.