4 #include "kernel/kernel.h"
6 typedef struct spinlock
{
12 #define SPINLOCK_DEFINE(name)
13 #define PRIVATE_SPINLOCK_DEFINE(name)
14 #define SPINLOCK_DECLARE(name)
15 #define spinlock_init(sl)
16 #define spinlock_lock(sl)
17 #define spinlock_unlock(sl)
22 #define SPINLOCK_DEFINE(name) spinlock_t name;
23 #define PRIVATE_SPINLOCK_DEFINE(name) PRIVATE SPINLOCK_DEFINE(name)
24 #define SPINLOCK_DECLARE(name) extern SPINLOCK_DEFINE(name)
25 #define spinlock_init(sl) do { (sl)->val = 0; } while (0)
27 #if CONFIG_MAX_CPUS == 1
28 #define spinlock_lock(sl)
29 #define spinlock_unlock(sl)
31 void arch_spinlock_lock(atomic_t
* sl
);
32 void arch_spinlock_unlock(atomic_t
* sl
);
33 #define spinlock_lock(sl) arch_spinlock_lock((atomic_t*) sl)
34 #define spinlock_unlock(sl) arch_spinlock_unlock((atomic_t*) sl)
38 #endif /* CONFIG_SMP */
40 #define BKL_LOCK() spinlock_lock(&big_kernel_lock)
41 #define BKL_UNLOCK() spinlock_unlock(&big_kernel_lock)
43 #endif /* __SPINLOCK_H__ */