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 * Solaris 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 #ifdef AFS_SUN57_64BIT_ENV
22 #include <sys/model.h> /* for get_udatamodel() */
25 #define getpid() curproc->p_pid
28 * The location of the NFSSRV module
29 * Used in osi_vfsops.c when checking to see if the nfssrv module is
32 #define NFSSRV "/kernel/misc/nfssrv"
33 #define NFSSRV_V9 "/kernel/misc/sparcv9/nfssrv"
35 #define AFS_UCRED cred
36 #define AFS_PROC struct proc
43 #define osi_Time() local_osi_Time()
44 extern void gethrestime(timespec_t *);
53 #define osi_Time() (hrestime.tv_sec)
56 #undef afs_osi_Alloc_NoSleep
57 extern void *afs_osi_Alloc_NoSleep(size_t size);
59 #define osi_vnhold(avc, r) do { VN_HOLD(AFSTOV(avc)); } while(0)
60 #define gop_rdwr(rw,gp,base,len,offset,segflg,ioflag,ulimit,cr,aresid) \
61 vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(ioflag),(ulimit),(cr),(aresid))
63 #define afs_suser suser
68 * Global lock support.
70 #include <sys/mutex.h>
71 extern kmutex_t afs_global_lock;
72 extern kmutex_t afs_rxglobal_lock;
74 #define AFS_GLOCK() mutex_enter(&afs_global_lock);
75 #define AFS_GUNLOCK() mutex_exit(&afs_global_lock);
76 #define ISAFS_GLOCK() mutex_owned(&afs_global_lock)
79 #define AFS_RXGUNLOCK()
80 #define ISAFS_RXGLOCK() 1
84 /* Associate the Berkley signal equivalent lock types to System V's */
85 #define LOCK_SH 1 /* F_RDLCK */
86 #define LOCK_EX 2 /* F_WRLCK */
87 #define LOCK_NB 4 /* XXX */
88 #define LOCK_UN 8 /* F_UNLCK */
91 #define IO_APPEND FAPPEND
98 #if defined(AFS_SUN56_ENV)
100 ** Macro returns 1 if file is larger than 2GB; else returns 0
102 #undef AfsLargeFileUio
103 #define AfsLargeFileUio(uio) ( (uio)->_uio_offset._p._u ? 1 : 0 )
104 #undef AfsLargeFileSize
105 #define AfsLargeFileSize(pos, off) ( ((offset_t)(pos)+(offset_t)(off) > (offset_t)MAXOFF_T)?1:0)
108 #endif /* _OSI_MACHDEP_H_ */