Ignore:
File:
1 edited

Legend:

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

    r63e27ef rb2fa1204  
    3636#define KERN_SPINLOCK_H_
    3737
    38 #include <stdbool.h>
     38#include <typedefs.h>
    3939#include <arch/barrier.h>
    40 #include <assert.h>
    4140#include <preemption.h>
    4241#include <atomic.h>
     42#include <debug.h>
    4343#include <arch/asm.h>
    4444
    4545#ifdef CONFIG_SMP
    4646
    47 typedef struct spinlock {
     47typedef struct {
    4848        atomic_t val;
    4949       
     
    8080
    8181#define ASSERT_SPINLOCK(expr, lock) \
    82         assert_verbose(expr, (lock)->name)
     82        ASSERT_VERBOSE(expr, (lock)->name)
    8383
    8484#define spinlock_lock(lock)    spinlock_lock_debug((lock))
     
    9898
    9999#define ASSERT_SPINLOCK(expr, lock) \
    100         assert(expr)
     100        ASSERT(expr)
    101101
    102102#define spinlock_lock(lock)    atomic_lock_arch(&(lock)->val)
     
    163163/* On UP systems, spinlocks are effectively left out. */
    164164
    165 /* Allow the use of spinlock_t as an incomplete type. */
    166 typedef struct spinlock spinlock_t;
    167 
    168165#define SPINLOCK_DECLARE(name)
    169166#define SPINLOCK_EXTERN(name)
     
    175172#define SPINLOCK_STATIC_INITIALIZE_NAME(name, desc_name)
    176173
    177 #define ASSERT_SPINLOCK(expr, lock)  assert(expr)
     174#define ASSERT_SPINLOCK(expr, lock)  ASSERT(expr)
    178175
    179176#define spinlock_initialize(lock, name)
    180177
    181178#define spinlock_lock(lock)     preemption_disable()
    182 #define spinlock_trylock(lock)  ({ preemption_disable(); 1; })
     179#define spinlock_trylock(lock)  (preemption_disable(), 1)
    183180#define spinlock_unlock(lock)   preemption_enable()
    184181#define spinlock_locked(lock)   1
Note: See TracChangeset for help on using the changeset viewer.