]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
91447636 | 2 | * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. |
1c79356b | 3 | * |
8f6c56a5 | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
1c79356b | 5 | * |
8f6c56a5 A |
6 | * This file contains Original Code and/or Modifications of Original Code |
7 | * as defined in and that are subject to the Apple Public Source License | |
8 | * Version 2.0 (the 'License'). You may not use this file except in | |
9 | * compliance with the License. The rights granted to you under the License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
14 | * | |
15 | * Please obtain a copy of the License at | |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
17 | * | |
18 | * The Original Code and all software distributed under the License are | |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
23 | * Please see the License for the specific language governing rights and | |
8ad349bb | 24 | * limitations under the License. |
8f6c56a5 A |
25 | * |
26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | |
1c79356b A |
27 | */ |
28 | /* | |
29 | * @OSF_COPYRIGHT@ | |
30 | */ | |
31 | /* | |
32 | * Mach Operating System | |
33 | * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University | |
34 | * All Rights Reserved. | |
35 | * | |
36 | * Permission to use, copy, modify and distribute this software and its | |
37 | * documentation is hereby granted, provided that both the copyright | |
38 | * notice and this permission notice appear in all copies of the | |
39 | * software, derivative works or modified versions, and any portions | |
40 | * thereof, and that both notices appear in supporting documentation. | |
41 | * | |
42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | |
44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
45 | * | |
46 | * Carnegie Mellon requests users of this software to return to | |
47 | * | |
48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
49 | * School of Computer Science | |
50 | * Carnegie Mellon University | |
51 | * Pittsburgh PA 15213-3890 | |
52 | * | |
53 | * any improvements or extensions that they make and grant Carnegie Mellon | |
54 | * the rights to redistribute these changes. | |
55 | */ | |
56 | /* | |
57 | */ | |
58 | /* | |
59 | * File: mach/mach_types.h | |
60 | * Author: Avadis Tevanian, Jr., Michael Wayne Young | |
61 | * Date: 1986 | |
62 | * | |
63 | * Mach external interface definitions. | |
64 | * | |
65 | */ | |
66 | ||
67 | #ifndef _MACH_MACH_TYPES_H_ | |
68 | #define _MACH_MACH_TYPES_H_ | |
69 | ||
0b4e3aa0 A |
70 | #include <stdint.h> |
71 | ||
91447636 A |
72 | #include <sys/cdefs.h> |
73 | ||
1c79356b | 74 | #include <mach/host_info.h> |
55e303ae A |
75 | #include <mach/host_notify.h> |
76 | #include <mach/host_special_ports.h> | |
1c79356b A |
77 | #include <mach/machine.h> |
78 | #include <mach/machine/vm_types.h> | |
79 | #include <mach/memory_object_types.h> | |
91447636 | 80 | #include <mach/message.h> |
1c79356b A |
81 | #include <mach/exception_types.h> |
82 | #include <mach/port.h> | |
83 | #include <mach/processor_info.h> | |
84 | #include <mach/task_info.h> | |
85 | #include <mach/task_policy.h> | |
86 | #include <mach/task_special_ports.h> | |
87 | #include <mach/thread_info.h> | |
88 | #include <mach/thread_policy.h> | |
89 | #include <mach/thread_special_ports.h> | |
90 | #include <mach/thread_status.h> | |
91 | #include <mach/time_value.h> | |
92 | #include <mach/clock_types.h> | |
93 | #include <mach/vm_attributes.h> | |
94 | #include <mach/vm_inherit.h> | |
91447636 | 95 | #include <mach/vm_purgable.h> |
1c79356b A |
96 | #include <mach/vm_behavior.h> |
97 | #include <mach/vm_prot.h> | |
98 | #include <mach/vm_statistics.h> | |
99 | #include <mach/vm_sync.h> | |
100 | #include <mach/vm_types.h> | |
101 | #include <mach/vm_region.h> | |
102 | #include <mach/kmod.h> | |
103 | ||
91447636 | 104 | #ifdef KERNEL |
1c79356b A |
105 | |
106 | #include <mach/vm_param.h> | |
107 | ||
108 | /* | |
109 | * If we are in the kernel, then pick up the kernel definitions for | |
110 | * the basic mach types. | |
111 | */ | |
89b3af67 | 112 | typedef struct task *task_t, *task_name_t; |
55e303ae | 113 | typedef struct thread *thread_t, *thread_act_t; |
9bccf70c A |
114 | typedef struct ipc_space *ipc_space_t; |
115 | typedef struct host *host_t; | |
116 | typedef struct host *host_priv_t; | |
117 | typedef struct host *host_security_t; | |
118 | typedef struct processor *processor_t; | |
119 | typedef struct processor_set *processor_set_t; | |
120 | typedef struct processor_set *processor_set_control_t; | |
121 | typedef struct semaphore *semaphore_t; | |
122 | typedef struct lock_set *lock_set_t; | |
123 | typedef struct ledger *ledger_t; | |
124 | typedef struct alarm *alarm_t; | |
125 | typedef struct clock *clock_serv_t; | |
126 | typedef struct clock *clock_ctrl_t; | |
1c79356b | 127 | |
91447636 A |
128 | #ifndef MACH_KERNEL_PRIVATE |
129 | ||
130 | __BEGIN_DECLS | |
9bccf70c | 131 | |
9bccf70c | 132 | struct task ; |
55e303ae | 133 | struct thread ; |
9bccf70c A |
134 | struct host ; |
135 | struct processor ; | |
136 | struct processor_set ; | |
137 | struct semaphore ; | |
138 | struct lock_set ; | |
139 | struct ledger ; | |
140 | struct alarm ; | |
141 | struct clock ; | |
142 | ||
91447636 | 143 | __END_DECLS |
1c79356b | 144 | |
91447636 A |
145 | #endif /* MACH_KERNEL_PRIVATE */ |
146 | ||
147 | #else /* KERNEL */ | |
1c79356b A |
148 | |
149 | /* | |
150 | * If we are not in the kernel, then these will all be represented by | |
151 | * ports at user-space. | |
152 | */ | |
153 | typedef mach_port_t task_t; | |
89b3af67 | 154 | typedef mach_port_t task_name_t; |
1c79356b | 155 | typedef mach_port_t thread_t; |
9bccf70c | 156 | typedef mach_port_t thread_act_t; |
1c79356b A |
157 | typedef mach_port_t ipc_space_t; |
158 | typedef mach_port_t host_t; | |
159 | typedef mach_port_t host_priv_t; | |
160 | typedef mach_port_t host_security_t; | |
9bccf70c | 161 | typedef mach_port_t processor_t; |
1c79356b | 162 | typedef mach_port_t processor_set_t; |
1c79356b | 163 | typedef mach_port_t processor_set_control_t; |
1c79356b A |
164 | typedef mach_port_t semaphore_t; |
165 | typedef mach_port_t lock_set_t; | |
166 | typedef mach_port_t ledger_t; | |
167 | typedef mach_port_t alarm_t; | |
168 | typedef mach_port_t clock_serv_t; | |
169 | typedef mach_port_t clock_ctrl_t; | |
1c79356b | 170 | |
91447636 | 171 | #endif /* KERNEL */ |
1c79356b | 172 | |
9bccf70c A |
173 | /* |
174 | * These aren't really unique types. They are just called | |
175 | * out as unique types at one point in history. So we list | |
176 | * them here for compatibility. | |
177 | */ | |
178 | typedef processor_set_t processor_set_name_t; | |
1c79356b A |
179 | |
180 | /* | |
91447636 | 181 | * These types are just hard-coded as ports |
1c79356b A |
182 | */ |
183 | typedef mach_port_t clock_reply_t; | |
184 | typedef mach_port_t bootstrap_t; | |
185 | typedef mach_port_t mem_entry_name_port_t; | |
186 | typedef mach_port_t exception_handler_t; | |
187 | typedef exception_handler_t *exception_handler_array_t; | |
1c79356b | 188 | typedef mach_port_t vm_task_entry_t; |
1c79356b A |
189 | typedef mach_port_t io_master_t; |
190 | typedef mach_port_t UNDServerRef; | |
191 | ||
192 | /* | |
91447636 | 193 | * Mig doesn't translate the components of an array. |
1c79356b A |
194 | * For example, Mig won't use the thread_t translations |
195 | * to translate a thread_array_t argument. So, these definitions | |
196 | * are not completely accurate at the moment for other kernel | |
91447636 | 197 | * components. |
1c79356b A |
198 | */ |
199 | typedef task_t *task_array_t; | |
200 | typedef thread_t *thread_array_t; | |
201 | typedef processor_set_t *processor_set_array_t; | |
202 | typedef processor_set_t *processor_set_name_array_t; | |
203 | typedef processor_t *processor_array_t; | |
204 | typedef thread_act_t *thread_act_array_t; | |
205 | typedef ledger_t *ledger_array_t; | |
206 | ||
207 | /* | |
208 | * However the real mach_types got declared, we also have to declare | |
209 | * types with "port" in the name for compatability with the way OSF | |
210 | * had declared the user interfaces at one point. Someday these should | |
211 | * go away. | |
212 | */ | |
213 | typedef task_t task_port_t; | |
214 | typedef task_array_t task_port_array_t; | |
215 | typedef thread_t thread_port_t; | |
216 | typedef thread_array_t thread_port_array_t; | |
217 | typedef ipc_space_t ipc_space_port_t; | |
218 | typedef host_t host_name_t; | |
219 | typedef host_t host_name_port_t; | |
220 | typedef processor_set_t processor_set_port_t; | |
221 | typedef processor_set_t processor_set_name_port_t; | |
222 | typedef processor_set_array_t processor_set_name_port_array_t; | |
223 | typedef processor_set_t processor_set_control_port_t; | |
224 | typedef processor_t processor_port_t; | |
225 | typedef processor_array_t processor_port_array_t; | |
226 | typedef thread_act_t thread_act_port_t; | |
227 | typedef thread_act_array_t thread_act_port_array_t; | |
228 | typedef semaphore_t semaphore_port_t; | |
229 | typedef lock_set_t lock_set_port_t; | |
230 | typedef ledger_t ledger_port_t; | |
231 | typedef ledger_array_t ledger_port_array_t; | |
232 | typedef alarm_t alarm_port_t; | |
233 | typedef clock_serv_t clock_serv_port_t; | |
234 | typedef clock_ctrl_t clock_ctrl_port_t; | |
1c79356b A |
235 | typedef exception_handler_t exception_port_t; |
236 | typedef exception_handler_array_t exception_port_arrary_t; | |
237 | ||
9bccf70c | 238 | |
1c79356b | 239 | #define TASK_NULL ((task_t) 0) |
89b3af67 | 240 | #define TASK_NAME_NULL ((task_name_t) 0) |
1c79356b | 241 | #define THREAD_NULL ((thread_t) 0) |
9bccf70c A |
242 | #define THR_ACT_NULL ((thread_act_t) 0) |
243 | #define IPC_SPACE_NULL ((ipc_space_t) 0) | |
1c79356b A |
244 | #define HOST_NULL ((host_t) 0) |
245 | #define HOST_PRIV_NULL ((host_priv_t)0) | |
246 | #define HOST_SECURITY_NULL ((host_security_t)0) | |
247 | #define PROCESSOR_SET_NULL ((processor_set_t) 0) | |
248 | #define PROCESSOR_NULL ((processor_t) 0) | |
1c79356b A |
249 | #define SEMAPHORE_NULL ((semaphore_t) 0) |
250 | #define LOCK_SET_NULL ((lock_set_t) 0) | |
9bccf70c | 251 | #define LEDGER_NULL ((ledger_t) 0) |
1c79356b A |
252 | #define ALARM_NULL ((alarm_t) 0) |
253 | #define CLOCK_NULL ((clock_t) 0) | |
1c79356b A |
254 | #define UND_SERVER_NULL ((UNDServerRef) 0) |
255 | ||
91447636 A |
256 | typedef natural_t ledger_item_t; |
257 | #define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0)) | |
258 | ||
259 | typedef mach_vm_offset_t *emulation_vector_t; | |
1c79356b A |
260 | typedef char *user_subsystem_t; |
261 | ||
262 | /* | |
263 | * Backwards compatibility, for those programs written | |
264 | * before mach/{std,mach}_types.{defs,h} were set up. | |
265 | */ | |
266 | #include <mach/std_types.h> | |
267 | ||
268 | #endif /* _MACH_MACH_TYPES_H_ */ |