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