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