afs: Always define our own osi_timeval32_t
[openafs.git] / src / afs / IRIX / osi_machdep.h
index 991146a..56defec 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
@@ -36,12 +36,6 @@ typedef struct proc afs_proc_t;
 #undef gop_lookupname_user
 #define gop_lookupname_user(fnamep,segflg,followlink,compvpp) lookupname((fnamep),(segflg),(followlink),NULL,(compvpp), NULL)
 
-#define osi_vnhold(avc, r)  do { VN_HOLD(AFSTOV(avc)); } while(0)
-
-#undef afs_osi_Alloc_NoSleep
-extern void *afs_osi_Alloc_NoSleep(size_t size);
-
-
 #ifdef AFS_SGI64_ENV
 #include <sys/flock.h>
 extern flid_t osi_flid;
@@ -68,7 +62,7 @@ extern flid_t osi_flid;
 #undef AFS_MUTEX_ENTER
 #define AFS_MUTEX_ENTER(mp) \
   MACRO_BEGIN \
-    register struct kthread *_kthreadP; \
+    struct kthread *_kthreadP; \
     while(mutex_tryenter(mp) == 0) { \
       _kthreadP = (struct kthread*)mutex_owner(mp); \
       if (_kthreadP != NULL && _kthreadP->k_sonproc == CPU_NONE) { \
@@ -112,7 +106,7 @@ extern flid_t osi_flid;
 
 #define AFS_MUTEX_ENTER(mp) \
   MACRO_BEGIN \
-    register struct proc *_procP; \
+    struct proc *_procP; \
     while(mutex_tryenter(mp) == 0) { \
        _procP = mutex_owner(mp); \
        if (_procP != NULL && _procP->p_sonproc == CPU_NONE) { \
@@ -145,11 +139,11 @@ extern flid_t osi_flid;
  * CAUTION -- The ISAFS_(RX)?GLOCK macros are not safe to use when the lock is
  *     not held if the test may be made at interrupt level as the code may
  *     appear to be running as the process that is (or last was) running at
- *     non-interrupt level. Worse yet, the interrupt may occur just as the 
+ *     non-interrupt level. Worse yet, the interrupt may occur just as the
  *     process is exiting, in which case, the pid may change from the start
  *     of the interrupt to the end, since the u area has been changed. So,
  *     at interrupt level, I'm using the base of the current interrupt stack.
- *     Note that afs_osinet.c also modifies afs_global_owner for osi_Sleep and 
+ *     Note that afs_osinet.c also modifies afs_global_owner for osi_Sleep and
  *     afs_osi_Wakeup. Changes made here should be reflected there as well.
  * NOTE - As of 6.2, we can no longer use mutexes in interrupts, so the above
  *     concern no longer exists.
@@ -183,7 +177,7 @@ extern long afs_global_owner;
 #define AFS_GUNLOCK()
 #define ISAFS_GLOCK() 1
 
-#define SPLVAR      register int splvar
+#define SPLVAR      int splvar
 #define NETPRI      splvar=splnet()
 #define USERPRI     splx(splvar)
 
@@ -391,7 +385,20 @@ extern long afs_global_owner;
 #define OSI_VFS_CONVERT(V) struct vfs * V = (struct vfs*)bhvtovfs(bhv_##V)
 #endif /* AFS_SGI64_ENV */
 
+#define osi_procname(procname, size) strncpy(procname, proc_name(curproc()), size)
 
-
+static_inline void
+osi_GetTime(osi_timeval32_t *atv)
+{
+#ifdef _K64U64
+    struct __irix5_timeval now;
+    irix5_microtime(&now);
+#else
+    struct timeval now;
+    microtime(&now);
+#endif
+    atv->tv_sec = now.tv_sec;
+    atv->tv_usec = now.tv_usec;
+}
 
 #endif /* _OSI_MACHDEP_H_ */