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