1 #ifndef __XFS_SUPPORT_SPIN_H__
2 #define __XFS_SUPPORT_SPIN_H__
9 #define SPLDECL(s) register_t s
12 * Map the spinlocks from IRIX to FreeBSD
14 #define spinlock_init(lock, name) mtx_init(lock, name, NULL, MTX_DEF)
15 #define spinlock_destroy(lock) mtx_destroy(lock)
18 * Map lock_t from IRIX to FreeBSD mutexes
20 typedef struct mtx lock_t;
22 #define nested_spinunlock(lock) mtx_unlock(lock)
23 #define nested_spinlock(lock) mtx_lock(lock)
24 #define nested_spintrylock(lock) mtx_trylock(lock)
26 #define spin_lock(lock) mtx_lock(lock)
27 #define spin_unlock(lock) mtx_unlock(lock)
30 #define mutex_spinlock(lock) (spin_lock(lock),0)
32 static __inline register_t
33 mutex_spinlock(lock_t *lock) { mtx_lock(lock); return 0; }
36 #define mutex_spinunlock(lock, s) \
42 #endif /* __XFS_SUPPORT_SPIN_H__ */