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