1 #ifndef AFS_PARAM_COMMON_H
2 #define AFS_PARAM_COMMON_H
4 #define AFSLITTLE_ENDIAN 1
5 #define AFS_HAVE_FFS 1 /* Use system's ffs. */
8 /* This section for kernel libafs compiles only */
11 #include <sys/param.h>
14 #define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */
15 #define AFS_X86_XBSD_ENV 1
17 #define AFS_NAMEI_ENV 1 /* User space interface to file system */
18 #define AFS_64BIT_CLIENT 1
19 #define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
20 #define AFS_FBSD_ENV 1
21 #define AFS_X86_FBSD_ENV 1
24 #define AFS_NONFSTRANS 1
25 #define FTRUNC O_TRUNC
32 #define IN_LOCK(ip) lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
34 #define IN_UNLOCK(ip) lockmgr(&ip->i_lock, LK_RELEASE, \
37 #include <afs/afs_sysnames.h>
40 #define AFS_VFSINCL_ENV 1
41 #define AFS_GREEDY43_ENV 1
44 #define AFS_SYSCALL 339
47 #define MOUNT_UFS "ufs"
50 #define RXK_LISTENER_ENV 1
51 #define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
52 #define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */
54 /* Extra kernel definitions (from kdefs file) */
56 #define AFS_GLOBAL_SUNLOCK 1
57 #define AFS_VFS34 1 /* What is VFS34??? */
58 #define afsio_iov uio_iov
59 #define afsio_iovcnt uio_iovcnt
60 #define afsio_offset uio_offset
61 #define afsio_seg uio_segflg
62 #define afsio_resid uio_resid
63 #define AFS_UIOSYS UIO_SYSSPACE
64 #define AFS_UIOUSER UIO_USERSPACE
65 #define AFS_CLBYTES CLBYTES
66 #define AFS_KALLOC(x) osi_fbsd_alloc((x), 1)
67 #undef AFS_KALLOC_NOSLEEP
68 #define AFS_KALLOC_NOSLEEP(x) osi_fbsd_alloc((x), 0)
69 #define AFS_KFREE(x,y) osi_fbsd_free((x))
70 #define v_count v_usecount
71 #define v_vfsp v_mount
72 #define vfs_bsize mnt_stat.f_bsize
73 #define vfs_fsid mnt_stat.f_fsid
74 #define va_nodeid va_fileid
75 #define vfs_vnodecovered mnt_vnodecovered
77 #define vnode_t struct vnode
80 #define MUTEX_DEFAULT 0
81 #endif /* MUTEX_DEFAULT */
87 #define p_rcred p_ucred
89 # if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
90 enum vcexcl { NONEXCL, EXCL };
94 # define MIN(A,B) ((A) < (B) ? (A) : (B))
97 # define MAX(A,B) ((A) > (B) ? (A) : (B))
101 # endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
105 * Consolidate version checks into configure-test-like definitions
108 /* r270870 moved if_data into ifnet to avoid namespace-stealing macros. */
109 #if __FreeBSD_version >= 1100030
110 #define FBSD_IF_METRIC_IN_STRUCT_IFNET
113 /* r271438 changed the ifa_ifwithnet KPI signature. */
114 #if __FreeBSD_version >= 1100032
115 #define FBSD_IFA_IFWITHNET_THREE_ARGS
118 /* r273707 added a flags argument to syscall_register() */
119 #if __FreeBSD_version >= 1100041
120 #define FBSD_SYSCALL_REGISTER_FOUR_ARGS
123 /* r285819 eliminated b_saveaddr from struct buf */
124 #if __FreeBSD_version >= 1100078
125 #define FBSD_STRUCT_BUF_NO_SAVEADDR
128 /* r292373 changed the KPI for VOP_GETPAGES */
129 #if __FreeBSD_version >= 1100092
130 #define FBSD_VOP_GETPAGES_BUSIED
133 /* r333813 changed network interfaces and addrs to be traversed via
134 * CK_STAILQ_FOREACH instead of TAILQ_FOREACH */
135 #if __FreeBSD_version >= 1200064
136 # define AFS_FBSD_NET_FOREACH CK_STAILQ_FOREACH
138 # define AFS_FBSD_NET_FOREACH TAILQ_FOREACH
141 #else /* !defined(UKERNEL) */
143 /* This section for user space compiles only */
145 #define UKERNEL 1 /* user space kernel */
147 #define AFS_VFSINCL_ENV 1
148 #define AFS_USR_FBSD_ENV 1
149 #undef AFS_NONFSTRANS
150 #define AFS_NONFSTRANS 1
152 #define AFS_SYSCALL 339
153 #define AFS_NAMEI_ENV 1 /* User space interface to file system */
154 #define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
155 #define AFS_USERSPACE_IP_ADDR 1
156 #define RXK_LISTENER_ENV 1
157 #define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
158 #define AFS_HAVE_STATVFS 1 /* System supports statvfs */
160 #include <afs/afs_sysnames.h>
162 #define afsio_iov uio_iov
163 #define afsio_iovcnt uio_iovcnt
164 #define afsio_offset uio_offset
165 #define afsio_seg uio_segflg
166 #define afsio_fmode uio_fmode
167 #define afsio_resid uio_resid
169 #define AFS_UIOUSER UIO_USERSPACE
170 #define AFS_CLBYTES MCLBYTES
171 #define AFS_MINCHANGE 2
172 #define VATTR_NULL usr_vattr_null
179 #include <sys/param.h>
180 #include <sys/types.h>
181 #include <sys/mount.h>
182 #include <sys/fcntl.h>
184 #include <sys/socket.h>
185 #include <netinet/in.h>
188 #endif /* !defined(UKERNEL) */
190 #endif /* AFS_COMMON_PARAM_H */