2 * Copyright (c) 2000 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;
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 processor_list : processor_array_t);
170 * Get control port for a processor set.
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 * 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.
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 a given node.
213 * See norma_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 * Make the target task swappable or unswappable.
278 routine task_swappable(
279 host_priv : host_priv_t;
280 target_task : task_t;
281 make_swappable : boolean_t);
284 * JMM - Keep all processor_set related items at the end for easy
288 * List all processor sets on host.
290 routine host_processor_sets(
291 host_priv : host_priv_t;
292 out processor_sets : processor_set_name_array_t);
295 * Get control port for a processor set.
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);
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.
308 routine set_dp_control_port(
310 in control_port : mach_port_t);
313 * Get the dynamic_pager control port. This port
314 * allows the holder to talk directly with the dynamic
317 routine get_dp_control_port(
319 out contorl_port :mach_port_t);
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.
326 routine host_set_UNDServer(
328 in server : UNDServerRef);
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..).
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.
340 routine host_get_UNDServer(
342 out server : UNDServerRef);