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