aix51-support-20020926
[openafs.git] / src / rx / rx_kernel.h
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  */
9
10 /* Definitions specific to the in-kernel implementation of Rx, for in-kernel clients */
11
12 #ifndef __RX_KERNEL_INCL_
13 #define __RX_KERNEL_INCL_   1
14
15 #define osi_Alloc afs_osi_Alloc
16 #define osi_Free  afs_osi_Free
17
18 #define rxi_ReScheduleEvents    0 /* Not needed by kernel */
19
20 /* This is a no-op, because the kernel server procs are pre-allocated */
21 #define rxi_StartServerProcs(x) 0
22
23 /* Socket stuff */
24 typedef struct socket *osi_socket;
25 #define OSI_NULLSOCKET  ((osi_socket) 0)
26
27 #if (!defined(AFS_GLOBAL_SUNLOCK) && !defined(RX_ENABLE_LOCKS))
28 #define RX_KERNEL_TRACE 1
29 #ifdef RX_KERNEL_TRACE
30 #include "../afs/icl.h"
31 #include "../afs/afs_trace.h"
32 #ifdef AFS_AIX_ENV
33 #define osi_rxSleep(a)  afs_Trace2(afs_iclSetp, CM_TRACE_RXSLEEP, \
34         ICL_TYPE_STRING, __FILE__, ICL_TYPE_INT32, __LINE__); afs_osi_Sleep(a)
35 #define osi_rxWakeup(a) if (afs_osi_Wakeup(a) == 0) afs_Trace2(afs_iclSetp, \
36         CM_TRACE_RXWAKE, ICL_TYPE_STRING, __FILE__, ICL_TYPE_INT32, __LINE__)
37 #else
38 #define osi_rxSleep(a)  afs_osi_Sleep(a)
39 #define osi_rxWakeup(a) afs_osi_Wakeup(a)
40 #endif
41 #else /* RX_KERNEL_TRACE */
42 #define osi_rxSleep(a)  afs_osi_Sleep(a)
43 #define osi_rxWakeup(a) afs_osi_Wakeup(a)
44 #endif /* RX_KERNEL_TRACE */
45 #else /* AFS_GLOBAL_SUNLOCK || RX_ENABLE_LOCKS */
46 #define osi_rxSleep(a)  afs_osi_Sleep(a)
47 #define osi_rxWakeup(a) afs_osi_Wakeup(a)
48 #endif
49
50 extern int osi_utoa(char *buf, size_t len, unsigned long val);
51 #define osi_Assert(e) (void)((e) || (osi_AssertFailK(#e, __FILE__, __LINE__), 0))
52
53 #define osi_Msg printf)(
54
55 #define osi_YieldIfPossible()
56 #define osi_WakeupAndYieldIfPossible(x)     rx_Wakeup(x)
57
58 #include "../afs/longc_procs.h"
59
60 #endif /* __RX_KERNEL_INCL_ */