2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
34 * Mach Operating System
35 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
36 * All Rights Reserved.
38 * Permission to use, copy, modify and distribute this software and its
39 * documentation is hereby granted, provided that both the copyright
40 * notice and this permission notice appear in all copies of the
41 * software, derivative works or modified versions, and any portions
42 * thereof, and that both notices appear in supporting documentation.
44 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
45 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
46 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
48 * Carnegie Mellon requests users of this software to return to
50 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
51 * School of Computer Science
52 * Carnegie Mellon University
53 * Pittsburgh PA 15213-3890
55 * any improvements or extensions that they make and grant Carnegie Mellon
56 * the rights to redistribute these changes.
62 * Matchmaker definitions file for Mach kernel interface.
67 #endif /* KERNEL_USER */
70 #endif /* KERNEL_SERVER */
75 #endif /* KERNEL_USER */
77 #include <mach/std_types.defs>
78 #include <mach/mach_types.defs>
79 #include <mach/clock_types.defs>
80 #include <mach_debug/mach_debug_types.defs>
83 * Get boot configuration information from kernel.
85 routine host_get_boot_info(
86 host_priv : host_priv_t;
87 out boot_info : kernel_boot_info_t);
91 * Only available to privileged users.
94 host_priv : host_priv_t;
99 * Return privileged statistics from this host.
101 routine host_priv_statistics(
102 host_priv : host_priv_t;
103 flavor : host_flavor_t;
104 out host_info_out : host_info_t, CountInOut);
107 * Sets the default memory manager, the port to which
108 * newly-created temporary memory objects are delivered.
109 * [See (memory_object_default)memory_object_create.]
110 * Also sets the default cluster size used for pagein/pageout
112 * The old memory manager port is returned.
114 routine host_default_memory_manager(
115 host_priv : host_priv_t;
116 inout default_manager : memory_object_default_t =
117 MACH_MSG_TYPE_MAKE_SEND;
118 cluster_size : vm_size_t);
122 * Specify that the range of the virtual address space
123 * of the target task must not cause page faults for
124 * the indicated accesses.
126 * [ To unwire the pages, specify VM_PROT_NONE. ]
129 host_priv : host_priv_t;
131 address : vm_address_t;
133 desired_access : vm_prot_t);
136 * Specify that the target thread must always be able
137 * to run and to allocate memory.
140 host_priv : host_priv_t;
141 thread : thread_act_t;
145 * Allocate zero-filled, wired, contiguous physical memory
146 * in the address space of the target task, either at the
147 * specified address, or wherever space can be found (if
148 * anywhere is TRUE), of the specified size. The address
149 * at which the allocation actually took place is returned.
150 * All pages will be entered into the task's pmap immediately,
153 * In addition to all the failure modes of its cousin,
154 * vm_allocate, this call may also fail if insufficient
155 * contiguous memory exists to satisfy the request.
157 * Memory obtained from this call should be freed the
158 * normal way, via vm_deallocate.
160 * N.B. This is an EXPERIMENTAL interface!
162 routine vm_allocate_cpm(
163 host_priv : host_priv_t;
165 inout address : vm_address_t;
167 anywhere : boolean_t);
170 * Get list of processors on this host.
172 routine host_processors(
173 host_priv : host_priv_t;
174 out out_processor_list : processor_array_t);
178 * Get control port for a system-wide clock.
181 routine host_get_clock_control(
182 host_priv : host_priv_t;
183 clock_id : clock_id_t;
184 out clock_ctrl : clock_ctrl_t);
188 * kernel module interface
193 host_priv : host_priv_t;
195 out module : kmod_t);
197 routine kmod_destroy(
198 host_priv : host_priv_t;
201 routine kmod_control(
202 host_priv : host_priv_t;
204 flavor : kmod_control_flavor_t;
205 inout data : kmod_args_t);
208 * Get a given special port for a given node.
209 * Special ports are defined in host_special_ports.h;
210 * examples include the master device port.
211 * There are a limited number of slots available for system servers.
213 routine host_get_special_port(
214 host_priv : host_priv_t;
217 out port : mach_port_t);
220 * Set a given special port for the local node.
221 * See host_get_special_port.
223 routine host_set_special_port(
224 host_priv : host_priv_t;
229 * Set an exception handler for a host on one or more exception types.
230 * These handlers are invoked for all threads on the host if there are
231 * no task or thread-specific exception handlers or those handlers returned
234 routine host_set_exception_ports(
235 host_priv : host_priv_t;
236 exception_mask : exception_mask_t;
237 new_port : mach_port_t;
238 behavior : exception_behavior_t;
239 new_flavor : thread_state_flavor_t);
243 * Lookup some of the old exception handlers for a host
245 routine host_get_exception_ports(
246 host_priv : host_priv_t;
247 exception_mask : exception_mask_t;
248 out masks : exception_mask_array_t;
249 out old_handlers : exception_handler_array_t, SameCount;
250 out old_behaviors : exception_behavior_array_t, SameCount;
251 out old_flavors : exception_flavor_array_t, SameCount);
255 * Set an exception handler for a host on one or more exception types.
256 * At the same time, return the previously defined exception handlers for
259 routine host_swap_exception_ports(
260 host_priv : host_priv_t;
261 exception_mask : exception_mask_t;
262 new_port : mach_port_t;
263 behavior : exception_behavior_t;
264 new_flavor : thread_state_flavor_t;
265 out masks : exception_mask_array_t;
266 out old_handlerss : exception_handler_array_t, SameCount;
267 out old_behaviors : exception_behavior_array_t, SameCount;
268 out old_flavors : exception_flavor_array_t, SameCount);
271 * Loads a symbol table for an external file into the kernel debugger.
272 * The symbol table data is an array of characters. It is assumed that
273 * the caller and the kernel debugger agree on its format.
274 * This call is only supported in MACH_DEBUG and MACH_KDB kernels,
275 * otherwise KERN_FAILURE is returned.
277 routine host_load_symbol_table(
280 name : symtab_name_t;
284 * Specify that the range of the virtual address space
285 * of the target task must not cause page faults for
286 * the indicated accesses.
288 * [ To unwire the pages, specify VM_PROT_NONE. ]
290 routine mach_vm_wire(
291 host_priv : host_priv_t;
293 address : mach_vm_address_t;
294 size : mach_vm_size_t;
295 desired_access : vm_prot_t);
298 * JMM - Keep all processor_set related items at the end for easy
302 * List all processor sets on host.
304 routine host_processor_sets(
305 host_priv : host_priv_t;
306 out processor_sets : processor_set_name_array_t);
309 * Get control port for a processor set.
311 routine host_processor_set_priv(
312 host_priv : host_priv_t;
313 set_name : processor_set_name_t;
314 out set : processor_set_t);
316 /************************** Warning *************************************/
317 /* The following routines are going away in a future release */
318 /* use the appropriate variant of host_set_special_port instead */
319 /************************************************************************/
322 * Set the dynamic_pager control port. Other entities
323 * can request a send right to this port to talk with
324 * the dynamic_pager utility, setting behavioral parameters
325 * within the dynamic pager and getting low/high backing store
326 * resource notifications.
328 routine set_dp_control_port(
330 in control_port : mach_port_t);
333 * Get the dynamic_pager control port. This port
334 * allows the holder to talk directly with the dynamic
337 routine get_dp_control_port(
339 out contorl_port :mach_port_t);
342 * Set the UserNotification daemon access port for this host.
343 * If this value is already set, the kernel will discard its
344 * reference to the previously registered port.
346 routine host_set_UNDServer(
348 in server : UNDServerRef);
351 * Get the UserNotification daemon access port for this host.
352 * This can then be used to communicate with that daemon, which
353 * in turn communicates with the User through whatever means
354 * available (pop-up-menus for GUI systems, text for non-GUI, etc..).
356 * Access to this port is restricted to privileged clients because
357 * it is a special purpose port intended for kernel clients. User
358 * level clients should go directly to the CFUserNotifcation services.
360 routine host_get_UNDServer(
362 out server : UNDServerRef);