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