4 * Implement the MP lock. Note that debug operations
6 #ifndef _SYS_MPLOCK2_H_
7 #define _SYS_MPLOCK2_H_
9 #ifndef _MACHINE_ATOMIC_H_
10 #include <machine/atomic.h>
12 #ifndef _SYS_THREAD_H_
13 #include <sys/thread.h>
15 #ifndef _SYS_GLOBALDATA_H_
16 #include <sys/globaldata.h>
22 * NOTE: try_mplock()/lwkt_trytoken() return non-zero on success.
24 #define get_mplock() lwkt_gettoken(&mp_token)
25 #define try_mplock() lwkt_trytoken(&mp_token)
26 #define rel_mplock() lwkt_reltoken(&mp_token)
27 #define get_mplock_count(td) lwkt_cnttoken(&mp_token, td)
29 void cpu_get_initial_mplock(void);
31 #define MP_LOCK_HELD() LWKT_TOKEN_HELD(&mp_token)
32 #define ASSERT_MP_LOCK_HELD() ASSERT_LWKT_TOKEN_HELD(&mp_token)
37 * UNI-PROCESSOR BUILD - Degenerate case macros
41 #define try_mplock() 1
42 #define owner_mplock() 0
43 #define MP_LOCK_HELD(gd) 1
44 #define ASSERT_MP_LOCK_HELD(td)