]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/mach_types.h
xnu-792.6.76.tar.gz
[apple/xnu.git] / osfmk / mach / mach_types.h
CommitLineData
1c79356b 1/*
91447636 2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
1c79356b
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
37839358
A
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.
1c79356b 11 *
37839358
A
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
1c79356b
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
37839358
A
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.
1c79356b
A
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
0b4e3aa0
A
64#include <stdint.h>
65
91447636
A
66#include <sys/cdefs.h>
67
1c79356b 68#include <mach/host_info.h>
55e303ae
A
69#include <mach/host_notify.h>
70#include <mach/host_special_ports.h>
1c79356b
A
71#include <mach/machine.h>
72#include <mach/machine/vm_types.h>
73#include <mach/memory_object_types.h>
91447636 74#include <mach/message.h>
1c79356b
A
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>
91447636 89#include <mach/vm_purgable.h>
1c79356b
A
90#include <mach/vm_behavior.h>
91#include <mach/vm_prot.h>
92#include <mach/vm_statistics.h>
93#include <mach/vm_sync.h>
94#include <mach/vm_types.h>
95#include <mach/vm_region.h>
96#include <mach/kmod.h>
97
91447636 98#ifdef KERNEL
1c79356b
A
99
100#include <mach/vm_param.h>
101
102/*
103 * If we are in the kernel, then pick up the kernel definitions for
104 * the basic mach types.
105 */
9bccf70c 106typedef struct task *task_t;
55e303ae 107typedef struct thread *thread_t, *thread_act_t;
9bccf70c
A
108typedef struct ipc_space *ipc_space_t;
109typedef struct host *host_t;
110typedef struct host *host_priv_t;
111typedef struct host *host_security_t;
112typedef struct processor *processor_t;
113typedef struct processor_set *processor_set_t;
114typedef struct processor_set *processor_set_control_t;
115typedef struct semaphore *semaphore_t;
116typedef struct lock_set *lock_set_t;
117typedef struct ledger *ledger_t;
118typedef struct alarm *alarm_t;
119typedef struct clock *clock_serv_t;
120typedef struct clock *clock_ctrl_t;
1c79356b 121
91447636
A
122#ifndef MACH_KERNEL_PRIVATE
123
124__BEGIN_DECLS
9bccf70c 125
9bccf70c 126struct task ;
55e303ae 127struct thread ;
9bccf70c
A
128struct host ;
129struct processor ;
130struct processor_set ;
131struct semaphore ;
132struct lock_set ;
133struct ledger ;
134struct alarm ;
135struct clock ;
136
91447636 137__END_DECLS
1c79356b 138
91447636
A
139#endif /* MACH_KERNEL_PRIVATE */
140
141#else /* KERNEL */
1c79356b
A
142
143/*
144 * If we are not in the kernel, then these will all be represented by
145 * ports at user-space.
146 */
147typedef mach_port_t task_t;
148typedef mach_port_t thread_t;
9bccf70c 149typedef mach_port_t thread_act_t;
1c79356b
A
150typedef mach_port_t ipc_space_t;
151typedef mach_port_t host_t;
152typedef mach_port_t host_priv_t;
153typedef mach_port_t host_security_t;
9bccf70c 154typedef mach_port_t processor_t;
1c79356b 155typedef mach_port_t processor_set_t;
1c79356b 156typedef mach_port_t processor_set_control_t;
1c79356b
A
157typedef mach_port_t semaphore_t;
158typedef mach_port_t lock_set_t;
159typedef mach_port_t ledger_t;
160typedef mach_port_t alarm_t;
161typedef mach_port_t clock_serv_t;
162typedef mach_port_t clock_ctrl_t;
1c79356b 163
91447636 164#endif /* KERNEL */
1c79356b 165
9bccf70c
A
166/*
167 * These aren't really unique types. They are just called
168 * out as unique types at one point in history. So we list
169 * them here for compatibility.
170 */
171typedef processor_set_t processor_set_name_t;
1c79356b
A
172
173/*
91447636 174 * These types are just hard-coded as ports
1c79356b
A
175 */
176typedef mach_port_t clock_reply_t;
177typedef mach_port_t bootstrap_t;
178typedef mach_port_t mem_entry_name_port_t;
179typedef mach_port_t exception_handler_t;
180typedef exception_handler_t *exception_handler_array_t;
1c79356b 181typedef mach_port_t vm_task_entry_t;
1c79356b
A
182typedef mach_port_t io_master_t;
183typedef mach_port_t UNDServerRef;
184
185/*
91447636 186 * Mig doesn't translate the components of an array.
1c79356b
A
187 * For example, Mig won't use the thread_t translations
188 * to translate a thread_array_t argument. So, these definitions
189 * are not completely accurate at the moment for other kernel
91447636 190 * components.
1c79356b
A
191 */
192typedef task_t *task_array_t;
193typedef thread_t *thread_array_t;
194typedef processor_set_t *processor_set_array_t;
195typedef processor_set_t *processor_set_name_array_t;
196typedef processor_t *processor_array_t;
197typedef thread_act_t *thread_act_array_t;
198typedef ledger_t *ledger_array_t;
199
200/*
201 * However the real mach_types got declared, we also have to declare
202 * types with "port" in the name for compatability with the way OSF
203 * had declared the user interfaces at one point. Someday these should
204 * go away.
205 */
206typedef task_t task_port_t;
207typedef task_array_t task_port_array_t;
208typedef thread_t thread_port_t;
209typedef thread_array_t thread_port_array_t;
210typedef ipc_space_t ipc_space_port_t;
211typedef host_t host_name_t;
212typedef host_t host_name_port_t;
213typedef processor_set_t processor_set_port_t;
214typedef processor_set_t processor_set_name_port_t;
215typedef processor_set_array_t processor_set_name_port_array_t;
216typedef processor_set_t processor_set_control_port_t;
217typedef processor_t processor_port_t;
218typedef processor_array_t processor_port_array_t;
219typedef thread_act_t thread_act_port_t;
220typedef thread_act_array_t thread_act_port_array_t;
221typedef semaphore_t semaphore_port_t;
222typedef lock_set_t lock_set_port_t;
223typedef ledger_t ledger_port_t;
224typedef ledger_array_t ledger_port_array_t;
225typedef alarm_t alarm_port_t;
226typedef clock_serv_t clock_serv_port_t;
227typedef clock_ctrl_t clock_ctrl_port_t;
1c79356b
A
228typedef exception_handler_t exception_port_t;
229typedef exception_handler_array_t exception_port_arrary_t;
230
9bccf70c 231
1c79356b
A
232#define TASK_NULL ((task_t) 0)
233#define THREAD_NULL ((thread_t) 0)
9bccf70c
A
234#define THR_ACT_NULL ((thread_act_t) 0)
235#define IPC_SPACE_NULL ((ipc_space_t) 0)
1c79356b
A
236#define HOST_NULL ((host_t) 0)
237#define HOST_PRIV_NULL ((host_priv_t)0)
238#define HOST_SECURITY_NULL ((host_security_t)0)
239#define PROCESSOR_SET_NULL ((processor_set_t) 0)
240#define PROCESSOR_NULL ((processor_t) 0)
1c79356b
A
241#define SEMAPHORE_NULL ((semaphore_t) 0)
242#define LOCK_SET_NULL ((lock_set_t) 0)
9bccf70c 243#define LEDGER_NULL ((ledger_t) 0)
1c79356b
A
244#define ALARM_NULL ((alarm_t) 0)
245#define CLOCK_NULL ((clock_t) 0)
1c79356b
A
246#define UND_SERVER_NULL ((UNDServerRef) 0)
247
91447636
A
248typedef natural_t ledger_item_t;
249#define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0))
250
251typedef mach_vm_offset_t *emulation_vector_t;
1c79356b
A
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_ */