2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
28 * All Rights Reserved.
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.
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.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
54 * Matchmaker definitions file for Mach kernel interface.
59 #endif /* KERNEL_USER */
62 #endif /* KERNEL_SERVER */
67 #endif /* KERNEL_USER */
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>
75 * Get boot configuration information from kernel.
77 routine host_get_boot_info(
78 host_priv : host_priv_t;
79 out boot_info : kernel_boot_info_t);
83 * Only available to privileged users.
86 host_priv : host_priv_t;
91 * Return privileged statistics from this host.
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);
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
104 * The old memory manager port is returned.
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);
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.
118 * [ To unwire the pages, specify VM_PROT_NONE. ]
121 host_priv : host_priv_t;
123 address : vm_address_t;
125 desired_access : vm_prot_t);
128 * Specify that the target thread must always be able
129 * to run and to allocate memory.
132 host_priv : host_priv_t;
133 thread : thread_act_t;
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,
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.
149 * Memory obtained from this call should be freed the
150 * normal way, via vm_deallocate.
152 * N.B. This is an EXPERIMENTAL interface!
154 routine vm_allocate_cpm(
155 host_priv : host_priv_t;
157 inout address : vm_address_t;
159 anywhere : boolean_t);
162 * Get list of processors on this host.
164 routine host_processors(
165 host_priv : host_priv_t;
166 out out_processor_list : processor_array_t);
170 * Get control port for a system-wide clock.
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);
180 * kernel module interface
185 host_priv : host_priv_t;
187 out module : kmod_t);
189 routine kmod_destroy(
190 host_priv : host_priv_t;
193 routine kmod_control(
194 host_priv : host_priv_t;
196 flavor : kmod_control_flavor_t;
197 inout data : kmod_args_t);
200 * Get a given special port for a given node.
201 * Special ports are defined in host_special_ports.h;
202 * examples include the master device port.
203 * There are a limited number of slots available for system servers.
205 routine host_get_special_port(
206 host_priv : host_priv_t;
209 out port : mach_port_t);
212 * Set a given special port for the local node.
213 * See host_get_special_port.
215 routine host_set_special_port(
216 host_priv : host_priv_t;
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
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);
235 * Lookup some of the old exception handlers for a host
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);
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
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);
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.
269 routine host_load_symbol_table(
272 name : symtab_name_t;
276 * Specify that the range of the virtual address space
277 * of the target task must not cause page faults for
278 * the indicated accesses.
280 * [ To unwire the pages, specify VM_PROT_NONE. ]
282 routine mach_vm_wire(
283 host_priv : host_priv_t;
285 address : mach_vm_address_t;
286 size : mach_vm_size_t;
287 desired_access : vm_prot_t);
290 * JMM - Keep all processor_set related items at the end for easy
294 * List all processor sets on host.
296 routine host_processor_sets(
297 host_priv : host_priv_t;
298 out processor_sets : processor_set_name_array_t);
301 * Get control port for a processor set.
303 routine host_processor_set_priv(
304 host_priv : host_priv_t;
305 set_name : processor_set_name_t;
306 out set : processor_set_t);
308 /************************** Warning *************************************/
309 /* The following routines are going away in a future release */
310 /* use the appropriate variant of host_set_special_port instead */
311 /************************************************************************/
314 * Set the dynamic_pager control port. Other entities
315 * can request a send right to this port to talk with
316 * the dynamic_pager utility, setting behavioral parameters
317 * within the dynamic pager and getting low/high backing store
318 * resource notifications.
320 routine set_dp_control_port(
322 in control_port : mach_port_t);
325 * Get the dynamic_pager control port. This port
326 * allows the holder to talk directly with the dynamic
329 routine get_dp_control_port(
331 out contorl_port :mach_port_t);
334 * Set the UserNotification daemon access port for this host.
335 * If this value is already set, the kernel will discard its
336 * reference to the previously registered port.
338 routine host_set_UNDServer(
340 in server : UNDServerRef);
343 * Get the UserNotification daemon access port for this host.
344 * This can then be used to communicate with that daemon, which
345 * in turn communicates with the User through whatever means
346 * available (pop-up-menus for GUI systems, text for non-GUI, etc..).
348 * Access to this port is restricted to privileged clients because
349 * it is a special purpose port intended for kernel clients. User
350 * level clients should go directly to the CFUserNotifcation services.
352 routine host_get_UNDServer(
354 out server : UNDServerRef);