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