4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
33 #include <sys/syscall.h>
35 #define SUBSYS_lwp_rwlock_rdlock 0
36 #define SUBSYS_lwp_rwlock_wrlock 1
37 #define SUBSYS_lwp_rwlock_tryrdlock 2
38 #define SUBSYS_lwp_rwlock_trywrlock 3
39 #define SUBSYS_lwp_rwlock_unlock 4
42 __lwp_rwlock_rdlock(rwlock_t
*rwl
, timespec_t
*tsp
)
47 error
= __systemcall(&rval
, SYS_lwp_rwlock_sys
,
48 SUBSYS_lwp_rwlock_rdlock
, rwl
, tsp
);
49 if (error
== ERESTART
)
56 __lwp_rwlock_wrlock(rwlock_t
*rwl
, timespec_t
*tsp
)
61 error
= __systemcall(&rval
, SYS_lwp_rwlock_sys
,
62 SUBSYS_lwp_rwlock_wrlock
, rwl
, tsp
);
63 if (error
== ERESTART
)
70 __lwp_rwlock_tryrdlock(rwlock_t
*rwl
)
75 error
= __systemcall(&rval
, SYS_lwp_rwlock_sys
,
76 SUBSYS_lwp_rwlock_tryrdlock
, rwl
);
77 if (error
== ERESTART
)
84 __lwp_rwlock_trywrlock(rwlock_t
*rwl
)
89 error
= __systemcall(&rval
, SYS_lwp_rwlock_sys
,
90 SUBSYS_lwp_rwlock_trywrlock
, rwl
);
91 if (error
== ERESTART
)
98 __lwp_rwlock_unlock(rwlock_t
*rwl
)
103 error
= __systemcall(&rval
, SYS_lwp_rwlock_sys
,
104 SUBSYS_lwp_rwlock_unlock
, rwl
);
105 if (error
== ERESTART
)