4 ****************************************************************************
5 * Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
7 * Permission to use, copy, modify, and distribute this software and its *
8 * documentation for any purpose and without fee is hereby granted, *
9 * provided that the above copyright notice appear in all copies and *
10 * that both that copyright notice and this permission notice appear in *
11 * supporting documentation, and that the name of IBM not be used in *
12 * advertising or publicity pertaining to distribution of the software *
13 * without specific, written prior permission. *
15 * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
17 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
18 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
19 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
20 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
21 ****************************************************************************
24 #ifndef RX_USER_INCLUDE
25 #define RX_USER_INCLUDE
29 * definitions specific to the user-level implementation of Rx
36 extern FILE *rx_debugFile
;
39 /* These routines are no-ops in the user level implementation */
43 #if defined(AFS_SGIMP_ENV)
49 void rxi_StartListener(void);
50 void rxi_StartServerProcs(int);
51 void rxi_ReScheduleEvents(void);
53 void rxi_PacketsUnWait(void);
56 *Some "operating-system independent" stuff, for the user mode implementation
58 typedef short osi_socket
;
60 osi_socket
rxi_GetUDPSocket(uint16_t, uint16_t *);
61 osi_socket
rxi_GetICMPSocket(void);
63 #define OSI_NULLSOCKET ((osi_socket) -1)
65 #define rx_Sleep(x) osi_Sleep(x)
66 #define rx_Wakeup(x) osi_Wakeup(x)
67 #define osi_rxSleep(x) osi_Sleep(x)
68 #define osi_rxWakeup(x) osi_Wakeup(x)
69 #define osi_Sleep(x) LWP_WaitProcess(x)
70 #define osi_Wakeup(x) LWP_NoYieldSignal(x)
72 * osi_WakeupAndYieldIfPossible doesn't actually have to yield, but
73 * its better if it does
75 #define osi_WakeupAndYieldIfPossible(x) LWP_SignalProcess(x)
76 #define osi_YieldIfPossible() LWP_DispatchProcess();
79 #define osi_Alloc(size) (malloc(size))
83 #define osi_Free(ptr, size) free(ptr)
86 #define osi_GetTime(timevalptr) gettimeofday(timevalptr, 0)
89 * Just in case it's possible to distinguish between relatively
90 * long-lived stuff and stuff which will be freed very soon, but which
91 * needs quick allocation (e.g. dynamically allocated xdr things)
94 #define osi_QuickFree(ptr, size) osi_Free(ptr, size)
95 #define osi_QuickAlloc(size) osi_Alloc(size)
98 void osi_Panic(const char *fmt
, ...);
99 void osi_vMsg(const char *fmt
, ...);
101 #define osi_Msg(x) do { osi_vMsg x ; } while(0)
103 #endif /* RX_USER_INCLUDE */