2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
12 * DUX OSI header file. Extends afs_osi.h.
14 * afs_osi.h includes this file, which is the only way this file should
15 * be included in a source file. This file can redefine macros declared in
19 #ifndef _OSI_MACHDEP_H_
20 #define _OSI_MACHDEP_H_
23 /* #include <kern/sched_prim.h> */
24 /* #include <sys/unix_defs.h> */
26 #define getpid() curproc
27 extern struct simplelock afs_rxglobal_lock;
32 extern struct timeval time;
33 #define osi_Time() (time.tv_sec)
38 #define AFS_UCRED ucred
39 #define AFS_PROC struct proc
41 #define afs_bufferpages bufpages
43 #define osi_vnhold(avc,r) do { \
44 if ((avc)->vrefCount) { VN_HOLD((struct vnode *)(avc)); } \
45 else osi_Panic("refcnt==0"); } while(0)
47 #define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \
48 vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(aresid), curproc)
53 extern struct simplelock afs_global_lock;
55 extern thread_t afs_global_owner;
58 usimple_lock(&afs_global_lock); \
59 osi_Assert(afs_global_owner == (thread_t)0); \
60 afs_global_owner = current_thread(); \
62 #define AFS_GUNLOCK() \
64 osi_Assert(afs_global_owner == current_thread()); \
65 afs_global_owner = (thread_t)0; \
66 usimple_unlock(&afs_global_lock); \
68 #define ISAFS_GLOCK() (afs_global_owner == current_thread())
72 simple_lock(&afs_global_lock); \
74 #define AFS_GUNLOCK() \
76 simple_unlock(&afs_global_lock); \
80 #define AFS_RXGUNLOCK()
81 #define ISAFS_RXGLOCK() 1
91 #endif /* _OSI_MACHDEP_H_ */