summaryrefslogtreecommitdiff
path: root/include/mach/mach_host.defs
blob: 28439a01d824f9208151e8623c699415d6ad9d31 (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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
/*
 * Mach Operating System
 * Copyright (c) 1991,1990,1989 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.
 */
/*
 * File:	mach/mach_host.defs
 *
 * Abstract:
 *	Mach host operations support.  Includes processor allocation and
 *	control.  
 */

subsystem
#if	KERNEL_SERVER
	  KernelServer
#endif
		       mach_host 2600;

/*
 *	Basic types
 */

#include <mach/std_types.defs>
#include <mach/mach_types.defs>

#ifdef	MACH_HOST_IMPORTS
MACH_HOST_IMPORTS
#endif

/*
 *	Get list of processors on this host.
 */

routine host_processors(
		host_priv	: host_priv_t;
	out	processor_list	: processor_array_t);

skip;	/* old yyy_host_info */
skip;	/* old yyy_processor_info */

/*
 *	Start processor.
 */

routine	processor_start(
		processor	: processor_t);

/*
 *	Exit processor -- may not be restartable.
 */

routine	processor_exit(
		processor	: processor_t);

skip;	/* old yyy_processor_control */

/*
 *	Get default processor set for host.
 */
routine processor_set_default(
		host		: host_t;
	out	default_set	: processor_set_name_t);

skip;	/* old xxx_processor_set_default_priv */

/*
 *	Create new processor set.  Returns real port for manipulations,
 *	and name port for obtaining information.
 */
routine processor_set_create(
		host		: host_t;
	out	new_set		: processor_set_t;
	out	new_name	: processor_set_name_t);

/*
 *	Destroy processor set.
 */
routine processor_set_destroy(
		set		: processor_set_t);

skip;	/* old yyy_processor_set_info */

/*
 *	Assign processor to processor set.
 */
routine processor_assign(
		processor	: processor_t;
		new_set		: processor_set_t;
		wait		: boolean_t);

/*
 *	Get current assignment for processor.
 */

routine processor_get_assignment(
		processor	: processor_t;
	out	assigned_set	: processor_set_name_t);

/*
 *	Assign thread to processor set.
 */
routine	thread_assign(
		thread		: thread_t;
		new_set		: processor_set_t);

/*
 *	Assign thread to default set.
 */
routine thread_assign_default(
		thread		: thread_t);

/*
 *	Get current assignment for thread.
 */
routine thread_get_assignment(
		thread		: thread_t;
	out	assigned_set	: processor_set_name_t);

/*
 *	Assign task to processor set.
 */
routine task_assign(
		task		: task_t;
		new_set		: processor_set_t;
		assign_threads	: boolean_t);
/*
 *	Assign task to default set.
 */
routine task_assign_default(
		task		: task_t;
		assign_threads	: boolean_t);

/*
 *	Get current assignment for task.
 */
routine task_get_assignment(
		task		: task_t;
	out	assigned_set	: processor_set_name_t);

/*
 *	Get string describing current kernel version.
 */
routine	host_kernel_version(
		host		: host_t;
	out	kernel_version	: kernel_version_t);

/*
 *	Set priority for thread.
 */
routine thread_priority(
		thread		: thread_t;
		priority	: int;
		set_max		: boolean_t);

/*
 *	Set max priority for thread.
 */
routine thread_max_priority(
		thread		: thread_t;
		processor_set	: processor_set_t;
		max_priority	: int);

/*
 *	Set task priority.
 */
routine task_priority(
		task		: task_t;
		priority	: int;
		change_threads	: boolean_t);

/*
 *	Set max priority for processor_set.
 */
routine processor_set_max_priority(
		processor_set	: processor_set_t;
		max_priority	: int;
		change_threads	: boolean_t);

/*
 *	Set policy for thread
 */
routine thread_policy(
		thread		: thread_t;
		policy		: int;
		data		: int);

/*
 *	Enable policy for processor set
 */
routine processor_set_policy_enable(
		processor_set	: processor_set_t;
		policy		: int);

/*
 *	Disable policy for processor set
 */
routine processor_set_policy_disable(
		processor_set	: processor_set_t;
		policy		: int;
		change_threads	: boolean_t);
/*
 *	List all tasks in processor set.
 */
routine processor_set_tasks(
		processor_set	: processor_set_t;
	out	task_list	: task_array_t);

/*
 *	List all threads in processor set.
 */
routine processor_set_threads(
		processor_set	: processor_set_t;
	out	thread_list	: thread_array_t);

/*
 *	List all processor sets on host.
 */
routine host_processor_sets(
		host		: host_t;
	out	processor_sets	: processor_set_name_array_t);

/*
 *	Get control port for a processor set.
 */
routine host_processor_set_priv(
		host_priv	: host_priv_t;
		set_name	: processor_set_name_t;
	out	set		: processor_set_t);

routine thread_depress_abort(
		thread		: thread_t);

/*
 *	Set the time on this host.
 *	Only available to privileged users.
 */
routine host_set_time(
		host_priv	: host_priv_t;
		new_time	: time_value_t);

/*
 *	Arrange for the time on this host to be gradually changed
 *	by an adjustment value, and return the old value.
 *	Only available to privileged users.
 */
routine	host_adjust_time(
		host_priv	: host_priv_t;
	in	new_adjustment	: time_value_t;
	out	old_adjustment	: time_value_t);

/*
 *	Get the time on this host.
 *	Available to all.
 */
routine	host_get_time(
		host		: host_t;
	out	current_time	: time_value_t);

/*
 *	Reboot this host.
 *	Only available to privileged users.
 */
routine host_reboot(
		host_priv	: host_priv_t;
		options		: int);

/*
 *	Specify that the range of the virtual address space
 *	of the target task must not cause page faults for
 *	the indicated accesses.
 *
 *	[ To unwire the pages, specify VM_PROT_NONE. ]
 */
routine	vm_wire(
		host		: mach_port_t;
		task		: vm_task_t;
		address		: vm_address_t;
		size		: vm_size_t;
		access		: vm_prot_t);

/*
 *	Specify that the target thread must always be able
 *	to run and to allocate memory.
 */
routine	thread_wire(
		host_priv	: host_priv_t;
		thread		: thread_t;
		wired		: boolean_t);

/*
 *	Return information about this host.
 */

routine host_info(
		host		: host_t;
		flavor		: int;
	out	host_info_out	: host_info_t, CountInOut);


/*
 *	Return information about this processor.
 */
routine processor_info(
		processor	: processor_t;
		flavor		: int;
	out	host		: host_t;
	out	processor_info_out: processor_info_t, CountInOut);

/*
 *	Get information about processor set.
 */
routine processor_set_info(
		set_name	: processor_set_name_t;
		flavor		: int;
	out	host		: host_t;
	out	info_out	: processor_set_info_t, CountInOut);

/*
 *	Do something machine-dependent to processor.
 */
routine processor_control(
		processor	: processor_t;
		processor_cmd	: processor_info_t);

/*
 *      Get boot configuration information from kernel.
 */
routine host_get_boot_info(
		host_priv	: host_priv_t;
	out	boot_info	: kernel_boot_info_t);