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