OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/rx/rx_user.h
00001 /*
00002  * Copyright 2000, International Business Machines Corporation and others.
00003  * All Rights Reserved.
00004  *
00005  * This software has been released under the terms of the IBM Public
00006  * License.  For details, see the LICENSE file in the top-level source
00007  * directory or online at http://www.openafs.org/dl/license10.html
00008  */
00009 
00010 #ifdef  VALIDATE
00011 error - foo error - foo error - foo
00012 #endif /* VALIDATE */
00013 #ifndef RX_USER_INCLUDE
00014 #define RX_USER_INCLUDE
00015 /* rx_user.h:  definitions specific to the user-level implementation of Rx */
00016 #include <afs/param.h>
00017 #include <stdio.h>
00018 #include <stdlib.h>             /* for malloc() */
00019 #include <lwp.h>
00020 /* These routines are no-ops in the user level implementation */
00021 #define SPLVAR
00022 #define NETPRI
00023 #define USERPRI
00024 #define AFS_GLOCK()
00025 #define AFS_GUNLOCK()
00026 #define AFS_ASSERT_GLOCK()
00027 #ifndef UKERNEL
00028 /* Defined in rx/UKERNEL/rx_kmutex.h */
00029 #define ISAFS_GLOCK()
00030 #endif
00031 /* Some "operating-system independent" stuff, for the user mode implementation */
00032 #ifdef UAFS_CLIENT
00033 typedef void *osi_socket;
00034 #define OSI_NULLSOCKET  ((osi_socket) 0)
00035 #else /* UAFS_CLIENT */
00036 #ifdef AFS_NT40_ENV
00037 typedef SOCKET osi_socket;
00038 #define OSI_NULLSOCKET INVALID_SOCKET
00039 #else /* !AFS_NT40_ENV */
00040 typedef afs_int32 osi_socket;
00041 #define OSI_NULLSOCKET  ((osi_socket) -1)
00042 #endif /* !AFS_NT40_ENV */
00043 #endif /* UAFS_CLIENT */
00044 
00045 #define osi_rxSleep(x)              rxi_Sleep(x)
00046 #define osi_rxWakeup(x)             rxi_Wakeup(x)
00047 
00048 #ifndef AFS_AIX32_ENV
00049 
00050 #ifndef osi_Alloc
00051 #define osi_Alloc(size)             malloc(size)
00052 #endif
00053 
00054 #ifndef osi_Free
00055 #define osi_Free(ptr, size)         free(ptr)
00056 #endif
00057 
00058 #endif
00059 
00060 #define osi_GetTime(timevalptr)     gettimeofday(timevalptr, 0)
00061 
00062 /* Just in case it's possible to distinguish between relatively long-lived stuff and stuff which will be freed very soon, but which needs quick allocation (e.g. dynamically allocated xdr things) */
00063 #define osi_QuickFree(ptr, size)    osi_Free(ptr, size)
00064 #define osi_QuickAlloc(size)        osi_Alloc(size)
00065 
00066 #define osi_Assert(e) opr_Assert(e)
00067 
00068 #define osi_Msg                     fprintf)(stderr,
00069 #define osi_VMsg                    vfprintf)(stderr,
00070 
00071 #endif /* RX_USER_INCLUDE */
 All Data Structures Files Functions Variables