*** empty log message ***
[arla.git] / rx / rx_mach.h
blob7af2168a849796abd5182a13f7cdf52443531a3a
1 #ifndef _RX_MACHDEP_
2 #define _RX_MACHDEP_
4 /* $I$d$ */
5 /*
6 ****************************************************************************
7 * Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
8 * Copyright Transarc Corporation 1993 - All Rights Reserved *
9 * *
10 * Permission to use, copy, modify, and distribute this software and its *
11 * documentation for any purpose and without fee is hereby granted, *
12 * provided that the above copyright notice appear in all copies and *
13 * that both that copyright notice and this permission notice appear in *
14 * supporting documentation, and that neither the name of IBM nor the name *
15 * of Transarc be used in advertising or publicity pertaining to *
16 * distribution of the software without specific, written prior permission. *
17 * *
18 * IBM AND TRANSARC DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *
19 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO *
20 * EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL *
21 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR *
22 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS *
23 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF *
24 * THIS SOFTWARE. *
25 ****************************************************************************
29 #if defined(AFS_SUN5_ENV) && defined(KERNEL)
30 #if defined(AFS_FINEGR_SUNLOCK)
31 #define RX_ENABLE_LOCKS 1
32 #else
33 #undef RX_ENABLE_LOCKS
34 #endif
35 #include <sys/tiuser.h>
36 #include <sys/t_lock.h>
37 #include <sys/mutex.h>
38 #endif
40 #ifndef AFS_AOS_ENV
41 #define ADAPT_PERF
42 #ifndef AFS_SUN5_ENV
43 #define MISCMTU
44 #ifndef __CYGWIN32__
45 #define ADAPT_MTU
46 #endif
47 #endif
48 #endif
50 #if defined(AFS_AIX32_ENV) && defined(KERNEL)
51 #define PIN(a, b) pin(a, b);
52 #define UNPIN(a, b) unpin(a, b);
53 #else
54 #define PIN(a, b) ;
55 #define UNPIN(a, b) ;
56 #endif
58 #if defined(AFS_GLOBAL_SUNLOCK) && defined(KERNEL)
59 extern kmutex_t afs_rxglobal_lock;
61 #define GLOBAL_LOCK() mutex_enter(&afs_rxglobal_lock)
62 #define GLOBAL_UNLOCK() mutex_exit(&afs_rxglobal_lock)
63 #else
64 #define GLOBAL_LOCK()
65 #define GLOBAL_UNLOCK()
66 #endif
68 #ifdef RX_ENABLE_LOCKS
69 extern kmutex_t afs_termStateLock;
70 extern kcondvar_t afs_termStateCv;
72 #define RX_MUTEX_DESTROY(a) mutex_destroy(a)
73 #define RX_MUTEX_ENTER(a) mutex_enter(a)
74 #define RX_MUTEX_EXIT(a) mutex_exit(a)
75 #define RX_MUTEX_INIT(a,b,c,d) mutex_init(a,b,c,d)
76 #else
77 #define MObtainWriteLock(a)
78 #define MReleaseWriteLock(a)
79 #define RX_MUTEX_DESTROY(a)
80 #define RX_MUTEX_ENTER(a)
81 #define RX_MUTEX_EXIT(a)
82 #define RX_MUTEX_INIT(a,b,c,d)
83 #endif
85 #ifndef AFS_AIX32_ENV
86 #define IFADDR2SA(f) (&((f)->ifa_addr))
87 #else /* AFS_AIX32_ENV */
88 #define IFADDR2SA(f) ((f)->ifa_addr)
89 #endif
92 #endif /* _RX_MACHDEP_ */