*** empty log message ***
[arla.git] / rx / rx_kmutex.h
bloba2db26019aa9e9a483c67f94919e8de7aeaf9392
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
11 * rx_kmutex.h - mutex and condition variable macros for kernel environment.
13 * Solaris implementation.
16 #ifndef _RX_KMUTEX_H_
17 #define _RX_KMUTEX_H_
19 #define AFS_GLOBAL_RXLOCK_KERNEL
20 #define RX_ENABLE_LOCKS 1
22 #define afs_kmutex_t usr_mutex_t
23 #define afs_kcondvar_t usr_cond_t
24 #define RX_MUTEX_INIT(A,B,C,D) usr_mutex_init(A)
25 #define RX_MUTEX_ENTER(A) usr_mutex_lock(A)
26 #define RX_MUTEX_TRYENTER(A) usr_mutex_trylock(A)
27 #define RX_MUTEX_ISMINE(A) (1)
28 #define RX_MUTEX_EXIT(A) usr_mutex_unlock(A)
29 #define RX_MUTEX_DESTROY(A) usr_mutex_destroy(A)
30 #define CV_INIT(A,B,C,D) usr_cond_init(A)
31 #define CV_TIMEDWAIT(A,B,C) usr_cond_timedwait(A,B,C)
32 #define CV_SIGNAL(A) usr_cond_signal(A)
33 #define CV_BROADCAST(A) usr_cond_broadcast(A)
34 #define CV_DESTROY(A) usr_cond_destroy(A)
35 #define CV_WAIT(_cv, _lck) { \
36 int isGlockOwner = ISAFS_GLOCK(); \
37 if (isGlockOwner) { \
38 AFS_GUNLOCK(); \
39 } \
40 usr_cond_wait(_cv, _lck); \
41 if (isGlockOwner) { \
42 RX_MUTEX_EXIT(_lck); \
43 AFS_GLOCK(); \
44 RX_MUTEX_ENTER(_lck); \
45 } \
48 extern void osirx_AssertMine(afs_kmutex_t *lockaddr, char *msg);
50 #define AFS_RXGLOCK()
51 #define AFS_RXGUNLOCK()
52 #define ISAFS_RXGLOCK() 1
53 #define AFS_ASSERT_RXGLOCK()
55 #define SPLVAR
56 #define NETPRI
57 #define USERPRI
59 #endif /* _RX_KMUTEX_H_ */