1 | /* |
2 | * IDENTIFICATION: |
3 | * stub generated by bootstrap_cmds-133 |
4 | * OPTIONS: |
5 | * KernelServer |
6 | */ |
7 | |
8 | /* Module exc */ |
9 | |
10 | #define __MIG_check__Request__exc_subsystem__ 1 |
11 | |
12 | #include "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 | |
101 | mig_internal novalue _Xexception_raise |
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 _Xexception_raise_state |
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 _Xexception_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 | |
110 | |
111 | #if ( __MigTypeCheck ) |
112 | #if __MIG_check__Request__exc_subsystem__ |
113 | #if !defined(__MIG_check__Request__exception_raise_t__defined) |
114 | #define __MIG_check__Request__exception_raise_t__defined |
115 | |
116 | mig_internal kern_return_t __MIG_check__Request__exception_raise_t( |
117 | __attribute__((__unused__)) __RequestKData__exception_raise_t *InKP, |
118 | __attribute__((__unused__)) __RequestUData__exception_raise_t *In0UP, |
119 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP) |
120 | { |
121 | |
122 | typedef __Request__exception_raise_t __Request; |
123 | typedef __RequestUData__exception_raise_t __RequestU __attribute__((unused)); |
124 | #if __MigTypeCheck |
125 | unsigned int msgh_size; |
126 | #endif /* __MigTypeCheck */ |
127 | |
128 | #if __MigTypeCheck |
129 | msgh_size = InKP->Head.msgh_size; |
130 | if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
131 | (InKP->msgh_body.msgh_descriptor_count != 2) || |
132 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 8)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
133 | return MIG_BAD_ARGUMENTS; |
134 | #endif /* __MigTypeCheck */ |
135 | |
136 | #if __MigTypeCheck |
137 | if (InKP->thread.type != MACH_MSG_PORT_DESCRIPTOR || |
138 | InKP->thread.disposition != 17) |
139 | return MIG_TYPE_ERROR; |
140 | #endif /* __MigTypeCheck */ |
141 | |
142 | #if __MigTypeCheck |
143 | if (InKP->task.type != MACH_MSG_PORT_DESCRIPTOR || |
144 | InKP->task.disposition != 17) |
145 | return MIG_TYPE_ERROR; |
146 | #endif /* __MigTypeCheck */ |
147 | |
148 | #if defined(__NDR_convert__int_rep__Request__exception_raise_t__codeCnt__defined) |
149 | if (In0UP->NDR.int_rep != NDR_record.int_rep) |
150 | __NDR_convert__int_rep__Request__exception_raise_t__codeCnt(&In0UP->codeCnt, In0UP->NDR.int_rep); |
151 | #endif /* __NDR_convert__int_rep__Request__exception_raise_t__codeCnt__defined */ |
152 | #if __MigTypeCheck |
153 | if (In0UP->codeCnt > 2) |
154 | return MIG_BAD_ARGUMENTS; |
155 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 8)) / 4 < In0UP->codeCnt) || |
156 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 8) + (4 * In0UP->codeCnt))) |
157 | return MIG_BAD_ARGUMENTS; |
158 | #endif /* __MigTypeCheck */ |
159 | |
160 | return MACH_MSG_SUCCESS; |
161 | } |
162 | #endif /* !defined(__MIG_check__Request__exception_raise_t__defined) */ |
163 | #endif /* __MIG_check__Request__exc_subsystem__ */ |
164 | #endif /* ( __MigTypeCheck ) */ |
165 | |
166 | |
167 | /* Routine exception_raise */ |
168 | mig_internal novalue _Xexception_raise |
169 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
170 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
171 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
172 | { |
173 | |
174 | #ifdef __MigPackStructs |
175 | #pragma pack(push, 4) |
176 | #endif |
177 | typedef struct { |
178 | NDR_record_t NDR; |
179 | exception_type_t exception; |
180 | mach_msg_type_number_t codeCnt; |
181 | integer_t code[2]; |
182 | mach_msg_trailer_t trailer; |
183 | char padding[0]; /* Avoid generating empty UData structs */ |
184 | } RequestU __attribute__((unused)); |
185 | #ifdef __MigPackStructs |
186 | #pragma pack(pop) |
187 | #endif |
188 | typedef __RequestKData__exception_raise_t RequestK; |
189 | typedef __RequestUData__exception_raise_t __RequestU; |
190 | typedef __ReplyKData__exception_raise_t ReplyK __attribute__((unused)); |
191 | typedef __ReplyUData__exception_raise_t ReplyU __attribute__((unused)); |
192 | typedef __Reply__exception_raise_t Reply __attribute__((unused)); |
193 | typedef __Request__exception_raise_t __Request __attribute__((unused)); |
194 | |
195 | /* |
196 | * typedef struct { |
197 | * mach_msg_header_t Head; |
198 | * NDR_record_t NDR; |
199 | * kern_return_t RetCode; |
200 | * } mig_reply_error_t; |
201 | */ |
202 | |
203 | RequestK *InKP = (RequestK *) InHeadP; |
204 | RequestU *In0UP = (RequestU *) InDataP; |
205 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
206 | ReplyU *OutUP = (ReplyU *) OutDataP; |
207 | (void)OutUP; |
208 | #ifdef __MIG_check__Request__exception_raise_t__defined |
209 | kern_return_t check_result; |
210 | #endif /* __MIG_check__Request__exception_raise_t__defined */ |
211 | |
212 | #if __MigKernelSpecificCode |
213 | #else |
214 | #endif /* __MigKernelSpecificCode */ |
215 | __DeclareRcvRpc(2401, "exception_raise" ) |
216 | __BeforeRcvRpc(2401, "exception_raise" ) |
217 | |
218 | #if defined(__MIG_check__Request__exception_raise_t__defined) |
219 | check_result = __MIG_check__Request__exception_raise_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP); |
220 | if (check_result != MACH_MSG_SUCCESS) |
221 | { MIG_RETURN_ERROR(OutKP, check_result); } |
222 | #endif /* defined(__MIG_check__Request__exception_raise_t__defined) */ |
223 | |
224 | OutUP->RetCode = catch_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); |
225 | #if __MigKernelSpecificCode |
226 | #endif /* __MigKernelSpecificCode */ |
227 | |
228 | OutUP->NDR = NDR_record; |
229 | |
230 | |
231 | __AfterRcvRpc(2401, "exception_raise" ) |
232 | } |
233 | |
234 | #if ( __MigTypeCheck ) |
235 | #if __MIG_check__Request__exc_subsystem__ |
236 | #if !defined(__MIG_check__Request__exception_raise_state_t__defined) |
237 | #define __MIG_check__Request__exception_raise_state_t__defined |
238 | |
239 | mig_internal kern_return_t __MIG_check__Request__exception_raise_state_t( |
240 | __attribute__((__unused__)) __RequestKData__exception_raise_state_t *InKP, |
241 | __attribute__((__unused__)) __RequestUData__exception_raise_state_t *In0UP, |
242 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
243 | __attribute__((__unused__)) __RequestUData__exception_raise_state_t **In1UPP) |
244 | { |
245 | |
246 | typedef __Request__exception_raise_state_t __Request; |
247 | typedef __RequestUData__exception_raise_state_t __RequestU __attribute__((unused)); |
248 | __RequestU *In1UP; |
249 | #if __MigTypeCheck |
250 | unsigned int msgh_size; |
251 | #endif /* __MigTypeCheck */ |
252 | unsigned int msgh_size_delta; |
253 | |
254 | #if __MigTypeCheck |
255 | msgh_size = InKP->Head.msgh_size; |
256 | if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
257 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 5192)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
258 | return MIG_BAD_ARGUMENTS; |
259 | #endif /* __MigTypeCheck */ |
260 | |
261 | #if defined(__NDR_convert__int_rep__Request__exception_raise_state_t__codeCnt__defined) |
262 | if (In0UP->NDR.int_rep != NDR_record.int_rep) |
263 | __NDR_convert__int_rep__Request__exception_raise_state_t__codeCnt(&In0UP->codeCnt, In0UP->NDR.int_rep); |
264 | #endif /* __NDR_convert__int_rep__Request__exception_raise_state_t__codeCnt__defined */ |
265 | msgh_size_delta = (4 * In0UP->codeCnt); |
266 | #if __MigTypeCheck |
267 | if (In0UP->codeCnt > 2) |
268 | return MIG_BAD_ARGUMENTS; |
269 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 5192)) / 4 < In0UP->codeCnt) || |
270 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 5192) + (4 * In0UP->codeCnt))) |
271 | return MIG_BAD_ARGUMENTS; |
272 | msgh_size -= msgh_size_delta; |
273 | #endif /* __MigTypeCheck */ |
274 | |
275 | *In1UPP = In1UP = (__RequestU *) ((pointer_t) In0UP + msgh_size_delta - 8); |
276 | |
277 | #if defined(__NDR_convert__int_rep__Request__exception_raise_state_t__old_stateCnt__defined) |
278 | if (In0UP->NDR.int_rep != NDR_record.int_rep) |
279 | __NDR_convert__int_rep__Request__exception_raise_state_t__old_stateCnt(&In1UP->old_stateCnt, In1UP->NDR.int_rep); |
280 | #endif /* __NDR_convert__int_rep__Request__exception_raise_state_t__old_stateCnt__defined */ |
281 | #if __MigTypeCheck |
282 | if (In1UP->old_stateCnt > 1296) |
283 | return MIG_BAD_ARGUMENTS; |
284 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 5192)) / 4 < In1UP->old_stateCnt) || |
285 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 5192) + (4 * In1UP->old_stateCnt))) |
286 | return MIG_BAD_ARGUMENTS; |
287 | #endif /* __MigTypeCheck */ |
288 | |
289 | return MACH_MSG_SUCCESS; |
290 | } |
291 | #endif /* !defined(__MIG_check__Request__exception_raise_state_t__defined) */ |
292 | #endif /* __MIG_check__Request__exc_subsystem__ */ |
293 | #endif /* ( __MigTypeCheck ) */ |
294 | |
295 | |
296 | /* Routine exception_raise_state */ |
297 | mig_internal novalue _Xexception_raise_state |
298 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
299 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
300 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
301 | { |
302 | |
303 | #ifdef __MigPackStructs |
304 | #pragma pack(push, 4) |
305 | #endif |
306 | typedef struct { |
307 | NDR_record_t NDR; |
308 | exception_type_t exception; |
309 | mach_msg_type_number_t codeCnt; |
310 | integer_t code[2]; |
311 | int flavor; |
312 | mach_msg_type_number_t old_stateCnt; |
313 | natural_t old_state[1296]; |
314 | mach_msg_trailer_t trailer; |
315 | char padding[0]; /* Avoid generating empty UData structs */ |
316 | } RequestU __attribute__((unused)); |
317 | #ifdef __MigPackStructs |
318 | #pragma pack(pop) |
319 | #endif |
320 | typedef __RequestKData__exception_raise_state_t RequestK; |
321 | typedef __RequestUData__exception_raise_state_t __RequestU; |
322 | typedef __ReplyKData__exception_raise_state_t ReplyK __attribute__((unused)); |
323 | typedef __ReplyUData__exception_raise_state_t ReplyU __attribute__((unused)); |
324 | typedef __Reply__exception_raise_state_t Reply __attribute__((unused)); |
325 | typedef __Request__exception_raise_state_t __Request __attribute__((unused)); |
326 | |
327 | /* |
328 | * typedef struct { |
329 | * mach_msg_header_t Head; |
330 | * NDR_record_t NDR; |
331 | * kern_return_t RetCode; |
332 | * } mig_reply_error_t; |
333 | */ |
334 | |
335 | RequestK *InKP = (RequestK *) InHeadP; |
336 | RequestU *In0UP = (RequestU *) InDataP; |
337 | RequestU *In1UP; |
338 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
339 | ReplyU *OutUP = (ReplyU *) OutDataP; |
340 | (void)OutUP; |
341 | #ifdef __MIG_check__Request__exception_raise_state_t__defined |
342 | kern_return_t check_result; |
343 | #endif /* __MIG_check__Request__exception_raise_state_t__defined */ |
344 | |
345 | #if __MigKernelSpecificCode |
346 | #else |
347 | #endif /* __MigKernelSpecificCode */ |
348 | __DeclareRcvRpc(2402, "exception_raise_state" ) |
349 | __BeforeRcvRpc(2402, "exception_raise_state" ) |
350 | |
351 | #if defined(__MIG_check__Request__exception_raise_state_t__defined) |
352 | check_result = __MIG_check__Request__exception_raise_state_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP, In1UPP: (__RequestU **)&In1UP); |
353 | if (check_result != MACH_MSG_SUCCESS) |
354 | { MIG_RETURN_ERROR(OutKP, check_result); } |
355 | #endif /* defined(__MIG_check__Request__exception_raise_state_t__defined) */ |
356 | |
357 | OutUP->new_stateCnt = 1296; |
358 | |
359 | OutUP->RetCode = catch_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); |
360 | if (OutUP->RetCode != KERN_SUCCESS) { |
361 | MIG_RETURN_ERROR(OutKP, OutUP->RetCode); |
362 | } |
363 | #if __MigKernelSpecificCode |
364 | #endif /* __MigKernelSpecificCode */ |
365 | |
366 | OutUP->NDR = NDR_record; |
367 | |
368 | |
369 | OutUP->flavor = In1UP->flavor; |
370 | OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 5184) + (((4 * OutUP->new_stateCnt))); |
371 | |
372 | __AfterRcvRpc(2402, "exception_raise_state" ) |
373 | } |
374 | |
375 | #if ( __MigTypeCheck ) |
376 | #if __MIG_check__Request__exc_subsystem__ |
377 | #if !defined(__MIG_check__Request__exception_raise_state_identity_t__defined) |
378 | #define __MIG_check__Request__exception_raise_state_identity_t__defined |
379 | |
380 | mig_internal kern_return_t __MIG_check__Request__exception_raise_state_identity_t( |
381 | __attribute__((__unused__)) __RequestKData__exception_raise_state_identity_t *InKP, |
382 | __attribute__((__unused__)) __RequestUData__exception_raise_state_identity_t *In0UP, |
383 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
384 | __attribute__((__unused__)) __RequestUData__exception_raise_state_identity_t **In1UPP) |
385 | { |
386 | |
387 | typedef __Request__exception_raise_state_identity_t __Request; |
388 | typedef __RequestUData__exception_raise_state_identity_t __RequestU __attribute__((unused)); |
389 | __RequestU *In1UP; |
390 | #if __MigTypeCheck |
391 | unsigned int msgh_size; |
392 | #endif /* __MigTypeCheck */ |
393 | unsigned int msgh_size_delta; |
394 | |
395 | #if __MigTypeCheck |
396 | msgh_size = InKP->Head.msgh_size; |
397 | if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
398 | (InKP->msgh_body.msgh_descriptor_count != 2) || |
399 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 5192)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
400 | return MIG_BAD_ARGUMENTS; |
401 | #endif /* __MigTypeCheck */ |
402 | |
403 | #if __MigTypeCheck |
404 | if (InKP->thread.type != MACH_MSG_PORT_DESCRIPTOR || |
405 | InKP->thread.disposition != 17) |
406 | return MIG_TYPE_ERROR; |
407 | #endif /* __MigTypeCheck */ |
408 | |
409 | #if __MigTypeCheck |
410 | if (InKP->task.type != MACH_MSG_PORT_DESCRIPTOR || |
411 | InKP->task.disposition != 17) |
412 | return MIG_TYPE_ERROR; |
413 | #endif /* __MigTypeCheck */ |
414 | |
415 | #if defined(__NDR_convert__int_rep__Request__exception_raise_state_identity_t__codeCnt__defined) |
416 | if (In0UP->NDR.int_rep != NDR_record.int_rep) |
417 | __NDR_convert__int_rep__Request__exception_raise_state_identity_t__codeCnt(&In0UP->codeCnt, In0UP->NDR.int_rep); |
418 | #endif /* __NDR_convert__int_rep__Request__exception_raise_state_identity_t__codeCnt__defined */ |
419 | msgh_size_delta = (4 * In0UP->codeCnt); |
420 | #if __MigTypeCheck |
421 | if (In0UP->codeCnt > 2) |
422 | return MIG_BAD_ARGUMENTS; |
423 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 5192)) / 4 < In0UP->codeCnt) || |
424 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 5192) + (4 * In0UP->codeCnt))) |
425 | return MIG_BAD_ARGUMENTS; |
426 | msgh_size -= msgh_size_delta; |
427 | #endif /* __MigTypeCheck */ |
428 | |
429 | *In1UPP = In1UP = (__RequestU *) ((pointer_t) In0UP + msgh_size_delta - 8); |
430 | |
431 | #if defined(__NDR_convert__int_rep__Request__exception_raise_state_identity_t__old_stateCnt__defined) |
432 | if (In0UP->NDR.int_rep != NDR_record.int_rep) |
433 | __NDR_convert__int_rep__Request__exception_raise_state_identity_t__old_stateCnt(&In1UP->old_stateCnt, In1UP->NDR.int_rep); |
434 | #endif /* __NDR_convert__int_rep__Request__exception_raise_state_identity_t__old_stateCnt__defined */ |
435 | #if __MigTypeCheck |
436 | if (In1UP->old_stateCnt > 1296) |
437 | return MIG_BAD_ARGUMENTS; |
438 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 5192)) / 4 < In1UP->old_stateCnt) || |
439 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 5192) + (4 * In1UP->old_stateCnt))) |
440 | return MIG_BAD_ARGUMENTS; |
441 | #endif /* __MigTypeCheck */ |
442 | |
443 | return MACH_MSG_SUCCESS; |
444 | } |
445 | #endif /* !defined(__MIG_check__Request__exception_raise_state_identity_t__defined) */ |
446 | #endif /* __MIG_check__Request__exc_subsystem__ */ |
447 | #endif /* ( __MigTypeCheck ) */ |
448 | |
449 | |
450 | /* Routine exception_raise_state_identity */ |
451 | mig_internal novalue _Xexception_raise_state_identity |
452 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
453 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
454 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
455 | { |
456 | |
457 | #ifdef __MigPackStructs |
458 | #pragma pack(push, 4) |
459 | #endif |
460 | typedef struct { |
461 | NDR_record_t NDR; |
462 | exception_type_t exception; |
463 | mach_msg_type_number_t codeCnt; |
464 | integer_t code[2]; |
465 | int flavor; |
466 | mach_msg_type_number_t old_stateCnt; |
467 | natural_t old_state[1296]; |
468 | mach_msg_trailer_t trailer; |
469 | char padding[0]; /* Avoid generating empty UData structs */ |
470 | } RequestU __attribute__((unused)); |
471 | #ifdef __MigPackStructs |
472 | #pragma pack(pop) |
473 | #endif |
474 | typedef __RequestKData__exception_raise_state_identity_t RequestK; |
475 | typedef __RequestUData__exception_raise_state_identity_t __RequestU; |
476 | typedef __ReplyKData__exception_raise_state_identity_t ReplyK __attribute__((unused)); |
477 | typedef __ReplyUData__exception_raise_state_identity_t ReplyU __attribute__((unused)); |
478 | typedef __Reply__exception_raise_state_identity_t Reply __attribute__((unused)); |
479 | typedef __Request__exception_raise_state_identity_t __Request __attribute__((unused)); |
480 | |
481 | /* |
482 | * typedef struct { |
483 | * mach_msg_header_t Head; |
484 | * NDR_record_t NDR; |
485 | * kern_return_t RetCode; |
486 | * } mig_reply_error_t; |
487 | */ |
488 | |
489 | RequestK *InKP = (RequestK *) InHeadP; |
490 | RequestU *In0UP = (RequestU *) InDataP; |
491 | RequestU *In1UP; |
492 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
493 | ReplyU *OutUP = (ReplyU *) OutDataP; |
494 | (void)OutUP; |
495 | #ifdef __MIG_check__Request__exception_raise_state_identity_t__defined |
496 | kern_return_t check_result; |
497 | #endif /* __MIG_check__Request__exception_raise_state_identity_t__defined */ |
498 | |
499 | #if __MigKernelSpecificCode |
500 | #else |
501 | #endif /* __MigKernelSpecificCode */ |
502 | __DeclareRcvRpc(2403, "exception_raise_state_identity" ) |
503 | __BeforeRcvRpc(2403, "exception_raise_state_identity" ) |
504 | |
505 | #if defined(__MIG_check__Request__exception_raise_state_identity_t__defined) |
506 | check_result = __MIG_check__Request__exception_raise_state_identity_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP, In1UPP: (__RequestU **)&In1UP); |
507 | if (check_result != MACH_MSG_SUCCESS) |
508 | { MIG_RETURN_ERROR(OutKP, check_result); } |
509 | #endif /* defined(__MIG_check__Request__exception_raise_state_identity_t__defined) */ |
510 | |
511 | OutUP->new_stateCnt = 1296; |
512 | |
513 | OutUP->RetCode = catch_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); |
514 | if (OutUP->RetCode != KERN_SUCCESS) { |
515 | MIG_RETURN_ERROR(OutKP, OutUP->RetCode); |
516 | } |
517 | #if __MigKernelSpecificCode |
518 | #endif /* __MigKernelSpecificCode */ |
519 | |
520 | OutUP->NDR = NDR_record; |
521 | |
522 | |
523 | OutUP->flavor = In1UP->flavor; |
524 | OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 5184) + (((4 * OutUP->new_stateCnt))); |
525 | |
526 | __AfterRcvRpc(2403, "exception_raise_state_identity" ) |
527 | } |
528 | |
529 | |
530 | |
531 | /* Description of this kernel subsystem, for use in direct RPC */ |
532 | const struct catch_exc_subsystem catch_exc_subsystem = { |
533 | exc_server_routine, |
534 | 2401, |
535 | 2404, |
536 | (mach_msg_size_t)sizeof(union __ReplyUnion__catch_exc_subsystem), |
537 | (vm_address_t)0, |
538 | { |
539 | { (mig_impl_routine_t) 0, |
540 | (mig_stub_kern_routine_t) _Xexception_raise, 6, 0, 0, (mach_msg_size_t)sizeof(__Reply__exception_raise_t)}, |
541 | { .impl_routine: (mig_impl_routine_t) 0, |
542 | .kstub_routine: (mig_stub_kern_routine_t) _Xexception_raise_state, .argc: 9, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__exception_raise_state_t)}, |
543 | { .impl_routine: (mig_impl_routine_t) 0, |
544 | .kstub_routine: (mig_stub_kern_routine_t) _Xexception_raise_state_identity, .argc: 11, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__exception_raise_state_identity_t)}, |
545 | } |
546 | }; |
547 | |
548 | mig_external boolean_t exc_server |
549 | (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP) |
550 | { |
551 | /* |
552 | * typedef struct { |
553 | * mach_msg_header_t Head; |
554 | * NDR_record_t NDR; |
555 | * kern_return_t RetCode; |
556 | * } mig_reply_error_t; |
557 | */ |
558 | |
559 | mig_kern_routine_t routine; |
560 | |
561 | OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0); |
562 | OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port; |
563 | /* Minimal size: routine() will update it if different */ |
564 | OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); |
565 | OutHeadP->msgh_local_port = MACH_PORT_NULL; |
566 | OutHeadP->msgh_id = InHeadP->msgh_id + 100; |
567 | OutHeadP->msgh_reserved = 0; |
568 | |
569 | if ((InHeadP->msgh_id > 2403) || (InHeadP->msgh_id < 2401) || |
570 | ((routine = catch_exc_subsystem.kroutine[InHeadP->msgh_id - 2401].kstub_routine) == 0)) { |
571 | ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record; |
572 | ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID; |
573 | return FALSE; |
574 | } |
575 | (*routine) (InHeadP, InDataP, InTrailerP, OutHeadP, OutDataP); |
576 | return TRUE; |
577 | } |
578 | |
579 | mig_external mig_kern_routine_t exc_server_routine |
580 | (mach_msg_header_t *InHeadP) |
581 | { |
582 | int msgh_id; |
583 | |
584 | msgh_id = InHeadP->msgh_id - 2401; |
585 | |
586 | if ((msgh_id > 2) || (msgh_id < 0)) |
587 | return 0; |
588 | |
589 | return catch_exc_subsystem.kroutine[msgh_id].kstub_routine; |
590 | } |
591 | |