Remove struct from AFS_UCRED instantiations (opaque credential type support)
[openafs.git] / src / afs / AIX / osi_machdep.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 /*
11  * AIX OSI header file. Extends afs_osi.h.
12  *
13  * afs_osi.h includes this file, which is the only way this file should
14  * be included in a source file. This file can redefine macros declared in
15  * afs_osi.h.
16  */
17
18 #ifndef _OSI_MACHDEP_H_
19 #define _OSI_MACHDEP_H_
20
21
22 #undef osi_ThreadUnique
23 #define osi_ThreadUnique()      thread_self()
24
25 #define afs_hz      HZ
26 extern long time;
27 #define osi_Time() (time)
28
29 #define AFS_UCRED       struct ucred
30 #define AFS_PROC        struct proc
31
32 #define afs_bufferpages v.v_bufhw
33
34 #define osi_vnhold(avc, r) do { (avc)->vrefCount++; } while (0)
35 #undef AFS_FAST_HOLD
36 #define AFS_FAST_HOLD(vp) (vp)->vrefCount++
37 #undef AFS_FAST_RELE
38 #define AFS_FAST_RELE(vp) (vp)->vrefCount--
39
40 #undef gop_lookupname
41 #define gop_lookupname(fnamep,segflg,followlink,compvpp) \
42         lookupvp((fnamep), (followlink), (compvpp), &afs_osi_cred)
43
44 #undef gop_lookupname_user
45 #define gop_lookupname_user(fnamep,segflg,followlink,compvpp) \
46         lookupvp((fnamep), (followlink), (compvpp), &afs_osi_cred)
47
48 #undef afs_suser
49
50 #undef setuerror
51 #undef getuerror
52 /* #undef getpid                getpid() provided by native kernel */
53 #include <ulimit.h>
54 #define get_ulimit()            (ulimit(GET_FSIZE, 0) << UBSHIFT)
55
56 #ifdef KERNEL
57 #include <sys/lockl.h>
58 #include <sys/lock_def.h>
59 #include <sys/lock_alloc.h>
60 #include <sys/sleep.h>
61
62 extern simple_lock_data afs_global_lock;
63 #define AFS_GLOCK()     do {                                            \
64                             if (lock_mine((void *)&afs_global_lock))    \
65                                 osi_Panic("AFS_GLOCK %s %d",            \
66                                           __FILE__, __LINE__);          \
67                             simple_lock((void *)&afs_global_lock);      \
68                         } while(0)
69 #define AFS_GUNLOCK()   do {                                            \
70                             if (!lock_mine((void *)&afs_global_lock))   \
71                                 osi_Panic("AFS_GUNLOCK %s %d",          \
72                                           __FILE__, __LINE__);          \
73                             simple_unlock((void *)&afs_global_lock);    \
74                         } while(0)
75 #define ISAFS_GLOCK()   lock_mine((void *)&afs_global_lock)
76
77 #define ifnet_flags(x) (x?(x)->if_flags:0)
78 #endif
79
80 #endif /* _OSI_MACHDEP_H_ */