]>
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 | ||
67 | #ifdef MACH_KERNEL | |
1c79356b A |
68 | #include <advisory_pageout.h> |
69 | #endif /* MACH_KERNEL */ | |
70 | ||
71 | subsystem | |
72 | #if KERNEL_SERVER | |
73 | KernelServer | |
74 | #endif /* KERNEL_SERVER */ | |
75 | mach_host 200; | |
76 | ||
77 | /* | |
78 | * Basic types | |
79 | */ | |
80 | ||
81 | #include <mach/std_types.defs> | |
82 | #include <mach/mach_types.defs> | |
83 | #include <mach/clock_types.defs> | |
84 | #include <mach_debug/mach_debug_types.defs> | |
85 | ||
86 | /* | |
87 | * References to host objects are returned by: | |
88 | * mach_host_self() - trap | |
89 | */ | |
90 | ||
91 | /* | |
92 | * Return information about this host. | |
93 | */ | |
94 | routine host_info( | |
95 | host : host_t; | |
96 | flavor : host_flavor_t; | |
97 | out host_info_out : host_info_t, CountInOut); | |
98 | ||
99 | /* | |
100 | * Get string describing current kernel version. | |
101 | */ | |
102 | routine host_kernel_version( | |
103 | host : host_t; | |
104 | out kernel_version : kernel_version_t); | |
105 | ||
106 | /* | |
107 | * Get host page size | |
2d21ac55 A |
108 | * (compatibility for running old libraries on new kernels - |
109 | * host_page_size() is now a library routine based on constants) | |
1c79356b | 110 | */ |
2d21ac55 | 111 | #if KERNEL |
1c79356b | 112 | routine host_page_size( |
2d21ac55 A |
113 | #else |
114 | routine _host_page_size( | |
115 | #endif | |
1c79356b | 116 | host : host_t; |
91447636 | 117 | out out_page_size : vm_size_t); |
1c79356b A |
118 | |
119 | /* | |
120 | * Allow pagers to create named entries that point to un-mapped | |
121 | * abstract memory object. The named entries are generally mappable | |
122 | * and can be subsetted through the mach_make_memory_entry call | |
123 | */ | |
124 | routine mach_memory_object_memory_entry( | |
125 | host :host_t; | |
126 | internal :boolean_t; | |
127 | size :vm_size_t; | |
128 | permission :vm_prot_t; | |
129 | pager :memory_object_t; | |
130 | out entry_handle :mach_port_move_send_t); | |
131 | ||
132 | ||
133 | /* | |
134 | * Get processor info for all the processors on this host. | |
135 | * The returned data is an OOL array of processor info. | |
136 | */ | |
137 | routine host_processor_info( | |
91447636 A |
138 | host : host_t; |
139 | flavor : processor_flavor_t; | |
140 | out out_processor_count : natural_t; | |
141 | out out_processor_info : processor_info_array_t); | |
1c79356b A |
142 | |
143 | /* | |
144 | * Return host IO master access port | |
145 | */ | |
146 | routine host_get_io_master( | |
147 | host : host_t; | |
148 | out io_master : io_master_t); | |
149 | ||
150 | /* | |
151 | * Get service port for a processor set. | |
152 | * Available to all. | |
153 | */ | |
154 | routine host_get_clock_service( | |
155 | host : host_t; | |
156 | clock_id : clock_id_t; | |
157 | out clock_serv : clock_serv_t); | |
158 | ||
b0d623f7 A |
159 | /* |
160 | * kernel module interface (obsolete as of SnowLeopard) | |
161 | * see mach/kmod.h | |
162 | */ | |
163 | /* kmod_ MIG calls now return KERN_NOT_SUPPORTED on PPC/i386/x86_64. */ | |
1c79356b A |
164 | routine kmod_get_info( |
165 | host : host_t; | |
166 | out modules : kmod_args_t); | |
167 | ||
168 | /* | |
169 | * Returns information about the memory allocation zones. | |
170 | * Supported in all kernels.. | |
6d2010ae A |
171 | * |
172 | * DEPRECATED! Use mach_zone_info() instead. | |
1c79356b A |
173 | */ |
174 | routine host_zone_info( | |
175 | host : host_t; | |
176 | out names : zone_name_array_t, | |
177 | Dealloc; | |
178 | out info : zone_info_array_t, | |
179 | Dealloc); | |
180 | ||
181 | /* | |
182 | * Returns information about the global VP table. | |
183 | * Only supported in MACH_VM_DEBUG kernels, | |
184 | * otherwise returns KERN_FAILURE. | |
185 | */ | |
186 | routine host_virtual_physical_table_info( | |
187 | host : host_t; | |
188 | out info : hash_info_bucket_array_t, | |
189 | Dealloc); | |
190 | ||
191 | /* | |
192 | * Returns information about the global reverse hash table. | |
193 | * This call is only valid on MACH_IPC_DEBUG kernels. | |
194 | * Otherwise, KERN_FAILURE is returned. | |
195 | */ | |
196 | routine host_ipc_hash_info( | |
197 | host : host_t; | |
198 | out info : hash_info_bucket_array_t, | |
199 | Dealloc); | |
200 | ||
b0d623f7 A |
201 | skip; /* was enable_bluebox */ |
202 | skip; /* was disable_bluebox */ | |
1c79356b A |
203 | |
204 | /* | |
205 | * JMM - Keep processor_set related items at the end for easy | |
206 | * removal. | |
207 | */ | |
208 | /* | |
209 | * Get default processor set for host. | |
210 | */ | |
211 | routine processor_set_default( | |
212 | host : host_t; | |
213 | out default_set : processor_set_name_t); | |
214 | ||
215 | /* | |
216 | * Create new processor set. Returns real port for manipulations, | |
217 | * and name port for obtaining information. | |
218 | */ | |
219 | routine processor_set_create( | |
220 | host : host_t; | |
221 | out new_set : processor_set_t; | |
222 | out new_name : processor_set_name_t); | |
223 | ||
224 | /* | |
225 | * Temporary interfaces for conversion to 64 bit data path | |
226 | */ | |
227 | ||
228 | routine mach_memory_object_memory_entry_64( | |
229 | host :host_t; | |
230 | internal :boolean_t; | |
231 | size :memory_object_size_t; | |
232 | permission :vm_prot_t; | |
233 | pager :memory_object_t; | |
234 | out entry_handle :mach_port_move_send_t); | |
235 | ||
236 | /* | |
237 | * Return statistics from this host. | |
238 | */ | |
239 | routine host_statistics( | |
240 | host_priv : host_t; | |
241 | flavor : host_flavor_t; | |
242 | out host_info_out : host_info_t, CountInOut); | |
55e303ae A |
243 | |
244 | routine host_request_notification( | |
245 | host : host_t; | |
246 | notify_type : host_flavor_t; | |
247 | notify_port : mach_port_make_send_once_t); | |
91447636 A |
248 | |
249 | routine host_lockgroup_info( | |
250 | host : host_t; | |
251 | out lockgroup_info : lockgroup_info_array_t, | |
252 | Dealloc); | |
253 | ||
b0d623f7 A |
254 | /* |
255 | * Return 64-bit statistics from this host. | |
256 | */ | |
257 | routine host_statistics64( | |
258 | host_priv : host_t; | |
259 | flavor : host_flavor_t; | |
260 | out host_info64_out : host_info64_t, CountInOut); | |
261 | ||
6d2010ae A |
262 | /* |
263 | * Returns information about the memory allocation zones. | |
264 | * Data returned is compatible with various caller and kernel | |
265 | * address space sizes (unlike host_zone_info()). | |
266 | */ | |
267 | routine mach_zone_info( | |
268 | host : host_t; | |
269 | out names : mach_zone_name_array_t, | |
270 | Dealloc; | |
271 | out info : mach_zone_info_array_t, | |
272 | Dealloc); | |
273 | ||
b0d623f7 | 274 | |
2d21ac55 | 275 | /* vim: set ft=c : */ |