]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
b0d623f7 | 2 | * Copyright (c) 2000-2009 Apple Inc. All rights reserved. |
1c79356b | 3 | * |
2d21ac55 | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
1c79356b | 5 | * |
2d21ac55 A |
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 License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
8f6c56a5 | 14 | * |
2d21ac55 A |
15 | * Please obtain a copy of the License at |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
17 | * | |
18 | * The Original Code and all software distributed under the License are | |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
8f6c56a5 A |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
2d21ac55 A |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
23 | * Please see the License for the specific language governing rights and | |
24 | * limitations under the License. | |
8f6c56a5 | 25 | * |
2d21ac55 | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
1c79356b A |
27 | */ |
28 | /* | |
29 | * @OSF_COPYRIGHT@ | |
30 | */ | |
31 | /* | |
32 | * Mach Operating System | |
33 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | |
34 | * All Rights Reserved. | |
35 | * | |
36 | * Permission to use, copy, modify and distribute this software and its | |
37 | * documentation is hereby granted, provided that both the copyright | |
38 | * notice and this permission notice appear in all copies of the | |
39 | * software, derivative works or modified versions, and any portions | |
40 | * thereof, and that both notices appear in supporting documentation. | |
41 | * | |
42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | |
44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
45 | * | |
46 | * Carnegie Mellon requests users of this software to return to | |
47 | * | |
48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
49 | * School of Computer Science | |
50 | * Carnegie Mellon University | |
51 | * Pittsburgh PA 15213-3890 | |
52 | * | |
53 | * any improvements or extensions that they make and grant Carnegie Mellon | |
54 | * the rights to redistribute these changes. | |
55 | */ | |
56 | /* | |
57 | */ | |
58 | ||
59 | /* | |
60 | * File: mach/mach_host.defs | |
61 | * | |
62 | * Abstract: | |
63 | * Mach host operations support. Includes processor allocation and | |
64 | * control. | |
65 | */ | |
66 | ||
1c79356b A |
67 | subsystem |
68 | #if KERNEL_SERVER | |
69 | KernelServer | |
70 | #endif /* KERNEL_SERVER */ | |
71 | mach_host 200; | |
72 | ||
73 | /* | |
74 | * Basic types | |
75 | */ | |
76 | ||
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> | |
81 | ||
82 | /* | |
83 | * References to host objects are returned by: | |
84 | * mach_host_self() - trap | |
85 | */ | |
86 | ||
87 | /* | |
88 | * Return information about this host. | |
89 | */ | |
90 | routine host_info( | |
91 | host : host_t; | |
92 | flavor : host_flavor_t; | |
93 | out host_info_out : host_info_t, CountInOut); | |
94 | ||
95 | /* | |
96 | * Get string describing current kernel version. | |
97 | */ | |
98 | routine host_kernel_version( | |
99 | host : host_t; | |
100 | out kernel_version : kernel_version_t); | |
101 | ||
102 | /* | |
103 | * Get host page size | |
2d21ac55 A |
104 | * (compatibility for running old libraries on new kernels - |
105 | * host_page_size() is now a library routine based on constants) | |
1c79356b | 106 | */ |
2d21ac55 | 107 | #if KERNEL |
1c79356b | 108 | routine host_page_size( |
2d21ac55 A |
109 | #else |
110 | routine _host_page_size( | |
111 | #endif | |
1c79356b | 112 | host : host_t; |
91447636 | 113 | out out_page_size : vm_size_t); |
1c79356b A |
114 | |
115 | /* | |
116 | * Allow pagers to create named entries that point to un-mapped | |
117 | * abstract memory object. The named entries are generally mappable | |
118 | * and can be subsetted through the mach_make_memory_entry call | |
119 | */ | |
120 | routine mach_memory_object_memory_entry( | |
121 | host :host_t; | |
122 | internal :boolean_t; | |
123 | size :vm_size_t; | |
124 | permission :vm_prot_t; | |
125 | pager :memory_object_t; | |
126 | out entry_handle :mach_port_move_send_t); | |
127 | ||
128 | ||
129 | /* | |
130 | * Get processor info for all the processors on this host. | |
131 | * The returned data is an OOL array of processor info. | |
132 | */ | |
133 | routine host_processor_info( | |
91447636 A |
134 | host : host_t; |
135 | flavor : processor_flavor_t; | |
136 | out out_processor_count : natural_t; | |
137 | out out_processor_info : processor_info_array_t); | |
1c79356b A |
138 | |
139 | /* | |
140 | * Return host IO master access port | |
141 | */ | |
142 | routine host_get_io_master( | |
143 | host : host_t; | |
144 | out io_master : io_master_t); | |
145 | ||
146 | /* | |
147 | * Get service port for a processor set. | |
148 | * Available to all. | |
149 | */ | |
150 | routine host_get_clock_service( | |
151 | host : host_t; | |
152 | clock_id : clock_id_t; | |
153 | out clock_serv : clock_serv_t); | |
154 | ||
b0d623f7 A |
155 | /* |
156 | * kernel module interface (obsolete as of SnowLeopard) | |
157 | * see mach/kmod.h | |
158 | */ | |
159 | /* kmod_ MIG calls now return KERN_NOT_SUPPORTED on PPC/i386/x86_64. */ | |
1c79356b A |
160 | routine kmod_get_info( |
161 | host : host_t; | |
162 | out modules : kmod_args_t); | |
163 | ||
5ba3f43e A |
164 | |
165 | skip; /* was host_zone_info */ | |
1c79356b A |
166 | |
167 | /* | |
168 | * Returns information about the global VP table. | |
169 | * Only supported in MACH_VM_DEBUG kernels, | |
170 | * otherwise returns KERN_FAILURE. | |
171 | */ | |
172 | routine host_virtual_physical_table_info( | |
173 | host : host_t; | |
174 | out info : hash_info_bucket_array_t, | |
175 | Dealloc); | |
176 | ||
1c79356b | 177 | |
316670eb | 178 | skip; /* was host_ipc_hash_info */ |
b0d623f7 A |
179 | skip; /* was enable_bluebox */ |
180 | skip; /* was disable_bluebox */ | |
1c79356b A |
181 | |
182 | /* | |
183 | * JMM - Keep processor_set related items at the end for easy | |
184 | * removal. | |
185 | */ | |
186 | /* | |
187 | * Get default processor set for host. | |
188 | */ | |
189 | routine processor_set_default( | |
190 | host : host_t; | |
191 | out default_set : processor_set_name_t); | |
192 | ||
193 | /* | |
194 | * Create new processor set. Returns real port for manipulations, | |
195 | * and name port for obtaining information. | |
196 | */ | |
197 | routine processor_set_create( | |
198 | host : host_t; | |
199 | out new_set : processor_set_t; | |
200 | out new_name : processor_set_name_t); | |
201 | ||
202 | /* | |
203 | * Temporary interfaces for conversion to 64 bit data path | |
204 | */ | |
205 | ||
206 | routine mach_memory_object_memory_entry_64( | |
207 | host :host_t; | |
208 | internal :boolean_t; | |
209 | size :memory_object_size_t; | |
210 | permission :vm_prot_t; | |
211 | pager :memory_object_t; | |
212 | out entry_handle :mach_port_move_send_t); | |
213 | ||
214 | /* | |
215 | * Return statistics from this host. | |
216 | */ | |
cc8bc92a A |
217 | routine |
218 | #ifdef KERNEL_SERVER | |
219 | host_statistics_from_user( | |
220 | #else | |
221 | host_statistics( | |
222 | #endif | |
1c79356b A |
223 | host_priv : host_t; |
224 | flavor : host_flavor_t; | |
225 | out host_info_out : host_info_t, CountInOut); | |
55e303ae A |
226 | |
227 | routine host_request_notification( | |
228 | host : host_t; | |
229 | notify_type : host_flavor_t; | |
230 | notify_port : mach_port_make_send_once_t); | |
91447636 A |
231 | |
232 | routine host_lockgroup_info( | |
233 | host : host_t; | |
234 | out lockgroup_info : lockgroup_info_array_t, | |
235 | Dealloc); | |
236 | ||
b0d623f7 A |
237 | /* |
238 | * Return 64-bit statistics from this host. | |
239 | */ | |
cc8bc92a A |
240 | routine |
241 | #ifdef KERNEL_SERVER | |
242 | host_statistics64_from_user( | |
243 | #else | |
244 | host_statistics64( | |
245 | #endif | |
b0d623f7 A |
246 | host_priv : host_t; |
247 | flavor : host_flavor_t; | |
248 | out host_info64_out : host_info64_t, CountInOut); | |
249 | ||
6d2010ae A |
250 | /* |
251 | * Returns information about the memory allocation zones. | |
252 | * Data returned is compatible with various caller and kernel | |
5ba3f43e | 253 | * address space sizes. |
6d2010ae A |
254 | */ |
255 | routine mach_zone_info( | |
316670eb | 256 | host : host_priv_t; |
6d2010ae A |
257 | out names : mach_zone_name_array_t, |
258 | Dealloc; | |
259 | out info : mach_zone_info_array_t, | |
260 | Dealloc); | |
261 | ||
316670eb A |
262 | #ifdef PRIVATE |
263 | /* | |
264 | * Forces a zone allocator garbage collections pass. | |
265 | * Pages with no in-use allocations are returned to | |
266 | * the VM system for re-use. | |
267 | */ | |
268 | routine mach_zone_force_gc( | |
269 | host : host_t); | |
270 | #else | |
271 | skip; | |
272 | #endif | |
b0d623f7 | 273 | |
fe8ab488 A |
274 | /* |
275 | * Create a new voucher by running a series of commands against | |
276 | * <key, previous-voucher> pairs of resource attributes. | |
277 | */ | |
39037602 A |
278 | #if !KERNEL && !LIBSYSCALL_INTERFACE |
279 | routine _kernelrpc_host_create_mach_voucher( | |
280 | #else | |
fe8ab488 | 281 | routine host_create_mach_voucher( |
39037602 | 282 | #endif |
fe8ab488 A |
283 | host : host_t; |
284 | recipes : mach_voucher_attr_raw_recipe_array_t; | |
285 | out voucher : ipc_voucher_t); | |
286 | ||
287 | /* | |
288 | * Register a resource manager with the kernel. A new key is selected. | |
289 | */ | |
290 | routine host_register_mach_voucher_attr_manager( | |
291 | host : host_t; | |
292 | attr_manager : mach_voucher_attr_manager_t; | |
293 | default_value : mach_voucher_attr_value_handle_t; | |
294 | out new_key : mach_voucher_attr_key_t; | |
295 | out new_attr_control: ipc_voucher_attr_control_t); | |
296 | ||
297 | /* | |
298 | * Register a resource manager (with a well-known key value) with the kernel. | |
299 | */ | |
300 | routine host_register_well_known_mach_voucher_attr_manager( | |
301 | host : host_t; | |
302 | attr_manager : mach_voucher_attr_manager_t; | |
303 | default_value : mach_voucher_attr_value_handle_t; | |
304 | key : mach_voucher_attr_key_t; | |
305 | out new_attr_control: ipc_voucher_attr_control_t); | |
306 | ||
3e170ce0 A |
307 | |
308 | /* | |
309 | * Update the global ATM diagnostic flag, readable from the commpage | |
310 | */ | |
311 | routine host_set_atm_diagnostic_flag( | |
c6bf4f31 A |
312 | host : host_t; |
313 | in diagnostic_flag : uint32_t); | |
3e170ce0 A |
314 | |
315 | #if !KERNEL && LIBSYSCALL_INTERFACE | |
316 | routine host_get_atm_diagnostic_flag( | |
317 | host : host_t; | |
318 | out diagnostic_flag : uint32_t); | |
319 | #else | |
320 | skip; | |
321 | #endif | |
322 | ||
323 | routine mach_memory_info( | |
324 | host : host_priv_t; | |
325 | out names : mach_zone_name_array_t, | |
326 | Dealloc; | |
327 | out info : mach_zone_info_array_t, | |
328 | Dealloc; | |
329 | out memory_info : mach_memory_info_array_t, | |
330 | Dealloc); | |
331 | ||
490019cf A |
332 | /* |
333 | * Update the global multiuser flags, readable from the commpage | |
334 | */ | |
335 | routine host_set_multiuser_config_flags( | |
336 | host_priv : host_priv_t; | |
337 | in multiuser_flags : uint32_t); | |
338 | ||
339 | #if !KERNEL && LIBSYSCALL_INTERFACE | |
340 | routine host_get_multiuser_config_flags( | |
341 | host : host_t; | |
342 | out multiuser_flags : uint32_t); | |
343 | #else | |
344 | skip; | |
345 | #endif // !KERNEL && LIBSYSCALL_INTERFACE | |
346 | ||
347 | #if !KERNEL && LIBSYSCALL_INTERFACE | |
348 | routine host_check_multiuser_mode( | |
349 | host : host_t; | |
350 | out multiuser_mode : uint32_t); | |
351 | #else | |
352 | skip; | |
353 | #endif // !KERNEL && LIBSYSCALL_INTERFACE | |
354 | ||
a39ff7e2 A |
355 | /* |
356 | * Returns information about a specific zone. | |
357 | * The zone name is passed in via the argument name, | |
358 | * info returns the zone info. | |
359 | */ | |
360 | routine mach_zone_info_for_zone( | |
361 | host : host_priv_t; | |
362 | name : mach_zone_name_t; | |
363 | out info : mach_zone_info_t); | |
364 | ||
365 | #ifdef PRIVATE | |
366 | /* | |
367 | * Returns information about the largest zone. | |
368 | * name returns the zone name, info returns the zone info. | |
369 | */ | |
370 | routine mach_zone_info_for_largest_zone( | |
371 | host : host_priv_t; | |
372 | out name : mach_zone_name_t; | |
373 | out info : mach_zone_info_t); | |
374 | #else | |
375 | skip; | |
376 | #endif | |
377 | ||
d9a64523 A |
378 | #ifdef PRIVATE |
379 | /* | |
380 | * Returns names of zones that have zlog enabled. | |
381 | */ | |
382 | routine mach_zone_get_zlog_zones( | |
383 | host : host_priv_t; | |
384 | out names : mach_zone_name_array_t, | |
385 | Dealloc); | |
386 | #else | |
387 | skip; | |
388 | #endif | |
389 | ||
390 | #ifdef PRIVATE | |
391 | /* | |
392 | * Returns BTLog records for a specific zone. | |
393 | * The zone name is passed in via the argument name, | |
394 | * recs returns an array of zone_btrecord_t's. | |
395 | */ | |
396 | routine mach_zone_get_btlog_records( | |
397 | host : host_priv_t; | |
398 | name : mach_zone_name_t; | |
399 | out recs : zone_btrecord_array_t, | |
400 | Dealloc); | |
401 | #else | |
402 | skip; | |
403 | #endif | |
404 | ||
2d21ac55 | 405 | /* vim: set ft=c : */ |