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