Import Upstream version 1.8.5
[hcoop/debian/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 #define AFS_MOUNT_AFS "afs"
46
47 #ifndef MOUNT_UFS
48 #define MOUNT_UFS "ufs"
49 #endif
50
51 #ifndef MOUNT_AFS
52 #define MOUNT_AFS AFS_MOUNT_AFS
53 #endif
54
55 #define RXK_LISTENER_ENV 1
56 #define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
57 #define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */
58
59 /* Extra kernel definitions (from kdefs file) */
60 #ifdef _KERNEL
61 #define AFS_GLOBAL_SUNLOCK 1
62 #define AFS_VFS34 1 /* What is VFS34??? */
63 #define afsio_iov uio_iov
64 #define afsio_iovcnt uio_iovcnt
65 #define afsio_offset uio_offset
66 #define afsio_seg uio_segflg
67 #define afsio_resid uio_resid
68 #define AFS_UIOSYS UIO_SYSSPACE
69 #define AFS_UIOUSER UIO_USERSPACE
70 #define AFS_CLBYTES CLBYTES
71 #define osi_GetTime(x) microtime(x)
72 #define AFS_KALLOC(x) osi_fbsd_alloc((x), 1)
73 #undef AFS_KALLOC_NOSLEEP
74 #define AFS_KALLOC_NOSLEEP(x) osi_fbsd_alloc((x), 0)
75 #define AFS_KFREE(x,y) osi_fbsd_free((x))
76 #define v_count v_usecount
77 #define v_vfsp v_mount
78 #define vfs_bsize mnt_stat.f_bsize
79 #define vfs_fsid mnt_stat.f_fsid
80 #define va_nodeid va_fileid
81 #define vfs_vnodecovered mnt_vnodecovered
82 #define direct dirent
83 #define vnode_t struct vnode
84
85 #ifndef MUTEX_DEFAULT
86 #define MUTEX_DEFAULT 0
87 #endif /* MUTEX_DEFAULT */
88
89 #ifndef SSYS
90 #define SSYS 0x00002
91 #endif /* SSYS */
92
93 #define p_rcred p_ucred
94
95 # if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
96 enum vcexcl { NONEXCL, EXCL };
97
98 # ifdef KERNEL
99 # ifndef MIN
100 # define MIN(A,B) ((A) < (B) ? (A) : (B))
101 # endif
102 # ifndef MAX
103 # define MAX(A,B) ((A) > (B) ? (A) : (B))
104 # endif
105 # endif /* KERNEL */
106
107 # endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
108 #endif /* _KERNEL */
109
110 /*
111 * Consolidate version checks into configure-test-like definitions
112 */
113
114 /* r270870 moved if_data into ifnet to avoid namespace-stealing macros. */
115 #if __FreeBSD_version >= 1100030
116 #define FBSD_IF_METRIC_IN_STRUCT_IFNET
117 #endif
118
119 /* r271438 changed the ifa_ifwithnet KPI signature. */
120 #if __FreeBSD_version >= 1100032
121 #define FBSD_IFA_IFWITHNET_THREE_ARGS
122 #endif
123
124 /* r273707 added a flags argument to syscall_register() */
125 #if __FreeBSD_version >= 1100041
126 #define FBSD_SYSCALL_REGISTER_FOUR_ARGS
127 #endif
128
129 /* r285819 eliminated b_saveaddr from struct buf */
130 #if __FreeBSD_version >= 1100078
131 #define FBSD_STRUCT_BUF_NO_SAVEADDR
132 #endif
133
134 /* r292373 changed the KPI for VOP_GETPAGES */
135 #if __FreeBSD_version >= 1100092
136 #define FBSD_VOP_GETPAGES_BUSIED
137 #endif
138
139 #else /* !defined(UKERNEL) */
140
141 /* This section for user space compiles only */
142
143 #define UKERNEL 1 /* user space kernel */
144 #define AFS_ENV 1
145 #define AFS_VFSINCL_ENV 1
146 #define AFS_USR_FBSD_ENV 1
147 #undef AFS_NONFSTRANS
148 #define AFS_NONFSTRANS 1
149
150 #define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
151 #define AFS_SYSCALL 339
152 #define AFS_NAMEI_ENV 1 /* User space interface to file system */
153 #define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
154 #define AFS_USERSPACE_IP_ADDR 1
155 #define RXK_LISTENER_ENV 1
156 #define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
157 #define AFS_HAVE_STATVFS 1 /* System supports statvfs */
158
159 #include <afs/afs_sysnames.h>
160
161 #define afsio_iov uio_iov
162 #define afsio_iovcnt uio_iovcnt
163 #define afsio_offset uio_offset
164 #define afsio_seg uio_segflg
165 #define afsio_fmode uio_fmode
166 #define afsio_resid uio_resid
167 #define AFS_UIOSYS 1
168 #define AFS_UIOUSER UIO_USERSPACE
169 #define AFS_CLBYTES MCLBYTES
170 #define AFS_MINCHANGE 2
171 #define VATTR_NULL usr_vattr_null
172
173 #define AFS_DIRENT
174 #ifndef CMSERVERPREF
175 #define CMSERVERPREF
176 #endif
177
178 #include <sys/param.h>
179 #include <sys/types.h>
180 #include <sys/mount.h>
181 #include <sys/fcntl.h>
182 #include <sys/uio.h>
183 #include <sys/socket.h>
184 #include <netinet/in.h>
185 #include <limits.h>
186
187 #endif /* !defined(UKERNEL) */
188
189 #endif /* AFS_COMMON_PARAM_H */