| 1 | /* |
| 2 | * IDENTIFICATION: |
| 3 | * stub generated Tue Apr 9 11:33:41 2019 |
| 4 | * with a MiG generated by bootstrap_cmds-96.20.2.200.4 |
| 5 | * OPTIONS: |
| 6 | * KernelServer |
| 7 | */ |
| 8 | |
| 9 | /* Module exc */ |
| 10 | |
| 11 | #define __MIG_check__Request__exc_subsystem__ 1 |
| 12 | |
| 13 | #include "exc_server.h" |
| 14 | |
| 15 | #ifndef mig_internal |
| 16 | #define mig_internal static __inline__ |
| 17 | #endif /* mig_internal */ |
| 18 | |
| 19 | #ifndef mig_external |
| 20 | #define mig_external |
| 21 | #endif /* mig_external */ |
| 22 | |
| 23 | #if !defined(__MigTypeCheck) && defined(TypeCheck) |
| 24 | #define __MigTypeCheck TypeCheck /* Legacy setting */ |
| 25 | #endif /* !defined(__MigTypeCheck) */ |
| 26 | |
| 27 | #if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_) |
| 28 | #define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */ |
| 29 | #endif /* !defined(__MigKernelSpecificCode) */ |
| 30 | |
| 31 | #ifndef LimitCheck |
| 32 | #define LimitCheck 0 |
| 33 | #endif /* LimitCheck */ |
| 34 | |
| 35 | #ifndef min |
| 36 | #define min(a,b) ( ((a) < (b))? (a): (b) ) |
| 37 | #endif /* min */ |
| 38 | |
| 39 | #if !defined(_WALIGN_) |
| 40 | #define _WALIGN_(x) (((x) + 3) & ~3) |
| 41 | #endif /* !defined(_WALIGN_) */ |
| 42 | |
| 43 | #if !defined(_WALIGNSZ_) |
| 44 | #define _WALIGNSZ_(x) _WALIGN_(sizeof(x)) |
| 45 | #endif /* !defined(_WALIGNSZ_) */ |
| 46 | |
| 47 | #ifndef UseStaticTemplates |
| 48 | #define UseStaticTemplates 0 |
| 49 | #endif /* UseStaticTemplates */ |
| 50 | |
| 51 | #ifndef __DeclareRcvRpc |
| 52 | #define __DeclareRcvRpc(_NUM_, _NAME_) |
| 53 | #endif /* __DeclareRcvRpc */ |
| 54 | |
| 55 | #ifndef __BeforeRcvRpc |
| 56 | #define __BeforeRcvRpc(_NUM_, _NAME_) |
| 57 | #endif /* __BeforeRcvRpc */ |
| 58 | |
| 59 | #ifndef __AfterRcvRpc |
| 60 | #define __AfterRcvRpc(_NUM_, _NAME_) |
| 61 | #endif /* __AfterRcvRpc */ |
| 62 | |
| 63 | #ifndef __DeclareRcvSimple |
| 64 | #define __DeclareRcvSimple(_NUM_, _NAME_) |
| 65 | #endif /* __DeclareRcvSimple */ |
| 66 | |
| 67 | #ifndef __BeforeRcvSimple |
| 68 | #define __BeforeRcvSimple(_NUM_, _NAME_) |
| 69 | #endif /* __BeforeRcvSimple */ |
| 70 | |
| 71 | #ifndef __AfterRcvSimple |
| 72 | #define __AfterRcvSimple(_NUM_, _NAME_) |
| 73 | #endif /* __AfterRcvSimple */ |
| 74 | |
| 75 | #define novalue void |
| 76 | |
| 77 | #if __MigKernelSpecificCode |
| 78 | #define msgh_request_port msgh_remote_port |
| 79 | #define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_REMOTE(bits) |
| 80 | #define msgh_reply_port msgh_local_port |
| 81 | #define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_LOCAL(bits) |
| 82 | #else |
| 83 | #define msgh_request_port msgh_local_port |
| 84 | #define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits) |
| 85 | #define msgh_reply_port msgh_remote_port |
| 86 | #define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits) |
| 87 | #endif /* __MigKernelSpecificCode */ |
| 88 | |
| 89 | #define MIG_RETURN_ERROR(X, code) {\ |
| 90 | ((mig_reply_error_t *)X)->RetCode = code;\ |
| 91 | ((mig_reply_error_t *)X)->NDR = NDR_record;\ |
| 92 | return;\ |
| 93 | } |
| 94 | |
| 95 | /* Forward Declarations */ |
| 96 | |
| 97 | |
| 98 | mig_internal novalue _Xexception_raise |
| 99 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 100 | |
| 101 | mig_internal novalue _Xexception_raise_state |
| 102 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 103 | |
| 104 | mig_internal novalue _Xexception_raise_state_identity |
| 105 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 106 | |
| 107 | |
| 108 | #if ( __MigTypeCheck ) |
| 109 | #if __MIG_check__Request__exc_subsystem__ |
| 110 | #if !defined(__MIG_check__Request__exception_raise_t__defined) |
| 111 | #define __MIG_check__Request__exception_raise_t__defined |
| 112 | |
| 113 | mig_internal kern_return_t __MIG_check__Request__exception_raise_t(__attribute__((__unused__)) __Request__exception_raise_t *In0P) |
| 114 | { |
| 115 | |
| 116 | typedef __Request__exception_raise_t __Request; |
| 117 | #if __MigTypeCheck |
| 118 | unsigned int msgh_size; |
| 119 | #endif /* __MigTypeCheck */ |
| 120 | |
| 121 | #if __MigTypeCheck |
| 122 | msgh_size = In0P->Head.msgh_size; |
| 123 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 124 | (In0P->msgh_body.msgh_descriptor_count != 2) || |
| 125 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 8)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 126 | return MIG_BAD_ARGUMENTS; |
| 127 | #endif /* __MigTypeCheck */ |
| 128 | |
| 129 | #if __MigTypeCheck |
| 130 | if (In0P->thread.type != MACH_MSG_PORT_DESCRIPTOR || |
| 131 | In0P->thread.disposition != 17) |
| 132 | return MIG_TYPE_ERROR; |
| 133 | #endif /* __MigTypeCheck */ |
| 134 | |
| 135 | #if __MigTypeCheck |
| 136 | if (In0P->task.type != MACH_MSG_PORT_DESCRIPTOR || |
| 137 | In0P->task.disposition != 17) |
| 138 | return MIG_TYPE_ERROR; |
| 139 | #endif /* __MigTypeCheck */ |
| 140 | |
| 141 | #if defined(__NDR_convert__int_rep__Request__exception_raise_t__codeCnt__defined) |
| 142 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 143 | __NDR_convert__int_rep__Request__exception_raise_t__codeCnt(&In0P->codeCnt, In0P->NDR.int_rep); |
| 144 | #endif /* __NDR_convert__int_rep__Request__exception_raise_t__codeCnt__defined */ |
| 145 | #if __MigTypeCheck |
| 146 | if ( In0P->codeCnt > 2 ) |
| 147 | return MIG_BAD_ARGUMENTS; |
| 148 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 8)) / 4 < In0P->codeCnt) || |
| 149 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 8) + (4 * In0P->codeCnt))) |
| 150 | return MIG_BAD_ARGUMENTS; |
| 151 | #endif /* __MigTypeCheck */ |
| 152 | |
| 153 | return MACH_MSG_SUCCESS; |
| 154 | } |
| 155 | #endif /* !defined(__MIG_check__Request__exception_raise_t__defined) */ |
| 156 | #endif /* __MIG_check__Request__exc_subsystem__ */ |
| 157 | #endif /* ( __MigTypeCheck ) */ |
| 158 | |
| 159 | |
| 160 | /* Routine exception_raise */ |
| 161 | mig_internal novalue _Xexception_raise |
| 162 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 163 | { |
| 164 | |
| 165 | #ifdef __MigPackStructs |
| 166 | #pragma pack(4) |
| 167 | #endif |
| 168 | typedef struct { |
| 169 | mach_msg_header_t Head; |
| 170 | /* start of the kernel processed data */ |
| 171 | mach_msg_body_t msgh_body; |
| 172 | mach_msg_port_descriptor_t thread; |
| 173 | mach_msg_port_descriptor_t task; |
| 174 | /* end of the kernel processed data */ |
| 175 | NDR_record_t NDR; |
| 176 | exception_type_t exception; |
| 177 | mach_msg_type_number_t codeCnt; |
| 178 | integer_t code[2]; |
| 179 | mach_msg_trailer_t trailer; |
| 180 | } Request __attribute__((unused)); |
| 181 | #ifdef __MigPackStructs |
| 182 | #pragma pack() |
| 183 | #endif |
| 184 | typedef __Request__exception_raise_t __Request; |
| 185 | typedef __Reply__exception_raise_t Reply __attribute__((unused)); |
| 186 | |
| 187 | /* |
| 188 | * typedef struct { |
| 189 | * mach_msg_header_t Head; |
| 190 | * NDR_record_t NDR; |
| 191 | * kern_return_t RetCode; |
| 192 | * } mig_reply_error_t; |
| 193 | */ |
| 194 | |
| 195 | Request *In0P = (Request *) InHeadP; |
| 196 | Reply *OutP = (Reply *) OutHeadP; |
| 197 | #ifdef __MIG_check__Request__exception_raise_t__defined |
| 198 | kern_return_t check_result; |
| 199 | #endif /* __MIG_check__Request__exception_raise_t__defined */ |
| 200 | |
| 201 | #if __MigKernelSpecificCode |
| 202 | #else |
| 203 | #endif /* __MigKernelSpecificCode */ |
| 204 | __DeclareRcvRpc(2401, "exception_raise" ) |
| 205 | __BeforeRcvRpc(2401, "exception_raise" ) |
| 206 | |
| 207 | #if defined(__MIG_check__Request__exception_raise_t__defined) |
| 208 | check_result = __MIG_check__Request__exception_raise_t((__Request *)In0P); |
| 209 | if (check_result != MACH_MSG_SUCCESS) |
| 210 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 211 | #endif /* defined(__MIG_check__Request__exception_raise_t__defined) */ |
| 212 | |
| 213 | OutP->RetCode = catch_exception_raise(In0P->Head.msgh_request_port, In0P->thread.name, In0P->task.name, In0P->exception, In0P->code, In0P->codeCnt); |
| 214 | #if __MigKernelSpecificCode |
| 215 | #endif /* __MigKernelSpecificCode */ |
| 216 | |
| 217 | OutP->NDR = NDR_record; |
| 218 | |
| 219 | |
| 220 | __AfterRcvRpc(2401, "exception_raise" ) |
| 221 | } |
| 222 | |
| 223 | #if ( __MigTypeCheck ) |
| 224 | #if __MIG_check__Request__exc_subsystem__ |
| 225 | #if !defined(__MIG_check__Request__exception_raise_state_t__defined) |
| 226 | #define __MIG_check__Request__exception_raise_state_t__defined |
| 227 | |
| 228 | mig_internal kern_return_t __MIG_check__Request__exception_raise_state_t(__attribute__((__unused__)) __Request__exception_raise_state_t *In0P, __attribute__((__unused__)) __Request__exception_raise_state_t **In1PP) |
| 229 | { |
| 230 | |
| 231 | typedef __Request__exception_raise_state_t __Request; |
| 232 | __Request *In1P; |
| 233 | #if __MigTypeCheck |
| 234 | unsigned int msgh_size; |
| 235 | #endif /* __MigTypeCheck */ |
| 236 | unsigned int msgh_size_delta; |
| 237 | |
| 238 | #if __MigTypeCheck |
| 239 | msgh_size = In0P->Head.msgh_size; |
| 240 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 241 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 2464)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 242 | return MIG_BAD_ARGUMENTS; |
| 243 | #endif /* __MigTypeCheck */ |
| 244 | |
| 245 | #if defined(__NDR_convert__int_rep__Request__exception_raise_state_t__codeCnt__defined) |
| 246 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 247 | __NDR_convert__int_rep__Request__exception_raise_state_t__codeCnt(&In0P->codeCnt, In0P->NDR.int_rep); |
| 248 | #endif /* __NDR_convert__int_rep__Request__exception_raise_state_t__codeCnt__defined */ |
| 249 | msgh_size_delta = (4 * In0P->codeCnt); |
| 250 | #if __MigTypeCheck |
| 251 | if ( In0P->codeCnt > 2 ) |
| 252 | return MIG_BAD_ARGUMENTS; |
| 253 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 2464)) / 4 < In0P->codeCnt) || |
| 254 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 2464) + (4 * In0P->codeCnt))) |
| 255 | return MIG_BAD_ARGUMENTS; |
| 256 | msgh_size -= msgh_size_delta; |
| 257 | #endif /* __MigTypeCheck */ |
| 258 | |
| 259 | *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 8); |
| 260 | |
| 261 | #if defined(__NDR_convert__int_rep__Request__exception_raise_state_t__old_stateCnt__defined) |
| 262 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 263 | __NDR_convert__int_rep__Request__exception_raise_state_t__old_stateCnt(&In1P->old_stateCnt, In1P->NDR.int_rep); |
| 264 | #endif /* __NDR_convert__int_rep__Request__exception_raise_state_t__old_stateCnt__defined */ |
| 265 | #if __MigTypeCheck |
| 266 | if ( In1P->old_stateCnt > 614 ) |
| 267 | return MIG_BAD_ARGUMENTS; |
| 268 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 2464)) / 4 < In1P->old_stateCnt) || |
| 269 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 2464) + (4 * In1P->old_stateCnt))) |
| 270 | return MIG_BAD_ARGUMENTS; |
| 271 | #endif /* __MigTypeCheck */ |
| 272 | |
| 273 | return MACH_MSG_SUCCESS; |
| 274 | } |
| 275 | #endif /* !defined(__MIG_check__Request__exception_raise_state_t__defined) */ |
| 276 | #endif /* __MIG_check__Request__exc_subsystem__ */ |
| 277 | #endif /* ( __MigTypeCheck ) */ |
| 278 | |
| 279 | |
| 280 | /* Routine exception_raise_state */ |
| 281 | mig_internal novalue _Xexception_raise_state |
| 282 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 283 | { |
| 284 | |
| 285 | #ifdef __MigPackStructs |
| 286 | #pragma pack(4) |
| 287 | #endif |
| 288 | typedef struct { |
| 289 | mach_msg_header_t Head; |
| 290 | NDR_record_t NDR; |
| 291 | exception_type_t exception; |
| 292 | mach_msg_type_number_t codeCnt; |
| 293 | integer_t code[2]; |
| 294 | int flavor; |
| 295 | mach_msg_type_number_t old_stateCnt; |
| 296 | natural_t old_state[614]; |
| 297 | mach_msg_trailer_t trailer; |
| 298 | } Request __attribute__((unused)); |
| 299 | #ifdef __MigPackStructs |
| 300 | #pragma pack() |
| 301 | #endif |
| 302 | typedef __Request__exception_raise_state_t __Request; |
| 303 | typedef __Reply__exception_raise_state_t Reply __attribute__((unused)); |
| 304 | |
| 305 | /* |
| 306 | * typedef struct { |
| 307 | * mach_msg_header_t Head; |
| 308 | * NDR_record_t NDR; |
| 309 | * kern_return_t RetCode; |
| 310 | * } mig_reply_error_t; |
| 311 | */ |
| 312 | |
| 313 | Request *In0P = (Request *) InHeadP; |
| 314 | Request *In1P; |
| 315 | Reply *OutP = (Reply *) OutHeadP; |
| 316 | #ifdef __MIG_check__Request__exception_raise_state_t__defined |
| 317 | kern_return_t check_result; |
| 318 | #endif /* __MIG_check__Request__exception_raise_state_t__defined */ |
| 319 | |
| 320 | #if __MigKernelSpecificCode |
| 321 | #else |
| 322 | #endif /* __MigKernelSpecificCode */ |
| 323 | __DeclareRcvRpc(2402, "exception_raise_state" ) |
| 324 | __BeforeRcvRpc(2402, "exception_raise_state" ) |
| 325 | |
| 326 | #if defined(__MIG_check__Request__exception_raise_state_t__defined) |
| 327 | check_result = __MIG_check__Request__exception_raise_state_t((__Request *)In0P, (__Request **)&In1P); |
| 328 | if (check_result != MACH_MSG_SUCCESS) |
| 329 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 330 | #endif /* defined(__MIG_check__Request__exception_raise_state_t__defined) */ |
| 331 | |
| 332 | OutP->new_stateCnt = 614; |
| 333 | |
| 334 | OutP->RetCode = catch_exception_raise_state(In0P->Head.msgh_request_port, In0P->exception, In0P->code, In0P->codeCnt, &In1P->flavor, In1P->old_state, In1P->old_stateCnt, OutP->new_state, &OutP->new_stateCnt); |
| 335 | if (OutP->RetCode != KERN_SUCCESS) { |
| 336 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 337 | } |
| 338 | #if __MigKernelSpecificCode |
| 339 | #endif /* __MigKernelSpecificCode */ |
| 340 | |
| 341 | OutP->NDR = NDR_record; |
| 342 | |
| 343 | |
| 344 | OutP->flavor = In1P->flavor; |
| 345 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 2456) + (((4 * OutP->new_stateCnt))); |
| 346 | |
| 347 | __AfterRcvRpc(2402, "exception_raise_state" ) |
| 348 | } |
| 349 | |
| 350 | #if ( __MigTypeCheck ) |
| 351 | #if __MIG_check__Request__exc_subsystem__ |
| 352 | #if !defined(__MIG_check__Request__exception_raise_state_identity_t__defined) |
| 353 | #define __MIG_check__Request__exception_raise_state_identity_t__defined |
| 354 | |
| 355 | mig_internal kern_return_t __MIG_check__Request__exception_raise_state_identity_t(__attribute__((__unused__)) __Request__exception_raise_state_identity_t *In0P, __attribute__((__unused__)) __Request__exception_raise_state_identity_t **In1PP) |
| 356 | { |
| 357 | |
| 358 | typedef __Request__exception_raise_state_identity_t __Request; |
| 359 | __Request *In1P; |
| 360 | #if __MigTypeCheck |
| 361 | unsigned int msgh_size; |
| 362 | #endif /* __MigTypeCheck */ |
| 363 | unsigned int msgh_size_delta; |
| 364 | |
| 365 | #if __MigTypeCheck |
| 366 | msgh_size = In0P->Head.msgh_size; |
| 367 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 368 | (In0P->msgh_body.msgh_descriptor_count != 2) || |
| 369 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 2464)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 370 | return MIG_BAD_ARGUMENTS; |
| 371 | #endif /* __MigTypeCheck */ |
| 372 | |
| 373 | #if __MigTypeCheck |
| 374 | if (In0P->thread.type != MACH_MSG_PORT_DESCRIPTOR || |
| 375 | In0P->thread.disposition != 17) |
| 376 | return MIG_TYPE_ERROR; |
| 377 | #endif /* __MigTypeCheck */ |
| 378 | |
| 379 | #if __MigTypeCheck |
| 380 | if (In0P->task.type != MACH_MSG_PORT_DESCRIPTOR || |
| 381 | In0P->task.disposition != 17) |
| 382 | return MIG_TYPE_ERROR; |
| 383 | #endif /* __MigTypeCheck */ |
| 384 | |
| 385 | #if defined(__NDR_convert__int_rep__Request__exception_raise_state_identity_t__codeCnt__defined) |
| 386 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 387 | __NDR_convert__int_rep__Request__exception_raise_state_identity_t__codeCnt(&In0P->codeCnt, In0P->NDR.int_rep); |
| 388 | #endif /* __NDR_convert__int_rep__Request__exception_raise_state_identity_t__codeCnt__defined */ |
| 389 | msgh_size_delta = (4 * In0P->codeCnt); |
| 390 | #if __MigTypeCheck |
| 391 | if ( In0P->codeCnt > 2 ) |
| 392 | return MIG_BAD_ARGUMENTS; |
| 393 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 2464)) / 4 < In0P->codeCnt) || |
| 394 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 2464) + (4 * In0P->codeCnt))) |
| 395 | return MIG_BAD_ARGUMENTS; |
| 396 | msgh_size -= msgh_size_delta; |
| 397 | #endif /* __MigTypeCheck */ |
| 398 | |
| 399 | *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 8); |
| 400 | |
| 401 | #if defined(__NDR_convert__int_rep__Request__exception_raise_state_identity_t__old_stateCnt__defined) |
| 402 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 403 | __NDR_convert__int_rep__Request__exception_raise_state_identity_t__old_stateCnt(&In1P->old_stateCnt, In1P->NDR.int_rep); |
| 404 | #endif /* __NDR_convert__int_rep__Request__exception_raise_state_identity_t__old_stateCnt__defined */ |
| 405 | #if __MigTypeCheck |
| 406 | if ( In1P->old_stateCnt > 614 ) |
| 407 | return MIG_BAD_ARGUMENTS; |
| 408 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 2464)) / 4 < In1P->old_stateCnt) || |
| 409 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 2464) + (4 * In1P->old_stateCnt))) |
| 410 | return MIG_BAD_ARGUMENTS; |
| 411 | #endif /* __MigTypeCheck */ |
| 412 | |
| 413 | return MACH_MSG_SUCCESS; |
| 414 | } |
| 415 | #endif /* !defined(__MIG_check__Request__exception_raise_state_identity_t__defined) */ |
| 416 | #endif /* __MIG_check__Request__exc_subsystem__ */ |
| 417 | #endif /* ( __MigTypeCheck ) */ |
| 418 | |
| 419 | |
| 420 | /* Routine exception_raise_state_identity */ |
| 421 | mig_internal novalue _Xexception_raise_state_identity |
| 422 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 423 | { |
| 424 | |
| 425 | #ifdef __MigPackStructs |
| 426 | #pragma pack(4) |
| 427 | #endif |
| 428 | typedef struct { |
| 429 | mach_msg_header_t Head; |
| 430 | /* start of the kernel processed data */ |
| 431 | mach_msg_body_t msgh_body; |
| 432 | mach_msg_port_descriptor_t thread; |
| 433 | mach_msg_port_descriptor_t task; |
| 434 | /* end of the kernel processed data */ |
| 435 | NDR_record_t NDR; |
| 436 | exception_type_t exception; |
| 437 | mach_msg_type_number_t codeCnt; |
| 438 | integer_t code[2]; |
| 439 | int flavor; |
| 440 | mach_msg_type_number_t old_stateCnt; |
| 441 | natural_t old_state[614]; |
| 442 | mach_msg_trailer_t trailer; |
| 443 | } Request __attribute__((unused)); |
| 444 | #ifdef __MigPackStructs |
| 445 | #pragma pack() |
| 446 | #endif |
| 447 | typedef __Request__exception_raise_state_identity_t __Request; |
| 448 | typedef __Reply__exception_raise_state_identity_t Reply __attribute__((unused)); |
| 449 | |
| 450 | /* |
| 451 | * typedef struct { |
| 452 | * mach_msg_header_t Head; |
| 453 | * NDR_record_t NDR; |
| 454 | * kern_return_t RetCode; |
| 455 | * } mig_reply_error_t; |
| 456 | */ |
| 457 | |
| 458 | Request *In0P = (Request *) InHeadP; |
| 459 | Request *In1P; |
| 460 | Reply *OutP = (Reply *) OutHeadP; |
| 461 | #ifdef __MIG_check__Request__exception_raise_state_identity_t__defined |
| 462 | kern_return_t check_result; |
| 463 | #endif /* __MIG_check__Request__exception_raise_state_identity_t__defined */ |
| 464 | |
| 465 | #if __MigKernelSpecificCode |
| 466 | #else |
| 467 | #endif /* __MigKernelSpecificCode */ |
| 468 | __DeclareRcvRpc(2403, "exception_raise_state_identity" ) |
| 469 | __BeforeRcvRpc(2403, "exception_raise_state_identity" ) |
| 470 | |
| 471 | #if defined(__MIG_check__Request__exception_raise_state_identity_t__defined) |
| 472 | check_result = __MIG_check__Request__exception_raise_state_identity_t((__Request *)In0P, (__Request **)&In1P); |
| 473 | if (check_result != MACH_MSG_SUCCESS) |
| 474 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 475 | #endif /* defined(__MIG_check__Request__exception_raise_state_identity_t__defined) */ |
| 476 | |
| 477 | OutP->new_stateCnt = 614; |
| 478 | |
| 479 | OutP->RetCode = catch_exception_raise_state_identity(In0P->Head.msgh_request_port, In0P->thread.name, In0P->task.name, In0P->exception, In0P->code, In0P->codeCnt, &In1P->flavor, In1P->old_state, In1P->old_stateCnt, OutP->new_state, &OutP->new_stateCnt); |
| 480 | if (OutP->RetCode != KERN_SUCCESS) { |
| 481 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 482 | } |
| 483 | #if __MigKernelSpecificCode |
| 484 | #endif /* __MigKernelSpecificCode */ |
| 485 | |
| 486 | OutP->NDR = NDR_record; |
| 487 | |
| 488 | |
| 489 | OutP->flavor = In1P->flavor; |
| 490 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 2456) + (((4 * OutP->new_stateCnt))); |
| 491 | |
| 492 | __AfterRcvRpc(2403, "exception_raise_state_identity" ) |
| 493 | } |
| 494 | |
| 495 | |
| 496 | |
| 497 | /* Description of this subsystem, for use in direct RPC */ |
| 498 | const struct catch_exc_subsystem catch_exc_subsystem = { |
| 499 | exc_server_routine, |
| 500 | 2401, |
| 501 | 2404, |
| 502 | (mach_msg_size_t)sizeof(union __ReplyUnion__catch_exc_subsystem), |
| 503 | (vm_address_t)0, |
| 504 | { |
| 505 | { (mig_impl_routine_t) 0, |
| 506 | (mig_stub_routine_t) _Xexception_raise, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__exception_raise_t)}, |
| 507 | { (mig_impl_routine_t) 0, |
| 508 | (mig_stub_routine_t) _Xexception_raise_state, 9, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__exception_raise_state_t)}, |
| 509 | { (mig_impl_routine_t) 0, |
| 510 | (mig_stub_routine_t) _Xexception_raise_state_identity, 11, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__exception_raise_state_identity_t)}, |
| 511 | } |
| 512 | }; |
| 513 | |
| 514 | mig_external boolean_t exc_server |
| 515 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 516 | { |
| 517 | /* |
| 518 | * typedef struct { |
| 519 | * mach_msg_header_t Head; |
| 520 | * NDR_record_t NDR; |
| 521 | * kern_return_t RetCode; |
| 522 | * } mig_reply_error_t; |
| 523 | */ |
| 524 | |
| 525 | register mig_routine_t routine; |
| 526 | |
| 527 | OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0); |
| 528 | OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port; |
| 529 | /* Minimal size: routine() will update it if different */ |
| 530 | OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); |
| 531 | OutHeadP->msgh_local_port = MACH_PORT_NULL; |
| 532 | OutHeadP->msgh_id = InHeadP->msgh_id + 100; |
| 533 | OutHeadP->msgh_reserved = 0; |
| 534 | |
| 535 | if ((InHeadP->msgh_id > 2403) || (InHeadP->msgh_id < 2401) || |
| 536 | ((routine = catch_exc_subsystem.routine[InHeadP->msgh_id - 2401].stub_routine) == 0)) { |
| 537 | ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record; |
| 538 | ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID; |
| 539 | return FALSE; |
| 540 | } |
| 541 | (*routine) (InHeadP, OutHeadP); |
| 542 | return TRUE; |
| 543 | } |
| 544 | |
| 545 | mig_external mig_routine_t exc_server_routine |
| 546 | (mach_msg_header_t *InHeadP) |
| 547 | { |
| 548 | register int msgh_id; |
| 549 | |
| 550 | msgh_id = InHeadP->msgh_id - 2401; |
| 551 | |
| 552 | if ((msgh_id > 2) || (msgh_id < 0)) |
| 553 | return 0; |
| 554 | |
| 555 | return catch_exc_subsystem.routine[msgh_id].stub_routine; |
| 556 | } |
| 557 | |