5e274321891724747f592438fa729a73589662b7
[openafs.git] / src / afs / sysincludes.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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
8  */
9
10 #ifndef __AFS_SYSINCLUDESH__
11 #define __AFS_SYSINCLUDESH__ 1
12
13 #ifdef AFS_OBSD_ENV
14 #include <sys/errno.h>
15 #include <sys/types.h>
16 #include <sys/param.h>
17 #include <sys/lock.h>
18 #include <sys/queue.h>
19 #include <sys/resourcevar.h>
20 #include <sys/kernel.h>
21 #include <sys/proc.h>
22 #include <sys/systm.h>
23 #include <sys/time.h>
24 #include <sys/filedesc.h>
25 #include <sys/file.h>
26 #include <sys/socket.h>
27 #include <sys/socketvar.h>
28 #include <sys/dirent.h>
29 #include <sys/user.h>
30 #include <sys/uio.h>
31 #include <sys/buf.h>
32 #include <sys/stat.h>
33 #include <sys/mount.h>
34 #include <sys/vnode.h>
35 #include <sys/malloc.h>
36 #include <ufs/ffs/fs.h>
37 #include <ufs/ufs/quota.h>
38 #include <ufs/ufs/inode.h>
39 #include <ufs/ufs/ufsmount.h>
40 #include <sys/mbuf.h>
41 #include <sys/protosw.h>
42 #include <sys/ioctl.h> 
43 #include <vm/vm_kern.h>
44 #include <rpc/rpc.h>
45 #else /* AFS_OBSD_ENV */
46 #ifdef AFS_LINUX22_ENV
47 #include <linux/version.h>
48 #include <linux/config.h>
49 #include <linux/linkage.h>
50 #include <linux/limits.h>
51 #include <linux/wait.h>
52 #include <linux/types.h>
53 #include <linux/vfs.h>
54 #include <linux/net.h>
55 #include <linux/kdev_t.h>
56 #include <linux/ioctl.h>
57 /* Avoid conflicts with coda overloading AFS type namespace. Must precede
58  * inclusion of uaccess.h.
59  */
60 #define _LINUX_CODA_FS_I
61 #define _CFS_HEADER_
62 struct coda_inode_info {};
63 #define _LINUX_XFS_FS_I
64 struct xfs_inode_info {};
65 #include <asm/uaccess.h>
66 #include <linux/list.h>
67 #include <linux/dcache.h>
68 #include <linux/fs.h>
69 #include <linux/quota.h>
70 #include <linux/sched.h>
71 #include <linux/mm.h>
72 #include <linux/string.h>
73 #include <asm/semaphore.h>
74 #include <linux/errno.h>
75
76 #else /* AFS_LINUX22_ENV */
77 #if defined(AFS_DARWIN_ENV)
78 #define _MACH_ETAP_H_   
79 typedef unsigned short                  etap_event_t; 
80 #endif
81 #if     !defined(AFS_OSF_ENV)
82 #include "../h/errno.h"
83 #include "../h/types.h"
84 #include "../h/param.h"
85
86 #ifdef  AFS_AUX_ENV
87 #ifdef  PAGING
88 #include "../h/mmu.h"
89 #include "../h/seg.h"
90 #include "../h/page.h"
91 #include "../h/region.h"
92 #endif /* PAGING */
93 #include "../h/sysmacros.h"
94 #include "../h/signal.h"
95 #include "../h/var.h"
96 #endif /* AFS_AUX_ENV */
97
98 #include "../h/systm.h"
99 #include "../h/time.h"
100
101 #ifdef  AFS_AIX_ENV
102 #ifdef AFS_AIX41_ENV
103 #include "sys/statfs.h"
104 #endif
105 #include "../h/file.h"
106 #include "../h/fullstat.h"
107 #include "../h/vattr.h"
108 #include "../h/var.h"
109 #include "../h/access.h"
110 #endif /* AFS_AIX_ENV */
111
112 #if defined(AFS_SGI_ENV)
113 #include "values.h"
114 #include "../sys/sema.h"
115 #include "../sys/cmn_err.h"
116 #ifdef AFS_SGI64_ENV
117 #include <ksys/behavior.h>
118 #endif /* AFS_SGI64_ENV */
119 #include "../fs/efs_inode.h"
120 #ifdef AFS_SGI_EFS_IOPS_ENV
121 #include "../sgiefs/efs.h"
122 #endif
123 #include "../sys/kmem.h"
124 #include "../sys/cred.h"
125 #include "../sys/resource.h"
126
127 /*
128  * ../sys/debug.h defines ASSERT(), but it is nontrivial only if DEBUG
129  * is on (see afs_osi.h).
130  * In IRIX 6.5 we cannot have DEBUG turned on since certain
131  * system-defined structures have different members with DEBUG on, and
132  * this breaks our ability to interact with the rest of the kernel.
133  *
134  * Instead of using ASSERT(), we use our own osi_Assert().
135  */
136 #if defined(AFS_SGI65_ENV) && !defined(DEBUG)
137 #define DEBUG
138 #include "../sys/debug.h"
139 #undef DEBUG
140 #else
141 #include "../sys/debug.h"
142 #endif
143
144 #include "../sys/statvfs.h"
145 #include "../sys/sysmacros.h"
146 #include "../sys/fs_subr.h"
147 #include "../sys/siginfo.h"
148 #endif  /* AFS_SGI_ENV */
149
150 #if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
151 #  include "../h/kernel.h"
152 #endif /* !SUN5 && !SGI */
153
154 #ifdef  AFS_SUN5_ENV
155 #include <sys/cmn_err.h>        /* for kernel printf() prototype */
156 #endif
157
158 #if     defined(AFS_SUN56_ENV)
159 #include "../h/vfs.h"           /* stops SUN56 socketvar.h warnings */
160 #include "../h/stropts.h"       /* stops SUN56 socketvar.h warnings */
161 #include "../h/stream.h"        /* stops SUN56 socketvar.h errors */
162 #endif
163
164 #include "../h/socket.h"
165 #include "../h/socketvar.h"
166 #include "../h/protosw.h"
167
168 #if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV)
169 #  include "../h/dirent.h"
170 #  ifdef        AFS_SUN5_ENV
171 #    include "../h/sysmacros.h"
172 #    include "../h/fs/ufs_fsdir.h"
173 #  endif /* AFS_SUN5_ENV */
174 #else
175 #  include "../h/dir.h"
176 #endif /* SGI || SUN || HPUX */
177
178 #ifdef AFS_DEC_ENV
179 #  include "../h/smp_lock.h"
180 #endif /* AFS_DEC_ENV */
181
182
183 #if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV)
184 #include "../h/user.h"
185 #endif /* AFS_SGI64_ENV */
186 #define MACH_USER_API   1
187 #include "../h/file.h"
188 #include "../h/uio.h"
189 #include "../h/buf.h"
190 #include "../h/stat.h"
191
192
193 /* ----- The following mainly deal with vnodes/inodes stuff ------ */
194 #ifdef  AFS_DEC_ENV
195 #  include "../h/mount.h"
196 #  include "../machine/psl.h"
197 #  include "../afs/gfs_vnode.h"
198 #endif
199
200 #ifdef  AFS_MACH_ENV
201 #    include <vfs/vfs.h>
202 #    include <vfs/vnode.h>
203 #    include <sys/inode.h>
204 #    include <sys/mount.h>
205 #    include <vm/vm_pager.h>
206 #    include <kern/mfs.h>
207 #    include <mach/vm_param.h>
208 #    include <kern/parallel.h>
209 #endif /* AFS_MACH_ENV */
210
211 #ifndef AFS_DEC_ENV
212 #  ifdef        AFS_SUN5_ENV
213 #    include "../h/statvfs.h"
214 #  endif /* AFS_SUN5_ENV */
215 #  ifdef AFS_HPUX_ENV
216 struct vfspage;                 /* for vnode.h compiler warnings */
217 #    include "../h/swap.h"      /* for struct swpdbd, for vnode.h compiler warnings */
218 #    include "../h/dbd.h"       /* for union idbd, for vnode.h compiler warnings */
219 #  endif /* AFS_HPUX_ENV */
220 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD40_ENV)
221 #  include <sys/uio.h>
222 #  include <sys/mount.h> 
223 #  include <sys/namei.h>
224 #  include <sys/vnode.h>  
225 #  include <sys/queue.h>    
226 #  include <sys/malloc.h>
227 #ifndef AFS_FBSD_ENV
228 #  include <sys/ubc.h>
229 #define timeout_fcn_t mach_timeout_fcn_t
230 #  include <kern/sched_prim.h>
231 #else
232 MALLOC_DECLARE(M_AFS);
233 #  include <ufs/ufs/dinode.h>
234 #  include <vm/vm.h>
235 #  include <vm/vm_extern.h>
236 #  include <vm/pmap.h>
237 #  include <vm/vm_map.h>
238 #  include <sys/lock.h>
239 #  include <sys/user.h>
240 #endif
241 #undef timeout_fcn_t
242 #define _DIR_H_
243 #define doff_t          int32_t
244 #  include <ufs/ufs/quota.h>
245 #  include <ufs/ufs/inode.h>
246 #  include <ufs/ffs/fs.h>
247 #else
248 #  include "../h/vfs.h"
249 #  include "../h/vnode.h"
250 #  ifdef        AFS_SUN5_ENV
251 #    include "../h/fs/ufs_inode.h"
252 #    include "../h/fs/ufs_mount.h"
253 #  else
254 #    if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV)
255 #      include "../ufs/inode.h"
256 #      if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV)
257 #        include "../ufs/mount.h"
258 #      endif /* !AFS_HPUX_ENV */
259 #    endif /* !AFS_AIX32_ENV */
260 #  endif /* AFS_SUN5_ENV */
261 #endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
262 #endif /* AFS_DEC_ENV */
263
264 /* These mainly deal with networking and rpc headers */
265 #include "../netinet/in.h"
266 #undef  MFREE   /* defined at mount.h for AIX */
267 #ifdef  AFS_SUN5_ENV
268 #  include "../h/time.h"
269 #else
270 #  include "../h/mbuf.h"
271 #endif /* AFS_SUN5_ENV */
272
273 #include "../rpc/types.h"
274 #include "../rx/xdr.h"
275
276 #ifdef AFS_AIX32_ENV
277 #  include "net/spl.h"
278 #endif
279
280 /* Miscellaneous headers */
281 #include "../h/proc.h"
282 #if !defined(AFS_FBSD_ENV)
283 #include "../h/ioctl.h"
284 #endif /* AFS_FBSD_ENV */
285
286 #if     defined(AFS_HPUX101_ENV)
287 #include "../h/proc_iface.h"
288 #include "../h/vas.h"
289 #endif
290
291 #if     defined(AFS_HPUX102_ENV)
292 #include "../h/unistd.h"
293 #include "../h/tty.h"
294 #endif
295
296 #if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_MACH_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
297
298 #  include "../h/text.h"
299 #endif 
300
301
302 #if     defined(AFS_AIX_ENV) || defined(AFS_DEC_ENV)
303 #  include "../h/flock.h"       /* fcntl.h is a user-level include in aix */
304 #else
305 #  include "../h/fcntl.h"
306 #endif /* AIX || DEC */
307
308 #if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
309 #  include "../h/unistd.h"
310 #endif /* SGI || SUN */
311
312 #ifdef  AFS_AIX32_ENV
313 #  include "../h/vmuser.h"
314 #endif /* AFS_AIX32_ENV */
315
316 #if     defined(AFS_SUN5_ENV)
317 #include <sys/tiuser.h>
318 #include <sys/t_lock.h>
319 #include <sys/mutex.h>
320 #include <sys/vtrace.h>
321 #include <sys/pathname.h>
322 #include <sys/debug.h>
323 #endif
324
325 #else   /* ! AFS_OSF_ENV */
326 /* All of the OSF/1 stuff is here */
327 #include <net/net_globals.h>
328 #include <errno.h>
329 #include <sys/types.h>
330 #include <sys/param.h>
331 #include <sys/systm.h>
332 #include <sys/time.h>
333 #include <sys/kernel.h>
334 #include <sys/socket.h>
335 #include <sys/socketvar.h>
336 #include <sys/protosw.h>
337 #include <ufs/dir.h>
338 #include <sys/user.h>
339 #include <sys/file.h>
340 #include <sys/uio.h>
341 #include <sys/buf.h>
342 #include <sys/stat.h>
343 #include <sys/vnode.h>
344 #include <ufs/inode.h>
345 #include <sys/mount.h>
346 #include <vm/vm_page.h>
347 #include <mach/vm_param.h>
348 #include <kern/parallel.h>
349 #include <mach/mach_types.h>
350 #ifndef AFS_OSF30_ENV
351 #include <kern/mfs.h>
352 #endif
353 #include <mach/vm_param.h>
354 #include <kern/parallel.h>
355
356 /* These mainly deal with networking and rpc headers */
357 #include <netinet/in.h>
358 #include <sys/mbuf.h>
359 #include <rpc/types.h>
360
361 #ifdef  AFS_ALPHA_ENV
362 #undef kmem_alloc
363 #undef kmem_free
364 #undef mem_alloc
365 #undef mem_free
366 #undef register
367 #endif  /* AFS_ALPHA_ENV */
368
369 #include <rx/xdr.h>
370 #include <sys/proc.h>
371 #include <sys/ioctl.h>
372
373 #endif  /* AFS_OSF_ENV */
374 #endif /* AFS_LINUX22_ENV */
375 #endif /* AFS_OBSD_ENV */
376
377 #endif /* __AFS_SYSINCLUDESH__  so idempotent */