Changes in kernel/generic/include/synch/spinlock.h [13108f24:90c8b8d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/synch/spinlock.h
r13108f24 r90c8b8d 36 36 #define KERN_SPINLOCK_H_ 37 37 38 #include < typedefs.h>38 #include <arch/types.h> 39 39 #include <arch/barrier.h> 40 40 #include <preemption.h> … … 48 48 49 49 #ifdef CONFIG_DEBUG_SPINLOCK 50 c onst char *name;50 char *name; 51 51 #endif 52 52 } spinlock_t; … … 77 77 } 78 78 79 #define spinlock_lock(lock) spinlock_lock_debug((lock)) 80 #define spinlock_unlock(lock) spinlock_unlock_debug((lock)) 79 #define spinlock_lock(lock) spinlock_lock_debug(lock) 81 80 82 81 #else … … 92 91 } 93 92 94 #define spinlock_lock(lock) atomic_lock_arch(&(lock)->val) 95 #define spinlock_unlock(lock) spinlock_unlock_nondebug((lock)) 93 #define spinlock_lock(lock) atomic_lock_arch(&(lock)->val) 96 94 97 95 #endif … … 103 101 SPINLOCK_STATIC_INITIALIZE_NAME(lock_name, #lock_name) 104 102 105 extern void spinlock_initialize(spinlock_t *lock, c onst char *name);103 extern void spinlock_initialize(spinlock_t *lock, char *name); 106 104 extern int spinlock_trylock(spinlock_t *lock); 107 105 extern void spinlock_lock_debug(spinlock_t *lock); 108 extern void spinlock_unlock_debug(spinlock_t *lock);109 106 110 107 /** Unlock spinlock 111 108 * 112 * Unlock spinlock for non-debug kernels.109 * Unlock spinlock. 113 110 * 114 111 * @param sl Pointer to spinlock_t structure. 115 112 */ 116 static inline void spinlock_unlock _nondebug(spinlock_t *lock)113 static inline void spinlock_unlock(spinlock_t *lock) 117 114 { 115 ASSERT(atomic_get(&lock->val) != 0); 116 118 117 /* 119 118 * Prevent critical section code from bleeding out this way down.
Note:
See TracChangeset
for help on using the changeset viewer.