Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/synch/spinlock.h

    r13108f24 r90c8b8d  
    3636#define KERN_SPINLOCK_H_
    3737
    38 #include <typedefs.h>
     38#include <arch/types.h>
    3939#include <arch/barrier.h>
    4040#include <preemption.h>
     
    4848       
    4949#ifdef CONFIG_DEBUG_SPINLOCK
    50         const char *name;
     50        char *name;
    5151#endif
    5252} spinlock_t;
     
    7777        }
    7878
    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)
    8180
    8281#else
     
    9291        }
    9392
    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)
    9694
    9795#endif
     
    103101        SPINLOCK_STATIC_INITIALIZE_NAME(lock_name, #lock_name)
    104102
    105 extern void spinlock_initialize(spinlock_t *lock, const char *name);
     103extern void spinlock_initialize(spinlock_t *lock, char *name);
    106104extern int spinlock_trylock(spinlock_t *lock);
    107105extern void spinlock_lock_debug(spinlock_t *lock);
    108 extern void spinlock_unlock_debug(spinlock_t *lock);
    109106
    110107/** Unlock spinlock
    111108 *
    112  * Unlock spinlock for non-debug kernels.
     109 * Unlock spinlock.
    113110 *
    114111 * @param sl Pointer to spinlock_t structure.
    115112 */
    116 static inline void spinlock_unlock_nondebug(spinlock_t *lock)
     113static inline void spinlock_unlock(spinlock_t *lock)
    117114{
     115        ASSERT(atomic_get(&lock->val) != 0);
     116       
    118117        /*
    119118         * Prevent critical section code from bleeding out this way down.
Note: See TracChangeset for help on using the changeset viewer.