afs: Always define our own osi_timeval32_t
[openafs.git] / src / afs / UKERNEL / osi_machdep.h
index ad08918..27667eb 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
@@ -38,7 +38,7 @@
 
 #define AFS_KALLOC(A)           afs_osi_Alloc(A)
 
-/* 
+/*
  * Time related macros
  */
 #define        afs_hz      HZ
 #undef gop_lookupname_user
 #define gop_lookupname_user(fnamep,segflg,followlink,compvpp) lookupname((fnamep),(segflg),(followlink),(compvpp))
 
-#define osi_vnhold(avc, r)  do { VN_HOLD(AFSTOV(avc)); } while(0)
-
-#if 0
-#define        afs_suser(x)        suser(x)
-#endif
 /*
  * Global lock support.
  */
@@ -76,9 +71,26 @@ extern usr_mutex_t afs_global_lock;
     } while(0)
 #define AFS_ASSERT_GLOCK() \
     do { if (!ISAFS_GLOCK()) { osi_Panic("afs global lock not held"); } } while(0)
+#define osi_GlockInit() \
+    usr_mutex_init(&afs_global_lock, "afs_global_lock", MUTEX_DEFAULT, NULL)
 
 extern int afs_bufferpages;
 
-extern int afs_suser(void *credp);
+extern int afs_suser(afs_ucred_t *credp);
+
+#define setuerror(erval) get_user_struct()->u_error = (erval)
+#define getuerror(erval) get_user_struct()->u_error
+#define osi_curcred()    get_user_struct()->u_cred
+
+#define osi_procname(procname, size) strncpy(procname, "(unknown)", size)
+
+static_inline void
+osi_GetTime(osi_timeval32_t *atv)
+{
+    struct timeval now;
+    gettimeofday(&now, NULL);
+    atv->tv_sec = now.tv_sec;
+    atv->tv_usec = now.tv_usec;
+}
 
 #endif /* _OSI_MACHDEP_H_ */