| 1 | /* |
| 2 | * IDENTIFICATION: |
| 3 | * stub generated by bootstrap_cmds-133 |
| 4 | * OPTIONS: |
| 5 | * KernelServer |
| 6 | */ |
| 7 | |
| 8 | /* Module mach_eventlink */ |
| 9 | |
| 10 | #define __MIG_check__Request__mach_eventlink_subsystem__ 1 |
| 11 | |
| 12 | #include "mach_eventlink_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 _Xmach_eventlink_create |
| 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 _Xmach_eventlink_destroy |
| 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 _Xmach_eventlink_associate |
| 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 _Xmach_eventlink_disassociate |
| 111 | (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP); |
| 112 | |
| 113 | |
| 114 | #if ( __MigTypeCheck ) |
| 115 | #if __MIG_check__Request__mach_eventlink_subsystem__ |
| 116 | #if !defined(__MIG_check__Request__mach_eventlink_create_t__defined) |
| 117 | #define __MIG_check__Request__mach_eventlink_create_t__defined |
| 118 | |
| 119 | mig_internal kern_return_t __MIG_check__Request__mach_eventlink_create_t( |
| 120 | __attribute__((__unused__)) __RequestKData__mach_eventlink_create_t *InKP, |
| 121 | __attribute__((__unused__)) __RequestUData__mach_eventlink_create_t *In0UP, |
| 122 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP) |
| 123 | { |
| 124 | |
| 125 | typedef __Request__mach_eventlink_create_t __Request; |
| 126 | typedef __RequestUData__mach_eventlink_create_t __RequestU __attribute__((unused)); |
| 127 | #if __MigTypeCheck |
| 128 | if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 129 | (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 130 | return MIG_BAD_ARGUMENTS; |
| 131 | #endif /* __MigTypeCheck */ |
| 132 | |
| 133 | return MACH_MSG_SUCCESS; |
| 134 | } |
| 135 | #endif /* !defined(__MIG_check__Request__mach_eventlink_create_t__defined) */ |
| 136 | #endif /* __MIG_check__Request__mach_eventlink_subsystem__ */ |
| 137 | #endif /* ( __MigTypeCheck ) */ |
| 138 | |
| 139 | |
| 140 | /* Routine mach_eventlink_create */ |
| 141 | mig_internal novalue _Xmach_eventlink_create |
| 142 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
| 143 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
| 144 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
| 145 | { |
| 146 | |
| 147 | #ifdef __MigPackStructs |
| 148 | #pragma pack(push, 4) |
| 149 | #endif |
| 150 | typedef struct { |
| 151 | NDR_record_t NDR; |
| 152 | mach_eventlink_create_option_t option; |
| 153 | mach_msg_trailer_t trailer; |
| 154 | char padding[0]; /* Avoid generating empty UData structs */ |
| 155 | } RequestU __attribute__((unused)); |
| 156 | #ifdef __MigPackStructs |
| 157 | #pragma pack(pop) |
| 158 | #endif |
| 159 | typedef __RequestKData__mach_eventlink_create_t RequestK; |
| 160 | typedef __RequestUData__mach_eventlink_create_t __RequestU; |
| 161 | typedef __ReplyKData__mach_eventlink_create_t ReplyK __attribute__((unused)); |
| 162 | typedef __ReplyUData__mach_eventlink_create_t ReplyU __attribute__((unused)); |
| 163 | typedef __Reply__mach_eventlink_create_t Reply __attribute__((unused)); |
| 164 | typedef __Request__mach_eventlink_create_t __Request __attribute__((unused)); |
| 165 | |
| 166 | /* |
| 167 | * typedef struct { |
| 168 | * mach_msg_header_t Head; |
| 169 | * NDR_record_t NDR; |
| 170 | * kern_return_t RetCode; |
| 171 | * } mig_reply_error_t; |
| 172 | */ |
| 173 | |
| 174 | RequestK *InKP = (RequestK *) InHeadP; |
| 175 | RequestU *In0UP = (RequestU *) InDataP; |
| 176 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
| 177 | ReplyU *OutUP = (ReplyU *) OutDataP; |
| 178 | (void)OutUP; |
| 179 | #ifdef __MIG_check__Request__mach_eventlink_create_t__defined |
| 180 | kern_return_t check_result; |
| 181 | #endif /* __MIG_check__Request__mach_eventlink_create_t__defined */ |
| 182 | |
| 183 | #if __MigKernelSpecificCode |
| 184 | #if UseStaticTemplates |
| 185 | const static mach_msg_port_descriptor_t eventlink_pairTemplate = { |
| 186 | /* name = */ MACH_PORT_NULL, |
| 187 | /* pad1 = */ 0, |
| 188 | /* pad2 = */ 0, |
| 189 | /* disp = */ 17, |
| 190 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 191 | }; |
| 192 | #endif /* UseStaticTemplates */ |
| 193 | |
| 194 | #else |
| 195 | #if UseStaticTemplates |
| 196 | const static mach_msg_port_descriptor_t eventlink_pairTemplate = { |
| 197 | /* name = */ MACH_PORT_NULL, |
| 198 | /* pad1 = */ 0, |
| 199 | /* pad2 = */ 0, |
| 200 | /* disp = */ 19, |
| 201 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 202 | }; |
| 203 | #endif /* UseStaticTemplates */ |
| 204 | |
| 205 | #endif /* __MigKernelSpecificCode */ |
| 206 | kern_return_t RetCode; |
| 207 | task_t task; |
| 208 | mach_port_t eventlink_pair[2]; |
| 209 | |
| 210 | __DeclareRcvRpc(716200, "mach_eventlink_create" ) |
| 211 | __BeforeRcvRpc(716200, "mach_eventlink_create" ) |
| 212 | |
| 213 | #if defined(__MIG_check__Request__mach_eventlink_create_t__defined) |
| 214 | check_result = __MIG_check__Request__mach_eventlink_create_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP); |
| 215 | if (check_result != MACH_MSG_SUCCESS) |
| 216 | { MIG_RETURN_ERROR(OutKP, check_result); } |
| 217 | #endif /* defined(__MIG_check__Request__mach_eventlink_create_t__defined) */ |
| 218 | |
| 219 | { |
| 220 | mach_msg_port_descriptor_t *ptr; |
| 221 | int i; |
| 222 | |
| 223 | ptr = &OutKP->eventlink_pair[0]; |
| 224 | for (i = 0; i < 2; ptr++, i++) { |
| 225 | #if UseStaticTemplates |
| 226 | *ptr = eventlink_pairTemplate; |
| 227 | #else /* UseStaticTemplates */ |
| 228 | #if __MigKernelSpecificCode |
| 229 | ptr->disposition = 17; |
| 230 | #else |
| 231 | ptr->disposition = 19; |
| 232 | #endif /* __MigKernelSpecificCode */ |
| 233 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 234 | ptr->pad1 = 0; |
| 235 | #endif |
| 236 | ptr->pad2 = 0; |
| 237 | ptr->type = MACH_MSG_PORT_DESCRIPTOR; |
| 238 | #if defined(KERNEL) |
| 239 | ptr->pad_end = 0; |
| 240 | #endif |
| 241 | #endif /* UseStaticTemplates */ |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | |
| 246 | task = convert_port_to_task_mig(port: InKP->Head.msgh_request_port); |
| 247 | |
| 248 | RetCode = mach_eventlink_create(task, option: In0UP->option, eventlink_pair); |
| 249 | task_deallocate_mig(task); |
| 250 | if (RetCode != KERN_SUCCESS) { |
| 251 | MIG_RETURN_ERROR(OutKP, RetCode); |
| 252 | } |
| 253 | #if __MigKernelSpecificCode |
| 254 | #endif /* __MigKernelSpecificCode */ |
| 255 | { |
| 256 | mach_msg_port_descriptor_t *ptr; |
| 257 | int i; |
| 258 | |
| 259 | ptr = &OutKP->eventlink_pair[0]; |
| 260 | for (i = 0; i < 2; ptr++, i++) { |
| 261 | ptr->name = eventlink_pair[i]; |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | |
| 266 | OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 267 | OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 268 | OutKP->msgh_body.msgh_descriptor_count = 2; |
| 269 | __AfterRcvRpc(716200, "mach_eventlink_create" ) |
| 270 | } |
| 271 | |
| 272 | #if ( __MigTypeCheck ) |
| 273 | #if __MIG_check__Request__mach_eventlink_subsystem__ |
| 274 | #if !defined(__MIG_check__Request__mach_eventlink_destroy_t__defined) |
| 275 | #define __MIG_check__Request__mach_eventlink_destroy_t__defined |
| 276 | |
| 277 | mig_internal kern_return_t __MIG_check__Request__mach_eventlink_destroy_t( |
| 278 | __attribute__((__unused__)) __RequestKData__mach_eventlink_destroy_t *InKP, |
| 279 | __attribute__((__unused__)) __RequestUData__mach_eventlink_destroy_t *In0UP, |
| 280 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP) |
| 281 | { |
| 282 | |
| 283 | typedef __Request__mach_eventlink_destroy_t __Request; |
| 284 | typedef __RequestUData__mach_eventlink_destroy_t __RequestU __attribute__((unused)); |
| 285 | #if __MigTypeCheck |
| 286 | if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 287 | (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 288 | return MIG_BAD_ARGUMENTS; |
| 289 | #endif /* __MigTypeCheck */ |
| 290 | |
| 291 | return MACH_MSG_SUCCESS; |
| 292 | } |
| 293 | #endif /* !defined(__MIG_check__Request__mach_eventlink_destroy_t__defined) */ |
| 294 | #endif /* __MIG_check__Request__mach_eventlink_subsystem__ */ |
| 295 | #endif /* ( __MigTypeCheck ) */ |
| 296 | |
| 297 | |
| 298 | /* Routine mach_eventlink_destroy */ |
| 299 | mig_internal novalue _Xmach_eventlink_destroy |
| 300 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
| 301 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
| 302 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
| 303 | { |
| 304 | |
| 305 | #ifdef __MigPackStructs |
| 306 | #pragma pack(push, 4) |
| 307 | #endif |
| 308 | typedef struct { |
| 309 | mach_msg_trailer_t trailer; |
| 310 | char padding[0]; /* Avoid generating empty UData structs */ |
| 311 | } RequestU __attribute__((unused)); |
| 312 | #ifdef __MigPackStructs |
| 313 | #pragma pack(pop) |
| 314 | #endif |
| 315 | typedef __RequestKData__mach_eventlink_destroy_t RequestK; |
| 316 | typedef __RequestUData__mach_eventlink_destroy_t __RequestU; |
| 317 | typedef __ReplyKData__mach_eventlink_destroy_t ReplyK __attribute__((unused)); |
| 318 | typedef __ReplyUData__mach_eventlink_destroy_t ReplyU __attribute__((unused)); |
| 319 | typedef __Reply__mach_eventlink_destroy_t Reply __attribute__((unused)); |
| 320 | typedef __Request__mach_eventlink_destroy_t __Request __attribute__((unused)); |
| 321 | |
| 322 | /* |
| 323 | * typedef struct { |
| 324 | * mach_msg_header_t Head; |
| 325 | * NDR_record_t NDR; |
| 326 | * kern_return_t RetCode; |
| 327 | * } mig_reply_error_t; |
| 328 | */ |
| 329 | |
| 330 | RequestK *InKP = (RequestK *) InHeadP; |
| 331 | RequestU *In0UP = (RequestU *) InDataP; |
| 332 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
| 333 | ReplyU *OutUP = (ReplyU *) OutDataP; |
| 334 | (void)OutUP; |
| 335 | #ifdef __MIG_check__Request__mach_eventlink_destroy_t__defined |
| 336 | kern_return_t check_result; |
| 337 | #endif /* __MIG_check__Request__mach_eventlink_destroy_t__defined */ |
| 338 | |
| 339 | #if __MigKernelSpecificCode |
| 340 | #else |
| 341 | #endif /* __MigKernelSpecificCode */ |
| 342 | ipc_eventlink_t eventlink; |
| 343 | |
| 344 | __DeclareRcvRpc(716201, "mach_eventlink_destroy" ) |
| 345 | __BeforeRcvRpc(716201, "mach_eventlink_destroy" ) |
| 346 | |
| 347 | #if defined(__MIG_check__Request__mach_eventlink_destroy_t__defined) |
| 348 | check_result = __MIG_check__Request__mach_eventlink_destroy_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP); |
| 349 | if (check_result != MACH_MSG_SUCCESS) |
| 350 | { MIG_RETURN_ERROR(OutKP, check_result); } |
| 351 | #endif /* defined(__MIG_check__Request__mach_eventlink_destroy_t__defined) */ |
| 352 | |
| 353 | eventlink = convert_port_to_eventlink(port: InKP->Head.msgh_request_port); |
| 354 | |
| 355 | OutUP->RetCode = mach_eventlink_destroy(eventlink); |
| 356 | ipc_eventlink_deallocate(ipc_eventlink: eventlink); |
| 357 | #if __MigKernelSpecificCode |
| 358 | #endif /* __MigKernelSpecificCode */ |
| 359 | |
| 360 | OutUP->NDR = NDR_record; |
| 361 | |
| 362 | |
| 363 | __AfterRcvRpc(716201, "mach_eventlink_destroy" ) |
| 364 | } |
| 365 | |
| 366 | #if ( __MigTypeCheck ) |
| 367 | #if __MIG_check__Request__mach_eventlink_subsystem__ |
| 368 | #if !defined(__MIG_check__Request__mach_eventlink_associate_t__defined) |
| 369 | #define __MIG_check__Request__mach_eventlink_associate_t__defined |
| 370 | |
| 371 | mig_internal kern_return_t __MIG_check__Request__mach_eventlink_associate_t( |
| 372 | __attribute__((__unused__)) __RequestKData__mach_eventlink_associate_t *InKP, |
| 373 | __attribute__((__unused__)) __RequestUData__mach_eventlink_associate_t *In0UP, |
| 374 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP) |
| 375 | { |
| 376 | |
| 377 | typedef __Request__mach_eventlink_associate_t __Request; |
| 378 | typedef __RequestUData__mach_eventlink_associate_t __RequestU __attribute__((unused)); |
| 379 | #if __MigTypeCheck |
| 380 | if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 381 | (InKP->msgh_body.msgh_descriptor_count != 1) || |
| 382 | (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 383 | return MIG_BAD_ARGUMENTS; |
| 384 | #endif /* __MigTypeCheck */ |
| 385 | |
| 386 | #if __MigTypeCheck |
| 387 | if (InKP->thread.type != MACH_MSG_PORT_DESCRIPTOR || |
| 388 | InKP->thread.disposition != 17) |
| 389 | return MIG_TYPE_ERROR; |
| 390 | #endif /* __MigTypeCheck */ |
| 391 | |
| 392 | return MACH_MSG_SUCCESS; |
| 393 | } |
| 394 | #endif /* !defined(__MIG_check__Request__mach_eventlink_associate_t__defined) */ |
| 395 | #endif /* __MIG_check__Request__mach_eventlink_subsystem__ */ |
| 396 | #endif /* ( __MigTypeCheck ) */ |
| 397 | |
| 398 | |
| 399 | /* Routine mach_eventlink_associate */ |
| 400 | mig_internal novalue _Xmach_eventlink_associate |
| 401 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
| 402 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
| 403 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
| 404 | { |
| 405 | |
| 406 | #ifdef __MigPackStructs |
| 407 | #pragma pack(push, 4) |
| 408 | #endif |
| 409 | typedef struct { |
| 410 | NDR_record_t NDR; |
| 411 | mach_vm_address_t copyin_addr_wait; |
| 412 | uint64_t copyin_mask_wait; |
| 413 | mach_vm_address_t copyin_addr_signal; |
| 414 | uint64_t copyin_mask_signal; |
| 415 | mach_eventlink_associate_option_t option; |
| 416 | mach_msg_trailer_t trailer; |
| 417 | char padding[0]; /* Avoid generating empty UData structs */ |
| 418 | } RequestU __attribute__((unused)); |
| 419 | #ifdef __MigPackStructs |
| 420 | #pragma pack(pop) |
| 421 | #endif |
| 422 | typedef __RequestKData__mach_eventlink_associate_t RequestK; |
| 423 | typedef __RequestUData__mach_eventlink_associate_t __RequestU; |
| 424 | typedef __ReplyKData__mach_eventlink_associate_t ReplyK __attribute__((unused)); |
| 425 | typedef __ReplyUData__mach_eventlink_associate_t ReplyU __attribute__((unused)); |
| 426 | typedef __Reply__mach_eventlink_associate_t Reply __attribute__((unused)); |
| 427 | typedef __Request__mach_eventlink_associate_t __Request __attribute__((unused)); |
| 428 | |
| 429 | /* |
| 430 | * typedef struct { |
| 431 | * mach_msg_header_t Head; |
| 432 | * NDR_record_t NDR; |
| 433 | * kern_return_t RetCode; |
| 434 | * } mig_reply_error_t; |
| 435 | */ |
| 436 | |
| 437 | RequestK *InKP = (RequestK *) InHeadP; |
| 438 | RequestU *In0UP = (RequestU *) InDataP; |
| 439 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
| 440 | ReplyU *OutUP = (ReplyU *) OutDataP; |
| 441 | (void)OutUP; |
| 442 | #ifdef __MIG_check__Request__mach_eventlink_associate_t__defined |
| 443 | kern_return_t check_result; |
| 444 | #endif /* __MIG_check__Request__mach_eventlink_associate_t__defined */ |
| 445 | |
| 446 | #if __MigKernelSpecificCode |
| 447 | #else |
| 448 | #endif /* __MigKernelSpecificCode */ |
| 449 | ipc_eventlink_t eventlink; |
| 450 | thread_t thread; |
| 451 | |
| 452 | __DeclareRcvRpc(716202, "mach_eventlink_associate" ) |
| 453 | __BeforeRcvRpc(716202, "mach_eventlink_associate" ) |
| 454 | |
| 455 | #if defined(__MIG_check__Request__mach_eventlink_associate_t__defined) |
| 456 | check_result = __MIG_check__Request__mach_eventlink_associate_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP); |
| 457 | if (check_result != MACH_MSG_SUCCESS) |
| 458 | { MIG_RETURN_ERROR(OutKP, check_result); } |
| 459 | #endif /* defined(__MIG_check__Request__mach_eventlink_associate_t__defined) */ |
| 460 | |
| 461 | eventlink = convert_port_to_eventlink(port: InKP->Head.msgh_request_port); |
| 462 | |
| 463 | thread = convert_port_to_thread(port: InKP->thread.name); |
| 464 | |
| 465 | OutUP->RetCode = mach_eventlink_associate(eventlink, thread, copyin_addr_wait: In0UP->copyin_addr_wait, copyin_mask_wait: In0UP->copyin_mask_wait, copyin_addr_signal: In0UP->copyin_addr_signal, copyin_mask_signal: In0UP->copyin_mask_signal, option: In0UP->option); |
| 466 | thread_deallocate(thread); |
| 467 | ipc_eventlink_deallocate(ipc_eventlink: eventlink); |
| 468 | #if __MigKernelSpecificCode |
| 469 | if (OutUP->RetCode != KERN_SUCCESS) { |
| 470 | MIG_RETURN_ERROR(OutKP, OutUP->RetCode); |
| 471 | } |
| 472 | ipc_port_release_send(port: (ipc_port_t)InKP->thread.name); |
| 473 | #endif /* __MigKernelSpecificCode */ |
| 474 | |
| 475 | OutUP->NDR = NDR_record; |
| 476 | |
| 477 | |
| 478 | __AfterRcvRpc(716202, "mach_eventlink_associate" ) |
| 479 | } |
| 480 | |
| 481 | #if ( __MigTypeCheck ) |
| 482 | #if __MIG_check__Request__mach_eventlink_subsystem__ |
| 483 | #if !defined(__MIG_check__Request__mach_eventlink_disassociate_t__defined) |
| 484 | #define __MIG_check__Request__mach_eventlink_disassociate_t__defined |
| 485 | |
| 486 | mig_internal kern_return_t __MIG_check__Request__mach_eventlink_disassociate_t( |
| 487 | __attribute__((__unused__)) __RequestKData__mach_eventlink_disassociate_t *InKP, |
| 488 | __attribute__((__unused__)) __RequestUData__mach_eventlink_disassociate_t *In0UP, |
| 489 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP) |
| 490 | { |
| 491 | |
| 492 | typedef __Request__mach_eventlink_disassociate_t __Request; |
| 493 | typedef __RequestUData__mach_eventlink_disassociate_t __RequestU __attribute__((unused)); |
| 494 | #if __MigTypeCheck |
| 495 | if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 496 | (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 497 | return MIG_BAD_ARGUMENTS; |
| 498 | #endif /* __MigTypeCheck */ |
| 499 | |
| 500 | return MACH_MSG_SUCCESS; |
| 501 | } |
| 502 | #endif /* !defined(__MIG_check__Request__mach_eventlink_disassociate_t__defined) */ |
| 503 | #endif /* __MIG_check__Request__mach_eventlink_subsystem__ */ |
| 504 | #endif /* ( __MigTypeCheck ) */ |
| 505 | |
| 506 | |
| 507 | /* Routine mach_eventlink_disassociate */ |
| 508 | mig_internal novalue _Xmach_eventlink_disassociate |
| 509 | (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP, |
| 510 | __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP, |
| 511 | mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP) |
| 512 | { |
| 513 | |
| 514 | #ifdef __MigPackStructs |
| 515 | #pragma pack(push, 4) |
| 516 | #endif |
| 517 | typedef struct { |
| 518 | NDR_record_t NDR; |
| 519 | mach_eventlink_disassociate_option_t option; |
| 520 | mach_msg_trailer_t trailer; |
| 521 | char padding[0]; /* Avoid generating empty UData structs */ |
| 522 | } RequestU __attribute__((unused)); |
| 523 | #ifdef __MigPackStructs |
| 524 | #pragma pack(pop) |
| 525 | #endif |
| 526 | typedef __RequestKData__mach_eventlink_disassociate_t RequestK; |
| 527 | typedef __RequestUData__mach_eventlink_disassociate_t __RequestU; |
| 528 | typedef __ReplyKData__mach_eventlink_disassociate_t ReplyK __attribute__((unused)); |
| 529 | typedef __ReplyUData__mach_eventlink_disassociate_t ReplyU __attribute__((unused)); |
| 530 | typedef __Reply__mach_eventlink_disassociate_t Reply __attribute__((unused)); |
| 531 | typedef __Request__mach_eventlink_disassociate_t __Request __attribute__((unused)); |
| 532 | |
| 533 | /* |
| 534 | * typedef struct { |
| 535 | * mach_msg_header_t Head; |
| 536 | * NDR_record_t NDR; |
| 537 | * kern_return_t RetCode; |
| 538 | * } mig_reply_error_t; |
| 539 | */ |
| 540 | |
| 541 | RequestK *InKP = (RequestK *) InHeadP; |
| 542 | RequestU *In0UP = (RequestU *) InDataP; |
| 543 | ReplyK *OutKP = (ReplyK *) OutHeadP; |
| 544 | ReplyU *OutUP = (ReplyU *) OutDataP; |
| 545 | (void)OutUP; |
| 546 | #ifdef __MIG_check__Request__mach_eventlink_disassociate_t__defined |
| 547 | kern_return_t check_result; |
| 548 | #endif /* __MIG_check__Request__mach_eventlink_disassociate_t__defined */ |
| 549 | |
| 550 | #if __MigKernelSpecificCode |
| 551 | #else |
| 552 | #endif /* __MigKernelSpecificCode */ |
| 553 | ipc_eventlink_t eventlink; |
| 554 | |
| 555 | __DeclareRcvRpc(716203, "mach_eventlink_disassociate" ) |
| 556 | __BeforeRcvRpc(716203, "mach_eventlink_disassociate" ) |
| 557 | |
| 558 | #if defined(__MIG_check__Request__mach_eventlink_disassociate_t__defined) |
| 559 | check_result = __MIG_check__Request__mach_eventlink_disassociate_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP); |
| 560 | if (check_result != MACH_MSG_SUCCESS) |
| 561 | { MIG_RETURN_ERROR(OutKP, check_result); } |
| 562 | #endif /* defined(__MIG_check__Request__mach_eventlink_disassociate_t__defined) */ |
| 563 | |
| 564 | eventlink = convert_port_to_eventlink(port: InKP->Head.msgh_request_port); |
| 565 | |
| 566 | OutUP->RetCode = mach_eventlink_disassociate(eventlink, option: In0UP->option); |
| 567 | ipc_eventlink_deallocate(ipc_eventlink: eventlink); |
| 568 | #if __MigKernelSpecificCode |
| 569 | #endif /* __MigKernelSpecificCode */ |
| 570 | |
| 571 | OutUP->NDR = NDR_record; |
| 572 | |
| 573 | |
| 574 | __AfterRcvRpc(716203, "mach_eventlink_disassociate" ) |
| 575 | } |
| 576 | |
| 577 | |
| 578 | |
| 579 | /* Description of this kernel subsystem, for use in direct RPC */ |
| 580 | const struct mach_eventlink_subsystem mach_eventlink_subsystem = { |
| 581 | mach_eventlink_server_routine, |
| 582 | 716200, |
| 583 | 716204, |
| 584 | (mach_msg_size_t)sizeof(union __ReplyUnion__mach_eventlink_subsystem), |
| 585 | (vm_address_t)0, |
| 586 | { |
| 587 | { (mig_impl_routine_t) 0, |
| 588 | (mig_stub_kern_routine_t) _Xmach_eventlink_create, 3, 0, 2, (mach_msg_size_t)sizeof(__Reply__mach_eventlink_create_t)}, |
| 589 | { .impl_routine: (mig_impl_routine_t) 0, |
| 590 | .kstub_routine: (mig_stub_kern_routine_t) _Xmach_eventlink_destroy, .argc: 1, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mach_eventlink_destroy_t)}, |
| 591 | { .impl_routine: (mig_impl_routine_t) 0, |
| 592 | .kstub_routine: (mig_stub_kern_routine_t) _Xmach_eventlink_associate, .argc: 11, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mach_eventlink_associate_t)}, |
| 593 | { .impl_routine: (mig_impl_routine_t) 0, |
| 594 | .kstub_routine: (mig_stub_kern_routine_t) _Xmach_eventlink_disassociate, .argc: 2, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mach_eventlink_disassociate_t)}, |
| 595 | } |
| 596 | }; |
| 597 | |
| 598 | mig_external boolean_t mach_eventlink_server |
| 599 | (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP) |
| 600 | { |
| 601 | /* |
| 602 | * typedef struct { |
| 603 | * mach_msg_header_t Head; |
| 604 | * NDR_record_t NDR; |
| 605 | * kern_return_t RetCode; |
| 606 | * } mig_reply_error_t; |
| 607 | */ |
| 608 | |
| 609 | mig_kern_routine_t routine; |
| 610 | |
| 611 | OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0); |
| 612 | OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port; |
| 613 | /* Minimal size: routine() will update it if different */ |
| 614 | OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); |
| 615 | OutHeadP->msgh_local_port = MACH_PORT_NULL; |
| 616 | OutHeadP->msgh_id = InHeadP->msgh_id + 100; |
| 617 | OutHeadP->msgh_reserved = 0; |
| 618 | |
| 619 | if ((InHeadP->msgh_id > 716203) || (InHeadP->msgh_id < 716200) || |
| 620 | ((routine = mach_eventlink_subsystem.kroutine[InHeadP->msgh_id - 716200].kstub_routine) == 0)) { |
| 621 | ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record; |
| 622 | ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID; |
| 623 | return FALSE; |
| 624 | } |
| 625 | (*routine) (InHeadP, InDataP, InTrailerP, OutHeadP, OutDataP); |
| 626 | return TRUE; |
| 627 | } |
| 628 | |
| 629 | mig_external mig_kern_routine_t mach_eventlink_server_routine |
| 630 | (mach_msg_header_t *InHeadP) |
| 631 | { |
| 632 | int msgh_id; |
| 633 | |
| 634 | msgh_id = InHeadP->msgh_id - 716200; |
| 635 | |
| 636 | if ((msgh_id > 3) || (msgh_id < 0)) |
| 637 | return 0; |
| 638 | |
| 639 | return mach_eventlink_subsystem.kroutine[msgh_id].kstub_routine; |
| 640 | } |
| 641 | |