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
11 * DUX OSI header file. Extends afs_osi.h.
13 * afs_osi.h includes this file, which is the only way this file should
14 * be included in a source file. This file can redefine macros declared in
18 #ifndef _OSI_MACHDEP_H_
19 #define _OSI_MACHDEP_H_
21 #include <kern/lock.h>
22 #include <kern/sched_prim.h>
23 #include <sys/unix_defs.h>
25 #define getpid() u.u_procp->p_pid
30 extern struct timeval time;
31 #define osi_Time() (time.tv_sec)
36 #define AFS_UCRED ucred
37 #define AFS_PROC struct proc
39 #define afs_bufferpages bufpages
41 #define osi_vnhold(avc,r) do { \
42 if ((avc)->vrefCount) { VN_HOLD(AFSTOV(avc)); } \
43 else osi_Panic("refcnt==0"); } while(0)
45 #define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \
46 vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(aresid))
51 extern simple_lock_data_t afs_global_lock;
52 extern thread_t afs_global_owner;
55 usimple_lock(&afs_global_lock); \
56 osi_Assert(afs_global_owner == (thread_t)0); \
57 afs_global_owner = current_thread(); \
59 #define AFS_GUNLOCK() \
61 osi_Assert(afs_global_owner == current_thread()); \
62 afs_global_owner = (thread_t)0; \
63 usimple_unlock(&afs_global_lock); \
65 #define ISAFS_GLOCK() (afs_global_owner == current_thread())
67 #define AFS_RXGUNLOCK()
68 #define ISAFS_RXGLOCK() 1
78 #endif /* _OSI_MACHDEP_H_ */