Changeset 53f9821 in mainline for generic/include/synch/spinlock.h
- Timestamp:
- 2006-03-20T20:32:17Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 018d957e
- Parents:
- 9d3e185
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/synch/spinlock.h
r9d3e185 r53f9821 34 34 #include <preemption.h> 35 35 #include <arch/atomic.h> 36 #include <debug.h> 36 37 37 38 #ifdef CONFIG_SMP … … 67 68 68 69 extern void spinlock_initialize(spinlock_t *sl, char *name); 69 extern void spinlock_lock(spinlock_t *sl);70 70 extern int spinlock_trylock(spinlock_t *sl); 71 extern void spinlock_unlock(spinlock_t *sl); 71 extern void spinlock_lock_debug(spinlock_t *sl); 72 73 #ifdef CONFIG_DEBUG_SPINLOCK 74 # define spinlock_lock(x) spinlock_lock_debug(x) 75 #else 76 # define spinlock_lock(x) atomic_lock_arch(&(x)->val) 77 #endif 78 79 /** Unlock spinlock 80 * 81 * Unlock spinlock. 82 * 83 * @param sl Pointer to spinlock_t structure. 84 */ 85 static inline void spinlock_unlock(spinlock_t *sl) 86 { 87 ASSERT(atomic_get(&sl->val) != 0); 88 89 /* 90 * Prevent critical section code from bleeding out this way down. 91 */ 92 CS_LEAVE_BARRIER(); 93 94 atomic_set(&sl->val,0); 95 preemption_enable(); 96 } 72 97 73 98 #else
Note:
See TracChangeset
for help on using the changeset viewer.