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