summaryrefslogtreecommitdiff
path: root/include/mach/mach_types.defs
blob: a0e9241cdec9ec606983d83721eefc5e99f29cea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
/*
 * Mach Operating System
 * Copyright (c) 1994-1988 Carnegie Mellon University.
 * Copyright (c) 1993,1994 The University of Utah and
 * the Computer Systems Laboratory (CSL).
 * All rights reserved.
 *
 * Permission to use, copy, modify and distribute this software and its
 * documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation.
 *
 * CARNEGIE MELLON, THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF
 * THIS SOFTWARE IN ITS "AS IS" CONDITION, AND DISCLAIM ANY LIABILITY
 * OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
 * THIS SOFTWARE.
 *
 * Carnegie Mellon requests users of this software to return to
 *
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 *  School of Computer Science
 *  Carnegie Mellon University
 *  Pittsburgh PA 15213-3890
 *
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */
/*
 *	Mach kernel interface type declarations
 */

#ifndef	_MACH_MACH_TYPES_DEFS_
#define _MACH_MACH_TYPES_DEFS_

/*
 *	For KernelServer and KernelUser interfaces, Mig will
 *	automagically use ipc_port_t instead of mach_port_t
 *	on the kernel side of the interface.  For example,
 *	convert_task_to_port really returns ipc_port_t.
 *	Doing this in Mig saves many explicit conditional
 *	cusertype/cservertype declarations.
 *
 *	Mig doesn't translate the components of an array.
 *	For example, Mig won't use the thread_t translations
 *	to translate a thread_array_t argument.
 */

#include <mach/std_types.defs>
#if	KERNEL_SERVER
#endif	/* KERNEL_SERVER */

#ifdef USERPREFIX
userprefix USERPREFIX;
#endif

#ifdef SERVERPREFIX
serverprefix SERVERPREFIX;
#endif

type mach_port_status_t = struct[9] of integer_t;

type task_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: task_t convert_port_to_task(mach_port_t)
		outtran: mach_port_t convert_task_to_port(task_t)
		destructor: task_deallocate(task_t)
#endif	/* KERNEL_SERVER */
		;

#ifdef	MIGRATING_THREADS
#if	KERNEL
/* What the conventional external Mach interfaces see as a thread_t
   is really an act_t within the kernel.  */
#define thread_t act_t
#define convert_port_to_thread convert_port_to_act
#define convert_thread_to_port convert_act_to_port
#define thread_deallocate act_deallocate
#endif	/* KERNEL */
#endif	/* MIGRATING_THREADS */

type thread_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: thread_t convert_port_to_thread(mach_port_t)
		outtran: mach_port_t convert_thread_to_port(thread_t)
		destructor: thread_deallocate(thread_t)
#endif	/* KERNEL_SERVER */
		;

type thread_state_t		= array[*:1024] of natural_t;

type task_array_t = ^array[] of task_t;
type thread_array_t = ^array[] of thread_t;

type vm_task_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: vm_map_t convert_port_to_map(mach_port_t)
		destructor: vm_map_deallocate(vm_map_t)
#endif	/* KERNEL_SERVER */
		;

type ipc_space_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: ipc_space_t convert_port_to_space(mach_port_t)
		destructor: space_deallocate(ipc_space_t)
#endif	/* KERNEL_SERVER */
		;

type vm_address_t = natural_t;
type vm_offset_t = natural_t;
type vm_size_t = natural_t;
type vm_prot_t = int;
type vm_inherit_t = int;
type vm_statistics_data_t = struct[13] of integer_t;
type vm_machine_attribute_t = int;
type vm_machine_attribute_val_t = int;
type vm_sync_t = int;

type thread_info_t		= array[*:1024] of integer_t;
type thread_basic_info_data_t	= struct[11] of integer_t;
type thread_sched_info_data_t	= struct[7] of integer_t;

type task_info_t		= array[*:1024] of integer_t;
type task_basic_info_data_t	= struct[8] of integer_t;
type task_events_info		= struct[7] of natural_t;
type task_thread_times_info_data_t = struct[4] of integer_t;


type memory_object_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: ipc_port_t null_conversion(mach_port_t)
#else	/* KERNEL_SERVER */
#ifdef	MEMORY_OBJECT_INTRAN
		intran: MEMORY_OBJECT_INTRAN
#endif
#ifdef	MEMORY_OBJECT_INTRAN_PAYLOAD
		intranpayload: MEMORY_OBJECT_INTRAN_PAYLOAD
#endif
#ifdef	MEMORY_OBJECT_OUTTRAN
		outtran: MEMORY_OBJECT_OUTTRAN
#endif
#ifdef	MEMORY_OBJECT_DESTRUCTOR
		destructor: MEMORY_OBJECT_DESTRUCTOR
#endif
#endif	/* KERNEL_SERVER */
		;

type memory_object_control_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: vm_object_t vm_object_lookup(mach_port_t)
#endif	/* KERNEL_SERVER */
		;

type memory_object_name_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: vm_object_t vm_object_lookup_name(mach_port_t)
		destructor: vm_object_deallocate(vm_object_t)
#endif	/* KERNEL_SERVER */
		;

type memory_object_copy_strategy_t = int;
type memory_object_return_t = int;

type machine_info_data_t = struct[5] of integer_t;
type machine_slot_data_t = struct[8] of integer_t;

type host_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: host_t convert_port_to_host(mach_port_t)
		outtran: mach_port_t convert_host_to_port(host_t)
#endif	/* KERNEL_SERVER */
		;

type host_priv_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: host_t convert_port_to_host_priv(mach_port_t)
#endif	/* KERNEL_SERVER */
		;

type host_info_t 			= array[*:1024] of integer_t;
type host_basic_info_data_t		= struct[5] of integer_t;
type host_sched_info_data_t		= struct[2] of integer_t;
type host_load_info_data_t		= struct[6] of integer_t;


type processor_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: processor_t convert_port_to_processor(mach_port_t)
		outtran: mach_port_t convert_processor_to_port(processor_t)
#endif	/* KERNEL_SERVER */
		;

type processor_array_t 		= ^array[] of processor_t;
type processor_info_t		= array[*:1024] of integer_t;
type processor_basic_info_data_t = struct[5] of integer_t;


type processor_set_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: processor_set_t convert_port_to_pset(mach_port_t)
		outtran: mach_port_t convert_pset_to_port(processor_set_t)
		destructor: pset_deallocate(processor_set_t)
#endif	/* KERNEL_SERVER */
		;

type processor_set_array_t = ^array[] of processor_set_t;

type processor_set_name_t = mach_port_t
		ctype: mach_port_t
#if	KERNEL_SERVER
		intran: processor_set_t convert_port_to_pset_name(mach_port_t)
		outtran: mach_port_t convert_pset_name_to_port(processor_set_t)
		destructor: pset_deallocate(processor_set_t)
#endif	/* KERNEL_SERVER */
		;

type processor_set_name_array_t = ^array[] of processor_set_name_t;

type processor_set_info_t	= array[*:1024] of integer_t;
type processor_set_basic_info_data_t = struct[5] of integer_t;
type processor_set_sched_info_data_t = struct[2] of integer_t;


type kernel_version_t		= (MACH_MSG_TYPE_STRING, 512*8);

type kernel_boot_info_t		= (MACH_MSG_TYPE_STRING, 4096*8);

type time_value_t		= struct[2] of integer_t;

type emulation_vector_t		= ^array[] of vm_offset_t;

type rpc_signature_info_t	= array[*:1024] of int;

#if	KERNEL_SERVER
simport <kern/ipc_kobject.h>;	/* for null conversion */
simport <kern/ipc_tt.h>;	/* for task/thread conversion */
simport <kern/ipc_host.h>;	/* for host/processor/pset conversions */
simport <kern/task.h>;		/* for task_t */
simport <kern/thread.h>;	/* for thread_t */
simport <kern/host.h>;		/* for host_t */
simport <kern/processor.h>;	/* for processor_t, processor_set_t */
simport <vm/vm_object.h>;	/* for vm_object_t */
simport <vm/vm_map.h>;		/* for vm_map_t */
simport <ipc/ipc_space.h>;	/* for ipc_space_t */
#endif	/* KERNEL_SERVER */

import <mach/mach_types.h>;

#endif	/* _MACH_MACH_TYPES_DEFS_ */