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 * OpenBSD 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
21 #ifndef _OSI_MACHDEP_H_
22 #define _OSI_MACHDEP_H_
26 #define getpid() curproc
27 extern struct simplelock afs_rxglobal_lock;
32 extern struct timeval time;
33 #define osi_Time() (time.tv_sec)
36 #define M_AFSFID (M_TEMP-1)
37 #define M_AFSBUFHDR (M_TEMP-2)
38 #define M_AFSBUFFER (M_TEMP-3)
39 #define M_AFSGENERIC (M_TEMP-4)
43 #define AFS_UCRED ucred
44 #define AFS_PROC struct proc
46 #define afs_bufferpages bufpages
48 #define osi_vnhold(avc, r) afs_vget(AFSTOV(avc), 0)
50 #define afs_suser() afs_osi_suser(osi_curcred())
52 extern int (**afs_vnodeop_p)();
53 #define SetAfsVnode(vn) /* nothing; done in getnewvnode() */
54 #define IsAfsVnode(vn) ((vn)->v_op == afs_vnodeop_p)
56 #define AFS_HOLD(vp) afs_nbsd_ref(vp)
57 #define AFS_RELE(vp) afs_nbsd_rele(vp)
58 extern int afs_vget();
59 extern void afs_nbsd_ref(struct vnode *);
60 extern void afs_nbsd_rele(struct vnode *);
62 #define va_nodeid va_fileid
63 #define v_vfsp v_mount
64 #define vfs_vnodecovered mnt_vnodecovered
65 #define vfs_bsize mnt_stat.f_bsize
66 typedef void (*osi_timeout_t)(void *);
67 #define osi_timeout_t_done
68 #define osi_curproc() (curproc)
69 #define osi_curcred() (curproc->p_cred->pc_ucred)
71 #define osi_vfs_bsize mnt_stat.f_bsize
72 #define osi_vfs_fsid mnt_stat.f_fsid
73 #define afs_osi_alloc osi_Alloc
74 #define afs_osi_free osi_Free
75 #define printk printf /* for RX version of xdr_* */
76 #define vType(vc) (vc)->v->v_type
77 #define vSetType(vc, type) AFSTOV(vc)->v_type = (type)
78 #define vSetVfsp(vc, vfsp) AFSTOV(vc)->v_mount = (vfsp)
79 #define FTRUNC O_TRUNC
80 #define FEXLOCK O_EXLOCK
81 #define FSHLOCK O_SHLOCK
84 /* no protoytpe 'cuz our includers don't always have uio_rw in scope first */
85 extern int afs_nbsd_rdwr();
86 extern int afs_nbsd_lookupname();
87 extern void afs_nbsd_getnewvnode();
89 #define VOP_RDWR afs_nbsd_rdwr
90 #define gop_lookupname(fnamep, segflg, followlink, dirvpp, compvpp) \
91 afs_nbsd_lookupname((fnamep), (segflg), (followlink), (dirvpp), (compvpp))
94 extern struct simplelock afs_global_lock;
96 #ifndef AFS_GLOBAL_SUNLOCK
97 #define AFS_ASSERT_GLOCK()
100 #define AFS_GUNLOCK()
101 #define AFS_RXGLOCK()
102 #define AFS_RXGUNLOCK()
103 #define ISAFS_RXGLOCK() 1
104 #define ISAFS_GLOCK() 1
114 #endif /* _OSI_MACHDEP_H_ */