]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/kernel_types.h
xnu-1228.15.4.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 struct ucred;
27 typedef struct ucred * ucred_t;
28
29 struct mount;
30 typedef struct mount * mount_t;
31
32 #ifdef TBDDDD
33 typedef struct fsid { int32_t val[2]; } fsid_t; /* file system id type */
34 #endif /* TBDDDD */
35
36 struct vnode;
37 typedef struct vnode * vnode_t;
38
39 struct proc;
40 typedef struct proc * proc_t;
41
42 struct uio;
43 typedef struct uio * uio_t;
44
45 struct vfs_context;
46 typedef struct vfs_context * vfs_context_t;
47
48 struct vfstable;
49 typedef struct vfstable * vfstable_t;
50
51 struct __ifnet;
52 struct __mbuf;
53 struct __pkthdr;
54 struct __socket;
55 struct __sockopt;
56 struct __ifaddr;
57 struct __ifmultiaddr;
58 struct __ifnet_filter;
59 struct __rtentry;
60
61 typedef struct __ifnet* ifnet_t;
62 typedef struct __mbuf* mbuf_t;
63 typedef struct __pkthdr* pkthdr_t;
64 typedef struct __socket* socket_t;
65 typedef struct __sockopt* sockopt_t;
66 typedef struct __ifaddr* ifaddr_t;
67 typedef struct __ifmultiaddr* ifmultiaddr_t;
68 typedef struct __ifnet_filter* interface_filter_t;
69 typedef struct __rtentry* route_t;
70
71 #else /* BSD_BUILD */
72
73 typedef struct buf * buf_t;
74 typedef struct file * file_t;
75 typedef struct ucred * ucred_t;
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_ */