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