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