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