Go to the documentation of this file. 1#ifndef __VSF_LINUX_SPINLOCK_H__
2#define __VSF_LINUX_SPINLOCK_H__
14#define SPIN_LOCK_INIT() (0)
15#define spin_lock_init(lock) vsf_spinlock_init(lock)
16#define spin_lock(lock) vsf_spin_lock(lock)
17#define spin_unlock(lock) vsf_spin_unlock(lock)
18#define spin_trylock(lock) vsf_spin_trylock(lock)
19#define spin_lock_irq(lock) do { vsf_disable_interrupt(); spin_lock(lock); } while(0)
20#define spin_unlock_irq(lock) do { spin_unlock(lock); vsf_enable_interrupt(); } while(0)
21#define spin_lock_irqsave(lock, flags) do { flags = vsf_protect_int(); spin_lock(lock); } while(0)
22#define spin_unlock_irqrestore(lock, flags) do { spin_unlock(lock); vsf_unprotect_int(flags); } while(0)
28#define SPIN_LOCK_INIT() (0)
29#define spin_lock_init(lock) do { *lock = 0; } while(0)
30#define __spin_lock(lock) do { *lock = 1; } while (0)
31#define __spin_unlock(lock) do { *lock = 0; } while (0)
32#define spin_lock(lock) do { vsf_protect_t orig = vsf_protect_int(); __spin_lock(lock); vsf_unprotect_int(orig); } while (0)
33#define spin_unlock(lock) do { vsf_protect_t orig = vsf_protect_int(); __spin_unlock(lock); vsf_unprotect_int(orig); } while (0)
34#define spin_trylock(lock) (spin_lock(lock), 1)
35#define spin_lock_irq(lock) do { vsf_disable_interrupt(); __spin_lock(lock); } while(0)
36#define spin_unlock_irq(lock) do { __spin_unlock(lock); vsf_enable_interrupt(); } while(0)
37#define spin_lock_irqsave(lock, flags) do { flags = vsf_protect_int(); __spin_lock(lock); } while(0)
38#define spin_unlock_irqrestore(lock, flags) do { __spin_unlock(lock); vsf_unprotect_int(flags); } while(0)
int spinlock_t
Definition spinlock.h:26