4d47118893f8eb618f6121e651cb27df3b6b98e8
[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 #define AFS_VM_RDWR_ENV         1       /* read/write implemented via VM */
7
8 #ifndef UKERNEL
9 /* This section for kernel libafs compiles only */
10
11 #ifndef IGNORE_STDS_H
12 #include <sys/param.h>
13 #endif
14
15 #define AFS_XBSD_ENV            1               /* {Free,Open,Net}BSD */
16 #define AFS_X86_XBSD_ENV        1
17
18 #define AFS_NAMEI_ENV           1       /* User space interface to file system */
19 #define AFS_64BIT_CLIENT        1
20 #define AFS_64BIT_IOPS_ENV      1       /* Needed for NAMEI */
21 #define AFS_FBSD_ENV            1
22 #define AFS_X86_FBSD_ENV        1
23 #define AFS_X86_ENV             1
24 #undef AFS_NONFSTRANS
25 #define AFS_NONFSTRANS          1
26 #define FTRUNC O_TRUNC
27
28 #define IUPD 0x0010
29 #define IACC 0x0020
30 #define ICHG 0x0040
31 #define IMOD 0x0080
32
33 #define IN_LOCK(ip) lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
34                             NULL, curproc)
35 #define IN_UNLOCK(ip) lockmgr(&ip->i_lock, LK_RELEASE, \
36                               NULL, curproc)
37
38 #include <afs/afs_sysnames.h>
39
40 #define AFS_VFS_ENV             1
41 #define AFS_VFSINCL_ENV         1
42 #define AFS_GREEDY43_ENV        1
43 #define AFS_ENV                 1
44
45 #define AFS_SYSCALL             339
46 #define AFS_MOUNT_AFS           "afs"
47
48 #ifndef MOUNT_UFS
49 #define MOUNT_UFS "ufs"
50 #endif
51
52 #ifndef MOUNT_AFS
53 #define MOUNT_AFS AFS_MOUNT_AFS
54 #endif
55
56 #define RXK_LISTENER_ENV        1
57 #define AFS_GCPAGS              0       /* if nonzero, garbage collect PAGs */
58 #define AFS_USE_GETTIMEOFDAY    1       /* use gettimeofday to implement rx clock */
59
60 /* Extra kernel definitions (from kdefs file) */
61 #ifdef _KERNEL
62 #define AFS_GLOBAL_SUNLOCK      1
63 #define AFS_VFS34               1       /* What is VFS34??? */
64 #define afsio_iov               uio_iov
65 #define afsio_iovcnt            uio_iovcnt
66 #define afsio_offset            uio_offset
67 #define afsio_seg               uio_segflg
68 #define afsio_resid             uio_resid
69 #define AFS_UIOSYS              UIO_SYSSPACE
70 #define AFS_UIOUSER             UIO_USERSPACE
71 #define AFS_CLBYTES             CLBYTES
72 #define osi_GetTime(x)          microtime(x)
73 #define AFS_KALLOC(x)           osi_fbsd_alloc((x), 1)
74 #undef AFS_KALLOC_NOSLEEP
75 #define AFS_KALLOC_NOSLEEP(x)   osi_fbsd_alloc((x), 0)
76 #define AFS_KFREE(x,y)          osi_fbsd_free((x))
77 #define v_count                 v_usecount
78 #define v_vfsp                  v_mount
79 #define vfs_bsize               mnt_stat.f_bsize
80 #define vfs_fsid                mnt_stat.f_fsid
81 #define va_nodeid               va_fileid
82 #define vfs_vnodecovered        mnt_vnodecovered
83 #define direct                  dirent
84 #define vnode_t                 struct vnode
85
86 #ifndef MUTEX_DEFAULT
87 #define MUTEX_DEFAULT 0
88 #endif /* MUTEX_DEFAULT */
89
90 #ifndef SSYS
91 #define SSYS 0x00002
92 #endif /* SSYS */
93
94 #define p_rcred p_ucred
95
96 # if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
97 enum vcexcl { NONEXCL, EXCL };
98
99 #  ifdef KERNEL
100 #   ifndef MIN
101 #    define MIN(A,B) ((A) < (B) ? (A) : (B))
102 #   endif
103 #   ifndef MAX
104 #    define MAX(A,B) ((A) > (B) ? (A) : (B))
105 #   endif
106 #  endif /* KERNEL */
107
108 # endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
109 #endif /* _KERNEL */
110
111 /*
112  * Consolidate version checks into configure-test-like definitions
113  */
114
115 /* r270870 moved if_data into ifnet to avoid namespace-stealing macros. */
116 #if __FreeBSD_version >= 1100030
117 #define FBSD_IF_METRIC_IN_STRUCT_IFNET
118 #endif
119
120 /* r271438 changed the ifa_ifwithnet KPI signature. */
121 #if __FreeBSD_version >= 1100032
122 #define FBSD_IFA_IFWITHNET_THREE_ARGS
123 #endif
124
125 #else /* !defined(UKERNEL) */
126
127 /* This section for user space compiles only */
128
129 #define UKERNEL                 1       /* user space kernel */
130 #define AFS_ENV                 1
131 #define AFS_VFSINCL_ENV         1
132 #define AFS_USR_FBSD_ENV        1
133 #undef  AFS_NONFSTRANS
134 #define AFS_NONFSTRANS          1
135
136 #define AFS_MOUNT_AFS           "afs"   /* The name of the filesystem type. */
137 #define AFS_SYSCALL             339
138 #define AFS_NAMEI_ENV           1       /* User space interface to file system */
139 #define AFS_64BIT_IOPS_ENV      1       /* Needed for NAMEI */
140 #define AFS_USERSPACE_IP_ADDR   1
141 #define RXK_LISTENER_ENV        1
142 #define AFS_GCPAGS              0       /* if nonzero, garbage collect PAGs */
143 #define AFS_HAVE_STATVFS        1       /* System supports statvfs */
144
145 #include <afs/afs_sysnames.h>
146
147 #define afsio_iov               uio_iov
148 #define afsio_iovcnt            uio_iovcnt
149 #define afsio_offset            uio_offset
150 #define afsio_seg               uio_segflg
151 #define afsio_fmode             uio_fmode
152 #define afsio_resid             uio_resid
153 #define AFS_UIOSYS              1
154 #define AFS_UIOUSER             UIO_USERSPACE
155 #define AFS_CLBYTES             MCLBYTES
156 #define AFS_MINCHANGE           2
157 #define VATTR_NULL              usr_vattr_null
158
159 #define AFS_DIRENT
160 #ifndef CMSERVERPREF
161 #define CMSERVERPREF
162 #endif
163
164 #include <sys/param.h>
165 #include <sys/types.h>
166 #include <sys/mount.h>
167 #include <sys/fcntl.h>
168 #include <sys/uio.h>
169 #include <sys/socket.h>
170 #include <netinet/in.h>
171 #include <limits.h>
172
173 #endif /* !defined(UKERNEL) */
174
175 #endif /* AFS_COMMON_PARAM_H */