]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/kernel_types.h
xnu-1504.3.12.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 #ifndef BSD_BUILD
20 struct buf;
21 typedef struct buf * buf_t;
22
23 struct file;
24 typedef struct file * file_t;
25
26 #ifndef __LP64__
27 struct ucred;
28 typedef struct ucred * ucred_t;
29 #endif
30
31 struct mount;
32 typedef struct mount * mount_t;
33
34 struct vnode;
35 typedef struct vnode * vnode_t;
36
37 struct proc;
38 typedef struct proc * proc_t;
39
40 struct uio;
41 typedef struct uio * uio_t;
42
43 struct vfs_context;
44 typedef struct vfs_context * vfs_context_t;
45
46 struct vfstable;
47 typedef struct vfstable * vfstable_t;
48
49 struct __ifnet;
50 struct __mbuf;
51 struct __pkthdr;
52 struct __socket;
53 struct __sockopt;
54 struct __ifaddr;
55 struct __ifmultiaddr;
56 struct __ifnet_filter;
57 struct __rtentry;
58
59 typedef struct __ifnet* ifnet_t;
60 typedef struct __mbuf* mbuf_t;
61 typedef struct __pkthdr* pkthdr_t;
62 typedef struct __socket* socket_t;
63 typedef struct __sockopt* sockopt_t;
64 typedef struct __ifaddr* ifaddr_t;
65 typedef struct __ifmultiaddr* ifmultiaddr_t;
66 typedef struct __ifnet_filter* interface_filter_t;
67 typedef struct __rtentry* route_t;
68
69 #else /* BSD_BUILD */
70
71 typedef struct buf * buf_t;
72 typedef struct file * file_t;
73 #ifndef __LP64__
74 typedef struct ucred * ucred_t;
75 #endif
76 typedef struct mount * mount_t;
77 typedef struct vnode * vnode_t;
78 typedef struct proc * proc_t;
79 typedef struct uio * uio_t;
80 typedef struct user_iovec * user_iovec_t;
81 typedef struct vfs_context * vfs_context_t;
82 typedef struct vfstable * vfstable_t;
83
84 #if KERNEL_PRIVATE
85 typedef struct kern_iovec * kern_iovec_t;
86 typedef struct ifnet* ifnet_t;
87 typedef struct mbuf* mbuf_t;
88 typedef struct pkthdr* pkthdr_t;
89 typedef struct socket* socket_t;
90 typedef struct sockopt* sockopt_t;
91 typedef struct ifaddr* ifaddr_t;
92 typedef struct ifmultiaddr* ifmultiaddr_t;
93 typedef struct ifnet_filter* interface_filter_t;
94 typedef struct rtentry* route_t;
95 #endif /* KERNEL_PRIVATE */
96
97 #endif /* !BSD_BUILD */
98
99 #ifndef _KAUTH_GUID
100 #define _KAUTH_GUID
101 /* Apple-style globally unique identifier */
102 typedef struct {
103 #define KAUTH_GUID_SIZE 16 /* 128-bit identifier */
104 unsigned char g_guid[KAUTH_GUID_SIZE];
105 } guid_t;
106 #define _GUID_T
107 #endif /* _KAUTH_GUID */
108
109 #ifndef _KAUTH_ACE
110 #define _KAUTH_ACE
111 struct kauth_ace;
112 typedef struct kauth_ace * kauth_ace_t;
113 #endif
114 #ifndef _KAUTH_ACL
115 #define _KAUTH_ACL
116 struct kauth_acl;
117 typedef struct kauth_acl * kauth_acl_t;
118 #endif
119 #ifndef _KAUTH_FILESEC
120 #define _KAUTH_FILESEC
121 struct kauth_filesec;
122 typedef struct kauth_filesec * kauth_filesec_t;
123 #endif
124
125 #endif /* !_KERN_SYS_KERNELTYPES_H_ */