]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/lockstat.h
327b033041c8e076b80d6ca7ffd15722f9120486
[apple/xnu.git] / bsd / sys / lockstat.h
1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 1997-2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #ifndef _SYS_LOCKSTAT_H
28 #define _SYS_LOCKSTAT_H
29
30 /* #pragma ident "@(#)lockstat.h 1.6 05/06/08 SMI" */
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 /*
37 * Name the various locking functions...
38 */
39 #define LS_LCK_MTX_LOCK "lck_mtx_lock"
40 #define LS_LCK_MTX_SPIN_LOCK "lck_mtx_spin_lock"
41 #define LS_LCK_MTX_UNLOCK "lck_mtx_unlock"
42 #define LS_LCK_MTX_TRY_LOCK "lck_mtx_try_lock"
43 #define LS_LCK_MTX_TRY_SPIN_LOCK "lck_mtx_try_spin_lock"
44 #define LS_LCK_MTX_EXT_LOCK "lck_mtx_ext_lock"
45 #define LS_LCK_MTX_EXT_UNLOCK "lck_mtx_ext_unlock"
46 #define LS_LCK_MTX_EXT_TRY_LOCK "lck_mtx_ext_try_lock"
47 #define LS_LCK_MTX_LOCK_SPIN_LOCK "lck_mtx_lock_spin"
48
49 #define LS_LCK_SPIN_LOCK "lck_spin_lock"
50 #define LS_LCK_SPIN_TRY_LOCK "lck_spin_try_lock"
51 #define LS_LCK_SPIN_UNLOCK "lck_spin_unlock"
52 #define LS_LCK_RW_LOCK_SHARED "lck_rw_lock_shared"
53 #define LS_LCK_RW_LOCK_EXCL "lck_rw_lock_exclusive"
54 #define LS_LCK_RW_DONE "lck_rw_done"
55 #define LS_LCK_RW_TRY_LOCK_EXCL "lck_rw_try_lock_exclusive"
56 #define LS_LCK_RW_TRY_LOCK_SHARED "lck_rw_try_lock_shared"
57 #define LS_LCK_RW_LOCK_SHARED_TO_EXCL "lck_rw_shared_to_exclusive"
58 #define LS_LCK_RW_LOCK_EXCL_TO_SHARED "lck_rw_exclusive_to_shared"
59
60 #define LS_ACQUIRE "acquire"
61 #define LS_RELEASE "release"
62 #define LS_SPIN "spin"
63 #define LS_BLOCK "block"
64 #define LS_UPGRADE "upgrade"
65 #define LS_DOWNGRADE "downgrade"
66
67 #define LS_TYPE_ADAPTIVE "adaptive"
68 #define LS_TYPE_SPIN "spin"
69 #define LS_TYPE_ILK "interlock" /* OS X only */
70 #define LS_TYPE_THREAD "thread" /* Solaris only */
71 #define LS_TYPE_RW "rw"
72 #define LS_TYPE_RWUPGRADE "rwupgrade" /* OS X only */
73
74 #define LSA_ACQUIRE (LS_TYPE_ADAPTIVE "-" LS_ACQUIRE)
75 #define LSA_RELEASE (LS_TYPE_ADAPTIVE "-" LS_RELEASE)
76 #define LSA_SPIN (LS_TYPE_ADAPTIVE "-" LS_SPIN)
77 #define LSA_BLOCK (LS_TYPE_ADAPTIVE "-" LS_BLOCK)
78 #define LSA_ILK_SPIN (LS_TYPE_ILK "-" LS_SPIN)
79 #define LSS_ACQUIRE (LS_TYPE_SPIN "-" LS_ACQUIRE)
80 #define LSS_RELEASE (LS_TYPE_SPIN "-" LS_RELEASE)
81 #define LSS_SPIN (LS_TYPE_SPIN "-" LS_SPIN)
82 #define LSR_ACQUIRE (LS_TYPE_RW "-" LS_ACQUIRE)
83 #define LSR_RELEASE (LS_TYPE_RW "-" LS_RELEASE)
84 #define LSR_BLOCK (LS_TYPE_RW "-" LS_BLOCK)
85 #define LSR_SPIN (LS_TYPE_RW "-" LS_SPIN)
86 #define LSR_UPGRADE (LS_TYPE_RW "-" LS_UPGRADE)
87 #define LSR_UPGRADE_BLOCK (LS_TYPE_RWUPGRADE "-" LS_BLOCK)
88 #define LSR_DOWNGRADE (LS_TYPE_RW "-" LS_DOWNGRADE)
89 #define LST_SPIN (LS_TYPE_THREAD "-" LS_SPIN)
90
91 #ifdef __cplusplus
92 }
93 #endif
94
95 #endif /* _SYS_LOCKSTAT_H */