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