2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
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
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.
23 * @APPLE_LICENSE_HEADER_END@
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
31 * All Rights Reserved.
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.
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.
43 * Carnegie Mellon requests users of this software to return to
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
50 * any improvements or extensions that they make and grant Carnegie Mellon
51 * the rights to redistribute these changes.
57 * Matchmaker definitions file for Mach kernel interface.
62 #endif /* KERNEL_USER */
65 #endif /* KERNEL_SERVER */
70 #endif /* KERNEL_USER */
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>
78 * Get boot configuration information from kernel.
80 routine host_get_boot_info(
81 host_priv : host_priv_t;
82 out boot_info : kernel_boot_info_t);
86 * Only available to privileged users.
89 host_priv : host_priv_t;
94 * Return privileged statistics from this host.
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);
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
107 * The old memory manager port is returned.
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);
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.
121 * [ To unwire the pages, specify VM_PROT_NONE. ]
124 host_priv : host_priv_t;
126 address : vm_address_t;
131 * Specify that the target thread must always be able
132 * to run and to allocate memory.
135 host_priv : host_priv_t;
136 thread : thread_act_t;
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,
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.
152 * Memory obtained from this call should be freed the
153 * normal way, via vm_deallocate.
155 * N.B. This is an EXPERIMENTAL interface!
157 routine vm_allocate_cpm(
158 host_priv : host_priv_t;
160 inout address : vm_address_t;
162 anywhere : boolean_t);
165 * Get list of processors on this host.
167 routine host_processors(
168 host_priv : host_priv_t;
169 out processor_list : processor_array_t);
173 * Get control port for a processor set.
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);
183 * kernel module interface
188 host_priv : host_priv_t;
190 out module : kmod_t);
192 routine kmod_destroy(
193 host_priv : host_priv_t;
196 routine kmod_control(
197 host_priv : host_priv_t;
199 flavor : kmod_control_flavor_t;
200 inout data : kmod_args_t);
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.
208 routine host_get_special_port(
209 host_priv : host_priv_t;
212 out port : mach_port_t);
215 * Set a given special port for a given node.
216 * See norma_get_special_port.
218 routine host_set_special_port(
219 host_priv : host_priv_t;
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
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);
238 * Lookup some of the old exception handlers for a host
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);
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
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);
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.
272 routine host_load_symbol_table(
275 name : symtab_name_t;
279 * Make the target task swappable or unswappable.
281 routine task_swappable(
282 host_priv : host_priv_t;
283 target_task : task_t;
284 make_swappable : boolean_t);
287 * JMM - Keep all processor_set related items at the end for easy
291 * List all processor sets on host.
293 routine host_processor_sets(
294 host_priv : host_priv_t;
295 out processor_sets : processor_set_name_array_t);
298 * Get control port for a processor set.
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);
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.
311 routine set_dp_control_port(
313 in control_port : mach_port_t);
316 * Get the dynamic_pager control port. This port
317 * allows the holder to talk directly with the dynamic
320 routine get_dp_control_port(
322 out contorl_port :mach_port_t);
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.
329 routine host_set_UNDServer(
331 in server : UNDServerRef);
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..).
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.
343 routine host_get_UNDServer(
345 out server : UNDServerRef);