1 /* Copyright (C) 1995 Transarc Corporation - All rights reserved. */
4 * DUX OSI header file. Extends afs_osi.h.
6 * afs_osi.h includes this file, which is the only way this file should
7 * be included in a source file. This file can redefine macros declared in
11 #ifndef _OSI_MACHDEP_H_
12 #define _OSI_MACHDEP_H_
14 #include <kern/lock.h>
15 #include <kern/sched_prim.h>
16 #include <sys/unix_defs.h>
18 #define getpid() u.u_procp->p_pid
23 extern struct timeval time;
24 #define osi_Time() (time.tv_sec)
29 #define AFS_UCRED ucred
30 #define AFS_PROC struct proc
32 #define afs_bufferpages bufpages
34 #define osi_vnhold(avc,r) do { \
35 if ((avc)->vrefCount) { VN_HOLD((struct vnode *)(avc)); } \
36 else osi_Panic("refcnt==0"); } while(0)
38 #define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \
39 vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(aresid))
44 extern simple_lock_data_t afs_global_lock;
45 extern thread_t afs_global_owner;
48 usimple_lock(&afs_global_lock); \
49 osi_Assert(afs_global_owner == (thread_t)0); \
50 afs_global_owner = current_thread(); \
52 #define AFS_GUNLOCK() \
54 osi_Assert(afs_global_owner == current_thread()); \
55 afs_global_owner = (thread_t)0; \
56 usimple_unlock(&afs_global_lock); \
58 #define ISAFS_GLOCK() (afs_global_owner == current_thread())
60 #define AFS_RXGUNLOCK()
61 #define ISAFS_RXGLOCK() 1
71 #endif /* _OSI_MACHDEP_H_ */