afs: Always define our own osi_timeval32_t
[openafs.git] / src / afs / HPUX / osi_machdep.h
index 36d73d1..f2afe21 100644 (file)
@@ -1,7 +1,8 @@
+
 /*
  * 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
 #define _OSI_MACHDEP_H_
 
 #include "h/kern_sem.h"
+#include "h/proc_iface.h"
 
 #define        afs_hz      hz
 extern struct timeval time;
 #define osi_Time() (time.tv_sec)
 
-#define        AFS_UCRED       ucred
-#define        AFS_PROC        proc_t
+typedef struct ucred afs_ucred_t;
+typedef proc_t afs_proc_t;
 
-#define osi_vnhold(avc, r)  do { VN_HOLD(AFSTOV(avc)); } while(0)
 #define gop_rdwr(rw,gp,base,len,offset,segflg,unit,aresid) \
   vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(aresid),0)
 #define gop_lookupname(fnamep,segflg,followlink,compvpp) \
   lookupname((fnamep),(segflg),(followlink),NULL,(compvpp))
+#define gop_lookupname_user(fnamep,segflg,followlink,compvpp) \
+  lookupname((fnamep),(segflg),(followlink),NULL,(compvpp))
 
 #undef afs_suser
 
@@ -41,9 +44,8 @@ extern struct timeval time;
 
 #define getppid()               (afs_uint32)p_ppid(u.u_procp)
 
-#ifdef KERNEL
 /*
- * Global lock support. 
+ * Global lock support.
  *
  * HP uses global mutex to protect afs land
  */
@@ -78,13 +80,12 @@ extern void afsHashRelease(tid_t key);
 #endif
 
 /* Uses splnet only in the SP case */
-#define SPLVAR      register ulong_t splvar
+#define SPLVAR      ulong_t splvar
 #define NETPRI      NET_SPLNET(splvar)
 #define USERPRI     NET_SPLX(splvar)
-#endif /* KERNEL */
 
 #if !defined(AFS_HPUX110_ENV)
-/* 
+/*
  * On HP, the global lock is an alpha semaphore, hence it is automatically
  * released and reacquired aroubd a sleep() and wakeup().
  */
@@ -118,4 +119,15 @@ extern caddr_t kmem_alloc();
 #include <vfs_vm.h>
 #endif
 
+#define osi_procname(procname, size) strncpy(procname, "", size)
+
+static_inline void
+osi_GetTime(osi_timeval32_t *atv)
+{
+    struct timeval now;
+    uniqtime(&now);
+    atv->tv_sec = now.tv_sec;
+    atv->tv_usec = now.tv_usec;
+}
+
 #endif /* _OSI_MACHDEP_H_ */