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