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