]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/mach_types.h
0e44e2b43ca6bb08748ef17c0647efed170716dc
[apple/xnu.git] / osfmk / mach / mach_types.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * @OSF_COPYRIGHT@
24 */
25 /*
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
28 * All Rights Reserved.
29 *
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
35 *
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
39 *
40 * Carnegie Mellon requests users of this software to return to
41 *
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
46 *
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
49 */
50 /*
51 */
52 /*
53 * File: mach/mach_types.h
54 * Author: Avadis Tevanian, Jr., Michael Wayne Young
55 * Date: 1986
56 *
57 * Mach external interface definitions.
58 *
59 */
60
61 #ifndef _MACH_MACH_TYPES_H_
62 #define _MACH_MACH_TYPES_H_
63
64 #include <mach/host_info.h>
65 #include <mach/machine.h>
66 #include <mach/machine/vm_types.h>
67 #include <mach/memory_object_types.h>
68 #include <mach/exception_types.h>
69 #include <mach/port.h>
70 #include <mach/processor_info.h>
71 #include <mach/task_info.h>
72 #include <mach/task_policy.h>
73 #include <mach/task_special_ports.h>
74 #include <mach/thread_info.h>
75 #include <mach/thread_policy.h>
76 #include <mach/thread_special_ports.h>
77 #include <mach/thread_status.h>
78 #include <mach/time_value.h>
79 #include <mach/clock_types.h>
80 #include <mach/vm_attributes.h>
81 #include <mach/vm_inherit.h>
82 #include <mach/vm_behavior.h>
83 #include <mach/vm_prot.h>
84 #include <mach/vm_statistics.h>
85 #include <mach/vm_sync.h>
86 #include <mach/vm_types.h>
87 #include <mach/vm_region.h>
88 #include <mach/kmod.h>
89
90 #ifdef KERNEL_PRIVATE
91
92 #include <mach/vm_param.h>
93
94 /*
95 * If we are in the kernel, then pick up the kernel definitions for
96 * the basic mach types.
97 */
98 #include <kern/kern_types.h>
99
100 extern ledger_t convert_port_to_ledger(ipc_port_t); /* JMM - Hack */
101
102 #else /* !KERNEL_PRIVATE */
103
104 /*
105 * If we are not in the kernel, then these will all be represented by
106 * ports at user-space.
107 */
108 typedef mach_port_t task_t;
109 typedef mach_port_t thread_t;
110 typedef mach_port_t ipc_space_t;
111 typedef mach_port_t host_t;
112 typedef mach_port_t host_priv_t;
113 typedef mach_port_t host_security_t;
114 typedef mach_port_t processor_set_t;
115 typedef mach_port_t processor_set_name_t;
116 typedef mach_port_t processor_set_control_t;
117 typedef mach_port_t processor_t;
118 typedef mach_port_t thread_act_t;
119 typedef mach_port_t subsystem_t;
120 typedef mach_port_t semaphore_t;
121 typedef mach_port_t lock_set_t;
122 typedef mach_port_t ledger_t;
123 typedef mach_port_t alarm_t;
124 typedef mach_port_t clock_serv_t;
125 typedef mach_port_t clock_ctrl_t;
126 typedef mach_port_t vm_map_t;
127 typedef mach_port_t vm_map_copy_t;
128 typedef mach_port_t vm_object_t;
129
130 #endif /* !KERNEL_PRIVATE */
131
132
133 /*
134 * JMM - These types are just hard-coded as ports for now
135 */
136 typedef mach_port_t clock_reply_t;
137 typedef mach_port_t bootstrap_t;
138 typedef mach_port_t mem_entry_name_port_t;
139 typedef mach_port_t exception_handler_t;
140 typedef exception_handler_t *exception_handler_array_t;
141 typedef mach_port_t vm_object_entry_t;
142 typedef mach_port_t vm_task_entry_t;
143 typedef mach_port_t upl_object_entry_t;
144 typedef mach_port_t io_master_t;
145 typedef mach_port_t UNDServerRef;
146
147 /*
148 * JMM - Mig doesn't translate the components of an array.
149 * For example, Mig won't use the thread_t translations
150 * to translate a thread_array_t argument. So, these definitions
151 * are not completely accurate at the moment for other kernel
152 * components. MIG is being fixed.
153 */
154 typedef task_t *task_array_t;
155 typedef thread_t *thread_array_t;
156 typedef processor_set_t *processor_set_array_t;
157 typedef processor_set_t *processor_set_name_array_t;
158 typedef processor_t *processor_array_t;
159 typedef thread_act_t *thread_act_array_t;
160 typedef ledger_t *ledger_array_t;
161
162 /*
163 * However the real mach_types got declared, we also have to declare
164 * types with "port" in the name for compatability with the way OSF
165 * had declared the user interfaces at one point. Someday these should
166 * go away.
167 */
168 typedef task_t task_port_t;
169 typedef task_array_t task_port_array_t;
170 typedef thread_t thread_port_t;
171 typedef thread_array_t thread_port_array_t;
172 typedef ipc_space_t ipc_space_port_t;
173 typedef host_t host_name_t;
174 typedef host_t host_name_port_t;
175 typedef processor_set_t processor_set_port_t;
176 typedef processor_set_t processor_set_name_port_t;
177 typedef processor_set_array_t processor_set_name_port_array_t;
178 typedef processor_set_t processor_set_control_port_t;
179 typedef processor_t processor_port_t;
180 typedef processor_array_t processor_port_array_t;
181 typedef thread_act_t thread_act_port_t;
182 typedef thread_act_array_t thread_act_port_array_t;
183 typedef semaphore_t semaphore_port_t;
184 typedef lock_set_t lock_set_port_t;
185 typedef ledger_t ledger_port_t;
186 typedef ledger_array_t ledger_port_array_t;
187 typedef alarm_t alarm_port_t;
188 typedef clock_serv_t clock_serv_port_t;
189 typedef clock_ctrl_t clock_ctrl_port_t;
190 typedef vm_map_t vm_map_port_t;
191 typedef vm_map_copy_t vm_map_copy_port_t;
192 typedef exception_handler_t exception_port_t;
193 typedef exception_handler_array_t exception_port_arrary_t;
194
195 #define TASK_NULL ((task_t) 0)
196 #define THREAD_NULL ((thread_t) 0)
197 #define HOST_NULL ((host_t) 0)
198 #define HOST_PRIV_NULL ((host_priv_t)0)
199 #define HOST_SECURITY_NULL ((host_security_t)0)
200 #define PROCESSOR_SET_NULL ((processor_set_t) 0)
201 #define PROCESSOR_NULL ((processor_t) 0)
202 #define THR_ACT_NULL ((thread_act_t) 0)
203 #define SUBSYSTEM_NULL ((subsystem_t) 0)
204 #define SEMAPHORE_NULL ((semaphore_t) 0)
205 #define LOCK_SET_NULL ((lock_set_t) 0)
206 #define ALARM_NULL ((alarm_t) 0)
207 #define CLOCK_NULL ((clock_t) 0)
208 #define VM_MAP_NULL ((vm_map_t) 0)
209 #define VM_MAP_COPY_NULL ((vm_map_copy_t) 0)
210 #define VM_OBJECT_NULL ((vm_object_t) 0)
211 #define UND_SERVER_NULL ((UNDServerRef) 0)
212
213 typedef integer_t ledger_item_t;
214 typedef vm_offset_t *emulation_vector_t;
215 typedef char *user_subsystem_t;
216
217 /*
218 * Backwards compatibility, for those programs written
219 * before mach/{std,mach}_types.{defs,h} were set up.
220 */
221 #include <mach/std_types.h>
222
223 #endif /* _MACH_MACH_TYPES_H_ */