]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/host_priv.defs
xnu-344.21.74.tar.gz
[apple/xnu.git] / osfmk / mach / host_priv.defs
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
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
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
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 /*
57 * Matchmaker definitions file for Mach kernel interface.
58 */
59 subsystem
60 #if KERNEL_USER
61 KernelUser
62 #endif /* KERNEL_USER */
63 #if KERNEL_SERVER
64 KernelServer
65 #endif /* KERNEL_SERVER */
66 host_priv 400;
67
68 #ifdef KERNEL_USER
69 userprefix r_;
70 #endif /* KERNEL_USER */
71
72 #include <mach/std_types.defs>
73 #include <mach/mach_types.defs>
74 #include <mach/clock_types.defs>
75 #include <mach_debug/mach_debug_types.defs>
76
77 /*
78 * Get boot configuration information from kernel.
79 */
80 routine host_get_boot_info(
81 host_priv : host_priv_t;
82 out boot_info : kernel_boot_info_t);
83
84 /*
85 * Reboot this host.
86 * Only available to privileged users.
87 */
88 routine host_reboot(
89 host_priv : host_priv_t;
90 options : int);
91
92
93 /*
94 * Return privileged statistics from this host.
95 */
96 routine host_priv_statistics(
97 host_priv : host_priv_t;
98 flavor : host_flavor_t;
99 out host_info_out : host_info_t, CountInOut);
100
101 /*
102 * Sets the default memory manager, the port to which
103 * newly-created temporary memory objects are delivered.
104 * [See (memory_object_default)memory_object_create.]
105 * Also sets the default cluster size used for pagein/pageout
106 * to this port.
107 * The old memory manager port is returned.
108 */
109 routine host_default_memory_manager(
110 host_priv : host_priv_t;
111 inout default_manager : memory_object_default_t =
112 MACH_MSG_TYPE_MAKE_SEND;
113 cluster_size : vm_size_t);
114
115
116 /*
117 * Specify that the range of the virtual address space
118 * of the target task must not cause page faults for
119 * the indicated accesses.
120 *
121 * [ To unwire the pages, specify VM_PROT_NONE. ]
122 */
123 routine vm_wire(
124 host_priv : host_priv_t;
125 task : vm_map_t;
126 address : vm_address_t;
127 size : vm_size_t;
128 access : vm_prot_t);
129
130 /*
131 * Specify that the target thread must always be able
132 * to run and to allocate memory.
133 */
134 routine thread_wire(
135 host_priv : host_priv_t;
136 thread : thread_act_t;
137 wired : boolean_t);
138
139 /*
140 * Allocate zero-filled, wired, contiguous physical memory
141 * in the address space of the target task, either at the
142 * specified address, or wherever space can be found (if
143 * anywhere is TRUE), of the specified size. The address
144 * at which the allocation actually took place is returned.
145 * All pages will be entered into the task's pmap immediately,
146 * with VM_PROT_ALL.
147 *
148 * In addition to all the failure modes of its cousin,
149 * vm_allocate, this call may also fail if insufficient
150 * contiguous memory exists to satisfy the request.
151 *
152 * Memory obtained from this call should be freed the
153 * normal way, via vm_deallocate.
154 *
155 * N.B. This is an EXPERIMENTAL interface!
156 */
157 routine vm_allocate_cpm(
158 host_priv : host_priv_t;
159 task : vm_map_t;
160 inout address : vm_address_t;
161 size : vm_size_t;
162 anywhere : boolean_t);
163
164 /*
165 * Get list of processors on this host.
166 */
167 routine host_processors(
168 host_priv : host_priv_t;
169 out processor_list : processor_array_t);
170
171
172 /*
173 * Get control port for a processor set.
174 * Privileged.
175 */
176 routine host_get_clock_control(
177 host_priv : host_priv_t;
178 clock_id : clock_id_t;
179 out clock_ctrl : clock_ctrl_t);
180
181
182 /*
183 * kernel module interface
184 *
185 * see mach/kmod.h:
186 */
187 routine kmod_create(
188 host_priv : host_priv_t;
189 info : vm_address_t;
190 out module : kmod_t);
191
192 routine kmod_destroy(
193 host_priv : host_priv_t;
194 module : kmod_t);
195
196 routine kmod_control(
197 host_priv : host_priv_t;
198 module : kmod_t;
199 flavor : kmod_control_flavor_t;
200 inout data : kmod_args_t);
201
202 /*
203 * Get a given special port for a given node.
204 * Norma special ports are defined in norma_special_ports.h;
205 * examples include the master device port.
206 * There are a limited number of slots available for system servers.
207 */
208 routine host_get_special_port(
209 host_priv : host_priv_t;
210 node : int;
211 which : int;
212 out port : mach_port_t);
213
214 /*
215 * Set a given special port for a given node.
216 * See norma_get_special_port.
217 */
218 routine host_set_special_port(
219 host_priv : host_priv_t;
220 which : int;
221 port : mach_port_t);
222
223 /*
224 * Set an exception handler for a host on one or more exception types.
225 * These handlers are invoked for all threads on the host if there are
226 * no task or thread-specific exception handlers or those handlers returned
227 * an error.
228 */
229 routine host_set_exception_ports(
230 host_priv : host_priv_t;
231 exception_mask : exception_mask_t;
232 new_port : mach_port_t;
233 behavior : exception_behavior_t;
234 new_flavor : thread_state_flavor_t);
235
236
237 /*
238 * Lookup some of the old exception handlers for a host
239 */
240 routine host_get_exception_ports(
241 host_priv : host_priv_t;
242 exception_mask : exception_mask_t;
243 out masks : exception_mask_array_t;
244 out old_handlers : exception_handler_array_t, SameCount;
245 out old_behaviors : exception_behavior_array_t, SameCount;
246 out old_flavors : exception_flavor_array_t, SameCount);
247
248
249 /*
250 * Set an exception handler for a host on one or more exception types.
251 * At the same time, return the previously defined exception handlers for
252 * those types.
253 */
254 routine host_swap_exception_ports(
255 host_priv : host_priv_t;
256 exception_mask : exception_mask_t;
257 new_port : mach_port_t;
258 behavior : exception_behavior_t;
259 new_flavor : thread_state_flavor_t;
260 out masks : exception_mask_array_t;
261 out old_handlerss : exception_handler_array_t, SameCount;
262 out old_behaviors : exception_behavior_array_t, SameCount;
263 out old_flavors : exception_flavor_array_t, SameCount);
264
265 /*
266 * Loads a symbol table for an external file into the kernel debugger.
267 * The symbol table data is an array of characters. It is assumed that
268 * the caller and the kernel debugger agree on its format.
269 * This call is only supported in MACH_DEBUG and MACH_KDB kernels,
270 * otherwise KERN_FAILURE is returned.
271 */
272 routine host_load_symbol_table(
273 host : host_priv_t;
274 task : task_t;
275 name : symtab_name_t;
276 symtab : pointer_t);
277
278 /*
279 * Make the target task swappable or unswappable.
280 */
281 routine task_swappable(
282 host_priv : host_priv_t;
283 target_task : task_t;
284 make_swappable : boolean_t);
285
286 /*
287 * JMM - Keep all processor_set related items at the end for easy
288 * removal.
289 */
290 /*
291 * List all processor sets on host.
292 */
293 routine host_processor_sets(
294 host_priv : host_priv_t;
295 out processor_sets : processor_set_name_array_t);
296
297 /*
298 * Get control port for a processor set.
299 */
300 routine host_processor_set_priv(
301 host_priv : host_priv_t;
302 set_name : processor_set_name_t;
303 out set : processor_set_t);
304 /*
305 * Set the dynamic_pager control port. Other entities
306 * can request a send right to this port to talk with
307 * the dynamic_pager utility, setting behavioral parameters
308 * within the dynamic pager and getting low/high backing store
309 * resource notifications.
310 */
311 routine set_dp_control_port(
312 host : host_priv_t;
313 in control_port : mach_port_t);
314
315 /*
316 * Get the dynamic_pager control port. This port
317 * allows the holder to talk directly with the dynamic
318 * pager utility.
319 */
320 routine get_dp_control_port(
321 host : host_priv_t;
322 out contorl_port :mach_port_t);
323
324 /*
325 * Set the UserNotification daemon access port for this host.
326 * If this value is already set, the kernel will discard its
327 * reference to the previously registered port.
328 */
329 routine host_set_UNDServer(
330 host : host_priv_t;
331 in server : UNDServerRef);
332
333 /*
334 * Get the UserNotification daemon access port for this host.
335 * This can then be used to communicate with that daemon, which
336 * in turn communicates with the User through whatever means
337 * available (pop-up-menus for GUI systems, text for non-GUI, etc..).
338 *
339 * Access to this port is restricted to privileged clients because
340 * it is a special purpose port intended for kernel clients. User
341 * level clients should go directly to the CFUserNotifcation services.
342 */
343 routine host_get_UNDServer(
344 host : host_priv_t;
345 out server : UNDServerRef);
346