xref: /xnu-8020.121.3/bsd/sys/kernel_types.h (revision fdd8201d7b966f0c3ea610489d29bd841d358941)
1*fdd8201dSApple OSS Distributions /*
2*fdd8201dSApple OSS Distributions  * Copyright (c) 2004-2010 Apple Inc. All rights reserved.
3*fdd8201dSApple OSS Distributions  *
4*fdd8201dSApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5*fdd8201dSApple OSS Distributions  *
6*fdd8201dSApple OSS Distributions  * This file contains Original Code and/or Modifications of Original Code
7*fdd8201dSApple OSS Distributions  * as defined in and that are subject to the Apple Public Source License
8*fdd8201dSApple OSS Distributions  * Version 2.0 (the 'License'). You may not use this file except in
9*fdd8201dSApple OSS Distributions  * compliance with the License. The rights granted to you under the License
10*fdd8201dSApple OSS Distributions  * may not be used to create, or enable the creation or redistribution of,
11*fdd8201dSApple OSS Distributions  * unlawful or unlicensed copies of an Apple operating system, or to
12*fdd8201dSApple OSS Distributions  * circumvent, violate, or enable the circumvention or violation of, any
13*fdd8201dSApple OSS Distributions  * terms of an Apple operating system software license agreement.
14*fdd8201dSApple OSS Distributions  *
15*fdd8201dSApple OSS Distributions  * Please obtain a copy of the License at
16*fdd8201dSApple OSS Distributions  * http://www.opensource.apple.com/apsl/ and read it before using this file.
17*fdd8201dSApple OSS Distributions  *
18*fdd8201dSApple OSS Distributions  * The Original Code and all software distributed under the License are
19*fdd8201dSApple OSS Distributions  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20*fdd8201dSApple OSS Distributions  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21*fdd8201dSApple OSS Distributions  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22*fdd8201dSApple OSS Distributions  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23*fdd8201dSApple OSS Distributions  * Please see the License for the specific language governing rights and
24*fdd8201dSApple OSS Distributions  * limitations under the License.
25*fdd8201dSApple OSS Distributions  *
26*fdd8201dSApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27*fdd8201dSApple OSS Distributions  */
28*fdd8201dSApple OSS Distributions 
29*fdd8201dSApple OSS Distributions #ifndef _KERN_SYS_KERNELTYPES_H_
30*fdd8201dSApple OSS Distributions #define _KERN_SYS_KERNELTYPES_H_
31*fdd8201dSApple OSS Distributions 
32*fdd8201dSApple OSS Distributions #include <sys/cdefs.h>
33*fdd8201dSApple OSS Distributions #include <sys/types.h>
34*fdd8201dSApple OSS Distributions #include <stdint.h>
35*fdd8201dSApple OSS Distributions 
36*fdd8201dSApple OSS Distributions #ifdef BSD_BUILD
37*fdd8201dSApple OSS Distributions /* Macros(?) to clear/set/test flags. */
38*fdd8201dSApple OSS Distributions #define SET(t, f)       (t) |= (f)
39*fdd8201dSApple OSS Distributions #define CLR(t, f)       (t) &= ~(f)
40*fdd8201dSApple OSS Distributions #define ISSET(t, f)     ((t) & (f))
41*fdd8201dSApple OSS Distributions #endif
42*fdd8201dSApple OSS Distributions 
43*fdd8201dSApple OSS Distributions 
44*fdd8201dSApple OSS Distributions typedef int64_t daddr64_t;
45*fdd8201dSApple OSS Distributions 
46*fdd8201dSApple OSS Distributions #ifndef BSD_BUILD
47*fdd8201dSApple OSS Distributions struct buf;
48*fdd8201dSApple OSS Distributions typedef struct buf * buf_t;
49*fdd8201dSApple OSS Distributions 
50*fdd8201dSApple OSS Distributions struct file;
51*fdd8201dSApple OSS Distributions typedef struct file * file_t;
52*fdd8201dSApple OSS Distributions 
53*fdd8201dSApple OSS Distributions #ifndef __LP64__
54*fdd8201dSApple OSS Distributions struct ucred;
55*fdd8201dSApple OSS Distributions typedef struct ucred * ucred_t;
56*fdd8201dSApple OSS Distributions #endif
57*fdd8201dSApple OSS Distributions 
58*fdd8201dSApple OSS Distributions #if defined(KERNEL) || !defined(_SYS_MOUNT_H_) /* also defined in mount.h */
59*fdd8201dSApple OSS Distributions struct mount;
60*fdd8201dSApple OSS Distributions typedef struct mount * mount_t;
61*fdd8201dSApple OSS Distributions 
62*fdd8201dSApple OSS Distributions struct vnode;
63*fdd8201dSApple OSS Distributions typedef struct vnode * vnode_t;
64*fdd8201dSApple OSS Distributions #endif
65*fdd8201dSApple OSS Distributions 
66*fdd8201dSApple OSS Distributions struct proc;
67*fdd8201dSApple OSS Distributions typedef struct proc * proc_t;
68*fdd8201dSApple OSS Distributions 
69*fdd8201dSApple OSS Distributions struct proc_ident;
70*fdd8201dSApple OSS Distributions typedef struct proc_ident * proc_ident_t;
71*fdd8201dSApple OSS Distributions 
72*fdd8201dSApple OSS Distributions struct uio;
73*fdd8201dSApple OSS Distributions typedef struct uio * uio_t;
74*fdd8201dSApple OSS Distributions 
75*fdd8201dSApple OSS Distributions struct vfs_context;
76*fdd8201dSApple OSS Distributions typedef struct vfs_context * vfs_context_t;
77*fdd8201dSApple OSS Distributions 
78*fdd8201dSApple OSS Distributions struct vfstable;
79*fdd8201dSApple OSS Distributions typedef struct vfstable * vfstable_t;
80*fdd8201dSApple OSS Distributions 
81*fdd8201dSApple OSS Distributions struct __ifnet;
82*fdd8201dSApple OSS Distributions struct __mbuf;
83*fdd8201dSApple OSS Distributions struct __pkthdr;
84*fdd8201dSApple OSS Distributions struct __socket;
85*fdd8201dSApple OSS Distributions struct __sockopt;
86*fdd8201dSApple OSS Distributions struct __ifaddr;
87*fdd8201dSApple OSS Distributions struct __ifmultiaddr;
88*fdd8201dSApple OSS Distributions struct __ifnet_filter;
89*fdd8201dSApple OSS Distributions struct __rtentry;
90*fdd8201dSApple OSS Distributions struct __if_clone;
91*fdd8201dSApple OSS Distributions struct __bufattr;
92*fdd8201dSApple OSS Distributions 
93*fdd8201dSApple OSS Distributions typedef struct __ifnet*                 ifnet_t;
94*fdd8201dSApple OSS Distributions typedef struct __mbuf*                  mbuf_t;
95*fdd8201dSApple OSS Distributions typedef struct __pkthdr*                pkthdr_t;
96*fdd8201dSApple OSS Distributions typedef struct __socket*                socket_t;
97*fdd8201dSApple OSS Distributions typedef struct __sockopt*               sockopt_t;
98*fdd8201dSApple OSS Distributions typedef struct __ifaddr*                ifaddr_t;
99*fdd8201dSApple OSS Distributions typedef struct __ifmultiaddr*   ifmultiaddr_t;
100*fdd8201dSApple OSS Distributions typedef struct __ifnet_filter*  interface_filter_t;
101*fdd8201dSApple OSS Distributions typedef struct __rtentry*               route_t;
102*fdd8201dSApple OSS Distributions typedef struct __if_clone*              if_clone_t;
103*fdd8201dSApple OSS Distributions typedef struct __bufattr*               bufattr_t;
104*fdd8201dSApple OSS Distributions 
105*fdd8201dSApple OSS Distributions #else /* BSD_BUILD */
106*fdd8201dSApple OSS Distributions 
107*fdd8201dSApple OSS Distributions typedef struct buf * buf_t;
108*fdd8201dSApple OSS Distributions typedef struct file * file_t;
109*fdd8201dSApple OSS Distributions #ifndef __LP64__
110*fdd8201dSApple OSS Distributions typedef struct ucred * ucred_t;
111*fdd8201dSApple OSS Distributions #endif
112*fdd8201dSApple OSS Distributions #if defined(KERNEL) || !defined(_SYS_MOUNT_H_) /* also defined in mount.h */
113*fdd8201dSApple OSS Distributions typedef struct mount * mount_t;
114*fdd8201dSApple OSS Distributions typedef struct vnode * vnode_t;
115*fdd8201dSApple OSS Distributions #endif
116*fdd8201dSApple OSS Distributions typedef struct proc * proc_t;
117*fdd8201dSApple OSS Distributions typedef struct proc_ident * proc_ident_t;
118*fdd8201dSApple OSS Distributions typedef struct uio * uio_t;
119*fdd8201dSApple OSS Distributions typedef struct user_iovec * user_iovec_t;
120*fdd8201dSApple OSS Distributions typedef struct vfs_context * vfs_context_t;
121*fdd8201dSApple OSS Distributions typedef struct vfstable * vfstable_t;
122*fdd8201dSApple OSS Distributions 
123*fdd8201dSApple OSS Distributions #ifdef KERNEL_PRIVATE
124*fdd8201dSApple OSS Distributions typedef struct kern_iovec * kern_iovec_t;
125*fdd8201dSApple OSS Distributions typedef struct ifnet*           ifnet_t;
126*fdd8201dSApple OSS Distributions typedef struct mbuf*            mbuf_t;
127*fdd8201dSApple OSS Distributions typedef struct pkthdr*          pkthdr_t;
128*fdd8201dSApple OSS Distributions typedef struct socket*          socket_t;
129*fdd8201dSApple OSS Distributions typedef struct sockopt*         sockopt_t;
130*fdd8201dSApple OSS Distributions typedef struct ifaddr*          ifaddr_t;
131*fdd8201dSApple OSS Distributions typedef struct ifmultiaddr*     ifmultiaddr_t;
132*fdd8201dSApple OSS Distributions typedef struct ifnet_filter*    interface_filter_t;
133*fdd8201dSApple OSS Distributions typedef struct rtentry*         route_t;
134*fdd8201dSApple OSS Distributions typedef struct if_clone*        if_clone_t;
135*fdd8201dSApple OSS Distributions typedef struct bufattr*         bufattr_t;
136*fdd8201dSApple OSS Distributions #endif /* KERNEL_PRIVATE */
137*fdd8201dSApple OSS Distributions 
138*fdd8201dSApple OSS Distributions #endif /* !BSD_BUILD */
139*fdd8201dSApple OSS Distributions 
140*fdd8201dSApple OSS Distributions #include <sys/_types/_guid_t.h>
141*fdd8201dSApple OSS Distributions 
142*fdd8201dSApple OSS Distributions #ifndef _KAUTH_ACE
143*fdd8201dSApple OSS Distributions #define _KAUTH_ACE
144*fdd8201dSApple OSS Distributions struct kauth_ace;
145*fdd8201dSApple OSS Distributions typedef struct kauth_ace * kauth_ace_t;
146*fdd8201dSApple OSS Distributions #endif
147*fdd8201dSApple OSS Distributions #ifndef _KAUTH_ACL
148*fdd8201dSApple OSS Distributions #define _KAUTH_ACL
149*fdd8201dSApple OSS Distributions struct kauth_acl;
150*fdd8201dSApple OSS Distributions typedef struct kauth_acl * kauth_acl_t;
151*fdd8201dSApple OSS Distributions #endif
152*fdd8201dSApple OSS Distributions #ifndef _KAUTH_FILESEC
153*fdd8201dSApple OSS Distributions #define _KAUTH_FILESEC
154*fdd8201dSApple OSS Distributions struct kauth_filesec;
155*fdd8201dSApple OSS Distributions typedef struct kauth_filesec * kauth_filesec_t;
156*fdd8201dSApple OSS Distributions #endif
157*fdd8201dSApple OSS Distributions 
158*fdd8201dSApple OSS Distributions #ifndef _KAUTH_ACTION_T
159*fdd8201dSApple OSS Distributions #define _KAUTH_ACTION_T
160*fdd8201dSApple OSS Distributions typedef int kauth_action_t;
161*fdd8201dSApple OSS Distributions #endif
162*fdd8201dSApple OSS Distributions 
163*fdd8201dSApple OSS Distributions #endif /* !_KERN_SYS_KERNELTYPES_H_ */
164