f100f4f992bfbb1af12f11ca207b89816e34c17d
[openafs.git] / src / config / param.generic_fbsd.h
1 #ifndef AFS_PARAM_COMMON_H
2 #define AFS_PARAM_COMMON_H
3
4 #define AFSLITTLE_ENDIAN        1
5 #define AFS_HAVE_FFS            1       /* Use system's ffs. */
6
7 #ifndef UKERNEL
8 /* This section for kernel libafs compiles only */
9
10 #ifndef IGNORE_STDS_H
11 #include <sys/param.h>
12 #endif
13
14 #define AFS_XBSD_ENV            1               /* {Free,Open,Net}BSD */
15 #define AFS_X86_XBSD_ENV        1
16
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
22 #define AFS_X86_ENV             1
23 #undef AFS_NONFSTRANS
24 #define AFS_NONFSTRANS          1
25 #define FTRUNC O_TRUNC
26
27 #define IUPD 0x0010
28 #define IACC 0x0020
29 #define ICHG 0x0040
30 #define IMOD 0x0080
31
32 #define IN_LOCK(ip) lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
33                             NULL, curproc)
34 #define IN_UNLOCK(ip) lockmgr(&ip->i_lock, LK_RELEASE, \
35                               NULL, curproc)
36
37 #include <afs/afs_sysnames.h>
38
39 #define AFS_VFS_ENV             1
40 #define AFS_VFSINCL_ENV         1
41 #define AFS_GREEDY43_ENV        1
42 #define AFS_ENV                 1
43
44 #define AFS_SYSCALL             339
45
46 #ifndef MOUNT_UFS
47 #define MOUNT_UFS "ufs"
48 #endif
49
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 */
53
54 /* Extra kernel definitions (from kdefs file) */
55 #ifdef _KERNEL
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
76 #define direct                  dirent
77 #define vnode_t                 struct vnode
78
79 #ifndef MUTEX_DEFAULT
80 #define MUTEX_DEFAULT 0
81 #endif /* MUTEX_DEFAULT */
82
83 #ifndef SSYS
84 #define SSYS 0x00002
85 #endif /* SSYS */
86
87 #define p_rcred p_ucred
88
89 # if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
90 enum vcexcl { NONEXCL, EXCL };
91
92 #  ifdef KERNEL
93 #   ifndef MIN
94 #    define MIN(A,B) ((A) < (B) ? (A) : (B))
95 #   endif
96 #   ifndef MAX
97 #    define MAX(A,B) ((A) > (B) ? (A) : (B))
98 #   endif
99 #  endif /* KERNEL */
100
101 # endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
102 #endif /* _KERNEL */
103
104 /*
105  * Consolidate version checks into configure-test-like definitions
106  */
107
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
111 #endif
112
113 /* r271438 changed the ifa_ifwithnet KPI signature. */
114 #if __FreeBSD_version >= 1100032
115 #define FBSD_IFA_IFWITHNET_THREE_ARGS
116 #endif
117
118 /* r273707 added a flags argument to syscall_register() */
119 #if __FreeBSD_version >= 1100041
120 #define FBSD_SYSCALL_REGISTER_FOUR_ARGS
121 #endif
122
123 /* r285819 eliminated b_saveaddr from struct buf */
124 #if __FreeBSD_version >= 1100078
125 #define FBSD_STRUCT_BUF_NO_SAVEADDR
126 #endif
127
128 /* r292373 changed the KPI for VOP_GETPAGES */
129 #if __FreeBSD_version >= 1100092
130 #define FBSD_VOP_GETPAGES_BUSIED
131 #endif
132
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
137 #else
138 # define AFS_FBSD_NET_FOREACH TAILQ_FOREACH
139 #endif
140
141 #else /* !defined(UKERNEL) */
142
143 /* This section for user space compiles only */
144
145 #define UKERNEL                 1       /* user space kernel */
146 #define AFS_ENV                 1
147 #define AFS_VFSINCL_ENV         1
148 #define AFS_USR_FBSD_ENV        1
149 #undef  AFS_NONFSTRANS
150 #define AFS_NONFSTRANS          1
151
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 */
159
160 #include <afs/afs_sysnames.h>
161
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
168 #define AFS_UIOSYS              1
169 #define AFS_UIOUSER             UIO_USERSPACE
170 #define AFS_CLBYTES             MCLBYTES
171 #define AFS_MINCHANGE           2
172 #define VATTR_NULL              usr_vattr_null
173
174 #define AFS_DIRENT
175 #ifndef CMSERVERPREF
176 #define CMSERVERPREF
177 #endif
178
179 #include <sys/param.h>
180 #include <sys/types.h>
181 #include <sys/mount.h>
182 #include <sys/fcntl.h>
183 #include <sys/uio.h>
184 #include <sys/socket.h>
185 #include <netinet/in.h>
186 #include <limits.h>
187
188 #endif /* !defined(UKERNEL) */
189
190 #endif /* AFS_COMMON_PARAM_H */