1/*
2 * IDENTIFICATION:
3 * stub generated by bootstrap_cmds-133
4 * OPTIONS:
5 * KernelServer
6 */
7
8/* Module mach_exc */
9
10#define __MIG_check__Request__mach_exc_subsystem__ 1
11
12#include "mach_exc_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
101mig_internal novalue _Xmach_exception_raise
102 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
103
104mig_internal novalue _Xmach_exception_raise_state
105 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
106
107mig_internal novalue _Xmach_exception_raise_state_identity
108 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
109
110mig_internal novalue _Xmach_exception_raise_identity_protected
111 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
112
113mig_internal novalue _Xmach_exception_raise_backtrace
114 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
115
116
117#if ( __MigTypeCheck )
118#if __MIG_check__Request__mach_exc_subsystem__
119#if !defined(__MIG_check__Request__mach_exception_raise_t__defined)
120#define __MIG_check__Request__mach_exception_raise_t__defined
121
122mig_internal kern_return_t __MIG_check__Request__mach_exception_raise_t(
123 __attribute__((__unused__)) __RequestKData__mach_exception_raise_t *InKP,
124 __attribute__((__unused__)) __RequestUData__mach_exception_raise_t *In0UP,
125 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
126{
127
128 typedef __Request__mach_exception_raise_t __Request;
129 typedef __RequestUData__mach_exception_raise_t __RequestU __attribute__((unused));
130#if __MigTypeCheck
131 unsigned int msgh_size;
132#endif /* __MigTypeCheck */
133
134#if __MigTypeCheck
135 msgh_size = InKP->Head.msgh_size;
136 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
137 (InKP->msgh_body.msgh_descriptor_count != 2) ||
138 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 16)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
139 return MIG_BAD_ARGUMENTS;
140#endif /* __MigTypeCheck */
141
142#if __MigTypeCheck
143 if (InKP->thread.type != MACH_MSG_PORT_DESCRIPTOR ||
144 InKP->thread.disposition != 17)
145 return MIG_TYPE_ERROR;
146#endif /* __MigTypeCheck */
147
148#if __MigTypeCheck
149 if (InKP->task.type != MACH_MSG_PORT_DESCRIPTOR ||
150 InKP->task.disposition != 17)
151 return MIG_TYPE_ERROR;
152#endif /* __MigTypeCheck */
153
154#if defined(__NDR_convert__int_rep__Request__mach_exception_raise_t__codeCnt__defined)
155 if (In0UP->NDR.int_rep != NDR_record.int_rep)
156 __NDR_convert__int_rep__Request__mach_exception_raise_t__codeCnt(&In0UP->codeCnt, In0UP->NDR.int_rep);
157#endif /* __NDR_convert__int_rep__Request__mach_exception_raise_t__codeCnt__defined */
158#if __MigTypeCheck
159 if (In0UP->codeCnt > 2)
160 return MIG_BAD_ARGUMENTS;
161 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 16)) / 8 < In0UP->codeCnt) ||
162 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 16) + (8 * In0UP->codeCnt)))
163 return MIG_BAD_ARGUMENTS;
164#endif /* __MigTypeCheck */
165
166 return MACH_MSG_SUCCESS;
167}
168#endif /* !defined(__MIG_check__Request__mach_exception_raise_t__defined) */
169#endif /* __MIG_check__Request__mach_exc_subsystem__ */
170#endif /* ( __MigTypeCheck ) */
171
172
173/* Routine mach_exception_raise */
174mig_internal novalue _Xmach_exception_raise
175 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
176 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
177 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
178{
179
180#ifdef __MigPackStructs
181#pragma pack(push, 4)
182#endif
183 typedef struct {
184 NDR_record_t NDR;
185 exception_type_t exception;
186 mach_msg_type_number_t codeCnt;
187 int64_t code[2];
188 mach_msg_trailer_t trailer;
189 char padding[0]; /* Avoid generating empty UData structs */
190 } RequestU __attribute__((unused));
191#ifdef __MigPackStructs
192#pragma pack(pop)
193#endif
194 typedef __RequestKData__mach_exception_raise_t RequestK;
195 typedef __RequestUData__mach_exception_raise_t __RequestU;
196 typedef __ReplyKData__mach_exception_raise_t ReplyK __attribute__((unused));
197 typedef __ReplyUData__mach_exception_raise_t ReplyU __attribute__((unused));
198 typedef __Reply__mach_exception_raise_t Reply __attribute__((unused));
199 typedef __Request__mach_exception_raise_t __Request __attribute__((unused));
200
201 /*
202 * typedef struct {
203 * mach_msg_header_t Head;
204 * NDR_record_t NDR;
205 * kern_return_t RetCode;
206 * } mig_reply_error_t;
207 */
208
209 RequestK *InKP = (RequestK *) InHeadP;
210 RequestU *In0UP = (RequestU *) InDataP;
211 ReplyK *OutKP = (ReplyK *) OutHeadP;
212 ReplyU *OutUP = (ReplyU *) OutDataP;
213 (void)OutUP;
214#ifdef __MIG_check__Request__mach_exception_raise_t__defined
215 kern_return_t check_result;
216#endif /* __MIG_check__Request__mach_exception_raise_t__defined */
217
218#if __MigKernelSpecificCode
219#else
220#endif /* __MigKernelSpecificCode */
221 __DeclareRcvRpc(2405, "mach_exception_raise")
222 __BeforeRcvRpc(2405, "mach_exception_raise")
223
224#if defined(__MIG_check__Request__mach_exception_raise_t__defined)
225 check_result = __MIG_check__Request__mach_exception_raise_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
226 if (check_result != MACH_MSG_SUCCESS)
227 { MIG_RETURN_ERROR(OutKP, check_result); }
228#endif /* defined(__MIG_check__Request__mach_exception_raise_t__defined) */
229
230 OutUP->RetCode = catch_mach_exception_raise(exception_port: InKP->Head.msgh_request_port, thread: InKP->thread.name, task: InKP->task.name, exception: In0UP->exception, code: In0UP->code, codeCnt: In0UP->codeCnt);
231#if __MigKernelSpecificCode
232#endif /* __MigKernelSpecificCode */
233
234 OutUP->NDR = NDR_record;
235
236
237 __AfterRcvRpc(2405, "mach_exception_raise")
238}
239
240#if ( __MigTypeCheck )
241#if __MIG_check__Request__mach_exc_subsystem__
242#if !defined(__MIG_check__Request__mach_exception_raise_state_t__defined)
243#define __MIG_check__Request__mach_exception_raise_state_t__defined
244
245mig_internal kern_return_t __MIG_check__Request__mach_exception_raise_state_t(
246 __attribute__((__unused__)) __RequestKData__mach_exception_raise_state_t *InKP,
247 __attribute__((__unused__)) __RequestUData__mach_exception_raise_state_t *In0UP,
248 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
249 __attribute__((__unused__)) __RequestUData__mach_exception_raise_state_t **In1UPP)
250{
251
252 typedef __Request__mach_exception_raise_state_t __Request;
253 typedef __RequestUData__mach_exception_raise_state_t __RequestU __attribute__((unused));
254 __RequestU *In1UP;
255#if __MigTypeCheck
256 unsigned int msgh_size;
257#endif /* __MigTypeCheck */
258 unsigned int msgh_size_delta;
259
260#if __MigTypeCheck
261 msgh_size = InKP->Head.msgh_size;
262 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
263 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 5200)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
264 return MIG_BAD_ARGUMENTS;
265#endif /* __MigTypeCheck */
266
267#if defined(__NDR_convert__int_rep__Request__mach_exception_raise_state_t__codeCnt__defined)
268 if (In0UP->NDR.int_rep != NDR_record.int_rep)
269 __NDR_convert__int_rep__Request__mach_exception_raise_state_t__codeCnt(&In0UP->codeCnt, In0UP->NDR.int_rep);
270#endif /* __NDR_convert__int_rep__Request__mach_exception_raise_state_t__codeCnt__defined */
271 msgh_size_delta = (8 * In0UP->codeCnt);
272#if __MigTypeCheck
273 if (In0UP->codeCnt > 2)
274 return MIG_BAD_ARGUMENTS;
275 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 5200)) / 8 < In0UP->codeCnt) ||
276 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 5200) + (8 * In0UP->codeCnt)))
277 return MIG_BAD_ARGUMENTS;
278 msgh_size -= msgh_size_delta;
279#endif /* __MigTypeCheck */
280
281 *In1UPP = In1UP = (__RequestU *) ((pointer_t) In0UP + msgh_size_delta - 16);
282
283#if defined(__NDR_convert__int_rep__Request__mach_exception_raise_state_t__old_stateCnt__defined)
284 if (In0UP->NDR.int_rep != NDR_record.int_rep)
285 __NDR_convert__int_rep__Request__mach_exception_raise_state_t__old_stateCnt(&In1UP->old_stateCnt, In1UP->NDR.int_rep);
286#endif /* __NDR_convert__int_rep__Request__mach_exception_raise_state_t__old_stateCnt__defined */
287#if __MigTypeCheck
288 if (In1UP->old_stateCnt > 1296)
289 return MIG_BAD_ARGUMENTS;
290 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 5200)) / 4 < In1UP->old_stateCnt) ||
291 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 5200) + (4 * In1UP->old_stateCnt)))
292 return MIG_BAD_ARGUMENTS;
293#endif /* __MigTypeCheck */
294
295 return MACH_MSG_SUCCESS;
296}
297#endif /* !defined(__MIG_check__Request__mach_exception_raise_state_t__defined) */
298#endif /* __MIG_check__Request__mach_exc_subsystem__ */
299#endif /* ( __MigTypeCheck ) */
300
301
302/* Routine mach_exception_raise_state */
303mig_internal novalue _Xmach_exception_raise_state
304 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
305 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
306 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
307{
308
309#ifdef __MigPackStructs
310#pragma pack(push, 4)
311#endif
312 typedef struct {
313 NDR_record_t NDR;
314 exception_type_t exception;
315 mach_msg_type_number_t codeCnt;
316 int64_t code[2];
317 int flavor;
318 mach_msg_type_number_t old_stateCnt;
319 natural_t old_state[1296];
320 mach_msg_trailer_t trailer;
321 char padding[0]; /* Avoid generating empty UData structs */
322 } RequestU __attribute__((unused));
323#ifdef __MigPackStructs
324#pragma pack(pop)
325#endif
326 typedef __RequestKData__mach_exception_raise_state_t RequestK;
327 typedef __RequestUData__mach_exception_raise_state_t __RequestU;
328 typedef __ReplyKData__mach_exception_raise_state_t ReplyK __attribute__((unused));
329 typedef __ReplyUData__mach_exception_raise_state_t ReplyU __attribute__((unused));
330 typedef __Reply__mach_exception_raise_state_t Reply __attribute__((unused));
331 typedef __Request__mach_exception_raise_state_t __Request __attribute__((unused));
332
333 /*
334 * typedef struct {
335 * mach_msg_header_t Head;
336 * NDR_record_t NDR;
337 * kern_return_t RetCode;
338 * } mig_reply_error_t;
339 */
340
341 RequestK *InKP = (RequestK *) InHeadP;
342 RequestU *In0UP = (RequestU *) InDataP;
343 RequestU *In1UP;
344 ReplyK *OutKP = (ReplyK *) OutHeadP;
345 ReplyU *OutUP = (ReplyU *) OutDataP;
346 (void)OutUP;
347#ifdef __MIG_check__Request__mach_exception_raise_state_t__defined
348 kern_return_t check_result;
349#endif /* __MIG_check__Request__mach_exception_raise_state_t__defined */
350
351#if __MigKernelSpecificCode
352#else
353#endif /* __MigKernelSpecificCode */
354 __DeclareRcvRpc(2406, "mach_exception_raise_state")
355 __BeforeRcvRpc(2406, "mach_exception_raise_state")
356
357#if defined(__MIG_check__Request__mach_exception_raise_state_t__defined)
358 check_result = __MIG_check__Request__mach_exception_raise_state_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP, In1UPP: (__RequestU **)&In1UP);
359 if (check_result != MACH_MSG_SUCCESS)
360 { MIG_RETURN_ERROR(OutKP, check_result); }
361#endif /* defined(__MIG_check__Request__mach_exception_raise_state_t__defined) */
362
363 OutUP->new_stateCnt = 1296;
364
365 OutUP->RetCode = catch_mach_exception_raise_state(exception_port: InKP->Head.msgh_request_port, exception: In0UP->exception, code: In0UP->code, codeCnt: In0UP->codeCnt, flavor: &In1UP->flavor, old_state: In1UP->old_state, old_stateCnt: In1UP->old_stateCnt, new_state: OutUP->new_state, new_stateCnt: &OutUP->new_stateCnt);
366 if (OutUP->RetCode != KERN_SUCCESS) {
367 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
368 }
369#if __MigKernelSpecificCode
370#endif /* __MigKernelSpecificCode */
371
372 OutUP->NDR = NDR_record;
373
374
375 OutUP->flavor = In1UP->flavor;
376 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 5184) + (((4 * OutUP->new_stateCnt)));
377
378 __AfterRcvRpc(2406, "mach_exception_raise_state")
379}
380
381#if ( __MigTypeCheck )
382#if __MIG_check__Request__mach_exc_subsystem__
383#if !defined(__MIG_check__Request__mach_exception_raise_state_identity_t__defined)
384#define __MIG_check__Request__mach_exception_raise_state_identity_t__defined
385
386mig_internal kern_return_t __MIG_check__Request__mach_exception_raise_state_identity_t(
387 __attribute__((__unused__)) __RequestKData__mach_exception_raise_state_identity_t *InKP,
388 __attribute__((__unused__)) __RequestUData__mach_exception_raise_state_identity_t *In0UP,
389 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
390 __attribute__((__unused__)) __RequestUData__mach_exception_raise_state_identity_t **In1UPP)
391{
392
393 typedef __Request__mach_exception_raise_state_identity_t __Request;
394 typedef __RequestUData__mach_exception_raise_state_identity_t __RequestU __attribute__((unused));
395 __RequestU *In1UP;
396#if __MigTypeCheck
397 unsigned int msgh_size;
398#endif /* __MigTypeCheck */
399 unsigned int msgh_size_delta;
400
401#if __MigTypeCheck
402 msgh_size = InKP->Head.msgh_size;
403 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
404 (InKP->msgh_body.msgh_descriptor_count != 2) ||
405 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 5200)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
406 return MIG_BAD_ARGUMENTS;
407#endif /* __MigTypeCheck */
408
409#if __MigTypeCheck
410 if (InKP->thread.type != MACH_MSG_PORT_DESCRIPTOR ||
411 InKP->thread.disposition != 17)
412 return MIG_TYPE_ERROR;
413#endif /* __MigTypeCheck */
414
415#if __MigTypeCheck
416 if (InKP->task.type != MACH_MSG_PORT_DESCRIPTOR ||
417 InKP->task.disposition != 17)
418 return MIG_TYPE_ERROR;
419#endif /* __MigTypeCheck */
420
421#if defined(__NDR_convert__int_rep__Request__mach_exception_raise_state_identity_t__codeCnt__defined)
422 if (In0UP->NDR.int_rep != NDR_record.int_rep)
423 __NDR_convert__int_rep__Request__mach_exception_raise_state_identity_t__codeCnt(&In0UP->codeCnt, In0UP->NDR.int_rep);
424#endif /* __NDR_convert__int_rep__Request__mach_exception_raise_state_identity_t__codeCnt__defined */
425 msgh_size_delta = (8 * In0UP->codeCnt);
426#if __MigTypeCheck
427 if (In0UP->codeCnt > 2)
428 return MIG_BAD_ARGUMENTS;
429 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 5200)) / 8 < In0UP->codeCnt) ||
430 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 5200) + (8 * In0UP->codeCnt)))
431 return MIG_BAD_ARGUMENTS;
432 msgh_size -= msgh_size_delta;
433#endif /* __MigTypeCheck */
434
435 *In1UPP = In1UP = (__RequestU *) ((pointer_t) In0UP + msgh_size_delta - 16);
436
437#if defined(__NDR_convert__int_rep__Request__mach_exception_raise_state_identity_t__old_stateCnt__defined)
438 if (In0UP->NDR.int_rep != NDR_record.int_rep)
439 __NDR_convert__int_rep__Request__mach_exception_raise_state_identity_t__old_stateCnt(&In1UP->old_stateCnt, In1UP->NDR.int_rep);
440#endif /* __NDR_convert__int_rep__Request__mach_exception_raise_state_identity_t__old_stateCnt__defined */
441#if __MigTypeCheck
442 if (In1UP->old_stateCnt > 1296)
443 return MIG_BAD_ARGUMENTS;
444 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 5200)) / 4 < In1UP->old_stateCnt) ||
445 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 5200) + (4 * In1UP->old_stateCnt)))
446 return MIG_BAD_ARGUMENTS;
447#endif /* __MigTypeCheck */
448
449 return MACH_MSG_SUCCESS;
450}
451#endif /* !defined(__MIG_check__Request__mach_exception_raise_state_identity_t__defined) */
452#endif /* __MIG_check__Request__mach_exc_subsystem__ */
453#endif /* ( __MigTypeCheck ) */
454
455
456/* Routine mach_exception_raise_state_identity */
457mig_internal novalue _Xmach_exception_raise_state_identity
458 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
459 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
460 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
461{
462
463#ifdef __MigPackStructs
464#pragma pack(push, 4)
465#endif
466 typedef struct {
467 NDR_record_t NDR;
468 exception_type_t exception;
469 mach_msg_type_number_t codeCnt;
470 int64_t code[2];
471 int flavor;
472 mach_msg_type_number_t old_stateCnt;
473 natural_t old_state[1296];
474 mach_msg_trailer_t trailer;
475 char padding[0]; /* Avoid generating empty UData structs */
476 } RequestU __attribute__((unused));
477#ifdef __MigPackStructs
478#pragma pack(pop)
479#endif
480 typedef __RequestKData__mach_exception_raise_state_identity_t RequestK;
481 typedef __RequestUData__mach_exception_raise_state_identity_t __RequestU;
482 typedef __ReplyKData__mach_exception_raise_state_identity_t ReplyK __attribute__((unused));
483 typedef __ReplyUData__mach_exception_raise_state_identity_t ReplyU __attribute__((unused));
484 typedef __Reply__mach_exception_raise_state_identity_t Reply __attribute__((unused));
485 typedef __Request__mach_exception_raise_state_identity_t __Request __attribute__((unused));
486
487 /*
488 * typedef struct {
489 * mach_msg_header_t Head;
490 * NDR_record_t NDR;
491 * kern_return_t RetCode;
492 * } mig_reply_error_t;
493 */
494
495 RequestK *InKP = (RequestK *) InHeadP;
496 RequestU *In0UP = (RequestU *) InDataP;
497 RequestU *In1UP;
498 ReplyK *OutKP = (ReplyK *) OutHeadP;
499 ReplyU *OutUP = (ReplyU *) OutDataP;
500 (void)OutUP;
501#ifdef __MIG_check__Request__mach_exception_raise_state_identity_t__defined
502 kern_return_t check_result;
503#endif /* __MIG_check__Request__mach_exception_raise_state_identity_t__defined */
504
505#if __MigKernelSpecificCode
506#else
507#endif /* __MigKernelSpecificCode */
508 __DeclareRcvRpc(2407, "mach_exception_raise_state_identity")
509 __BeforeRcvRpc(2407, "mach_exception_raise_state_identity")
510
511#if defined(__MIG_check__Request__mach_exception_raise_state_identity_t__defined)
512 check_result = __MIG_check__Request__mach_exception_raise_state_identity_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP, In1UPP: (__RequestU **)&In1UP);
513 if (check_result != MACH_MSG_SUCCESS)
514 { MIG_RETURN_ERROR(OutKP, check_result); }
515#endif /* defined(__MIG_check__Request__mach_exception_raise_state_identity_t__defined) */
516
517 OutUP->new_stateCnt = 1296;
518
519 OutUP->RetCode = catch_mach_exception_raise_state_identity(exception_port: InKP->Head.msgh_request_port, thread: InKP->thread.name, task: InKP->task.name, exception: In0UP->exception, code: In0UP->code, codeCnt: In0UP->codeCnt, flavor: &In1UP->flavor, old_state: In1UP->old_state, old_stateCnt: In1UP->old_stateCnt, new_state: OutUP->new_state, new_stateCnt: &OutUP->new_stateCnt);
520 if (OutUP->RetCode != KERN_SUCCESS) {
521 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
522 }
523#if __MigKernelSpecificCode
524#endif /* __MigKernelSpecificCode */
525
526 OutUP->NDR = NDR_record;
527
528
529 OutUP->flavor = In1UP->flavor;
530 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 5184) + (((4 * OutUP->new_stateCnt)));
531
532 __AfterRcvRpc(2407, "mach_exception_raise_state_identity")
533}
534
535#if ( __MigTypeCheck )
536#if __MIG_check__Request__mach_exc_subsystem__
537#if !defined(__MIG_check__Request__mach_exception_raise_identity_protected_t__defined)
538#define __MIG_check__Request__mach_exception_raise_identity_protected_t__defined
539
540mig_internal kern_return_t __MIG_check__Request__mach_exception_raise_identity_protected_t(
541 __attribute__((__unused__)) __RequestKData__mach_exception_raise_identity_protected_t *InKP,
542 __attribute__((__unused__)) __RequestUData__mach_exception_raise_identity_protected_t *In0UP,
543 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
544{
545
546 typedef __Request__mach_exception_raise_identity_protected_t __Request;
547 typedef __RequestUData__mach_exception_raise_identity_protected_t __RequestU __attribute__((unused));
548#if __MigTypeCheck
549 unsigned int msgh_size;
550#endif /* __MigTypeCheck */
551
552#if __MigTypeCheck
553 msgh_size = InKP->Head.msgh_size;
554 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
555 (InKP->msgh_body.msgh_descriptor_count != 1) ||
556 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 16)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
557 return MIG_BAD_ARGUMENTS;
558#endif /* __MigTypeCheck */
559
560#if __MigTypeCheck
561 if (InKP->task_id_token_t.type != MACH_MSG_PORT_DESCRIPTOR ||
562 InKP->task_id_token_t.disposition != 17)
563 return MIG_TYPE_ERROR;
564#endif /* __MigTypeCheck */
565
566#if defined(__NDR_convert__int_rep__Request__mach_exception_raise_identity_protected_t__codeCnt__defined)
567 if (In0UP->NDR.int_rep != NDR_record.int_rep)
568 __NDR_convert__int_rep__Request__mach_exception_raise_identity_protected_t__codeCnt(&In0UP->codeCnt, In0UP->NDR.int_rep);
569#endif /* __NDR_convert__int_rep__Request__mach_exception_raise_identity_protected_t__codeCnt__defined */
570#if __MigTypeCheck
571 if (In0UP->codeCnt > 2)
572 return MIG_BAD_ARGUMENTS;
573 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 16)) / 8 < In0UP->codeCnt) ||
574 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 16) + (8 * In0UP->codeCnt)))
575 return MIG_BAD_ARGUMENTS;
576#endif /* __MigTypeCheck */
577
578 return MACH_MSG_SUCCESS;
579}
580#endif /* !defined(__MIG_check__Request__mach_exception_raise_identity_protected_t__defined) */
581#endif /* __MIG_check__Request__mach_exc_subsystem__ */
582#endif /* ( __MigTypeCheck ) */
583
584
585/* Routine mach_exception_raise_identity_protected */
586mig_internal novalue _Xmach_exception_raise_identity_protected
587 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
588 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
589 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
590{
591
592#ifdef __MigPackStructs
593#pragma pack(push, 4)
594#endif
595 typedef struct {
596 NDR_record_t NDR;
597 uint64_t thread_id;
598 exception_type_t exception;
599 mach_msg_type_number_t codeCnt;
600 int64_t code[2];
601 mach_msg_trailer_t trailer;
602 char padding[0]; /* Avoid generating empty UData structs */
603 } RequestU __attribute__((unused));
604#ifdef __MigPackStructs
605#pragma pack(pop)
606#endif
607 typedef __RequestKData__mach_exception_raise_identity_protected_t RequestK;
608 typedef __RequestUData__mach_exception_raise_identity_protected_t __RequestU;
609 typedef __ReplyKData__mach_exception_raise_identity_protected_t ReplyK __attribute__((unused));
610 typedef __ReplyUData__mach_exception_raise_identity_protected_t ReplyU __attribute__((unused));
611 typedef __Reply__mach_exception_raise_identity_protected_t Reply __attribute__((unused));
612 typedef __Request__mach_exception_raise_identity_protected_t __Request __attribute__((unused));
613
614 /*
615 * typedef struct {
616 * mach_msg_header_t Head;
617 * NDR_record_t NDR;
618 * kern_return_t RetCode;
619 * } mig_reply_error_t;
620 */
621
622 RequestK *InKP = (RequestK *) InHeadP;
623 RequestU *In0UP = (RequestU *) InDataP;
624 ReplyK *OutKP = (ReplyK *) OutHeadP;
625 ReplyU *OutUP = (ReplyU *) OutDataP;
626 (void)OutUP;
627#ifdef __MIG_check__Request__mach_exception_raise_identity_protected_t__defined
628 kern_return_t check_result;
629#endif /* __MIG_check__Request__mach_exception_raise_identity_protected_t__defined */
630
631#if __MigKernelSpecificCode
632#else
633#endif /* __MigKernelSpecificCode */
634 __DeclareRcvRpc(2408, "mach_exception_raise_identity_protected")
635 __BeforeRcvRpc(2408, "mach_exception_raise_identity_protected")
636
637#if defined(__MIG_check__Request__mach_exception_raise_identity_protected_t__defined)
638 check_result = __MIG_check__Request__mach_exception_raise_identity_protected_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
639 if (check_result != MACH_MSG_SUCCESS)
640 { MIG_RETURN_ERROR(OutKP, check_result); }
641#endif /* defined(__MIG_check__Request__mach_exception_raise_identity_protected_t__defined) */
642
643 OutUP->RetCode = catch_mach_exception_raise_identity_protected(exception_port: InKP->Head.msgh_request_port, thread_id: In0UP->thread_id, task_id_token_t: InKP->task_id_token_t.name, exception: In0UP->exception, code: In0UP->code, codeCnt: In0UP->codeCnt);
644#if __MigKernelSpecificCode
645#endif /* __MigKernelSpecificCode */
646
647 OutUP->NDR = NDR_record;
648
649
650 __AfterRcvRpc(2408, "mach_exception_raise_identity_protected")
651}
652
653#if ( __MigTypeCheck )
654#if __MIG_check__Request__mach_exc_subsystem__
655#if !defined(__MIG_check__Request__mach_exception_raise_backtrace_t__defined)
656#define __MIG_check__Request__mach_exception_raise_backtrace_t__defined
657
658mig_internal kern_return_t __MIG_check__Request__mach_exception_raise_backtrace_t(
659 __attribute__((__unused__)) __RequestKData__mach_exception_raise_backtrace_t *InKP,
660 __attribute__((__unused__)) __RequestUData__mach_exception_raise_backtrace_t *In0UP,
661 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
662{
663
664 typedef __Request__mach_exception_raise_backtrace_t __Request;
665 typedef __RequestUData__mach_exception_raise_backtrace_t __RequestU __attribute__((unused));
666#if __MigTypeCheck
667 unsigned int msgh_size;
668#endif /* __MigTypeCheck */
669
670#if __MigTypeCheck
671 msgh_size = InKP->Head.msgh_size;
672 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
673 (InKP->msgh_body.msgh_descriptor_count != 1) ||
674 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 16)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
675 return MIG_BAD_ARGUMENTS;
676#endif /* __MigTypeCheck */
677
678#if __MigTypeCheck
679 if (InKP->kcdata_object_t.type != MACH_MSG_PORT_DESCRIPTOR ||
680 InKP->kcdata_object_t.disposition != 17)
681 return MIG_TYPE_ERROR;
682#endif /* __MigTypeCheck */
683
684#if defined(__NDR_convert__int_rep__Request__mach_exception_raise_backtrace_t__codeCnt__defined)
685 if (In0UP->NDR.int_rep != NDR_record.int_rep)
686 __NDR_convert__int_rep__Request__mach_exception_raise_backtrace_t__codeCnt(&In0UP->codeCnt, In0UP->NDR.int_rep);
687#endif /* __NDR_convert__int_rep__Request__mach_exception_raise_backtrace_t__codeCnt__defined */
688#if __MigTypeCheck
689 if (In0UP->codeCnt > 2)
690 return MIG_BAD_ARGUMENTS;
691 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 16)) / 8 < In0UP->codeCnt) ||
692 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 16) + (8 * In0UP->codeCnt)))
693 return MIG_BAD_ARGUMENTS;
694#endif /* __MigTypeCheck */
695
696 return MACH_MSG_SUCCESS;
697}
698#endif /* !defined(__MIG_check__Request__mach_exception_raise_backtrace_t__defined) */
699#endif /* __MIG_check__Request__mach_exc_subsystem__ */
700#endif /* ( __MigTypeCheck ) */
701
702
703/* Routine mach_exception_raise_backtrace */
704mig_internal novalue _Xmach_exception_raise_backtrace
705 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
706 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
707 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
708{
709
710#ifdef __MigPackStructs
711#pragma pack(push, 4)
712#endif
713 typedef struct {
714 NDR_record_t NDR;
715 exception_type_t exception;
716 mach_msg_type_number_t codeCnt;
717 int64_t code[2];
718 mach_msg_trailer_t trailer;
719 char padding[0]; /* Avoid generating empty UData structs */
720 } RequestU __attribute__((unused));
721#ifdef __MigPackStructs
722#pragma pack(pop)
723#endif
724 typedef __RequestKData__mach_exception_raise_backtrace_t RequestK;
725 typedef __RequestUData__mach_exception_raise_backtrace_t __RequestU;
726 typedef __ReplyKData__mach_exception_raise_backtrace_t ReplyK __attribute__((unused));
727 typedef __ReplyUData__mach_exception_raise_backtrace_t ReplyU __attribute__((unused));
728 typedef __Reply__mach_exception_raise_backtrace_t Reply __attribute__((unused));
729 typedef __Request__mach_exception_raise_backtrace_t __Request __attribute__((unused));
730
731 /*
732 * typedef struct {
733 * mach_msg_header_t Head;
734 * NDR_record_t NDR;
735 * kern_return_t RetCode;
736 * } mig_reply_error_t;
737 */
738
739 RequestK *InKP = (RequestK *) InHeadP;
740 RequestU *In0UP = (RequestU *) InDataP;
741 ReplyK *OutKP = (ReplyK *) OutHeadP;
742 ReplyU *OutUP = (ReplyU *) OutDataP;
743 (void)OutUP;
744#ifdef __MIG_check__Request__mach_exception_raise_backtrace_t__defined
745 kern_return_t check_result;
746#endif /* __MIG_check__Request__mach_exception_raise_backtrace_t__defined */
747
748#if __MigKernelSpecificCode
749#else
750#endif /* __MigKernelSpecificCode */
751 __DeclareRcvRpc(2409, "mach_exception_raise_backtrace")
752 __BeforeRcvRpc(2409, "mach_exception_raise_backtrace")
753
754#if defined(__MIG_check__Request__mach_exception_raise_backtrace_t__defined)
755 check_result = __MIG_check__Request__mach_exception_raise_backtrace_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
756 if (check_result != MACH_MSG_SUCCESS)
757 { MIG_RETURN_ERROR(OutKP, check_result); }
758#endif /* defined(__MIG_check__Request__mach_exception_raise_backtrace_t__defined) */
759
760 OutUP->RetCode = catch_mach_exception_raise_backtrace(exception_port: InKP->Head.msgh_request_port, kcdata_object_t: InKP->kcdata_object_t.name, exception: In0UP->exception, code: In0UP->code, codeCnt: In0UP->codeCnt);
761#if __MigKernelSpecificCode
762#endif /* __MigKernelSpecificCode */
763
764 OutUP->NDR = NDR_record;
765
766
767 __AfterRcvRpc(2409, "mach_exception_raise_backtrace")
768}
769
770
771
772/* Description of this kernel subsystem, for use in direct RPC */
773const struct catch_mach_exc_subsystem catch_mach_exc_subsystem = {
774 mach_exc_server_routine,
775 2405,
776 2410,
777 (mach_msg_size_t)sizeof(union __ReplyUnion__catch_mach_exc_subsystem),
778 (vm_address_t)0,
779 {
780 { (mig_impl_routine_t) 0,
781 (mig_stub_kern_routine_t) _Xmach_exception_raise, 6, 0, 0, (mach_msg_size_t)sizeof(__Reply__mach_exception_raise_t)},
782 { .impl_routine: (mig_impl_routine_t) 0,
783 .kstub_routine: (mig_stub_kern_routine_t) _Xmach_exception_raise_state, .argc: 9, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mach_exception_raise_state_t)},
784 { .impl_routine: (mig_impl_routine_t) 0,
785 .kstub_routine: (mig_stub_kern_routine_t) _Xmach_exception_raise_state_identity, .argc: 11, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mach_exception_raise_state_identity_t)},
786 { .impl_routine: (mig_impl_routine_t) 0,
787 .kstub_routine: (mig_stub_kern_routine_t) _Xmach_exception_raise_identity_protected, .argc: 7, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mach_exception_raise_identity_protected_t)},
788 { .impl_routine: (mig_impl_routine_t) 0,
789 .kstub_routine: (mig_stub_kern_routine_t) _Xmach_exception_raise_backtrace, .argc: 5, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mach_exception_raise_backtrace_t)},
790 }
791};
792
793mig_external boolean_t mach_exc_server
794 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP)
795{
796 /*
797 * typedef struct {
798 * mach_msg_header_t Head;
799 * NDR_record_t NDR;
800 * kern_return_t RetCode;
801 * } mig_reply_error_t;
802 */
803
804 mig_kern_routine_t routine;
805
806 OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0);
807 OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port;
808 /* Minimal size: routine() will update it if different */
809 OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t);
810 OutHeadP->msgh_local_port = MACH_PORT_NULL;
811 OutHeadP->msgh_id = InHeadP->msgh_id + 100;
812 OutHeadP->msgh_reserved = 0;
813
814 if ((InHeadP->msgh_id > 2409) || (InHeadP->msgh_id < 2405) ||
815 ((routine = catch_mach_exc_subsystem.kroutine[InHeadP->msgh_id - 2405].kstub_routine) == 0)) {
816 ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record;
817 ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID;
818 return FALSE;
819 }
820 (*routine) (InHeadP, InDataP, InTrailerP, OutHeadP, OutDataP);
821 return TRUE;
822}
823
824mig_external mig_kern_routine_t mach_exc_server_routine
825 (mach_msg_header_t *InHeadP)
826{
827 int msgh_id;
828
829 msgh_id = InHeadP->msgh_id - 2405;
830
831 if ((msgh_id > 4) || (msgh_id < 0))
832 return 0;
833
834 return catch_mach_exc_subsystem.kroutine[msgh_id].kstub_routine;
835}
836