rx-race-condition-cleanup-by-adding-busy-status-20010605
[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 extern int (*rxk_GetPacketProc)(); /* set to packet allocation procedure */
19 extern int (*rxk_PacketArrivalProc)();
20
21 extern void rxi_StartListener();
22 #define rxi_ReScheduleEvents    0 /* Not needed by kernel */
23
24 /* This is a no-op, because the kernel server procs are pre-allocated */
25 #define rxi_StartServerProcs(x) 0
26
27 /* Socket stuff */
28 typedef struct socket *osi_socket;
29 #define OSI_NULLSOCKET  ((osi_socket) 0)
30
31 extern osi_socket rxi_GetUDPSocket();
32
33 #if (!defined(AFS_GLOBAL_SUNLOCK) && !defined(RX_ENABLE_LOCKS)) || (defined(AFS_HPUX_ENV) && !defined(RX_ENABLE_LOCKS))
34 #define osi_rxSleep(a)  afs_osi_Sleep(a)
35 #define osi_rxWakeup(a) afs_osi_Wakeup(a)
36 #endif
37
38 extern void osi_Panic();
39 extern int osi_utoa(char *buf, size_t len, unsigned long val);
40 extern void osi_AssertFailK(const char *expr, const char *file, int line);
41 #define osi_Assert(e) (void)((e) || (osi_AssertFailK(#e, __FILE__, __LINE__), 0))
42
43 #define osi_Msg printf)(
44
45 #define osi_YieldIfPossible()
46 #define osi_WakeupAndYieldIfPossible(x)     rx_Wakeup(x)
47
48 #include "../afs/longc_procs.h"
49
50 #endif /* __RX_KERNEL_INCL_ */