xref: /xnu-12377.61.12/bsd/sys/lockstat.h (revision 4d495c6e23c53686cf65f45067f79024cf5dcee8)
1*4d495c6eSApple OSS Distributions /*
2*4d495c6eSApple OSS Distributions  * CDDL HEADER START
3*4d495c6eSApple OSS Distributions  *
4*4d495c6eSApple OSS Distributions  * The contents of this file are subject to the terms of the
5*4d495c6eSApple OSS Distributions  * Common Development and Distribution License, Version 1.0 only
6*4d495c6eSApple OSS Distributions  * (the "License").  You may not use this file except in compliance
7*4d495c6eSApple OSS Distributions  * with the License.
8*4d495c6eSApple OSS Distributions  *
9*4d495c6eSApple OSS Distributions  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*4d495c6eSApple OSS Distributions  * or http://www.opensolaris.org/os/licensing.
11*4d495c6eSApple OSS Distributions  * See the License for the specific language governing permissions
12*4d495c6eSApple OSS Distributions  * and limitations under the License.
13*4d495c6eSApple OSS Distributions  *
14*4d495c6eSApple OSS Distributions  * When distributing Covered Code, include this CDDL HEADER in each
15*4d495c6eSApple OSS Distributions  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*4d495c6eSApple OSS Distributions  * If applicable, add the following below this CDDL HEADER, with the
17*4d495c6eSApple OSS Distributions  * fields enclosed by brackets "[]" replaced with your own identifying
18*4d495c6eSApple OSS Distributions  * information: Portions Copyright [yyyy] [name of copyright owner]
19*4d495c6eSApple OSS Distributions  *
20*4d495c6eSApple OSS Distributions  * CDDL HEADER END
21*4d495c6eSApple OSS Distributions  */
22*4d495c6eSApple OSS Distributions /*
23*4d495c6eSApple OSS Distributions  * Copyright 1997-2003 Sun Microsystems, Inc.  All rights reserved.
24*4d495c6eSApple OSS Distributions  * Use is subject to license terms.
25*4d495c6eSApple OSS Distributions  */
26*4d495c6eSApple OSS Distributions 
27*4d495c6eSApple OSS Distributions #ifndef _SYS_LOCKSTAT_H
28*4d495c6eSApple OSS Distributions #define _SYS_LOCKSTAT_H
29*4d495c6eSApple OSS Distributions 
30*4d495c6eSApple OSS Distributions #ifdef  __cplusplus
31*4d495c6eSApple OSS Distributions extern "C" {
32*4d495c6eSApple OSS Distributions #endif
33*4d495c6eSApple OSS Distributions 
34*4d495c6eSApple OSS Distributions /*
35*4d495c6eSApple OSS Distributions  * Name the various locking functions...
36*4d495c6eSApple OSS Distributions  */
37*4d495c6eSApple OSS Distributions #define LS_LCK_MTX_LOCK_SPIN            "lck_mtx_lock_spin"
38*4d495c6eSApple OSS Distributions #define LS_LCK_MTX_LOCK                 "lck_mtx_lock"
39*4d495c6eSApple OSS Distributions #define LS_LCK_MTX_TRY_LOCK_SPIN        "lck_mtx_try_lock_spin"
40*4d495c6eSApple OSS Distributions #define LS_LCK_MTX_TRY_LOCK             "lck_mtx_try_lock"
41*4d495c6eSApple OSS Distributions #define LS_LCK_MTX_UNLOCK               "lck_mtx_unlock"
42*4d495c6eSApple OSS Distributions 
43*4d495c6eSApple OSS Distributions #define LS_LCK_SPIN_LOCK                "lck_spin_lock"
44*4d495c6eSApple OSS Distributions #define LS_LCK_SPIN_TRY_LOCK            "lck_spin_try_lock"
45*4d495c6eSApple OSS Distributions #define LS_LCK_SPIN_UNLOCK              "lck_spin_unlock"
46*4d495c6eSApple OSS Distributions #define LS_LCK_RW_LOCK_SHARED           "lck_rw_lock_shared"
47*4d495c6eSApple OSS Distributions #define LS_LCK_RW_LOCK_EXCL             "lck_rw_lock_exclusive"
48*4d495c6eSApple OSS Distributions #define LS_LCK_RW_DONE                  "lck_rw_done"
49*4d495c6eSApple OSS Distributions #define LS_LCK_RW_TRY_LOCK_EXCL         "lck_rw_try_lock_exclusive"
50*4d495c6eSApple OSS Distributions #define LS_LCK_RW_TRY_LOCK_SHARED       "lck_rw_try_lock_shared"
51*4d495c6eSApple OSS Distributions #define LS_LCK_RW_LOCK_SHARED_TO_EXCL   "lck_rw_lock_shared_to_exclusive"
52*4d495c6eSApple OSS Distributions #define LS_LCK_RW_LOCK_EXCL_TO_SHARED   "lck_rw_lock_exclusive_to_shared"
53*4d495c6eSApple OSS Distributions #define LS_LCK_TICKET_LOCK              "lck_ticket_lock"
54*4d495c6eSApple OSS Distributions #define LS_LCK_TICKET_UNLOCK            "lck_ticket_unlock"
55*4d495c6eSApple OSS Distributions 
56*4d495c6eSApple OSS Distributions 
57*4d495c6eSApple OSS Distributions #define LS_ACQUIRE                      "acquire"
58*4d495c6eSApple OSS Distributions #define LS_RELEASE                      "release"
59*4d495c6eSApple OSS Distributions #define LS_SPIN                         "spin"
60*4d495c6eSApple OSS Distributions #define LS_BLOCK                        "block"
61*4d495c6eSApple OSS Distributions #define LS_UPGRADE                      "upgrade"
62*4d495c6eSApple OSS Distributions #define LS_DOWNGRADE                    "downgrade"
63*4d495c6eSApple OSS Distributions 
64*4d495c6eSApple OSS Distributions #define LS_TYPE_ADAPTIVE                "adaptive" /* this really means "mutex" */
65*4d495c6eSApple OSS Distributions #define LS_TYPE_SPIN                    "spin"
66*4d495c6eSApple OSS Distributions #define LS_TYPE_RW                      "rw"
67*4d495c6eSApple OSS Distributions #define LS_TYPE_TICKET                  "ticket"
68*4d495c6eSApple OSS Distributions 
69*4d495c6eSApple OSS Distributions #define LSA_ACQUIRE                     (LS_TYPE_ADAPTIVE "-" LS_ACQUIRE)
70*4d495c6eSApple OSS Distributions #define LSA_RELEASE                     (LS_TYPE_ADAPTIVE "-" LS_RELEASE)
71*4d495c6eSApple OSS Distributions #define LSA_SPIN                        (LS_TYPE_ADAPTIVE "-" LS_SPIN)
72*4d495c6eSApple OSS Distributions #define LSA_BLOCK                       (LS_TYPE_ADAPTIVE "-" LS_BLOCK)
73*4d495c6eSApple OSS Distributions #define LSS_ACQUIRE                     (LS_TYPE_SPIN "-" LS_ACQUIRE)
74*4d495c6eSApple OSS Distributions #define LSS_RELEASE                     (LS_TYPE_SPIN "-" LS_RELEASE)
75*4d495c6eSApple OSS Distributions #define LSS_SPIN                        (LS_TYPE_SPIN "-" LS_SPIN)
76*4d495c6eSApple OSS Distributions #define LSR_ACQUIRE                     (LS_TYPE_RW "-" LS_ACQUIRE)
77*4d495c6eSApple OSS Distributions #define LSR_RELEASE                     (LS_TYPE_RW "-" LS_RELEASE)
78*4d495c6eSApple OSS Distributions #define LSR_BLOCK                       (LS_TYPE_RW "-" LS_BLOCK)
79*4d495c6eSApple OSS Distributions #define LSR_SPIN                        (LS_TYPE_RW "-" LS_SPIN)
80*4d495c6eSApple OSS Distributions #define LSR_UPGRADE                     (LS_TYPE_RW "-" LS_UPGRADE)
81*4d495c6eSApple OSS Distributions #define LSR_DOWNGRADE                   (LS_TYPE_RW "-" LS_DOWNGRADE)
82*4d495c6eSApple OSS Distributions #define LST_ACQUIRE                     (LS_TYPE_TICKET "-" LS_ACQUIRE)
83*4d495c6eSApple OSS Distributions #define LST_RELEASE                     (LS_TYPE_TICKET "-" LS_RELEASE)
84*4d495c6eSApple OSS Distributions #define LST_SPIN                        (LS_TYPE_TICKET "-" LS_SPIN)
85*4d495c6eSApple OSS Distributions 
86*4d495c6eSApple OSS Distributions #ifdef  __cplusplus
87*4d495c6eSApple OSS Distributions }
88*4d495c6eSApple OSS Distributions #endif
89*4d495c6eSApple OSS Distributions 
90*4d495c6eSApple OSS Distributions #endif  /* _SYS_LOCKSTAT_H */
91