]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/kernel_types.h
xnu-792.1.5.tar.gz
[apple/xnu.git] / bsd / sys / kernel_types.h
1 #ifndef _KERN_SYS_KERNELTYPES_H_
2 #define _KERN_SYS_KERNELTYPES_H_
3
4 #include <sys/cdefs.h>
5 #include <sys/types.h>
6 #include <stdint.h>
7
8 #ifdef BSD_BUILD
9 /* Macros(?) to clear/set/test flags. */
10 #define SET(t, f) (t) |= (f)
11 #define CLR(t, f) (t) &= ~(f)
12 #define ISSET(t, f) ((t) & (f))
13 #endif
14
15
16 typedef int errno_t;
17 typedef int64_t daddr64_t;
18
19 typedef int64_t ino64_t;
20
21 #ifndef BSD_BUILD
22 struct buf;
23 typedef struct buf * buf_t;
24
25 struct file;
26 typedef struct file * file_t;
27
28 struct ucred;
29 typedef struct ucred * ucred_t;
30
31 struct mount;
32 typedef struct mount * mount_t;
33
34 #ifdef TBDDDD
35 typedef struct fsid { int32_t val[2]; } fsid_t; /* file system id type */
36 #endif TBDDDD
37
38 struct vnode;
39 typedef struct vnode * vnode_t;
40
41 struct proc;
42 typedef struct proc * proc_t;
43
44 struct uio;
45 typedef struct uio * uio_t;
46
47 struct vfs_context;
48 typedef struct vfs_context * vfs_context_t;
49
50 struct vfstable;
51 typedef struct vfstable * vfstable_t;
52
53 struct __ifnet;
54 struct __mbuf;
55 struct __pkthdr;
56 struct __socket;
57 struct __sockopt;
58 struct __ifaddr;
59 struct __ifmultiaddr;
60 struct __ifnet_filter;
61 struct __rtentry;
62
63 typedef struct __ifnet* ifnet_t;
64 typedef struct __mbuf* mbuf_t;
65 typedef struct __pkthdr* pkthdr_t;
66 typedef struct __socket* socket_t;
67 typedef struct __sockopt* sockopt_t;
68 typedef struct __ifaddr* ifaddr_t;
69 typedef struct __ifmultiaddr* ifmultiaddr_t;
70 typedef struct __ifnet_filter* interface_filter_t;
71 typedef struct __rtentry* route_t;
72
73 #else /* BSD_BUILD */
74
75 typedef struct buf * buf_t;
76 typedef struct file * file_t;
77 typedef struct ucred * ucred_t;
78 typedef struct mount * mount_t;
79 typedef struct vnode * vnode_t;
80 typedef struct proc * proc_t;
81 typedef struct uio * uio_t;
82 typedef struct user_iovec * user_iovec_t;
83 typedef struct vfs_context * vfs_context_t;
84 typedef struct vfstable * vfstable_t;
85
86 #if KERNEL_PRIVATE
87 typedef struct kern_iovec * kern_iovec_t;
88 typedef struct ifnet* ifnet_t;
89 typedef struct mbuf* mbuf_t;
90 typedef struct pkthdr* pkthdr_t;
91 typedef struct socket* socket_t;
92 typedef struct sockopt* sockopt_t;
93 typedef struct ifaddr* ifaddr_t;
94 typedef struct ifmultiaddr* ifmultiaddr_t;
95 typedef struct ifnet_filter* interface_filter_t;
96 typedef struct rtentry* route_t;
97 #endif /* KERNEL_PRIVATE */
98
99 #endif /* !BSD_BUILD */
100
101 #ifndef _KAUTH_GUID
102 #define _KAUTH_GUID
103 /* Apple-style globally unique identifier */
104 typedef struct {
105 #define KAUTH_GUID_SIZE 16 /* 128-bit identifier */
106 unsigned char g_guid[KAUTH_GUID_SIZE];
107 } guid_t;
108 #define _GUID_T
109 #endif /* _KAUTH_GUID */
110
111 #ifndef _KAUTH_ACE
112 #define _KAUTH_ACE
113 struct kauth_ace;
114 typedef struct kauth_ace * kauth_ace_t;
115 #endif
116 #ifndef _KAUTH_ACL
117 #define _KAUTH_ACL
118 struct kauth_acl;
119 typedef struct kauth_acl * kauth_acl_t;
120 #endif
121 #ifndef _KAUTH_FILESEC
122 #define _KAUTH_FILESEC
123 struct kauth_filesec;
124 typedef struct kauth_filesec * kauth_filesec_t;
125 #endif
126
127 #endif /* !_KERN_SYS_KERNELTYPES_H_ */