1 | /* |
2 | * IDENTIFICATION: |
3 | * stub generated Tue Apr 9 11:33:41 2019 |
4 | * with a MiG generated by bootstrap_cmds-96.20.2.200.4 |
5 | * OPTIONS: |
6 | * KernelServer |
7 | */ |
8 | |
9 | /* Module host_priv */ |
10 | |
11 | #define __MIG_check__Request__host_priv_subsystem__ 1 |
12 | |
13 | #include "host_priv_server.h" |
14 | |
15 | #ifndef mig_internal |
16 | #define mig_internal static __inline__ |
17 | #endif /* mig_internal */ |
18 | |
19 | #ifndef mig_external |
20 | #define mig_external |
21 | #endif /* mig_external */ |
22 | |
23 | #if !defined(__MigTypeCheck) && defined(TypeCheck) |
24 | #define __MigTypeCheck TypeCheck /* Legacy setting */ |
25 | #endif /* !defined(__MigTypeCheck) */ |
26 | |
27 | #if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_) |
28 | #define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */ |
29 | #endif /* !defined(__MigKernelSpecificCode) */ |
30 | |
31 | #ifndef LimitCheck |
32 | #define LimitCheck 0 |
33 | #endif /* LimitCheck */ |
34 | |
35 | #ifndef min |
36 | #define min(a,b) ( ((a) < (b))? (a): (b) ) |
37 | #endif /* min */ |
38 | |
39 | #if !defined(_WALIGN_) |
40 | #define _WALIGN_(x) (((x) + 3) & ~3) |
41 | #endif /* !defined(_WALIGN_) */ |
42 | |
43 | #if !defined(_WALIGNSZ_) |
44 | #define _WALIGNSZ_(x) _WALIGN_(sizeof(x)) |
45 | #endif /* !defined(_WALIGNSZ_) */ |
46 | |
47 | #ifndef UseStaticTemplates |
48 | #define UseStaticTemplates 0 |
49 | #endif /* UseStaticTemplates */ |
50 | |
51 | #ifndef __DeclareRcvRpc |
52 | #define __DeclareRcvRpc(_NUM_, _NAME_) |
53 | #endif /* __DeclareRcvRpc */ |
54 | |
55 | #ifndef __BeforeRcvRpc |
56 | #define __BeforeRcvRpc(_NUM_, _NAME_) |
57 | #endif /* __BeforeRcvRpc */ |
58 | |
59 | #ifndef __AfterRcvRpc |
60 | #define __AfterRcvRpc(_NUM_, _NAME_) |
61 | #endif /* __AfterRcvRpc */ |
62 | |
63 | #ifndef __DeclareRcvSimple |
64 | #define __DeclareRcvSimple(_NUM_, _NAME_) |
65 | #endif /* __DeclareRcvSimple */ |
66 | |
67 | #ifndef __BeforeRcvSimple |
68 | #define __BeforeRcvSimple(_NUM_, _NAME_) |
69 | #endif /* __BeforeRcvSimple */ |
70 | |
71 | #ifndef __AfterRcvSimple |
72 | #define __AfterRcvSimple(_NUM_, _NAME_) |
73 | #endif /* __AfterRcvSimple */ |
74 | |
75 | #define novalue void |
76 | |
77 | #if __MigKernelSpecificCode |
78 | #define msgh_request_port msgh_remote_port |
79 | #define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_REMOTE(bits) |
80 | #define msgh_reply_port msgh_local_port |
81 | #define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_LOCAL(bits) |
82 | #else |
83 | #define msgh_request_port msgh_local_port |
84 | #define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits) |
85 | #define msgh_reply_port msgh_remote_port |
86 | #define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits) |
87 | #endif /* __MigKernelSpecificCode */ |
88 | |
89 | #define MIG_RETURN_ERROR(X, code) {\ |
90 | ((mig_reply_error_t *)X)->RetCode = code;\ |
91 | ((mig_reply_error_t *)X)->NDR = NDR_record;\ |
92 | return;\ |
93 | } |
94 | |
95 | /* Forward Declarations */ |
96 | |
97 | |
98 | mig_internal novalue _Xhost_get_boot_info |
99 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
100 | |
101 | mig_internal novalue _Xhost_reboot |
102 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
103 | |
104 | mig_internal novalue _Xhost_priv_statistics |
105 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
106 | |
107 | mig_internal novalue _Xhost_default_memory_manager |
108 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
109 | |
110 | mig_internal novalue _Xvm_wire |
111 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
112 | |
113 | mig_internal novalue _Xthread_wire |
114 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
115 | |
116 | mig_internal novalue _Xvm_allocate_cpm |
117 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
118 | |
119 | mig_internal novalue _Xhost_processors |
120 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
121 | |
122 | mig_internal novalue _Xhost_get_clock_control |
123 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
124 | |
125 | mig_internal novalue _Xkmod_create |
126 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
127 | |
128 | mig_internal novalue _Xkmod_destroy |
129 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
130 | |
131 | mig_internal novalue _Xkmod_control |
132 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
133 | |
134 | mig_internal novalue _Xhost_get_special_port |
135 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
136 | |
137 | mig_internal novalue _Xhost_set_special_port |
138 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
139 | |
140 | mig_internal novalue _Xhost_set_exception_ports |
141 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
142 | |
143 | mig_internal novalue _Xhost_get_exception_ports |
144 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
145 | |
146 | mig_internal novalue _Xhost_swap_exception_ports |
147 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
148 | |
149 | mig_internal novalue _Xmach_vm_wire_external |
150 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
151 | |
152 | mig_internal novalue _Xhost_processor_sets |
153 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
154 | |
155 | mig_internal novalue _Xhost_processor_set_priv |
156 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
157 | |
158 | mig_internal novalue _Xhost_set_UNDServer |
159 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
160 | |
161 | mig_internal novalue _Xhost_get_UNDServer |
162 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
163 | |
164 | mig_internal novalue _Xkext_request |
165 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
166 | |
167 | |
168 | #if ( __MigTypeCheck ) |
169 | #if __MIG_check__Request__host_priv_subsystem__ |
170 | #if !defined(__MIG_check__Request__host_get_boot_info_t__defined) |
171 | #define __MIG_check__Request__host_get_boot_info_t__defined |
172 | |
173 | mig_internal kern_return_t __MIG_check__Request__host_get_boot_info_t(__attribute__((__unused__)) __Request__host_get_boot_info_t *In0P) |
174 | { |
175 | |
176 | typedef __Request__host_get_boot_info_t __Request; |
177 | #if __MigTypeCheck |
178 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
179 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
180 | return MIG_BAD_ARGUMENTS; |
181 | #endif /* __MigTypeCheck */ |
182 | |
183 | return MACH_MSG_SUCCESS; |
184 | } |
185 | #endif /* !defined(__MIG_check__Request__host_get_boot_info_t__defined) */ |
186 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
187 | #endif /* ( __MigTypeCheck ) */ |
188 | |
189 | |
190 | /* Routine host_get_boot_info */ |
191 | mig_internal novalue _Xhost_get_boot_info |
192 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
193 | { |
194 | |
195 | #ifdef __MigPackStructs |
196 | #pragma pack(4) |
197 | #endif |
198 | typedef struct { |
199 | mach_msg_header_t Head; |
200 | mach_msg_trailer_t trailer; |
201 | } Request __attribute__((unused)); |
202 | #ifdef __MigPackStructs |
203 | #pragma pack() |
204 | #endif |
205 | typedef __Request__host_get_boot_info_t __Request; |
206 | typedef __Reply__host_get_boot_info_t Reply __attribute__((unused)); |
207 | |
208 | /* |
209 | * typedef struct { |
210 | * mach_msg_header_t Head; |
211 | * NDR_record_t NDR; |
212 | * kern_return_t RetCode; |
213 | * } mig_reply_error_t; |
214 | */ |
215 | |
216 | Request *In0P = (Request *) InHeadP; |
217 | Reply *OutP = (Reply *) OutHeadP; |
218 | #ifdef __MIG_check__Request__host_get_boot_info_t__defined |
219 | kern_return_t check_result; |
220 | #endif /* __MIG_check__Request__host_get_boot_info_t__defined */ |
221 | |
222 | #if __MigKernelSpecificCode |
223 | #else |
224 | #endif /* __MigKernelSpecificCode */ |
225 | __DeclareRcvRpc(400, "host_get_boot_info" ) |
226 | __BeforeRcvRpc(400, "host_get_boot_info" ) |
227 | |
228 | #if defined(__MIG_check__Request__host_get_boot_info_t__defined) |
229 | check_result = __MIG_check__Request__host_get_boot_info_t((__Request *)In0P); |
230 | if (check_result != MACH_MSG_SUCCESS) |
231 | { MIG_RETURN_ERROR(OutP, check_result); } |
232 | #endif /* defined(__MIG_check__Request__host_get_boot_info_t__defined) */ |
233 | |
234 | OutP->RetCode = host_get_boot_info(convert_port_to_host_priv(In0P->Head.msgh_request_port), OutP->boot_info); |
235 | if (OutP->RetCode != KERN_SUCCESS) { |
236 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
237 | } |
238 | #if __MigKernelSpecificCode |
239 | #endif /* __MigKernelSpecificCode */ |
240 | |
241 | OutP->NDR = NDR_record; |
242 | |
243 | #ifdef __LP64__ |
244 | { |
245 | size_t strLength = strlen(OutP->boot_info) + 1; |
246 | if (strLength > 0xffffffff) |
247 | MIG_RETURN_ERROR(OutP, MIG_BAD_ARGUMENTS); |
248 | OutP->boot_infoCnt = (mach_msg_type_number_t) strLength; |
249 | } |
250 | #else |
251 | OutP->boot_infoCnt = (mach_msg_type_number_t) strlen(OutP->boot_info) + 1; |
252 | #endif /* __LP64__ */ |
253 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + (_WALIGN_((OutP->boot_infoCnt + 3) & ~3)); |
254 | |
255 | __AfterRcvRpc(400, "host_get_boot_info" ) |
256 | } |
257 | |
258 | #if ( __MigTypeCheck ) |
259 | #if __MIG_check__Request__host_priv_subsystem__ |
260 | #if !defined(__MIG_check__Request__host_reboot_t__defined) |
261 | #define __MIG_check__Request__host_reboot_t__defined |
262 | |
263 | mig_internal kern_return_t __MIG_check__Request__host_reboot_t(__attribute__((__unused__)) __Request__host_reboot_t *In0P) |
264 | { |
265 | |
266 | typedef __Request__host_reboot_t __Request; |
267 | #if __MigTypeCheck |
268 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
269 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
270 | return MIG_BAD_ARGUMENTS; |
271 | #endif /* __MigTypeCheck */ |
272 | |
273 | return MACH_MSG_SUCCESS; |
274 | } |
275 | #endif /* !defined(__MIG_check__Request__host_reboot_t__defined) */ |
276 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
277 | #endif /* ( __MigTypeCheck ) */ |
278 | |
279 | |
280 | /* Routine host_reboot */ |
281 | mig_internal novalue _Xhost_reboot |
282 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
283 | { |
284 | |
285 | #ifdef __MigPackStructs |
286 | #pragma pack(4) |
287 | #endif |
288 | typedef struct { |
289 | mach_msg_header_t Head; |
290 | NDR_record_t NDR; |
291 | int options; |
292 | mach_msg_trailer_t trailer; |
293 | } Request __attribute__((unused)); |
294 | #ifdef __MigPackStructs |
295 | #pragma pack() |
296 | #endif |
297 | typedef __Request__host_reboot_t __Request; |
298 | typedef __Reply__host_reboot_t Reply __attribute__((unused)); |
299 | |
300 | /* |
301 | * typedef struct { |
302 | * mach_msg_header_t Head; |
303 | * NDR_record_t NDR; |
304 | * kern_return_t RetCode; |
305 | * } mig_reply_error_t; |
306 | */ |
307 | |
308 | Request *In0P = (Request *) InHeadP; |
309 | Reply *OutP = (Reply *) OutHeadP; |
310 | #ifdef __MIG_check__Request__host_reboot_t__defined |
311 | kern_return_t check_result; |
312 | #endif /* __MIG_check__Request__host_reboot_t__defined */ |
313 | |
314 | #if __MigKernelSpecificCode |
315 | #else |
316 | #endif /* __MigKernelSpecificCode */ |
317 | __DeclareRcvRpc(401, "host_reboot" ) |
318 | __BeforeRcvRpc(401, "host_reboot" ) |
319 | |
320 | #if defined(__MIG_check__Request__host_reboot_t__defined) |
321 | check_result = __MIG_check__Request__host_reboot_t((__Request *)In0P); |
322 | if (check_result != MACH_MSG_SUCCESS) |
323 | { MIG_RETURN_ERROR(OutP, check_result); } |
324 | #endif /* defined(__MIG_check__Request__host_reboot_t__defined) */ |
325 | |
326 | OutP->RetCode = host_reboot(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->options); |
327 | #if __MigKernelSpecificCode |
328 | #endif /* __MigKernelSpecificCode */ |
329 | |
330 | OutP->NDR = NDR_record; |
331 | |
332 | |
333 | __AfterRcvRpc(401, "host_reboot" ) |
334 | } |
335 | |
336 | #if ( __MigTypeCheck ) |
337 | #if __MIG_check__Request__host_priv_subsystem__ |
338 | #if !defined(__MIG_check__Request__host_priv_statistics_t__defined) |
339 | #define __MIG_check__Request__host_priv_statistics_t__defined |
340 | |
341 | mig_internal kern_return_t __MIG_check__Request__host_priv_statistics_t(__attribute__((__unused__)) __Request__host_priv_statistics_t *In0P) |
342 | { |
343 | |
344 | typedef __Request__host_priv_statistics_t __Request; |
345 | #if __MigTypeCheck |
346 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
347 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
348 | return MIG_BAD_ARGUMENTS; |
349 | #endif /* __MigTypeCheck */ |
350 | |
351 | return MACH_MSG_SUCCESS; |
352 | } |
353 | #endif /* !defined(__MIG_check__Request__host_priv_statistics_t__defined) */ |
354 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
355 | #endif /* ( __MigTypeCheck ) */ |
356 | |
357 | |
358 | /* Routine host_priv_statistics */ |
359 | mig_internal novalue _Xhost_priv_statistics |
360 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
361 | { |
362 | |
363 | #ifdef __MigPackStructs |
364 | #pragma pack(4) |
365 | #endif |
366 | typedef struct { |
367 | mach_msg_header_t Head; |
368 | NDR_record_t NDR; |
369 | host_flavor_t flavor; |
370 | mach_msg_type_number_t host_info_outCnt; |
371 | mach_msg_trailer_t trailer; |
372 | } Request __attribute__((unused)); |
373 | #ifdef __MigPackStructs |
374 | #pragma pack() |
375 | #endif |
376 | typedef __Request__host_priv_statistics_t __Request; |
377 | typedef __Reply__host_priv_statistics_t Reply __attribute__((unused)); |
378 | |
379 | /* |
380 | * typedef struct { |
381 | * mach_msg_header_t Head; |
382 | * NDR_record_t NDR; |
383 | * kern_return_t RetCode; |
384 | * } mig_reply_error_t; |
385 | */ |
386 | |
387 | Request *In0P = (Request *) InHeadP; |
388 | Reply *OutP = (Reply *) OutHeadP; |
389 | #ifdef __MIG_check__Request__host_priv_statistics_t__defined |
390 | kern_return_t check_result; |
391 | #endif /* __MIG_check__Request__host_priv_statistics_t__defined */ |
392 | |
393 | #if __MigKernelSpecificCode |
394 | #else |
395 | #endif /* __MigKernelSpecificCode */ |
396 | __DeclareRcvRpc(402, "host_priv_statistics" ) |
397 | __BeforeRcvRpc(402, "host_priv_statistics" ) |
398 | |
399 | #if defined(__MIG_check__Request__host_priv_statistics_t__defined) |
400 | check_result = __MIG_check__Request__host_priv_statistics_t((__Request *)In0P); |
401 | if (check_result != MACH_MSG_SUCCESS) |
402 | { MIG_RETURN_ERROR(OutP, check_result); } |
403 | #endif /* defined(__MIG_check__Request__host_priv_statistics_t__defined) */ |
404 | |
405 | OutP->host_info_outCnt = 68; |
406 | if (In0P->host_info_outCnt < OutP->host_info_outCnt) |
407 | OutP->host_info_outCnt = In0P->host_info_outCnt; |
408 | |
409 | OutP->RetCode = host_priv_statistics(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->flavor, OutP->host_info_out, &OutP->host_info_outCnt); |
410 | if (OutP->RetCode != KERN_SUCCESS) { |
411 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
412 | } |
413 | #if __MigKernelSpecificCode |
414 | #endif /* __MigKernelSpecificCode */ |
415 | |
416 | OutP->NDR = NDR_record; |
417 | |
418 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 272) + (((4 * OutP->host_info_outCnt))); |
419 | |
420 | __AfterRcvRpc(402, "host_priv_statistics" ) |
421 | } |
422 | |
423 | #if ( __MigTypeCheck ) |
424 | #if __MIG_check__Request__host_priv_subsystem__ |
425 | #if !defined(__MIG_check__Request__host_default_memory_manager_t__defined) |
426 | #define __MIG_check__Request__host_default_memory_manager_t__defined |
427 | |
428 | mig_internal kern_return_t __MIG_check__Request__host_default_memory_manager_t(__attribute__((__unused__)) __Request__host_default_memory_manager_t *In0P) |
429 | { |
430 | |
431 | typedef __Request__host_default_memory_manager_t __Request; |
432 | #if __MigTypeCheck |
433 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
434 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
435 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
436 | return MIG_BAD_ARGUMENTS; |
437 | #endif /* __MigTypeCheck */ |
438 | |
439 | #if __MigTypeCheck |
440 | if (In0P->default_manager.type != MACH_MSG_PORT_DESCRIPTOR || |
441 | In0P->default_manager.disposition != 17) |
442 | return MIG_TYPE_ERROR; |
443 | #endif /* __MigTypeCheck */ |
444 | |
445 | return MACH_MSG_SUCCESS; |
446 | } |
447 | #endif /* !defined(__MIG_check__Request__host_default_memory_manager_t__defined) */ |
448 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
449 | #endif /* ( __MigTypeCheck ) */ |
450 | |
451 | |
452 | /* Routine host_default_memory_manager */ |
453 | mig_internal novalue _Xhost_default_memory_manager |
454 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
455 | { |
456 | |
457 | #ifdef __MigPackStructs |
458 | #pragma pack(4) |
459 | #endif |
460 | typedef struct { |
461 | mach_msg_header_t Head; |
462 | /* start of the kernel processed data */ |
463 | mach_msg_body_t msgh_body; |
464 | mach_msg_port_descriptor_t default_manager; |
465 | /* end of the kernel processed data */ |
466 | NDR_record_t NDR; |
467 | memory_object_cluster_size_t cluster_size; |
468 | mach_msg_trailer_t trailer; |
469 | } Request __attribute__((unused)); |
470 | #ifdef __MigPackStructs |
471 | #pragma pack() |
472 | #endif |
473 | typedef __Request__host_default_memory_manager_t __Request; |
474 | typedef __Reply__host_default_memory_manager_t Reply __attribute__((unused)); |
475 | |
476 | /* |
477 | * typedef struct { |
478 | * mach_msg_header_t Head; |
479 | * NDR_record_t NDR; |
480 | * kern_return_t RetCode; |
481 | * } mig_reply_error_t; |
482 | */ |
483 | |
484 | Request *In0P = (Request *) InHeadP; |
485 | Reply *OutP = (Reply *) OutHeadP; |
486 | #ifdef __MIG_check__Request__host_default_memory_manager_t__defined |
487 | kern_return_t check_result; |
488 | #endif /* __MIG_check__Request__host_default_memory_manager_t__defined */ |
489 | |
490 | #if __MigKernelSpecificCode |
491 | #if UseStaticTemplates |
492 | const static mach_msg_port_descriptor_t default_managerTemplate = { |
493 | /* name = */ MACH_PORT_NULL, |
494 | /* pad1 = */ 0, |
495 | /* pad2 = */ 0, |
496 | /* disp = */ 17, |
497 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
498 | }; |
499 | #endif /* UseStaticTemplates */ |
500 | |
501 | #else |
502 | #if UseStaticTemplates |
503 | const static mach_msg_port_descriptor_t default_managerTemplate = { |
504 | /* name = */ MACH_PORT_NULL, |
505 | /* pad1 = */ 0, |
506 | /* pad2 = */ 0, |
507 | /* disp = */ 20, |
508 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
509 | }; |
510 | #endif /* UseStaticTemplates */ |
511 | |
512 | #endif /* __MigKernelSpecificCode */ |
513 | kern_return_t RetCode; |
514 | __DeclareRcvRpc(403, "host_default_memory_manager" ) |
515 | __BeforeRcvRpc(403, "host_default_memory_manager" ) |
516 | |
517 | #if defined(__MIG_check__Request__host_default_memory_manager_t__defined) |
518 | check_result = __MIG_check__Request__host_default_memory_manager_t((__Request *)In0P); |
519 | if (check_result != MACH_MSG_SUCCESS) |
520 | { MIG_RETURN_ERROR(OutP, check_result); } |
521 | #endif /* defined(__MIG_check__Request__host_default_memory_manager_t__defined) */ |
522 | |
523 | #if UseStaticTemplates |
524 | OutP->default_manager = default_managerTemplate; |
525 | #else /* UseStaticTemplates */ |
526 | #if __MigKernelSpecificCode |
527 | OutP->default_manager.disposition = 17; |
528 | #else |
529 | OutP->default_manager.disposition = 20; |
530 | #endif /* __MigKernelSpecificCode */ |
531 | #if !(defined(KERNEL) && defined(__LP64__)) |
532 | OutP->default_manager.pad1 = 0; |
533 | #endif |
534 | OutP->default_manager.pad2 = 0; |
535 | OutP->default_manager.type = MACH_MSG_PORT_DESCRIPTOR; |
536 | #if defined(KERNEL) |
537 | OutP->default_manager.pad_end = 0; |
538 | #endif |
539 | #endif /* UseStaticTemplates */ |
540 | |
541 | |
542 | RetCode = host_default_memory_manager(convert_port_to_host_priv(In0P->Head.msgh_request_port), &In0P->default_manager.name, In0P->cluster_size); |
543 | if (RetCode != KERN_SUCCESS) { |
544 | MIG_RETURN_ERROR(OutP, RetCode); |
545 | } |
546 | #if __MigKernelSpecificCode |
547 | #endif /* __MigKernelSpecificCode */ |
548 | |
549 | OutP->default_manager.name = In0P->default_manager.name; |
550 | |
551 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
552 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
553 | OutP->msgh_body.msgh_descriptor_count = 1; |
554 | __AfterRcvRpc(403, "host_default_memory_manager" ) |
555 | } |
556 | |
557 | #if ( __MigTypeCheck ) |
558 | #if __MIG_check__Request__host_priv_subsystem__ |
559 | #if !defined(__MIG_check__Request__vm_wire_t__defined) |
560 | #define __MIG_check__Request__vm_wire_t__defined |
561 | |
562 | mig_internal kern_return_t __MIG_check__Request__vm_wire_t(__attribute__((__unused__)) __Request__vm_wire_t *In0P) |
563 | { |
564 | |
565 | typedef __Request__vm_wire_t __Request; |
566 | #if __MigTypeCheck |
567 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
568 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
569 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
570 | return MIG_BAD_ARGUMENTS; |
571 | #endif /* __MigTypeCheck */ |
572 | |
573 | #if __MigTypeCheck |
574 | if (In0P->task.type != MACH_MSG_PORT_DESCRIPTOR || |
575 | In0P->task.disposition != 17) |
576 | return MIG_TYPE_ERROR; |
577 | #endif /* __MigTypeCheck */ |
578 | |
579 | return MACH_MSG_SUCCESS; |
580 | } |
581 | #endif /* !defined(__MIG_check__Request__vm_wire_t__defined) */ |
582 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
583 | #endif /* ( __MigTypeCheck ) */ |
584 | |
585 | |
586 | /* Routine vm_wire */ |
587 | mig_internal novalue _Xvm_wire |
588 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
589 | { |
590 | |
591 | #ifdef __MigPackStructs |
592 | #pragma pack(4) |
593 | #endif |
594 | typedef struct { |
595 | mach_msg_header_t Head; |
596 | /* start of the kernel processed data */ |
597 | mach_msg_body_t msgh_body; |
598 | mach_msg_port_descriptor_t task; |
599 | /* end of the kernel processed data */ |
600 | NDR_record_t NDR; |
601 | vm_address_t address; |
602 | vm_size_t size; |
603 | vm_prot_t desired_access; |
604 | mach_msg_trailer_t trailer; |
605 | } Request __attribute__((unused)); |
606 | #ifdef __MigPackStructs |
607 | #pragma pack() |
608 | #endif |
609 | typedef __Request__vm_wire_t __Request; |
610 | typedef __Reply__vm_wire_t Reply __attribute__((unused)); |
611 | |
612 | /* |
613 | * typedef struct { |
614 | * mach_msg_header_t Head; |
615 | * NDR_record_t NDR; |
616 | * kern_return_t RetCode; |
617 | * } mig_reply_error_t; |
618 | */ |
619 | |
620 | Request *In0P = (Request *) InHeadP; |
621 | Reply *OutP = (Reply *) OutHeadP; |
622 | #ifdef __MIG_check__Request__vm_wire_t__defined |
623 | kern_return_t check_result; |
624 | #endif /* __MIG_check__Request__vm_wire_t__defined */ |
625 | |
626 | #if __MigKernelSpecificCode |
627 | #else |
628 | #endif /* __MigKernelSpecificCode */ |
629 | vm_map_t task; |
630 | |
631 | __DeclareRcvRpc(404, "vm_wire" ) |
632 | __BeforeRcvRpc(404, "vm_wire" ) |
633 | |
634 | #if defined(__MIG_check__Request__vm_wire_t__defined) |
635 | check_result = __MIG_check__Request__vm_wire_t((__Request *)In0P); |
636 | if (check_result != MACH_MSG_SUCCESS) |
637 | { MIG_RETURN_ERROR(OutP, check_result); } |
638 | #endif /* defined(__MIG_check__Request__vm_wire_t__defined) */ |
639 | |
640 | task = convert_port_to_map(In0P->task.name); |
641 | |
642 | OutP->RetCode = vm_wire(convert_port_to_host_priv(In0P->Head.msgh_request_port), task, In0P->address, In0P->size, In0P->desired_access); |
643 | vm_map_deallocate(task); |
644 | #if __MigKernelSpecificCode |
645 | if (OutP->RetCode != KERN_SUCCESS) { |
646 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
647 | } |
648 | |
649 | if (IP_VALID((ipc_port_t)In0P->task.name)) |
650 | ipc_port_release_send((ipc_port_t)In0P->task.name); |
651 | #endif /* __MigKernelSpecificCode */ |
652 | |
653 | OutP->NDR = NDR_record; |
654 | |
655 | |
656 | __AfterRcvRpc(404, "vm_wire" ) |
657 | } |
658 | |
659 | #if ( __MigTypeCheck ) |
660 | #if __MIG_check__Request__host_priv_subsystem__ |
661 | #if !defined(__MIG_check__Request__thread_wire_t__defined) |
662 | #define __MIG_check__Request__thread_wire_t__defined |
663 | |
664 | mig_internal kern_return_t __MIG_check__Request__thread_wire_t(__attribute__((__unused__)) __Request__thread_wire_t *In0P) |
665 | { |
666 | |
667 | typedef __Request__thread_wire_t __Request; |
668 | #if __MigTypeCheck |
669 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
670 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
671 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
672 | return MIG_BAD_ARGUMENTS; |
673 | #endif /* __MigTypeCheck */ |
674 | |
675 | #if __MigTypeCheck |
676 | if (In0P->thread.type != MACH_MSG_PORT_DESCRIPTOR || |
677 | In0P->thread.disposition != 17) |
678 | return MIG_TYPE_ERROR; |
679 | #endif /* __MigTypeCheck */ |
680 | |
681 | return MACH_MSG_SUCCESS; |
682 | } |
683 | #endif /* !defined(__MIG_check__Request__thread_wire_t__defined) */ |
684 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
685 | #endif /* ( __MigTypeCheck ) */ |
686 | |
687 | |
688 | /* Routine thread_wire */ |
689 | mig_internal novalue _Xthread_wire |
690 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
691 | { |
692 | |
693 | #ifdef __MigPackStructs |
694 | #pragma pack(4) |
695 | #endif |
696 | typedef struct { |
697 | mach_msg_header_t Head; |
698 | /* start of the kernel processed data */ |
699 | mach_msg_body_t msgh_body; |
700 | mach_msg_port_descriptor_t thread; |
701 | /* end of the kernel processed data */ |
702 | NDR_record_t NDR; |
703 | boolean_t wired; |
704 | mach_msg_trailer_t trailer; |
705 | } Request __attribute__((unused)); |
706 | #ifdef __MigPackStructs |
707 | #pragma pack() |
708 | #endif |
709 | typedef __Request__thread_wire_t __Request; |
710 | typedef __Reply__thread_wire_t Reply __attribute__((unused)); |
711 | |
712 | /* |
713 | * typedef struct { |
714 | * mach_msg_header_t Head; |
715 | * NDR_record_t NDR; |
716 | * kern_return_t RetCode; |
717 | * } mig_reply_error_t; |
718 | */ |
719 | |
720 | Request *In0P = (Request *) InHeadP; |
721 | Reply *OutP = (Reply *) OutHeadP; |
722 | #ifdef __MIG_check__Request__thread_wire_t__defined |
723 | kern_return_t check_result; |
724 | #endif /* __MIG_check__Request__thread_wire_t__defined */ |
725 | |
726 | #if __MigKernelSpecificCode |
727 | #else |
728 | #endif /* __MigKernelSpecificCode */ |
729 | thread_act_t thread; |
730 | |
731 | __DeclareRcvRpc(405, "thread_wire" ) |
732 | __BeforeRcvRpc(405, "thread_wire" ) |
733 | |
734 | #if defined(__MIG_check__Request__thread_wire_t__defined) |
735 | check_result = __MIG_check__Request__thread_wire_t((__Request *)In0P); |
736 | if (check_result != MACH_MSG_SUCCESS) |
737 | { MIG_RETURN_ERROR(OutP, check_result); } |
738 | #endif /* defined(__MIG_check__Request__thread_wire_t__defined) */ |
739 | |
740 | thread = convert_port_to_thread(In0P->thread.name); |
741 | |
742 | OutP->RetCode = thread_wire(convert_port_to_host_priv(In0P->Head.msgh_request_port), thread, In0P->wired); |
743 | thread_deallocate(thread); |
744 | #if __MigKernelSpecificCode |
745 | if (OutP->RetCode != KERN_SUCCESS) { |
746 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
747 | } |
748 | |
749 | if (IP_VALID((ipc_port_t)In0P->thread.name)) |
750 | ipc_port_release_send((ipc_port_t)In0P->thread.name); |
751 | #endif /* __MigKernelSpecificCode */ |
752 | |
753 | OutP->NDR = NDR_record; |
754 | |
755 | |
756 | __AfterRcvRpc(405, "thread_wire" ) |
757 | } |
758 | |
759 | #if ( __MigTypeCheck ) |
760 | #if __MIG_check__Request__host_priv_subsystem__ |
761 | #if !defined(__MIG_check__Request__vm_allocate_cpm_t__defined) |
762 | #define __MIG_check__Request__vm_allocate_cpm_t__defined |
763 | |
764 | mig_internal kern_return_t __MIG_check__Request__vm_allocate_cpm_t(__attribute__((__unused__)) __Request__vm_allocate_cpm_t *In0P) |
765 | { |
766 | |
767 | typedef __Request__vm_allocate_cpm_t __Request; |
768 | #if __MigTypeCheck |
769 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
770 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
771 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
772 | return MIG_BAD_ARGUMENTS; |
773 | #endif /* __MigTypeCheck */ |
774 | |
775 | #if __MigTypeCheck |
776 | if (In0P->task.type != MACH_MSG_PORT_DESCRIPTOR || |
777 | In0P->task.disposition != 17) |
778 | return MIG_TYPE_ERROR; |
779 | #endif /* __MigTypeCheck */ |
780 | |
781 | return MACH_MSG_SUCCESS; |
782 | } |
783 | #endif /* !defined(__MIG_check__Request__vm_allocate_cpm_t__defined) */ |
784 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
785 | #endif /* ( __MigTypeCheck ) */ |
786 | |
787 | |
788 | /* Routine vm_allocate_cpm */ |
789 | mig_internal novalue _Xvm_allocate_cpm |
790 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
791 | { |
792 | |
793 | #ifdef __MigPackStructs |
794 | #pragma pack(4) |
795 | #endif |
796 | typedef struct { |
797 | mach_msg_header_t Head; |
798 | /* start of the kernel processed data */ |
799 | mach_msg_body_t msgh_body; |
800 | mach_msg_port_descriptor_t task; |
801 | /* end of the kernel processed data */ |
802 | NDR_record_t NDR; |
803 | vm_address_t address; |
804 | vm_size_t size; |
805 | int flags; |
806 | mach_msg_trailer_t trailer; |
807 | } Request __attribute__((unused)); |
808 | #ifdef __MigPackStructs |
809 | #pragma pack() |
810 | #endif |
811 | typedef __Request__vm_allocate_cpm_t __Request; |
812 | typedef __Reply__vm_allocate_cpm_t Reply __attribute__((unused)); |
813 | |
814 | /* |
815 | * typedef struct { |
816 | * mach_msg_header_t Head; |
817 | * NDR_record_t NDR; |
818 | * kern_return_t RetCode; |
819 | * } mig_reply_error_t; |
820 | */ |
821 | |
822 | Request *In0P = (Request *) InHeadP; |
823 | Reply *OutP = (Reply *) OutHeadP; |
824 | #ifdef __MIG_check__Request__vm_allocate_cpm_t__defined |
825 | kern_return_t check_result; |
826 | #endif /* __MIG_check__Request__vm_allocate_cpm_t__defined */ |
827 | |
828 | #if __MigKernelSpecificCode |
829 | #else |
830 | #endif /* __MigKernelSpecificCode */ |
831 | vm_map_t task; |
832 | |
833 | __DeclareRcvRpc(406, "vm_allocate_cpm" ) |
834 | __BeforeRcvRpc(406, "vm_allocate_cpm" ) |
835 | |
836 | #if defined(__MIG_check__Request__vm_allocate_cpm_t__defined) |
837 | check_result = __MIG_check__Request__vm_allocate_cpm_t((__Request *)In0P); |
838 | if (check_result != MACH_MSG_SUCCESS) |
839 | { MIG_RETURN_ERROR(OutP, check_result); } |
840 | #endif /* defined(__MIG_check__Request__vm_allocate_cpm_t__defined) */ |
841 | |
842 | task = convert_port_to_map(In0P->task.name); |
843 | |
844 | OutP->RetCode = vm_allocate_cpm(convert_port_to_host_priv(In0P->Head.msgh_request_port), task, &In0P->address, In0P->size, In0P->flags); |
845 | vm_map_deallocate(task); |
846 | if (OutP->RetCode != KERN_SUCCESS) { |
847 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
848 | } |
849 | #if __MigKernelSpecificCode |
850 | |
851 | if (IP_VALID((ipc_port_t)In0P->task.name)) |
852 | ipc_port_release_send((ipc_port_t)In0P->task.name); |
853 | #endif /* __MigKernelSpecificCode */ |
854 | |
855 | OutP->NDR = NDR_record; |
856 | |
857 | |
858 | OutP->address = In0P->address; |
859 | |
860 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
861 | __AfterRcvRpc(406, "vm_allocate_cpm" ) |
862 | } |
863 | |
864 | #if ( __MigTypeCheck ) |
865 | #if __MIG_check__Request__host_priv_subsystem__ |
866 | #if !defined(__MIG_check__Request__host_processors_t__defined) |
867 | #define __MIG_check__Request__host_processors_t__defined |
868 | |
869 | mig_internal kern_return_t __MIG_check__Request__host_processors_t(__attribute__((__unused__)) __Request__host_processors_t *In0P) |
870 | { |
871 | |
872 | typedef __Request__host_processors_t __Request; |
873 | #if __MigTypeCheck |
874 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
875 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
876 | return MIG_BAD_ARGUMENTS; |
877 | #endif /* __MigTypeCheck */ |
878 | |
879 | return MACH_MSG_SUCCESS; |
880 | } |
881 | #endif /* !defined(__MIG_check__Request__host_processors_t__defined) */ |
882 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
883 | #endif /* ( __MigTypeCheck ) */ |
884 | |
885 | |
886 | /* Routine host_processors */ |
887 | mig_internal novalue _Xhost_processors |
888 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
889 | { |
890 | |
891 | #ifdef __MigPackStructs |
892 | #pragma pack(4) |
893 | #endif |
894 | typedef struct { |
895 | mach_msg_header_t Head; |
896 | mach_msg_trailer_t trailer; |
897 | } Request __attribute__((unused)); |
898 | #ifdef __MigPackStructs |
899 | #pragma pack() |
900 | #endif |
901 | typedef __Request__host_processors_t __Request; |
902 | typedef __Reply__host_processors_t Reply __attribute__((unused)); |
903 | |
904 | /* |
905 | * typedef struct { |
906 | * mach_msg_header_t Head; |
907 | * NDR_record_t NDR; |
908 | * kern_return_t RetCode; |
909 | * } mig_reply_error_t; |
910 | */ |
911 | |
912 | Request *In0P = (Request *) InHeadP; |
913 | Reply *OutP = (Reply *) OutHeadP; |
914 | #ifdef __MIG_check__Request__host_processors_t__defined |
915 | kern_return_t check_result; |
916 | #endif /* __MIG_check__Request__host_processors_t__defined */ |
917 | |
918 | #if __MigKernelSpecificCode |
919 | #if UseStaticTemplates |
920 | const static mach_msg_ool_ports_descriptor_t out_processor_listTemplate = { |
921 | /* addr = */ (void *)0, |
922 | /* coun = */ 0, |
923 | /* deal = */ FALSE, |
924 | /* copy is meaningful only in overwrite mode */ |
925 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
926 | /* disp = */ 17, |
927 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
928 | }; |
929 | #endif /* UseStaticTemplates */ |
930 | |
931 | #else |
932 | #if UseStaticTemplates |
933 | const static mach_msg_ool_ports_descriptor_t out_processor_listTemplate = { |
934 | /* addr = */ (void *)0, |
935 | /* coun = */ 0, |
936 | /* deal = */ FALSE, |
937 | /* copy is meaningful only in overwrite mode */ |
938 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
939 | /* disp = */ 19, |
940 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
941 | }; |
942 | #endif /* UseStaticTemplates */ |
943 | |
944 | #endif /* __MigKernelSpecificCode */ |
945 | kern_return_t RetCode; |
946 | __DeclareRcvRpc(407, "host_processors" ) |
947 | __BeforeRcvRpc(407, "host_processors" ) |
948 | |
949 | #if defined(__MIG_check__Request__host_processors_t__defined) |
950 | check_result = __MIG_check__Request__host_processors_t((__Request *)In0P); |
951 | if (check_result != MACH_MSG_SUCCESS) |
952 | { MIG_RETURN_ERROR(OutP, check_result); } |
953 | #endif /* defined(__MIG_check__Request__host_processors_t__defined) */ |
954 | |
955 | #if UseStaticTemplates |
956 | OutP->out_processor_list = out_processor_listTemplate; |
957 | #else /* UseStaticTemplates */ |
958 | #if __MigKernelSpecificCode |
959 | OutP->out_processor_list.disposition = 17; |
960 | #else |
961 | OutP->out_processor_list.disposition = 19; |
962 | #endif /* __MigKernelSpecificCode */ |
963 | OutP->out_processor_list.deallocate = FALSE; |
964 | OutP->out_processor_list.type = MACH_MSG_OOL_PORTS_DESCRIPTOR; |
965 | #endif /* UseStaticTemplates */ |
966 | |
967 | |
968 | RetCode = host_processors(convert_port_to_host_priv(In0P->Head.msgh_request_port), (processor_array_t *)&(OutP->out_processor_list.address), &OutP->out_processor_listCnt); |
969 | if (RetCode != KERN_SUCCESS) { |
970 | MIG_RETURN_ERROR(OutP, RetCode); |
971 | } |
972 | #if __MigKernelSpecificCode |
973 | #endif /* __MigKernelSpecificCode */ |
974 | OutP->out_processor_list.count = OutP->out_processor_listCnt; |
975 | |
976 | |
977 | OutP->NDR = NDR_record; |
978 | |
979 | |
980 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
981 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
982 | OutP->msgh_body.msgh_descriptor_count = 1; |
983 | __AfterRcvRpc(407, "host_processors" ) |
984 | } |
985 | |
986 | #if ( __MigTypeCheck ) |
987 | #if __MIG_check__Request__host_priv_subsystem__ |
988 | #if !defined(__MIG_check__Request__host_get_clock_control_t__defined) |
989 | #define __MIG_check__Request__host_get_clock_control_t__defined |
990 | |
991 | mig_internal kern_return_t __MIG_check__Request__host_get_clock_control_t(__attribute__((__unused__)) __Request__host_get_clock_control_t *In0P) |
992 | { |
993 | |
994 | typedef __Request__host_get_clock_control_t __Request; |
995 | #if __MigTypeCheck |
996 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
997 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
998 | return MIG_BAD_ARGUMENTS; |
999 | #endif /* __MigTypeCheck */ |
1000 | |
1001 | return MACH_MSG_SUCCESS; |
1002 | } |
1003 | #endif /* !defined(__MIG_check__Request__host_get_clock_control_t__defined) */ |
1004 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
1005 | #endif /* ( __MigTypeCheck ) */ |
1006 | |
1007 | |
1008 | /* Routine host_get_clock_control */ |
1009 | mig_internal novalue _Xhost_get_clock_control |
1010 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1011 | { |
1012 | |
1013 | #ifdef __MigPackStructs |
1014 | #pragma pack(4) |
1015 | #endif |
1016 | typedef struct { |
1017 | mach_msg_header_t Head; |
1018 | NDR_record_t NDR; |
1019 | clock_id_t clock_id; |
1020 | mach_msg_trailer_t trailer; |
1021 | } Request __attribute__((unused)); |
1022 | #ifdef __MigPackStructs |
1023 | #pragma pack() |
1024 | #endif |
1025 | typedef __Request__host_get_clock_control_t __Request; |
1026 | typedef __Reply__host_get_clock_control_t Reply __attribute__((unused)); |
1027 | |
1028 | /* |
1029 | * typedef struct { |
1030 | * mach_msg_header_t Head; |
1031 | * NDR_record_t NDR; |
1032 | * kern_return_t RetCode; |
1033 | * } mig_reply_error_t; |
1034 | */ |
1035 | |
1036 | Request *In0P = (Request *) InHeadP; |
1037 | Reply *OutP = (Reply *) OutHeadP; |
1038 | #ifdef __MIG_check__Request__host_get_clock_control_t__defined |
1039 | kern_return_t check_result; |
1040 | #endif /* __MIG_check__Request__host_get_clock_control_t__defined */ |
1041 | |
1042 | #if __MigKernelSpecificCode |
1043 | #if UseStaticTemplates |
1044 | const static mach_msg_port_descriptor_t clock_ctrlTemplate = { |
1045 | /* name = */ MACH_PORT_NULL, |
1046 | /* pad1 = */ 0, |
1047 | /* pad2 = */ 0, |
1048 | /* disp = */ 17, |
1049 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
1050 | }; |
1051 | #endif /* UseStaticTemplates */ |
1052 | |
1053 | #else |
1054 | #if UseStaticTemplates |
1055 | const static mach_msg_port_descriptor_t clock_ctrlTemplate = { |
1056 | /* name = */ MACH_PORT_NULL, |
1057 | /* pad1 = */ 0, |
1058 | /* pad2 = */ 0, |
1059 | /* disp = */ 19, |
1060 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
1061 | }; |
1062 | #endif /* UseStaticTemplates */ |
1063 | |
1064 | #endif /* __MigKernelSpecificCode */ |
1065 | kern_return_t RetCode; |
1066 | clock_ctrl_t clock_ctrl; |
1067 | |
1068 | __DeclareRcvRpc(408, "host_get_clock_control" ) |
1069 | __BeforeRcvRpc(408, "host_get_clock_control" ) |
1070 | |
1071 | #if defined(__MIG_check__Request__host_get_clock_control_t__defined) |
1072 | check_result = __MIG_check__Request__host_get_clock_control_t((__Request *)In0P); |
1073 | if (check_result != MACH_MSG_SUCCESS) |
1074 | { MIG_RETURN_ERROR(OutP, check_result); } |
1075 | #endif /* defined(__MIG_check__Request__host_get_clock_control_t__defined) */ |
1076 | |
1077 | #if UseStaticTemplates |
1078 | OutP->clock_ctrl = clock_ctrlTemplate; |
1079 | #else /* UseStaticTemplates */ |
1080 | #if __MigKernelSpecificCode |
1081 | OutP->clock_ctrl.disposition = 17; |
1082 | #else |
1083 | OutP->clock_ctrl.disposition = 19; |
1084 | #endif /* __MigKernelSpecificCode */ |
1085 | #if !(defined(KERNEL) && defined(__LP64__)) |
1086 | OutP->clock_ctrl.pad1 = 0; |
1087 | #endif |
1088 | OutP->clock_ctrl.pad2 = 0; |
1089 | OutP->clock_ctrl.type = MACH_MSG_PORT_DESCRIPTOR; |
1090 | #if defined(KERNEL) |
1091 | OutP->clock_ctrl.pad_end = 0; |
1092 | #endif |
1093 | #endif /* UseStaticTemplates */ |
1094 | |
1095 | |
1096 | RetCode = host_get_clock_control(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->clock_id, &clock_ctrl); |
1097 | if (RetCode != KERN_SUCCESS) { |
1098 | MIG_RETURN_ERROR(OutP, RetCode); |
1099 | } |
1100 | #if __MigKernelSpecificCode |
1101 | #endif /* __MigKernelSpecificCode */ |
1102 | OutP->clock_ctrl.name = (mach_port_t)convert_clock_ctrl_to_port(clock_ctrl); |
1103 | |
1104 | |
1105 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
1106 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
1107 | OutP->msgh_body.msgh_descriptor_count = 1; |
1108 | __AfterRcvRpc(408, "host_get_clock_control" ) |
1109 | } |
1110 | |
1111 | #if ( __MigTypeCheck ) |
1112 | #if __MIG_check__Request__host_priv_subsystem__ |
1113 | #if !defined(__MIG_check__Request__kmod_create_t__defined) |
1114 | #define __MIG_check__Request__kmod_create_t__defined |
1115 | |
1116 | mig_internal kern_return_t __MIG_check__Request__kmod_create_t(__attribute__((__unused__)) __Request__kmod_create_t *In0P) |
1117 | { |
1118 | |
1119 | typedef __Request__kmod_create_t __Request; |
1120 | #if __MigTypeCheck |
1121 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
1122 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
1123 | return MIG_BAD_ARGUMENTS; |
1124 | #endif /* __MigTypeCheck */ |
1125 | |
1126 | return MACH_MSG_SUCCESS; |
1127 | } |
1128 | #endif /* !defined(__MIG_check__Request__kmod_create_t__defined) */ |
1129 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
1130 | #endif /* ( __MigTypeCheck ) */ |
1131 | |
1132 | |
1133 | /* Routine kmod_create */ |
1134 | mig_internal novalue _Xkmod_create |
1135 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1136 | { |
1137 | |
1138 | #ifdef __MigPackStructs |
1139 | #pragma pack(4) |
1140 | #endif |
1141 | typedef struct { |
1142 | mach_msg_header_t Head; |
1143 | NDR_record_t NDR; |
1144 | vm_address_t info; |
1145 | mach_msg_trailer_t trailer; |
1146 | } Request __attribute__((unused)); |
1147 | #ifdef __MigPackStructs |
1148 | #pragma pack() |
1149 | #endif |
1150 | typedef __Request__kmod_create_t __Request; |
1151 | typedef __Reply__kmod_create_t Reply __attribute__((unused)); |
1152 | |
1153 | /* |
1154 | * typedef struct { |
1155 | * mach_msg_header_t Head; |
1156 | * NDR_record_t NDR; |
1157 | * kern_return_t RetCode; |
1158 | * } mig_reply_error_t; |
1159 | */ |
1160 | |
1161 | Request *In0P = (Request *) InHeadP; |
1162 | Reply *OutP = (Reply *) OutHeadP; |
1163 | #ifdef __MIG_check__Request__kmod_create_t__defined |
1164 | kern_return_t check_result; |
1165 | #endif /* __MIG_check__Request__kmod_create_t__defined */ |
1166 | |
1167 | #if __MigKernelSpecificCode |
1168 | #else |
1169 | #endif /* __MigKernelSpecificCode */ |
1170 | __DeclareRcvRpc(409, "kmod_create" ) |
1171 | __BeforeRcvRpc(409, "kmod_create" ) |
1172 | |
1173 | #if defined(__MIG_check__Request__kmod_create_t__defined) |
1174 | check_result = __MIG_check__Request__kmod_create_t((__Request *)In0P); |
1175 | if (check_result != MACH_MSG_SUCCESS) |
1176 | { MIG_RETURN_ERROR(OutP, check_result); } |
1177 | #endif /* defined(__MIG_check__Request__kmod_create_t__defined) */ |
1178 | |
1179 | OutP->RetCode = kmod_create(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->info, &OutP->module); |
1180 | if (OutP->RetCode != KERN_SUCCESS) { |
1181 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
1182 | } |
1183 | #if __MigKernelSpecificCode |
1184 | #endif /* __MigKernelSpecificCode */ |
1185 | |
1186 | OutP->NDR = NDR_record; |
1187 | |
1188 | |
1189 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
1190 | __AfterRcvRpc(409, "kmod_create" ) |
1191 | } |
1192 | |
1193 | #if ( __MigTypeCheck ) |
1194 | #if __MIG_check__Request__host_priv_subsystem__ |
1195 | #if !defined(__MIG_check__Request__kmod_destroy_t__defined) |
1196 | #define __MIG_check__Request__kmod_destroy_t__defined |
1197 | |
1198 | mig_internal kern_return_t __MIG_check__Request__kmod_destroy_t(__attribute__((__unused__)) __Request__kmod_destroy_t *In0P) |
1199 | { |
1200 | |
1201 | typedef __Request__kmod_destroy_t __Request; |
1202 | #if __MigTypeCheck |
1203 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
1204 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
1205 | return MIG_BAD_ARGUMENTS; |
1206 | #endif /* __MigTypeCheck */ |
1207 | |
1208 | return MACH_MSG_SUCCESS; |
1209 | } |
1210 | #endif /* !defined(__MIG_check__Request__kmod_destroy_t__defined) */ |
1211 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
1212 | #endif /* ( __MigTypeCheck ) */ |
1213 | |
1214 | |
1215 | /* Routine kmod_destroy */ |
1216 | mig_internal novalue _Xkmod_destroy |
1217 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1218 | { |
1219 | |
1220 | #ifdef __MigPackStructs |
1221 | #pragma pack(4) |
1222 | #endif |
1223 | typedef struct { |
1224 | mach_msg_header_t Head; |
1225 | NDR_record_t NDR; |
1226 | kmod_t module; |
1227 | mach_msg_trailer_t trailer; |
1228 | } Request __attribute__((unused)); |
1229 | #ifdef __MigPackStructs |
1230 | #pragma pack() |
1231 | #endif |
1232 | typedef __Request__kmod_destroy_t __Request; |
1233 | typedef __Reply__kmod_destroy_t Reply __attribute__((unused)); |
1234 | |
1235 | /* |
1236 | * typedef struct { |
1237 | * mach_msg_header_t Head; |
1238 | * NDR_record_t NDR; |
1239 | * kern_return_t RetCode; |
1240 | * } mig_reply_error_t; |
1241 | */ |
1242 | |
1243 | Request *In0P = (Request *) InHeadP; |
1244 | Reply *OutP = (Reply *) OutHeadP; |
1245 | #ifdef __MIG_check__Request__kmod_destroy_t__defined |
1246 | kern_return_t check_result; |
1247 | #endif /* __MIG_check__Request__kmod_destroy_t__defined */ |
1248 | |
1249 | #if __MigKernelSpecificCode |
1250 | #else |
1251 | #endif /* __MigKernelSpecificCode */ |
1252 | __DeclareRcvRpc(410, "kmod_destroy" ) |
1253 | __BeforeRcvRpc(410, "kmod_destroy" ) |
1254 | |
1255 | #if defined(__MIG_check__Request__kmod_destroy_t__defined) |
1256 | check_result = __MIG_check__Request__kmod_destroy_t((__Request *)In0P); |
1257 | if (check_result != MACH_MSG_SUCCESS) |
1258 | { MIG_RETURN_ERROR(OutP, check_result); } |
1259 | #endif /* defined(__MIG_check__Request__kmod_destroy_t__defined) */ |
1260 | |
1261 | OutP->RetCode = kmod_destroy(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->module); |
1262 | #if __MigKernelSpecificCode |
1263 | #endif /* __MigKernelSpecificCode */ |
1264 | |
1265 | OutP->NDR = NDR_record; |
1266 | |
1267 | |
1268 | __AfterRcvRpc(410, "kmod_destroy" ) |
1269 | } |
1270 | |
1271 | #if ( __MigTypeCheck ) |
1272 | #if __MIG_check__Request__host_priv_subsystem__ |
1273 | #if !defined(__MIG_check__Request__kmod_control_t__defined) |
1274 | #define __MIG_check__Request__kmod_control_t__defined |
1275 | |
1276 | mig_internal kern_return_t __MIG_check__Request__kmod_control_t(__attribute__((__unused__)) __Request__kmod_control_t *In0P) |
1277 | { |
1278 | |
1279 | typedef __Request__kmod_control_t __Request; |
1280 | #if __MigTypeCheck |
1281 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
1282 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
1283 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
1284 | return MIG_BAD_ARGUMENTS; |
1285 | #endif /* __MigTypeCheck */ |
1286 | |
1287 | #if __MigTypeCheck |
1288 | if (In0P->data.type != MACH_MSG_OOL_DESCRIPTOR) |
1289 | return MIG_TYPE_ERROR; |
1290 | #endif /* __MigTypeCheck */ |
1291 | |
1292 | #if __MigTypeCheck |
1293 | if (In0P->data.size != In0P->dataCnt) |
1294 | return MIG_TYPE_ERROR; |
1295 | #endif /* __MigTypeCheck */ |
1296 | |
1297 | return MACH_MSG_SUCCESS; |
1298 | } |
1299 | #endif /* !defined(__MIG_check__Request__kmod_control_t__defined) */ |
1300 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
1301 | #endif /* ( __MigTypeCheck ) */ |
1302 | |
1303 | |
1304 | /* Routine kmod_control */ |
1305 | mig_internal novalue _Xkmod_control |
1306 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1307 | { |
1308 | |
1309 | #ifdef __MigPackStructs |
1310 | #pragma pack(4) |
1311 | #endif |
1312 | typedef struct { |
1313 | mach_msg_header_t Head; |
1314 | /* start of the kernel processed data */ |
1315 | mach_msg_body_t msgh_body; |
1316 | mach_msg_ool_descriptor_t data; |
1317 | /* end of the kernel processed data */ |
1318 | NDR_record_t NDR; |
1319 | kmod_t module; |
1320 | kmod_control_flavor_t flavor; |
1321 | mach_msg_type_number_t dataCnt; |
1322 | mach_msg_trailer_t trailer; |
1323 | } Request __attribute__((unused)); |
1324 | #ifdef __MigPackStructs |
1325 | #pragma pack() |
1326 | #endif |
1327 | typedef __Request__kmod_control_t __Request; |
1328 | typedef __Reply__kmod_control_t Reply __attribute__((unused)); |
1329 | |
1330 | /* |
1331 | * typedef struct { |
1332 | * mach_msg_header_t Head; |
1333 | * NDR_record_t NDR; |
1334 | * kern_return_t RetCode; |
1335 | * } mig_reply_error_t; |
1336 | */ |
1337 | |
1338 | Request *In0P = (Request *) InHeadP; |
1339 | Reply *OutP = (Reply *) OutHeadP; |
1340 | #ifdef __MIG_check__Request__kmod_control_t__defined |
1341 | kern_return_t check_result; |
1342 | #endif /* __MIG_check__Request__kmod_control_t__defined */ |
1343 | |
1344 | #if __MigKernelSpecificCode |
1345 | #if UseStaticTemplates |
1346 | const static mach_msg_ool_descriptor_t dataTemplate = { |
1347 | /* addr = */ (void *)0, |
1348 | /* size = */ 0, |
1349 | /* deal = */ FALSE, |
1350 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
1351 | /* pad2 = */ 0, |
1352 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
1353 | }; |
1354 | #endif /* UseStaticTemplates */ |
1355 | |
1356 | #else |
1357 | #if UseStaticTemplates |
1358 | const static mach_msg_ool_descriptor_t dataTemplate = { |
1359 | /* addr = */ (void *)0, |
1360 | /* size = */ 0, |
1361 | /* deal = */ FALSE, |
1362 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
1363 | /* pad2 = */ 0, |
1364 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
1365 | }; |
1366 | #endif /* UseStaticTemplates */ |
1367 | |
1368 | #endif /* __MigKernelSpecificCode */ |
1369 | kern_return_t RetCode; |
1370 | __DeclareRcvRpc(411, "kmod_control" ) |
1371 | __BeforeRcvRpc(411, "kmod_control" ) |
1372 | |
1373 | #if defined(__MIG_check__Request__kmod_control_t__defined) |
1374 | check_result = __MIG_check__Request__kmod_control_t((__Request *)In0P); |
1375 | if (check_result != MACH_MSG_SUCCESS) |
1376 | { MIG_RETURN_ERROR(OutP, check_result); } |
1377 | #endif /* defined(__MIG_check__Request__kmod_control_t__defined) */ |
1378 | |
1379 | #if UseStaticTemplates |
1380 | OutP->data = dataTemplate; |
1381 | #else /* UseStaticTemplates */ |
1382 | OutP->data.deallocate = FALSE; |
1383 | OutP->data.copy = MACH_MSG_VIRTUAL_COPY; |
1384 | OutP->data.pad1 = 0; |
1385 | OutP->data.type = MACH_MSG_OOL_DESCRIPTOR; |
1386 | #if defined(KERNEL) && !defined(__LP64__) |
1387 | OutP->data.pad_end = 0; |
1388 | #endif |
1389 | #endif /* UseStaticTemplates */ |
1390 | |
1391 | |
1392 | RetCode = kmod_control(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->module, In0P->flavor, (kmod_args_t *)&(In0P->data.address), &In0P->dataCnt); |
1393 | if (RetCode != KERN_SUCCESS) { |
1394 | MIG_RETURN_ERROR(OutP, RetCode); |
1395 | } |
1396 | #if __MigKernelSpecificCode |
1397 | #endif /* __MigKernelSpecificCode */ |
1398 | OutP->data.size = OutP->dataCnt; |
1399 | |
1400 | |
1401 | OutP->NDR = NDR_record; |
1402 | |
1403 | |
1404 | OutP->data.address = In0P->data.address; |
1405 | |
1406 | OutP->dataCnt = In0P->dataCnt; |
1407 | |
1408 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
1409 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
1410 | OutP->msgh_body.msgh_descriptor_count = 1; |
1411 | __AfterRcvRpc(411, "kmod_control" ) |
1412 | } |
1413 | |
1414 | #if ( __MigTypeCheck ) |
1415 | #if __MIG_check__Request__host_priv_subsystem__ |
1416 | #if !defined(__MIG_check__Request__host_get_special_port_t__defined) |
1417 | #define __MIG_check__Request__host_get_special_port_t__defined |
1418 | |
1419 | mig_internal kern_return_t __MIG_check__Request__host_get_special_port_t(__attribute__((__unused__)) __Request__host_get_special_port_t *In0P) |
1420 | { |
1421 | |
1422 | typedef __Request__host_get_special_port_t __Request; |
1423 | #if __MigTypeCheck |
1424 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
1425 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
1426 | return MIG_BAD_ARGUMENTS; |
1427 | #endif /* __MigTypeCheck */ |
1428 | |
1429 | return MACH_MSG_SUCCESS; |
1430 | } |
1431 | #endif /* !defined(__MIG_check__Request__host_get_special_port_t__defined) */ |
1432 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
1433 | #endif /* ( __MigTypeCheck ) */ |
1434 | |
1435 | |
1436 | /* Routine host_get_special_port */ |
1437 | mig_internal novalue _Xhost_get_special_port |
1438 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1439 | { |
1440 | |
1441 | #ifdef __MigPackStructs |
1442 | #pragma pack(4) |
1443 | #endif |
1444 | typedef struct { |
1445 | mach_msg_header_t Head; |
1446 | NDR_record_t NDR; |
1447 | int node; |
1448 | int which; |
1449 | mach_msg_trailer_t trailer; |
1450 | } Request __attribute__((unused)); |
1451 | #ifdef __MigPackStructs |
1452 | #pragma pack() |
1453 | #endif |
1454 | typedef __Request__host_get_special_port_t __Request; |
1455 | typedef __Reply__host_get_special_port_t Reply __attribute__((unused)); |
1456 | |
1457 | /* |
1458 | * typedef struct { |
1459 | * mach_msg_header_t Head; |
1460 | * NDR_record_t NDR; |
1461 | * kern_return_t RetCode; |
1462 | * } mig_reply_error_t; |
1463 | */ |
1464 | |
1465 | Request *In0P = (Request *) InHeadP; |
1466 | Reply *OutP = (Reply *) OutHeadP; |
1467 | #ifdef __MIG_check__Request__host_get_special_port_t__defined |
1468 | kern_return_t check_result; |
1469 | #endif /* __MIG_check__Request__host_get_special_port_t__defined */ |
1470 | |
1471 | #if __MigKernelSpecificCode |
1472 | #if UseStaticTemplates |
1473 | const static mach_msg_port_descriptor_t portTemplate = { |
1474 | /* name = */ MACH_PORT_NULL, |
1475 | /* pad1 = */ 0, |
1476 | /* pad2 = */ 0, |
1477 | /* disp = */ 17, |
1478 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
1479 | }; |
1480 | #endif /* UseStaticTemplates */ |
1481 | |
1482 | #else |
1483 | #if UseStaticTemplates |
1484 | const static mach_msg_port_descriptor_t portTemplate = { |
1485 | /* name = */ MACH_PORT_NULL, |
1486 | /* pad1 = */ 0, |
1487 | /* pad2 = */ 0, |
1488 | /* disp = */ 19, |
1489 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
1490 | }; |
1491 | #endif /* UseStaticTemplates */ |
1492 | |
1493 | #endif /* __MigKernelSpecificCode */ |
1494 | kern_return_t RetCode; |
1495 | __DeclareRcvRpc(412, "host_get_special_port" ) |
1496 | __BeforeRcvRpc(412, "host_get_special_port" ) |
1497 | |
1498 | #if defined(__MIG_check__Request__host_get_special_port_t__defined) |
1499 | check_result = __MIG_check__Request__host_get_special_port_t((__Request *)In0P); |
1500 | if (check_result != MACH_MSG_SUCCESS) |
1501 | { MIG_RETURN_ERROR(OutP, check_result); } |
1502 | #endif /* defined(__MIG_check__Request__host_get_special_port_t__defined) */ |
1503 | |
1504 | #if UseStaticTemplates |
1505 | OutP->port = portTemplate; |
1506 | #else /* UseStaticTemplates */ |
1507 | #if __MigKernelSpecificCode |
1508 | OutP->port.disposition = 17; |
1509 | #else |
1510 | OutP->port.disposition = 19; |
1511 | #endif /* __MigKernelSpecificCode */ |
1512 | #if !(defined(KERNEL) && defined(__LP64__)) |
1513 | OutP->port.pad1 = 0; |
1514 | #endif |
1515 | OutP->port.pad2 = 0; |
1516 | OutP->port.type = MACH_MSG_PORT_DESCRIPTOR; |
1517 | #if defined(KERNEL) |
1518 | OutP->port.pad_end = 0; |
1519 | #endif |
1520 | #endif /* UseStaticTemplates */ |
1521 | |
1522 | |
1523 | RetCode = host_get_special_port(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->node, In0P->which, &OutP->port.name); |
1524 | if (RetCode != KERN_SUCCESS) { |
1525 | MIG_RETURN_ERROR(OutP, RetCode); |
1526 | } |
1527 | #if __MigKernelSpecificCode |
1528 | #endif /* __MigKernelSpecificCode */ |
1529 | |
1530 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
1531 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
1532 | OutP->msgh_body.msgh_descriptor_count = 1; |
1533 | __AfterRcvRpc(412, "host_get_special_port" ) |
1534 | } |
1535 | |
1536 | #if ( __MigTypeCheck ) |
1537 | #if __MIG_check__Request__host_priv_subsystem__ |
1538 | #if !defined(__MIG_check__Request__host_set_special_port_t__defined) |
1539 | #define __MIG_check__Request__host_set_special_port_t__defined |
1540 | |
1541 | mig_internal kern_return_t __MIG_check__Request__host_set_special_port_t(__attribute__((__unused__)) __Request__host_set_special_port_t *In0P) |
1542 | { |
1543 | |
1544 | typedef __Request__host_set_special_port_t __Request; |
1545 | #if __MigTypeCheck |
1546 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
1547 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
1548 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
1549 | return MIG_BAD_ARGUMENTS; |
1550 | #endif /* __MigTypeCheck */ |
1551 | |
1552 | #if __MigTypeCheck |
1553 | if (In0P->port.type != MACH_MSG_PORT_DESCRIPTOR || |
1554 | In0P->port.disposition != 17) |
1555 | return MIG_TYPE_ERROR; |
1556 | #endif /* __MigTypeCheck */ |
1557 | |
1558 | return MACH_MSG_SUCCESS; |
1559 | } |
1560 | #endif /* !defined(__MIG_check__Request__host_set_special_port_t__defined) */ |
1561 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
1562 | #endif /* ( __MigTypeCheck ) */ |
1563 | |
1564 | |
1565 | /* Routine host_set_special_port */ |
1566 | mig_internal novalue _Xhost_set_special_port |
1567 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1568 | { |
1569 | |
1570 | #ifdef __MigPackStructs |
1571 | #pragma pack(4) |
1572 | #endif |
1573 | typedef struct { |
1574 | mach_msg_header_t Head; |
1575 | /* start of the kernel processed data */ |
1576 | mach_msg_body_t msgh_body; |
1577 | mach_msg_port_descriptor_t port; |
1578 | /* end of the kernel processed data */ |
1579 | NDR_record_t NDR; |
1580 | int which; |
1581 | mach_msg_trailer_t trailer; |
1582 | } Request __attribute__((unused)); |
1583 | #ifdef __MigPackStructs |
1584 | #pragma pack() |
1585 | #endif |
1586 | typedef __Request__host_set_special_port_t __Request; |
1587 | typedef __Reply__host_set_special_port_t Reply __attribute__((unused)); |
1588 | |
1589 | /* |
1590 | * typedef struct { |
1591 | * mach_msg_header_t Head; |
1592 | * NDR_record_t NDR; |
1593 | * kern_return_t RetCode; |
1594 | * } mig_reply_error_t; |
1595 | */ |
1596 | |
1597 | Request *In0P = (Request *) InHeadP; |
1598 | Reply *OutP = (Reply *) OutHeadP; |
1599 | #ifdef __MIG_check__Request__host_set_special_port_t__defined |
1600 | kern_return_t check_result; |
1601 | #endif /* __MIG_check__Request__host_set_special_port_t__defined */ |
1602 | |
1603 | #if __MigKernelSpecificCode |
1604 | #else |
1605 | #endif /* __MigKernelSpecificCode */ |
1606 | __DeclareRcvRpc(413, "host_set_special_port" ) |
1607 | __BeforeRcvRpc(413, "host_set_special_port" ) |
1608 | |
1609 | #if defined(__MIG_check__Request__host_set_special_port_t__defined) |
1610 | check_result = __MIG_check__Request__host_set_special_port_t((__Request *)In0P); |
1611 | if (check_result != MACH_MSG_SUCCESS) |
1612 | { MIG_RETURN_ERROR(OutP, check_result); } |
1613 | #endif /* defined(__MIG_check__Request__host_set_special_port_t__defined) */ |
1614 | |
1615 | OutP->RetCode = host_set_special_port(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->which, In0P->port.name); |
1616 | #if __MigKernelSpecificCode |
1617 | #endif /* __MigKernelSpecificCode */ |
1618 | |
1619 | OutP->NDR = NDR_record; |
1620 | |
1621 | |
1622 | __AfterRcvRpc(413, "host_set_special_port" ) |
1623 | } |
1624 | |
1625 | #if ( __MigTypeCheck ) |
1626 | #if __MIG_check__Request__host_priv_subsystem__ |
1627 | #if !defined(__MIG_check__Request__host_set_exception_ports_t__defined) |
1628 | #define __MIG_check__Request__host_set_exception_ports_t__defined |
1629 | |
1630 | mig_internal kern_return_t __MIG_check__Request__host_set_exception_ports_t(__attribute__((__unused__)) __Request__host_set_exception_ports_t *In0P) |
1631 | { |
1632 | |
1633 | typedef __Request__host_set_exception_ports_t __Request; |
1634 | #if __MigTypeCheck |
1635 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
1636 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
1637 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
1638 | return MIG_BAD_ARGUMENTS; |
1639 | #endif /* __MigTypeCheck */ |
1640 | |
1641 | #if __MigTypeCheck |
1642 | if (In0P->new_port.type != MACH_MSG_PORT_DESCRIPTOR || |
1643 | In0P->new_port.disposition != 17) |
1644 | return MIG_TYPE_ERROR; |
1645 | #endif /* __MigTypeCheck */ |
1646 | |
1647 | return MACH_MSG_SUCCESS; |
1648 | } |
1649 | #endif /* !defined(__MIG_check__Request__host_set_exception_ports_t__defined) */ |
1650 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
1651 | #endif /* ( __MigTypeCheck ) */ |
1652 | |
1653 | |
1654 | /* Routine host_set_exception_ports */ |
1655 | mig_internal novalue _Xhost_set_exception_ports |
1656 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1657 | { |
1658 | |
1659 | #ifdef __MigPackStructs |
1660 | #pragma pack(4) |
1661 | #endif |
1662 | typedef struct { |
1663 | mach_msg_header_t Head; |
1664 | /* start of the kernel processed data */ |
1665 | mach_msg_body_t msgh_body; |
1666 | mach_msg_port_descriptor_t new_port; |
1667 | /* end of the kernel processed data */ |
1668 | NDR_record_t NDR; |
1669 | exception_mask_t exception_mask; |
1670 | exception_behavior_t behavior; |
1671 | thread_state_flavor_t new_flavor; |
1672 | mach_msg_trailer_t trailer; |
1673 | } Request __attribute__((unused)); |
1674 | #ifdef __MigPackStructs |
1675 | #pragma pack() |
1676 | #endif |
1677 | typedef __Request__host_set_exception_ports_t __Request; |
1678 | typedef __Reply__host_set_exception_ports_t Reply __attribute__((unused)); |
1679 | |
1680 | /* |
1681 | * typedef struct { |
1682 | * mach_msg_header_t Head; |
1683 | * NDR_record_t NDR; |
1684 | * kern_return_t RetCode; |
1685 | * } mig_reply_error_t; |
1686 | */ |
1687 | |
1688 | Request *In0P = (Request *) InHeadP; |
1689 | Reply *OutP = (Reply *) OutHeadP; |
1690 | #ifdef __MIG_check__Request__host_set_exception_ports_t__defined |
1691 | kern_return_t check_result; |
1692 | #endif /* __MIG_check__Request__host_set_exception_ports_t__defined */ |
1693 | |
1694 | #if __MigKernelSpecificCode |
1695 | #else |
1696 | #endif /* __MigKernelSpecificCode */ |
1697 | __DeclareRcvRpc(414, "host_set_exception_ports" ) |
1698 | __BeforeRcvRpc(414, "host_set_exception_ports" ) |
1699 | |
1700 | #if defined(__MIG_check__Request__host_set_exception_ports_t__defined) |
1701 | check_result = __MIG_check__Request__host_set_exception_ports_t((__Request *)In0P); |
1702 | if (check_result != MACH_MSG_SUCCESS) |
1703 | { MIG_RETURN_ERROR(OutP, check_result); } |
1704 | #endif /* defined(__MIG_check__Request__host_set_exception_ports_t__defined) */ |
1705 | |
1706 | OutP->RetCode = host_set_exception_ports(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->exception_mask, In0P->new_port.name, In0P->behavior, In0P->new_flavor); |
1707 | #if __MigKernelSpecificCode |
1708 | #endif /* __MigKernelSpecificCode */ |
1709 | |
1710 | OutP->NDR = NDR_record; |
1711 | |
1712 | |
1713 | __AfterRcvRpc(414, "host_set_exception_ports" ) |
1714 | } |
1715 | |
1716 | #if ( __MigTypeCheck ) |
1717 | #if __MIG_check__Request__host_priv_subsystem__ |
1718 | #if !defined(__MIG_check__Request__host_get_exception_ports_t__defined) |
1719 | #define __MIG_check__Request__host_get_exception_ports_t__defined |
1720 | |
1721 | mig_internal kern_return_t __MIG_check__Request__host_get_exception_ports_t(__attribute__((__unused__)) __Request__host_get_exception_ports_t *In0P) |
1722 | { |
1723 | |
1724 | typedef __Request__host_get_exception_ports_t __Request; |
1725 | #if __MigTypeCheck |
1726 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
1727 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
1728 | return MIG_BAD_ARGUMENTS; |
1729 | #endif /* __MigTypeCheck */ |
1730 | |
1731 | return MACH_MSG_SUCCESS; |
1732 | } |
1733 | #endif /* !defined(__MIG_check__Request__host_get_exception_ports_t__defined) */ |
1734 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
1735 | #endif /* ( __MigTypeCheck ) */ |
1736 | |
1737 | |
1738 | /* Routine host_get_exception_ports */ |
1739 | mig_internal novalue _Xhost_get_exception_ports |
1740 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1741 | { |
1742 | |
1743 | #ifdef __MigPackStructs |
1744 | #pragma pack(4) |
1745 | #endif |
1746 | typedef struct { |
1747 | mach_msg_header_t Head; |
1748 | NDR_record_t NDR; |
1749 | exception_mask_t exception_mask; |
1750 | mach_msg_trailer_t trailer; |
1751 | } Request __attribute__((unused)); |
1752 | #ifdef __MigPackStructs |
1753 | #pragma pack() |
1754 | #endif |
1755 | typedef __Request__host_get_exception_ports_t __Request; |
1756 | typedef __Reply__host_get_exception_ports_t Reply __attribute__((unused)); |
1757 | |
1758 | /* |
1759 | * typedef struct { |
1760 | * mach_msg_header_t Head; |
1761 | * NDR_record_t NDR; |
1762 | * kern_return_t RetCode; |
1763 | * } mig_reply_error_t; |
1764 | */ |
1765 | |
1766 | Request *In0P = (Request *) InHeadP; |
1767 | Reply *OutP = (Reply *) OutHeadP; |
1768 | unsigned int msgh_size; |
1769 | unsigned int msgh_size_delta; |
1770 | |
1771 | #ifdef __MIG_check__Request__host_get_exception_ports_t__defined |
1772 | kern_return_t check_result; |
1773 | #endif /* __MIG_check__Request__host_get_exception_ports_t__defined */ |
1774 | |
1775 | #if __MigKernelSpecificCode |
1776 | #if UseStaticTemplates |
1777 | const static mach_msg_port_descriptor_t old_handlersTemplate = { |
1778 | /* name = */ MACH_PORT_NULL, |
1779 | /* pad1 = */ 0, |
1780 | /* pad2 = */ 0, |
1781 | /* disp = */ 17, |
1782 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
1783 | }; |
1784 | #endif /* UseStaticTemplates */ |
1785 | |
1786 | #else |
1787 | #if UseStaticTemplates |
1788 | const static mach_msg_port_descriptor_t old_handlersTemplate = { |
1789 | /* name = */ MACH_PORT_NULL, |
1790 | /* pad1 = */ 0, |
1791 | /* pad2 = */ 0, |
1792 | /* disp = */ 19, |
1793 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
1794 | }; |
1795 | #endif /* UseStaticTemplates */ |
1796 | |
1797 | #endif /* __MigKernelSpecificCode */ |
1798 | kern_return_t RetCode; |
1799 | mach_msg_type_number_t masksCnt; |
1800 | exception_handler_t old_handlers[32]; |
1801 | exception_behavior_t old_behaviors[32]; |
1802 | thread_state_flavor_t old_flavors[32]; |
1803 | |
1804 | __DeclareRcvRpc(415, "host_get_exception_ports" ) |
1805 | __BeforeRcvRpc(415, "host_get_exception_ports" ) |
1806 | |
1807 | #if defined(__MIG_check__Request__host_get_exception_ports_t__defined) |
1808 | check_result = __MIG_check__Request__host_get_exception_ports_t((__Request *)In0P); |
1809 | if (check_result != MACH_MSG_SUCCESS) |
1810 | { MIG_RETURN_ERROR(OutP, check_result); } |
1811 | #endif /* defined(__MIG_check__Request__host_get_exception_ports_t__defined) */ |
1812 | |
1813 | { |
1814 | register mach_msg_port_descriptor_t *ptr; |
1815 | register int i; |
1816 | |
1817 | ptr = &OutP->old_handlers[0]; |
1818 | for (i = 0; i < 32; ptr++, i++) { |
1819 | #if UseStaticTemplates |
1820 | *ptr = old_handlersTemplate; |
1821 | #else /* UseStaticTemplates */ |
1822 | ptr->name = MACH_PORT_NULL; |
1823 | #if __MigKernelSpecificCode |
1824 | ptr->disposition = 17; |
1825 | #else |
1826 | ptr->disposition = 19; |
1827 | #endif /* __MigKernelSpecificCode */ |
1828 | #if !(defined(KERNEL) && defined(__LP64__)) |
1829 | ptr->pad1 = 0; |
1830 | #endif |
1831 | ptr->pad2 = 0; |
1832 | ptr->type = MACH_MSG_PORT_DESCRIPTOR; |
1833 | #if defined(KERNEL) |
1834 | ptr->pad_end = 0; |
1835 | #endif |
1836 | #endif /* UseStaticTemplates */ |
1837 | } |
1838 | } |
1839 | |
1840 | |
1841 | masksCnt = 32; |
1842 | |
1843 | RetCode = host_get_exception_ports(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->exception_mask, OutP->masks, &masksCnt, old_handlers, old_behaviors, old_flavors); |
1844 | if (RetCode != KERN_SUCCESS) { |
1845 | MIG_RETURN_ERROR(OutP, RetCode); |
1846 | } |
1847 | #if __MigKernelSpecificCode |
1848 | #endif /* __MigKernelSpecificCode */ |
1849 | { |
1850 | register mach_msg_port_descriptor_t *ptr; |
1851 | register int i, j; |
1852 | |
1853 | ptr = &OutP->old_handlers[0]; |
1854 | j = min(32, masksCnt); |
1855 | for (i = 0; i < j; ptr++, i++) { |
1856 | ptr->name = old_handlers[i]; |
1857 | } |
1858 | } |
1859 | |
1860 | |
1861 | OutP->NDR = NDR_record; |
1862 | |
1863 | OutP->masksCnt = masksCnt; |
1864 | msgh_size_delta = ((4 * masksCnt)); |
1865 | msgh_size = (mach_msg_size_t)(sizeof(Reply) - 384) + msgh_size_delta; |
1866 | OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); |
1867 | (void)memcpy((char *) OutP->old_behaviors, (const char *) old_behaviors, 4 * masksCnt); |
1868 | msgh_size_delta = ((4 * masksCnt)); |
1869 | msgh_size += msgh_size_delta; |
1870 | OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); |
1871 | (void)memcpy((char *) OutP->old_flavors, (const char *) old_flavors, 4 * masksCnt); |
1872 | msgh_size += ((4 * masksCnt)); |
1873 | |
1874 | OutP = (Reply *) OutHeadP; |
1875 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
1876 | OutP->Head.msgh_size = msgh_size; |
1877 | OutP->msgh_body.msgh_descriptor_count = 32; |
1878 | __AfterRcvRpc(415, "host_get_exception_ports" ) |
1879 | } |
1880 | |
1881 | #if ( __MigTypeCheck ) |
1882 | #if __MIG_check__Request__host_priv_subsystem__ |
1883 | #if !defined(__MIG_check__Request__host_swap_exception_ports_t__defined) |
1884 | #define __MIG_check__Request__host_swap_exception_ports_t__defined |
1885 | |
1886 | mig_internal kern_return_t __MIG_check__Request__host_swap_exception_ports_t(__attribute__((__unused__)) __Request__host_swap_exception_ports_t *In0P) |
1887 | { |
1888 | |
1889 | typedef __Request__host_swap_exception_ports_t __Request; |
1890 | #if __MigTypeCheck |
1891 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
1892 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
1893 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
1894 | return MIG_BAD_ARGUMENTS; |
1895 | #endif /* __MigTypeCheck */ |
1896 | |
1897 | #if __MigTypeCheck |
1898 | if (In0P->new_port.type != MACH_MSG_PORT_DESCRIPTOR || |
1899 | In0P->new_port.disposition != 17) |
1900 | return MIG_TYPE_ERROR; |
1901 | #endif /* __MigTypeCheck */ |
1902 | |
1903 | return MACH_MSG_SUCCESS; |
1904 | } |
1905 | #endif /* !defined(__MIG_check__Request__host_swap_exception_ports_t__defined) */ |
1906 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
1907 | #endif /* ( __MigTypeCheck ) */ |
1908 | |
1909 | |
1910 | /* Routine host_swap_exception_ports */ |
1911 | mig_internal novalue _Xhost_swap_exception_ports |
1912 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1913 | { |
1914 | |
1915 | #ifdef __MigPackStructs |
1916 | #pragma pack(4) |
1917 | #endif |
1918 | typedef struct { |
1919 | mach_msg_header_t Head; |
1920 | /* start of the kernel processed data */ |
1921 | mach_msg_body_t msgh_body; |
1922 | mach_msg_port_descriptor_t new_port; |
1923 | /* end of the kernel processed data */ |
1924 | NDR_record_t NDR; |
1925 | exception_mask_t exception_mask; |
1926 | exception_behavior_t behavior; |
1927 | thread_state_flavor_t new_flavor; |
1928 | mach_msg_trailer_t trailer; |
1929 | } Request __attribute__((unused)); |
1930 | #ifdef __MigPackStructs |
1931 | #pragma pack() |
1932 | #endif |
1933 | typedef __Request__host_swap_exception_ports_t __Request; |
1934 | typedef __Reply__host_swap_exception_ports_t Reply __attribute__((unused)); |
1935 | |
1936 | /* |
1937 | * typedef struct { |
1938 | * mach_msg_header_t Head; |
1939 | * NDR_record_t NDR; |
1940 | * kern_return_t RetCode; |
1941 | * } mig_reply_error_t; |
1942 | */ |
1943 | |
1944 | Request *In0P = (Request *) InHeadP; |
1945 | Reply *OutP = (Reply *) OutHeadP; |
1946 | unsigned int msgh_size; |
1947 | unsigned int msgh_size_delta; |
1948 | |
1949 | #ifdef __MIG_check__Request__host_swap_exception_ports_t__defined |
1950 | kern_return_t check_result; |
1951 | #endif /* __MIG_check__Request__host_swap_exception_ports_t__defined */ |
1952 | |
1953 | #if __MigKernelSpecificCode |
1954 | #if UseStaticTemplates |
1955 | const static mach_msg_port_descriptor_t old_handlerssTemplate = { |
1956 | /* name = */ MACH_PORT_NULL, |
1957 | /* pad1 = */ 0, |
1958 | /* pad2 = */ 0, |
1959 | /* disp = */ 17, |
1960 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
1961 | }; |
1962 | #endif /* UseStaticTemplates */ |
1963 | |
1964 | #else |
1965 | #if UseStaticTemplates |
1966 | const static mach_msg_port_descriptor_t old_handlerssTemplate = { |
1967 | /* name = */ MACH_PORT_NULL, |
1968 | /* pad1 = */ 0, |
1969 | /* pad2 = */ 0, |
1970 | /* disp = */ 19, |
1971 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
1972 | }; |
1973 | #endif /* UseStaticTemplates */ |
1974 | |
1975 | #endif /* __MigKernelSpecificCode */ |
1976 | kern_return_t RetCode; |
1977 | mach_msg_type_number_t masksCnt; |
1978 | exception_handler_t old_handlerss[32]; |
1979 | exception_behavior_t old_behaviors[32]; |
1980 | thread_state_flavor_t old_flavors[32]; |
1981 | |
1982 | __DeclareRcvRpc(416, "host_swap_exception_ports" ) |
1983 | __BeforeRcvRpc(416, "host_swap_exception_ports" ) |
1984 | |
1985 | #if defined(__MIG_check__Request__host_swap_exception_ports_t__defined) |
1986 | check_result = __MIG_check__Request__host_swap_exception_ports_t((__Request *)In0P); |
1987 | if (check_result != MACH_MSG_SUCCESS) |
1988 | { MIG_RETURN_ERROR(OutP, check_result); } |
1989 | #endif /* defined(__MIG_check__Request__host_swap_exception_ports_t__defined) */ |
1990 | |
1991 | { |
1992 | register mach_msg_port_descriptor_t *ptr; |
1993 | register int i; |
1994 | |
1995 | ptr = &OutP->old_handlerss[0]; |
1996 | for (i = 0; i < 32; ptr++, i++) { |
1997 | #if UseStaticTemplates |
1998 | *ptr = old_handlerssTemplate; |
1999 | #else /* UseStaticTemplates */ |
2000 | ptr->name = MACH_PORT_NULL; |
2001 | #if __MigKernelSpecificCode |
2002 | ptr->disposition = 17; |
2003 | #else |
2004 | ptr->disposition = 19; |
2005 | #endif /* __MigKernelSpecificCode */ |
2006 | #if !(defined(KERNEL) && defined(__LP64__)) |
2007 | ptr->pad1 = 0; |
2008 | #endif |
2009 | ptr->pad2 = 0; |
2010 | ptr->type = MACH_MSG_PORT_DESCRIPTOR; |
2011 | #if defined(KERNEL) |
2012 | ptr->pad_end = 0; |
2013 | #endif |
2014 | #endif /* UseStaticTemplates */ |
2015 | } |
2016 | } |
2017 | |
2018 | |
2019 | masksCnt = 32; |
2020 | |
2021 | RetCode = host_swap_exception_ports(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->exception_mask, In0P->new_port.name, In0P->behavior, In0P->new_flavor, OutP->masks, &masksCnt, old_handlerss, old_behaviors, old_flavors); |
2022 | if (RetCode != KERN_SUCCESS) { |
2023 | MIG_RETURN_ERROR(OutP, RetCode); |
2024 | } |
2025 | #if __MigKernelSpecificCode |
2026 | #endif /* __MigKernelSpecificCode */ |
2027 | { |
2028 | register mach_msg_port_descriptor_t *ptr; |
2029 | register int i, j; |
2030 | |
2031 | ptr = &OutP->old_handlerss[0]; |
2032 | j = min(32, masksCnt); |
2033 | for (i = 0; i < j; ptr++, i++) { |
2034 | ptr->name = old_handlerss[i]; |
2035 | } |
2036 | } |
2037 | |
2038 | |
2039 | OutP->NDR = NDR_record; |
2040 | |
2041 | OutP->masksCnt = masksCnt; |
2042 | msgh_size_delta = ((4 * masksCnt)); |
2043 | msgh_size = (mach_msg_size_t)(sizeof(Reply) - 384) + msgh_size_delta; |
2044 | OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); |
2045 | (void)memcpy((char *) OutP->old_behaviors, (const char *) old_behaviors, 4 * masksCnt); |
2046 | msgh_size_delta = ((4 * masksCnt)); |
2047 | msgh_size += msgh_size_delta; |
2048 | OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); |
2049 | (void)memcpy((char *) OutP->old_flavors, (const char *) old_flavors, 4 * masksCnt); |
2050 | msgh_size += ((4 * masksCnt)); |
2051 | |
2052 | OutP = (Reply *) OutHeadP; |
2053 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
2054 | OutP->Head.msgh_size = msgh_size; |
2055 | OutP->msgh_body.msgh_descriptor_count = 32; |
2056 | __AfterRcvRpc(416, "host_swap_exception_ports" ) |
2057 | } |
2058 | |
2059 | #if ( __MigTypeCheck ) |
2060 | #if __MIG_check__Request__host_priv_subsystem__ |
2061 | #if !defined(__MIG_check__Request__mach_vm_wire_external_t__defined) |
2062 | #define __MIG_check__Request__mach_vm_wire_external_t__defined |
2063 | |
2064 | mig_internal kern_return_t __MIG_check__Request__mach_vm_wire_external_t(__attribute__((__unused__)) __Request__mach_vm_wire_external_t *In0P) |
2065 | { |
2066 | |
2067 | typedef __Request__mach_vm_wire_external_t __Request; |
2068 | #if __MigTypeCheck |
2069 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
2070 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
2071 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
2072 | return MIG_BAD_ARGUMENTS; |
2073 | #endif /* __MigTypeCheck */ |
2074 | |
2075 | #if __MigTypeCheck |
2076 | if (In0P->task.type != MACH_MSG_PORT_DESCRIPTOR || |
2077 | In0P->task.disposition != 17) |
2078 | return MIG_TYPE_ERROR; |
2079 | #endif /* __MigTypeCheck */ |
2080 | |
2081 | return MACH_MSG_SUCCESS; |
2082 | } |
2083 | #endif /* !defined(__MIG_check__Request__mach_vm_wire_external_t__defined) */ |
2084 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
2085 | #endif /* ( __MigTypeCheck ) */ |
2086 | |
2087 | |
2088 | /* Routine mach_vm_wire_external */ |
2089 | mig_internal novalue _Xmach_vm_wire_external |
2090 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2091 | { |
2092 | |
2093 | #ifdef __MigPackStructs |
2094 | #pragma pack(4) |
2095 | #endif |
2096 | typedef struct { |
2097 | mach_msg_header_t Head; |
2098 | /* start of the kernel processed data */ |
2099 | mach_msg_body_t msgh_body; |
2100 | mach_msg_port_descriptor_t task; |
2101 | /* end of the kernel processed data */ |
2102 | NDR_record_t NDR; |
2103 | mach_vm_address_t address; |
2104 | mach_vm_size_t size; |
2105 | vm_prot_t desired_access; |
2106 | mach_msg_trailer_t trailer; |
2107 | } Request __attribute__((unused)); |
2108 | #ifdef __MigPackStructs |
2109 | #pragma pack() |
2110 | #endif |
2111 | typedef __Request__mach_vm_wire_external_t __Request; |
2112 | typedef __Reply__mach_vm_wire_external_t Reply __attribute__((unused)); |
2113 | |
2114 | /* |
2115 | * typedef struct { |
2116 | * mach_msg_header_t Head; |
2117 | * NDR_record_t NDR; |
2118 | * kern_return_t RetCode; |
2119 | * } mig_reply_error_t; |
2120 | */ |
2121 | |
2122 | Request *In0P = (Request *) InHeadP; |
2123 | Reply *OutP = (Reply *) OutHeadP; |
2124 | #ifdef __MIG_check__Request__mach_vm_wire_external_t__defined |
2125 | kern_return_t check_result; |
2126 | #endif /* __MIG_check__Request__mach_vm_wire_external_t__defined */ |
2127 | |
2128 | #if __MigKernelSpecificCode |
2129 | #else |
2130 | #endif /* __MigKernelSpecificCode */ |
2131 | vm_map_t task; |
2132 | |
2133 | __DeclareRcvRpc(418, "mach_vm_wire_external" ) |
2134 | __BeforeRcvRpc(418, "mach_vm_wire_external" ) |
2135 | |
2136 | #if defined(__MIG_check__Request__mach_vm_wire_external_t__defined) |
2137 | check_result = __MIG_check__Request__mach_vm_wire_external_t((__Request *)In0P); |
2138 | if (check_result != MACH_MSG_SUCCESS) |
2139 | { MIG_RETURN_ERROR(OutP, check_result); } |
2140 | #endif /* defined(__MIG_check__Request__mach_vm_wire_external_t__defined) */ |
2141 | |
2142 | task = convert_port_to_map(In0P->task.name); |
2143 | |
2144 | OutP->RetCode = mach_vm_wire_external(convert_port_to_host_priv(In0P->Head.msgh_request_port), task, In0P->address, In0P->size, In0P->desired_access); |
2145 | vm_map_deallocate(task); |
2146 | #if __MigKernelSpecificCode |
2147 | if (OutP->RetCode != KERN_SUCCESS) { |
2148 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
2149 | } |
2150 | |
2151 | if (IP_VALID((ipc_port_t)In0P->task.name)) |
2152 | ipc_port_release_send((ipc_port_t)In0P->task.name); |
2153 | #endif /* __MigKernelSpecificCode */ |
2154 | |
2155 | OutP->NDR = NDR_record; |
2156 | |
2157 | |
2158 | __AfterRcvRpc(418, "mach_vm_wire_external" ) |
2159 | } |
2160 | |
2161 | #if ( __MigTypeCheck ) |
2162 | #if __MIG_check__Request__host_priv_subsystem__ |
2163 | #if !defined(__MIG_check__Request__host_processor_sets_t__defined) |
2164 | #define __MIG_check__Request__host_processor_sets_t__defined |
2165 | |
2166 | mig_internal kern_return_t __MIG_check__Request__host_processor_sets_t(__attribute__((__unused__)) __Request__host_processor_sets_t *In0P) |
2167 | { |
2168 | |
2169 | typedef __Request__host_processor_sets_t __Request; |
2170 | #if __MigTypeCheck |
2171 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
2172 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
2173 | return MIG_BAD_ARGUMENTS; |
2174 | #endif /* __MigTypeCheck */ |
2175 | |
2176 | return MACH_MSG_SUCCESS; |
2177 | } |
2178 | #endif /* !defined(__MIG_check__Request__host_processor_sets_t__defined) */ |
2179 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
2180 | #endif /* ( __MigTypeCheck ) */ |
2181 | |
2182 | |
2183 | /* Routine host_processor_sets */ |
2184 | mig_internal novalue _Xhost_processor_sets |
2185 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2186 | { |
2187 | |
2188 | #ifdef __MigPackStructs |
2189 | #pragma pack(4) |
2190 | #endif |
2191 | typedef struct { |
2192 | mach_msg_header_t Head; |
2193 | mach_msg_trailer_t trailer; |
2194 | } Request __attribute__((unused)); |
2195 | #ifdef __MigPackStructs |
2196 | #pragma pack() |
2197 | #endif |
2198 | typedef __Request__host_processor_sets_t __Request; |
2199 | typedef __Reply__host_processor_sets_t Reply __attribute__((unused)); |
2200 | |
2201 | /* |
2202 | * typedef struct { |
2203 | * mach_msg_header_t Head; |
2204 | * NDR_record_t NDR; |
2205 | * kern_return_t RetCode; |
2206 | * } mig_reply_error_t; |
2207 | */ |
2208 | |
2209 | Request *In0P = (Request *) InHeadP; |
2210 | Reply *OutP = (Reply *) OutHeadP; |
2211 | #ifdef __MIG_check__Request__host_processor_sets_t__defined |
2212 | kern_return_t check_result; |
2213 | #endif /* __MIG_check__Request__host_processor_sets_t__defined */ |
2214 | |
2215 | #if __MigKernelSpecificCode |
2216 | #if UseStaticTemplates |
2217 | const static mach_msg_ool_ports_descriptor_t processor_setsTemplate = { |
2218 | /* addr = */ (void *)0, |
2219 | /* coun = */ 0, |
2220 | /* deal = */ FALSE, |
2221 | /* copy is meaningful only in overwrite mode */ |
2222 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
2223 | /* disp = */ 17, |
2224 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
2225 | }; |
2226 | #endif /* UseStaticTemplates */ |
2227 | |
2228 | #else |
2229 | #if UseStaticTemplates |
2230 | const static mach_msg_ool_ports_descriptor_t processor_setsTemplate = { |
2231 | /* addr = */ (void *)0, |
2232 | /* coun = */ 0, |
2233 | /* deal = */ FALSE, |
2234 | /* copy is meaningful only in overwrite mode */ |
2235 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
2236 | /* disp = */ 19, |
2237 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
2238 | }; |
2239 | #endif /* UseStaticTemplates */ |
2240 | |
2241 | #endif /* __MigKernelSpecificCode */ |
2242 | kern_return_t RetCode; |
2243 | __DeclareRcvRpc(419, "host_processor_sets" ) |
2244 | __BeforeRcvRpc(419, "host_processor_sets" ) |
2245 | |
2246 | #if defined(__MIG_check__Request__host_processor_sets_t__defined) |
2247 | check_result = __MIG_check__Request__host_processor_sets_t((__Request *)In0P); |
2248 | if (check_result != MACH_MSG_SUCCESS) |
2249 | { MIG_RETURN_ERROR(OutP, check_result); } |
2250 | #endif /* defined(__MIG_check__Request__host_processor_sets_t__defined) */ |
2251 | |
2252 | #if UseStaticTemplates |
2253 | OutP->processor_sets = processor_setsTemplate; |
2254 | #else /* UseStaticTemplates */ |
2255 | #if __MigKernelSpecificCode |
2256 | OutP->processor_sets.disposition = 17; |
2257 | #else |
2258 | OutP->processor_sets.disposition = 19; |
2259 | #endif /* __MigKernelSpecificCode */ |
2260 | OutP->processor_sets.deallocate = FALSE; |
2261 | OutP->processor_sets.type = MACH_MSG_OOL_PORTS_DESCRIPTOR; |
2262 | #endif /* UseStaticTemplates */ |
2263 | |
2264 | |
2265 | RetCode = host_processor_sets(convert_port_to_host_priv(In0P->Head.msgh_request_port), (processor_set_name_array_t *)&(OutP->processor_sets.address), &OutP->processor_setsCnt); |
2266 | if (RetCode != KERN_SUCCESS) { |
2267 | MIG_RETURN_ERROR(OutP, RetCode); |
2268 | } |
2269 | #if __MigKernelSpecificCode |
2270 | #endif /* __MigKernelSpecificCode */ |
2271 | OutP->processor_sets.count = OutP->processor_setsCnt; |
2272 | |
2273 | |
2274 | OutP->NDR = NDR_record; |
2275 | |
2276 | |
2277 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
2278 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
2279 | OutP->msgh_body.msgh_descriptor_count = 1; |
2280 | __AfterRcvRpc(419, "host_processor_sets" ) |
2281 | } |
2282 | |
2283 | #if ( __MigTypeCheck ) |
2284 | #if __MIG_check__Request__host_priv_subsystem__ |
2285 | #if !defined(__MIG_check__Request__host_processor_set_priv_t__defined) |
2286 | #define __MIG_check__Request__host_processor_set_priv_t__defined |
2287 | |
2288 | mig_internal kern_return_t __MIG_check__Request__host_processor_set_priv_t(__attribute__((__unused__)) __Request__host_processor_set_priv_t *In0P) |
2289 | { |
2290 | |
2291 | typedef __Request__host_processor_set_priv_t __Request; |
2292 | #if __MigTypeCheck |
2293 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
2294 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
2295 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
2296 | return MIG_BAD_ARGUMENTS; |
2297 | #endif /* __MigTypeCheck */ |
2298 | |
2299 | #if __MigTypeCheck |
2300 | if (In0P->set_name.type != MACH_MSG_PORT_DESCRIPTOR || |
2301 | In0P->set_name.disposition != 17) |
2302 | return MIG_TYPE_ERROR; |
2303 | #endif /* __MigTypeCheck */ |
2304 | |
2305 | return MACH_MSG_SUCCESS; |
2306 | } |
2307 | #endif /* !defined(__MIG_check__Request__host_processor_set_priv_t__defined) */ |
2308 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
2309 | #endif /* ( __MigTypeCheck ) */ |
2310 | |
2311 | |
2312 | /* Routine host_processor_set_priv */ |
2313 | mig_internal novalue _Xhost_processor_set_priv |
2314 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2315 | { |
2316 | |
2317 | #ifdef __MigPackStructs |
2318 | #pragma pack(4) |
2319 | #endif |
2320 | typedef struct { |
2321 | mach_msg_header_t Head; |
2322 | /* start of the kernel processed data */ |
2323 | mach_msg_body_t msgh_body; |
2324 | mach_msg_port_descriptor_t set_name; |
2325 | /* end of the kernel processed data */ |
2326 | mach_msg_trailer_t trailer; |
2327 | } Request __attribute__((unused)); |
2328 | #ifdef __MigPackStructs |
2329 | #pragma pack() |
2330 | #endif |
2331 | typedef __Request__host_processor_set_priv_t __Request; |
2332 | typedef __Reply__host_processor_set_priv_t Reply __attribute__((unused)); |
2333 | |
2334 | /* |
2335 | * typedef struct { |
2336 | * mach_msg_header_t Head; |
2337 | * NDR_record_t NDR; |
2338 | * kern_return_t RetCode; |
2339 | * } mig_reply_error_t; |
2340 | */ |
2341 | |
2342 | Request *In0P = (Request *) InHeadP; |
2343 | Reply *OutP = (Reply *) OutHeadP; |
2344 | #ifdef __MIG_check__Request__host_processor_set_priv_t__defined |
2345 | kern_return_t check_result; |
2346 | #endif /* __MIG_check__Request__host_processor_set_priv_t__defined */ |
2347 | |
2348 | #if __MigKernelSpecificCode |
2349 | #if UseStaticTemplates |
2350 | const static mach_msg_port_descriptor_t setTemplate = { |
2351 | /* name = */ MACH_PORT_NULL, |
2352 | /* pad1 = */ 0, |
2353 | /* pad2 = */ 0, |
2354 | /* disp = */ 17, |
2355 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
2356 | }; |
2357 | #endif /* UseStaticTemplates */ |
2358 | |
2359 | #else |
2360 | #if UseStaticTemplates |
2361 | const static mach_msg_port_descriptor_t setTemplate = { |
2362 | /* name = */ MACH_PORT_NULL, |
2363 | /* pad1 = */ 0, |
2364 | /* pad2 = */ 0, |
2365 | /* disp = */ 19, |
2366 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
2367 | }; |
2368 | #endif /* UseStaticTemplates */ |
2369 | |
2370 | #endif /* __MigKernelSpecificCode */ |
2371 | kern_return_t RetCode; |
2372 | processor_set_name_t set_name; |
2373 | processor_set_t set; |
2374 | |
2375 | __DeclareRcvRpc(420, "host_processor_set_priv" ) |
2376 | __BeforeRcvRpc(420, "host_processor_set_priv" ) |
2377 | |
2378 | #if defined(__MIG_check__Request__host_processor_set_priv_t__defined) |
2379 | check_result = __MIG_check__Request__host_processor_set_priv_t((__Request *)In0P); |
2380 | if (check_result != MACH_MSG_SUCCESS) |
2381 | { MIG_RETURN_ERROR(OutP, check_result); } |
2382 | #endif /* defined(__MIG_check__Request__host_processor_set_priv_t__defined) */ |
2383 | |
2384 | #if UseStaticTemplates |
2385 | OutP->set = setTemplate; |
2386 | #else /* UseStaticTemplates */ |
2387 | #if __MigKernelSpecificCode |
2388 | OutP->set.disposition = 17; |
2389 | #else |
2390 | OutP->set.disposition = 19; |
2391 | #endif /* __MigKernelSpecificCode */ |
2392 | #if !(defined(KERNEL) && defined(__LP64__)) |
2393 | OutP->set.pad1 = 0; |
2394 | #endif |
2395 | OutP->set.pad2 = 0; |
2396 | OutP->set.type = MACH_MSG_PORT_DESCRIPTOR; |
2397 | #if defined(KERNEL) |
2398 | OutP->set.pad_end = 0; |
2399 | #endif |
2400 | #endif /* UseStaticTemplates */ |
2401 | |
2402 | |
2403 | set_name = convert_port_to_pset_name(In0P->set_name.name); |
2404 | |
2405 | RetCode = host_processor_set_priv(convert_port_to_host_priv(In0P->Head.msgh_request_port), set_name, &set); |
2406 | pset_deallocate(set_name); |
2407 | if (RetCode != KERN_SUCCESS) { |
2408 | MIG_RETURN_ERROR(OutP, RetCode); |
2409 | } |
2410 | #if __MigKernelSpecificCode |
2411 | |
2412 | if (IP_VALID((ipc_port_t)In0P->set_name.name)) |
2413 | ipc_port_release_send((ipc_port_t)In0P->set_name.name); |
2414 | #endif /* __MigKernelSpecificCode */ |
2415 | OutP->set.name = (mach_port_t)convert_pset_to_port(set); |
2416 | |
2417 | |
2418 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
2419 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
2420 | OutP->msgh_body.msgh_descriptor_count = 1; |
2421 | __AfterRcvRpc(420, "host_processor_set_priv" ) |
2422 | } |
2423 | |
2424 | #if ( __MigTypeCheck ) |
2425 | #if __MIG_check__Request__host_priv_subsystem__ |
2426 | #if !defined(__MIG_check__Request__host_set_UNDServer_t__defined) |
2427 | #define __MIG_check__Request__host_set_UNDServer_t__defined |
2428 | |
2429 | mig_internal kern_return_t __MIG_check__Request__host_set_UNDServer_t(__attribute__((__unused__)) __Request__host_set_UNDServer_t *In0P) |
2430 | { |
2431 | |
2432 | typedef __Request__host_set_UNDServer_t __Request; |
2433 | #if __MigTypeCheck |
2434 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
2435 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
2436 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
2437 | return MIG_BAD_ARGUMENTS; |
2438 | #endif /* __MigTypeCheck */ |
2439 | |
2440 | #if __MigTypeCheck |
2441 | if (In0P->server.type != MACH_MSG_PORT_DESCRIPTOR || |
2442 | In0P->server.disposition != 17) |
2443 | return MIG_TYPE_ERROR; |
2444 | #endif /* __MigTypeCheck */ |
2445 | |
2446 | return MACH_MSG_SUCCESS; |
2447 | } |
2448 | #endif /* !defined(__MIG_check__Request__host_set_UNDServer_t__defined) */ |
2449 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
2450 | #endif /* ( __MigTypeCheck ) */ |
2451 | |
2452 | |
2453 | /* Routine host_set_UNDServer */ |
2454 | mig_internal novalue _Xhost_set_UNDServer |
2455 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2456 | { |
2457 | |
2458 | #ifdef __MigPackStructs |
2459 | #pragma pack(4) |
2460 | #endif |
2461 | typedef struct { |
2462 | mach_msg_header_t Head; |
2463 | /* start of the kernel processed data */ |
2464 | mach_msg_body_t msgh_body; |
2465 | mach_msg_port_descriptor_t server; |
2466 | /* end of the kernel processed data */ |
2467 | mach_msg_trailer_t trailer; |
2468 | } Request __attribute__((unused)); |
2469 | #ifdef __MigPackStructs |
2470 | #pragma pack() |
2471 | #endif |
2472 | typedef __Request__host_set_UNDServer_t __Request; |
2473 | typedef __Reply__host_set_UNDServer_t Reply __attribute__((unused)); |
2474 | |
2475 | /* |
2476 | * typedef struct { |
2477 | * mach_msg_header_t Head; |
2478 | * NDR_record_t NDR; |
2479 | * kern_return_t RetCode; |
2480 | * } mig_reply_error_t; |
2481 | */ |
2482 | |
2483 | Request *In0P = (Request *) InHeadP; |
2484 | Reply *OutP = (Reply *) OutHeadP; |
2485 | #ifdef __MIG_check__Request__host_set_UNDServer_t__defined |
2486 | kern_return_t check_result; |
2487 | #endif /* __MIG_check__Request__host_set_UNDServer_t__defined */ |
2488 | |
2489 | #if __MigKernelSpecificCode |
2490 | #else |
2491 | #endif /* __MigKernelSpecificCode */ |
2492 | __DeclareRcvRpc(423, "host_set_UNDServer" ) |
2493 | __BeforeRcvRpc(423, "host_set_UNDServer" ) |
2494 | |
2495 | #if defined(__MIG_check__Request__host_set_UNDServer_t__defined) |
2496 | check_result = __MIG_check__Request__host_set_UNDServer_t((__Request *)In0P); |
2497 | if (check_result != MACH_MSG_SUCCESS) |
2498 | { MIG_RETURN_ERROR(OutP, check_result); } |
2499 | #endif /* defined(__MIG_check__Request__host_set_UNDServer_t__defined) */ |
2500 | |
2501 | OutP->RetCode = host_set_UNDServer(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->server.name); |
2502 | #if __MigKernelSpecificCode |
2503 | #endif /* __MigKernelSpecificCode */ |
2504 | |
2505 | OutP->NDR = NDR_record; |
2506 | |
2507 | |
2508 | __AfterRcvRpc(423, "host_set_UNDServer" ) |
2509 | } |
2510 | |
2511 | #if ( __MigTypeCheck ) |
2512 | #if __MIG_check__Request__host_priv_subsystem__ |
2513 | #if !defined(__MIG_check__Request__host_get_UNDServer_t__defined) |
2514 | #define __MIG_check__Request__host_get_UNDServer_t__defined |
2515 | |
2516 | mig_internal kern_return_t __MIG_check__Request__host_get_UNDServer_t(__attribute__((__unused__)) __Request__host_get_UNDServer_t *In0P) |
2517 | { |
2518 | |
2519 | typedef __Request__host_get_UNDServer_t __Request; |
2520 | #if __MigTypeCheck |
2521 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
2522 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
2523 | return MIG_BAD_ARGUMENTS; |
2524 | #endif /* __MigTypeCheck */ |
2525 | |
2526 | return MACH_MSG_SUCCESS; |
2527 | } |
2528 | #endif /* !defined(__MIG_check__Request__host_get_UNDServer_t__defined) */ |
2529 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
2530 | #endif /* ( __MigTypeCheck ) */ |
2531 | |
2532 | |
2533 | /* Routine host_get_UNDServer */ |
2534 | mig_internal novalue _Xhost_get_UNDServer |
2535 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2536 | { |
2537 | |
2538 | #ifdef __MigPackStructs |
2539 | #pragma pack(4) |
2540 | #endif |
2541 | typedef struct { |
2542 | mach_msg_header_t Head; |
2543 | mach_msg_trailer_t trailer; |
2544 | } Request __attribute__((unused)); |
2545 | #ifdef __MigPackStructs |
2546 | #pragma pack() |
2547 | #endif |
2548 | typedef __Request__host_get_UNDServer_t __Request; |
2549 | typedef __Reply__host_get_UNDServer_t Reply __attribute__((unused)); |
2550 | |
2551 | /* |
2552 | * typedef struct { |
2553 | * mach_msg_header_t Head; |
2554 | * NDR_record_t NDR; |
2555 | * kern_return_t RetCode; |
2556 | * } mig_reply_error_t; |
2557 | */ |
2558 | |
2559 | Request *In0P = (Request *) InHeadP; |
2560 | Reply *OutP = (Reply *) OutHeadP; |
2561 | #ifdef __MIG_check__Request__host_get_UNDServer_t__defined |
2562 | kern_return_t check_result; |
2563 | #endif /* __MIG_check__Request__host_get_UNDServer_t__defined */ |
2564 | |
2565 | #if __MigKernelSpecificCode |
2566 | #if UseStaticTemplates |
2567 | const static mach_msg_port_descriptor_t serverTemplate = { |
2568 | /* name = */ MACH_PORT_NULL, |
2569 | /* pad1 = */ 0, |
2570 | /* pad2 = */ 0, |
2571 | /* disp = */ 17, |
2572 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
2573 | }; |
2574 | #endif /* UseStaticTemplates */ |
2575 | |
2576 | #else |
2577 | #if UseStaticTemplates |
2578 | const static mach_msg_port_descriptor_t serverTemplate = { |
2579 | /* name = */ MACH_PORT_NULL, |
2580 | /* pad1 = */ 0, |
2581 | /* pad2 = */ 0, |
2582 | /* disp = */ 19, |
2583 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
2584 | }; |
2585 | #endif /* UseStaticTemplates */ |
2586 | |
2587 | #endif /* __MigKernelSpecificCode */ |
2588 | kern_return_t RetCode; |
2589 | __DeclareRcvRpc(424, "host_get_UNDServer" ) |
2590 | __BeforeRcvRpc(424, "host_get_UNDServer" ) |
2591 | |
2592 | #if defined(__MIG_check__Request__host_get_UNDServer_t__defined) |
2593 | check_result = __MIG_check__Request__host_get_UNDServer_t((__Request *)In0P); |
2594 | if (check_result != MACH_MSG_SUCCESS) |
2595 | { MIG_RETURN_ERROR(OutP, check_result); } |
2596 | #endif /* defined(__MIG_check__Request__host_get_UNDServer_t__defined) */ |
2597 | |
2598 | #if UseStaticTemplates |
2599 | OutP->server = serverTemplate; |
2600 | #else /* UseStaticTemplates */ |
2601 | #if __MigKernelSpecificCode |
2602 | OutP->server.disposition = 17; |
2603 | #else |
2604 | OutP->server.disposition = 19; |
2605 | #endif /* __MigKernelSpecificCode */ |
2606 | #if !(defined(KERNEL) && defined(__LP64__)) |
2607 | OutP->server.pad1 = 0; |
2608 | #endif |
2609 | OutP->server.pad2 = 0; |
2610 | OutP->server.type = MACH_MSG_PORT_DESCRIPTOR; |
2611 | #if defined(KERNEL) |
2612 | OutP->server.pad_end = 0; |
2613 | #endif |
2614 | #endif /* UseStaticTemplates */ |
2615 | |
2616 | |
2617 | RetCode = host_get_UNDServer(convert_port_to_host_priv(In0P->Head.msgh_request_port), &OutP->server.name); |
2618 | if (RetCode != KERN_SUCCESS) { |
2619 | MIG_RETURN_ERROR(OutP, RetCode); |
2620 | } |
2621 | #if __MigKernelSpecificCode |
2622 | #endif /* __MigKernelSpecificCode */ |
2623 | |
2624 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
2625 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
2626 | OutP->msgh_body.msgh_descriptor_count = 1; |
2627 | __AfterRcvRpc(424, "host_get_UNDServer" ) |
2628 | } |
2629 | |
2630 | #if ( __MigTypeCheck ) |
2631 | #if __MIG_check__Request__host_priv_subsystem__ |
2632 | #if !defined(__MIG_check__Request__kext_request_t__defined) |
2633 | #define __MIG_check__Request__kext_request_t__defined |
2634 | |
2635 | mig_internal kern_return_t __MIG_check__Request__kext_request_t(__attribute__((__unused__)) __Request__kext_request_t *In0P) |
2636 | { |
2637 | |
2638 | typedef __Request__kext_request_t __Request; |
2639 | #if __MigTypeCheck |
2640 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
2641 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
2642 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
2643 | return MIG_BAD_ARGUMENTS; |
2644 | #endif /* __MigTypeCheck */ |
2645 | |
2646 | #if __MigTypeCheck |
2647 | if (In0P->request_data.type != MACH_MSG_OOL_DESCRIPTOR) |
2648 | return MIG_TYPE_ERROR; |
2649 | #endif /* __MigTypeCheck */ |
2650 | |
2651 | #if __MigTypeCheck |
2652 | if (In0P->request_data.size != In0P->request_dataCnt) |
2653 | return MIG_TYPE_ERROR; |
2654 | #endif /* __MigTypeCheck */ |
2655 | |
2656 | return MACH_MSG_SUCCESS; |
2657 | } |
2658 | #endif /* !defined(__MIG_check__Request__kext_request_t__defined) */ |
2659 | #endif /* __MIG_check__Request__host_priv_subsystem__ */ |
2660 | #endif /* ( __MigTypeCheck ) */ |
2661 | |
2662 | |
2663 | /* Routine kext_request */ |
2664 | mig_internal novalue _Xkext_request |
2665 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2666 | { |
2667 | |
2668 | #ifdef __MigPackStructs |
2669 | #pragma pack(4) |
2670 | #endif |
2671 | typedef struct { |
2672 | mach_msg_header_t Head; |
2673 | /* start of the kernel processed data */ |
2674 | mach_msg_body_t msgh_body; |
2675 | mach_msg_ool_descriptor_t request_data; |
2676 | /* end of the kernel processed data */ |
2677 | NDR_record_t NDR; |
2678 | uint32_t user_log_flags; |
2679 | mach_msg_type_number_t request_dataCnt; |
2680 | mach_msg_trailer_t trailer; |
2681 | } Request __attribute__((unused)); |
2682 | #ifdef __MigPackStructs |
2683 | #pragma pack() |
2684 | #endif |
2685 | typedef __Request__kext_request_t __Request; |
2686 | typedef __Reply__kext_request_t Reply __attribute__((unused)); |
2687 | |
2688 | /* |
2689 | * typedef struct { |
2690 | * mach_msg_header_t Head; |
2691 | * NDR_record_t NDR; |
2692 | * kern_return_t RetCode; |
2693 | * } mig_reply_error_t; |
2694 | */ |
2695 | |
2696 | Request *In0P = (Request *) InHeadP; |
2697 | Reply *OutP = (Reply *) OutHeadP; |
2698 | #ifdef __MIG_check__Request__kext_request_t__defined |
2699 | kern_return_t check_result; |
2700 | #endif /* __MIG_check__Request__kext_request_t__defined */ |
2701 | |
2702 | #if __MigKernelSpecificCode |
2703 | #if UseStaticTemplates |
2704 | const static mach_msg_ool_descriptor_t response_dataTemplate = { |
2705 | /* addr = */ (void *)0, |
2706 | /* size = */ 0, |
2707 | /* deal = */ FALSE, |
2708 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
2709 | /* pad2 = */ 0, |
2710 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
2711 | }; |
2712 | #endif /* UseStaticTemplates */ |
2713 | |
2714 | #if UseStaticTemplates |
2715 | const static mach_msg_ool_descriptor_t log_dataTemplate = { |
2716 | /* addr = */ (void *)0, |
2717 | /* size = */ 0, |
2718 | /* deal = */ FALSE, |
2719 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
2720 | /* pad2 = */ 0, |
2721 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
2722 | }; |
2723 | #endif /* UseStaticTemplates */ |
2724 | |
2725 | #else |
2726 | #if UseStaticTemplates |
2727 | const static mach_msg_ool_descriptor_t response_dataTemplate = { |
2728 | /* addr = */ (void *)0, |
2729 | /* size = */ 0, |
2730 | /* deal = */ FALSE, |
2731 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
2732 | /* pad2 = */ 0, |
2733 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
2734 | }; |
2735 | #endif /* UseStaticTemplates */ |
2736 | |
2737 | #if UseStaticTemplates |
2738 | const static mach_msg_ool_descriptor_t log_dataTemplate = { |
2739 | /* addr = */ (void *)0, |
2740 | /* size = */ 0, |
2741 | /* deal = */ FALSE, |
2742 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
2743 | /* pad2 = */ 0, |
2744 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
2745 | }; |
2746 | #endif /* UseStaticTemplates */ |
2747 | |
2748 | #endif /* __MigKernelSpecificCode */ |
2749 | kern_return_t RetCode; |
2750 | __DeclareRcvRpc(425, "kext_request" ) |
2751 | __BeforeRcvRpc(425, "kext_request" ) |
2752 | |
2753 | #if defined(__MIG_check__Request__kext_request_t__defined) |
2754 | check_result = __MIG_check__Request__kext_request_t((__Request *)In0P); |
2755 | if (check_result != MACH_MSG_SUCCESS) |
2756 | { MIG_RETURN_ERROR(OutP, check_result); } |
2757 | #endif /* defined(__MIG_check__Request__kext_request_t__defined) */ |
2758 | |
2759 | #if UseStaticTemplates |
2760 | OutP->response_data = response_dataTemplate; |
2761 | #else /* UseStaticTemplates */ |
2762 | OutP->response_data.deallocate = FALSE; |
2763 | OutP->response_data.copy = MACH_MSG_VIRTUAL_COPY; |
2764 | OutP->response_data.pad1 = 0; |
2765 | OutP->response_data.type = MACH_MSG_OOL_DESCRIPTOR; |
2766 | #if defined(KERNEL) && !defined(__LP64__) |
2767 | OutP->response_data.pad_end = 0; |
2768 | #endif |
2769 | #endif /* UseStaticTemplates */ |
2770 | |
2771 | |
2772 | #if UseStaticTemplates |
2773 | OutP->log_data = log_dataTemplate; |
2774 | #else /* UseStaticTemplates */ |
2775 | OutP->log_data.deallocate = FALSE; |
2776 | OutP->log_data.copy = MACH_MSG_VIRTUAL_COPY; |
2777 | OutP->log_data.pad1 = 0; |
2778 | OutP->log_data.type = MACH_MSG_OOL_DESCRIPTOR; |
2779 | #if defined(KERNEL) && !defined(__LP64__) |
2780 | OutP->log_data.pad_end = 0; |
2781 | #endif |
2782 | #endif /* UseStaticTemplates */ |
2783 | |
2784 | |
2785 | RetCode = kext_request(convert_port_to_host_priv(In0P->Head.msgh_request_port), In0P->user_log_flags, (vm_offset_t)(In0P->request_data.address), In0P->request_data.size, (vm_offset_t *)&(OutP->response_data.address), &OutP->response_dataCnt, (vm_offset_t *)&(OutP->log_data.address), &OutP->log_dataCnt, &OutP->op_result); |
2786 | if (RetCode != KERN_SUCCESS) { |
2787 | MIG_RETURN_ERROR(OutP, RetCode); |
2788 | } |
2789 | #if __MigKernelSpecificCode |
2790 | #endif /* __MigKernelSpecificCode */ |
2791 | OutP->response_data.size = OutP->response_dataCnt; |
2792 | |
2793 | OutP->log_data.size = OutP->log_dataCnt; |
2794 | |
2795 | |
2796 | OutP->NDR = NDR_record; |
2797 | |
2798 | |
2799 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
2800 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
2801 | OutP->msgh_body.msgh_descriptor_count = 2; |
2802 | __AfterRcvRpc(425, "kext_request" ) |
2803 | } |
2804 | |
2805 | |
2806 | |
2807 | /* Description of this subsystem, for use in direct RPC */ |
2808 | const struct host_priv_subsystem host_priv_subsystem = { |
2809 | host_priv_server_routine, |
2810 | 400, |
2811 | 426, |
2812 | (mach_msg_size_t)sizeof(union __ReplyUnion__host_priv_subsystem), |
2813 | (vm_address_t)0, |
2814 | { |
2815 | { (mig_impl_routine_t) 0, |
2816 | (mig_stub_routine_t) _Xhost_get_boot_info, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_get_boot_info_t)}, |
2817 | { (mig_impl_routine_t) 0, |
2818 | (mig_stub_routine_t) _Xhost_reboot, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_reboot_t)}, |
2819 | { (mig_impl_routine_t) 0, |
2820 | (mig_stub_routine_t) _Xhost_priv_statistics, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_priv_statistics_t)}, |
2821 | { (mig_impl_routine_t) 0, |
2822 | (mig_stub_routine_t) _Xhost_default_memory_manager, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_default_memory_manager_t)}, |
2823 | { (mig_impl_routine_t) 0, |
2824 | (mig_stub_routine_t) _Xvm_wire, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__vm_wire_t)}, |
2825 | { (mig_impl_routine_t) 0, |
2826 | (mig_stub_routine_t) _Xthread_wire, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_wire_t)}, |
2827 | { (mig_impl_routine_t) 0, |
2828 | (mig_stub_routine_t) _Xvm_allocate_cpm, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__vm_allocate_cpm_t)}, |
2829 | { (mig_impl_routine_t) 0, |
2830 | (mig_stub_routine_t) _Xhost_processors, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_processors_t)}, |
2831 | { (mig_impl_routine_t) 0, |
2832 | (mig_stub_routine_t) _Xhost_get_clock_control, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_get_clock_control_t)}, |
2833 | { (mig_impl_routine_t) 0, |
2834 | (mig_stub_routine_t) _Xkmod_create, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__kmod_create_t)}, |
2835 | { (mig_impl_routine_t) 0, |
2836 | (mig_stub_routine_t) _Xkmod_destroy, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__kmod_destroy_t)}, |
2837 | { (mig_impl_routine_t) 0, |
2838 | (mig_stub_routine_t) _Xkmod_control, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__kmod_control_t)}, |
2839 | { (mig_impl_routine_t) 0, |
2840 | (mig_stub_routine_t) _Xhost_get_special_port, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_get_special_port_t)}, |
2841 | { (mig_impl_routine_t) 0, |
2842 | (mig_stub_routine_t) _Xhost_set_special_port, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_set_special_port_t)}, |
2843 | { (mig_impl_routine_t) 0, |
2844 | (mig_stub_routine_t) _Xhost_set_exception_ports, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_set_exception_ports_t)}, |
2845 | { (mig_impl_routine_t) 0, |
2846 | (mig_stub_routine_t) _Xhost_get_exception_ports, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_get_exception_ports_t)}, |
2847 | { (mig_impl_routine_t) 0, |
2848 | (mig_stub_routine_t) _Xhost_swap_exception_ports, 10, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_swap_exception_ports_t)}, |
2849 | {0, 0, 0, 0, 0, 0}, |
2850 | { (mig_impl_routine_t) 0, |
2851 | (mig_stub_routine_t) _Xmach_vm_wire_external, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_wire_external_t)}, |
2852 | { (mig_impl_routine_t) 0, |
2853 | (mig_stub_routine_t) _Xhost_processor_sets, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_processor_sets_t)}, |
2854 | { (mig_impl_routine_t) 0, |
2855 | (mig_stub_routine_t) _Xhost_processor_set_priv, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_processor_set_priv_t)}, |
2856 | {0, 0, 0, 0, 0, 0}, |
2857 | {0, 0, 0, 0, 0, 0}, |
2858 | { (mig_impl_routine_t) 0, |
2859 | (mig_stub_routine_t) _Xhost_set_UNDServer, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_set_UNDServer_t)}, |
2860 | { (mig_impl_routine_t) 0, |
2861 | (mig_stub_routine_t) _Xhost_get_UNDServer, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__host_get_UNDServer_t)}, |
2862 | { (mig_impl_routine_t) 0, |
2863 | (mig_stub_routine_t) _Xkext_request, 9, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__kext_request_t)}, |
2864 | } |
2865 | }; |
2866 | |
2867 | mig_external boolean_t host_priv_server |
2868 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2869 | { |
2870 | /* |
2871 | * typedef struct { |
2872 | * mach_msg_header_t Head; |
2873 | * NDR_record_t NDR; |
2874 | * kern_return_t RetCode; |
2875 | * } mig_reply_error_t; |
2876 | */ |
2877 | |
2878 | register mig_routine_t routine; |
2879 | |
2880 | OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0); |
2881 | OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port; |
2882 | /* Minimal size: routine() will update it if different */ |
2883 | OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); |
2884 | OutHeadP->msgh_local_port = MACH_PORT_NULL; |
2885 | OutHeadP->msgh_id = InHeadP->msgh_id + 100; |
2886 | OutHeadP->msgh_reserved = 0; |
2887 | |
2888 | if ((InHeadP->msgh_id > 425) || (InHeadP->msgh_id < 400) || |
2889 | ((routine = host_priv_subsystem.routine[InHeadP->msgh_id - 400].stub_routine) == 0)) { |
2890 | ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record; |
2891 | ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID; |
2892 | return FALSE; |
2893 | } |
2894 | (*routine) (InHeadP, OutHeadP); |
2895 | return TRUE; |
2896 | } |
2897 | |
2898 | mig_external mig_routine_t host_priv_server_routine |
2899 | (mach_msg_header_t *InHeadP) |
2900 | { |
2901 | register int msgh_id; |
2902 | |
2903 | msgh_id = InHeadP->msgh_id - 400; |
2904 | |
2905 | if ((msgh_id > 25) || (msgh_id < 0)) |
2906 | return 0; |
2907 | |
2908 | return host_priv_subsystem.routine[msgh_id].stub_routine; |
2909 | } |
2910 | |