| 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 task */ |
| 10 | |
| 11 | #define __MIG_check__Request__task_subsystem__ 1 |
| 12 | |
| 13 | #include "task_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 _Xtask_create |
| 99 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 100 | |
| 101 | mig_internal novalue _Xtask_terminate |
| 102 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 103 | |
| 104 | mig_internal novalue _Xtask_threads |
| 105 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 106 | |
| 107 | mig_internal novalue _Xmach_ports_register |
| 108 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 109 | |
| 110 | mig_internal novalue _Xmach_ports_lookup |
| 111 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 112 | |
| 113 | mig_internal novalue _Xtask_info_from_user |
| 114 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 115 | |
| 116 | mig_internal novalue _Xtask_set_info |
| 117 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 118 | |
| 119 | mig_internal novalue _Xtask_suspend |
| 120 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 121 | |
| 122 | mig_internal novalue _Xtask_resume |
| 123 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 124 | |
| 125 | mig_internal novalue _Xtask_get_special_port |
| 126 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 127 | |
| 128 | mig_internal novalue _Xtask_set_special_port |
| 129 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 130 | |
| 131 | mig_internal novalue _Xthread_create_from_user |
| 132 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 133 | |
| 134 | mig_internal novalue _Xthread_create_running_from_user |
| 135 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 136 | |
| 137 | mig_internal novalue _Xtask_set_exception_ports |
| 138 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 139 | |
| 140 | mig_internal novalue _Xtask_get_exception_ports |
| 141 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 142 | |
| 143 | mig_internal novalue _Xtask_swap_exception_ports |
| 144 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 145 | |
| 146 | mig_internal novalue _Xlock_set_create |
| 147 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 148 | |
| 149 | mig_internal novalue _Xlock_set_destroy |
| 150 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 151 | |
| 152 | mig_internal novalue _Xsemaphore_create |
| 153 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 154 | |
| 155 | mig_internal novalue _Xsemaphore_destroy |
| 156 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 157 | |
| 158 | mig_internal novalue _Xtask_policy_set |
| 159 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 160 | |
| 161 | mig_internal novalue _Xtask_policy_get |
| 162 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 163 | |
| 164 | mig_internal novalue _Xtask_policy |
| 165 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 166 | |
| 167 | mig_internal novalue _Xtask_set_emulation |
| 168 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 169 | |
| 170 | mig_internal novalue _Xtask_get_emulation_vector |
| 171 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 172 | |
| 173 | mig_internal novalue _Xtask_set_emulation_vector |
| 174 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 175 | |
| 176 | mig_internal novalue _Xtask_set_ras_pc |
| 177 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 178 | |
| 179 | mig_internal novalue _Xtask_zone_info |
| 180 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 181 | |
| 182 | mig_internal novalue _Xtask_assign |
| 183 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 184 | |
| 185 | mig_internal novalue _Xtask_assign_default |
| 186 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 187 | |
| 188 | mig_internal novalue _Xtask_get_assignment |
| 189 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 190 | |
| 191 | mig_internal novalue _Xtask_set_policy |
| 192 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 193 | |
| 194 | mig_internal novalue _Xtask_get_state |
| 195 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 196 | |
| 197 | mig_internal novalue _Xtask_set_state |
| 198 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 199 | |
| 200 | mig_internal novalue _Xtask_set_phys_footprint_limit |
| 201 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 202 | |
| 203 | mig_internal novalue _Xtask_suspend2 |
| 204 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 205 | |
| 206 | mig_internal novalue _Xtask_resume2 |
| 207 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 208 | |
| 209 | mig_internal novalue _Xtask_purgable_info |
| 210 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 211 | |
| 212 | mig_internal novalue _Xtask_get_mach_voucher |
| 213 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 214 | |
| 215 | mig_internal novalue _Xtask_set_mach_voucher |
| 216 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 217 | |
| 218 | mig_internal novalue _Xtask_swap_mach_voucher |
| 219 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 220 | |
| 221 | mig_internal novalue _Xtask_generate_corpse |
| 222 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 223 | |
| 224 | mig_internal novalue _Xtask_map_corpse_info |
| 225 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 226 | |
| 227 | mig_internal novalue _Xtask_register_dyld_image_infos |
| 228 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 229 | |
| 230 | mig_internal novalue _Xtask_unregister_dyld_image_infos |
| 231 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 232 | |
| 233 | mig_internal novalue _Xtask_get_dyld_image_infos |
| 234 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 235 | |
| 236 | mig_internal novalue _Xtask_register_dyld_shared_cache_image_info |
| 237 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 238 | |
| 239 | mig_internal novalue _Xtask_register_dyld_set_dyld_state |
| 240 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 241 | |
| 242 | mig_internal novalue _Xtask_register_dyld_get_process_state |
| 243 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 244 | |
| 245 | mig_internal novalue _Xtask_map_corpse_info_64 |
| 246 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 247 | |
| 248 | mig_internal novalue _Xtask_inspect |
| 249 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 250 | |
| 251 | |
| 252 | #if ( __MigTypeCheck ) |
| 253 | #if __MIG_check__Request__task_subsystem__ |
| 254 | #if !defined(__MIG_check__Request__task_create_t__defined) |
| 255 | #define __MIG_check__Request__task_create_t__defined |
| 256 | |
| 257 | mig_internal kern_return_t __MIG_check__Request__task_create_t(__attribute__((__unused__)) __Request__task_create_t *In0P) |
| 258 | { |
| 259 | |
| 260 | typedef __Request__task_create_t __Request; |
| 261 | #if __MigTypeCheck |
| 262 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 263 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 264 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 265 | return MIG_BAD_ARGUMENTS; |
| 266 | #endif /* __MigTypeCheck */ |
| 267 | |
| 268 | #if __MigTypeCheck |
| 269 | if (In0P->ledgers.type != MACH_MSG_OOL_PORTS_DESCRIPTOR || |
| 270 | In0P->ledgers.disposition != 17) |
| 271 | return MIG_TYPE_ERROR; |
| 272 | #endif /* __MigTypeCheck */ |
| 273 | |
| 274 | return MACH_MSG_SUCCESS; |
| 275 | } |
| 276 | #endif /* !defined(__MIG_check__Request__task_create_t__defined) */ |
| 277 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 278 | #endif /* ( __MigTypeCheck ) */ |
| 279 | |
| 280 | |
| 281 | /* Routine task_create */ |
| 282 | mig_internal novalue _Xtask_create |
| 283 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 284 | { |
| 285 | |
| 286 | #ifdef __MigPackStructs |
| 287 | #pragma pack(4) |
| 288 | #endif |
| 289 | typedef struct { |
| 290 | mach_msg_header_t Head; |
| 291 | /* start of the kernel processed data */ |
| 292 | mach_msg_body_t msgh_body; |
| 293 | mach_msg_ool_ports_descriptor_t ledgers; |
| 294 | /* end of the kernel processed data */ |
| 295 | NDR_record_t NDR; |
| 296 | mach_msg_type_number_t ledgersCnt; |
| 297 | boolean_t inherit_memory; |
| 298 | mach_msg_trailer_t trailer; |
| 299 | } Request __attribute__((unused)); |
| 300 | #ifdef __MigPackStructs |
| 301 | #pragma pack() |
| 302 | #endif |
| 303 | typedef __Request__task_create_t __Request; |
| 304 | typedef __Reply__task_create_t Reply __attribute__((unused)); |
| 305 | |
| 306 | /* |
| 307 | * typedef struct { |
| 308 | * mach_msg_header_t Head; |
| 309 | * NDR_record_t NDR; |
| 310 | * kern_return_t RetCode; |
| 311 | * } mig_reply_error_t; |
| 312 | */ |
| 313 | |
| 314 | Request *In0P = (Request *) InHeadP; |
| 315 | Reply *OutP = (Reply *) OutHeadP; |
| 316 | #ifdef __MIG_check__Request__task_create_t__defined |
| 317 | kern_return_t check_result; |
| 318 | #endif /* __MIG_check__Request__task_create_t__defined */ |
| 319 | |
| 320 | #if __MigKernelSpecificCode |
| 321 | #if UseStaticTemplates |
| 322 | const static mach_msg_port_descriptor_t child_taskTemplate = { |
| 323 | /* name = */ MACH_PORT_NULL, |
| 324 | /* pad1 = */ 0, |
| 325 | /* pad2 = */ 0, |
| 326 | /* disp = */ 17, |
| 327 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 328 | }; |
| 329 | #endif /* UseStaticTemplates */ |
| 330 | |
| 331 | #else |
| 332 | #if UseStaticTemplates |
| 333 | const static mach_msg_port_descriptor_t child_taskTemplate = { |
| 334 | /* name = */ MACH_PORT_NULL, |
| 335 | /* pad1 = */ 0, |
| 336 | /* pad2 = */ 0, |
| 337 | /* disp = */ 19, |
| 338 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 339 | }; |
| 340 | #endif /* UseStaticTemplates */ |
| 341 | |
| 342 | #endif /* __MigKernelSpecificCode */ |
| 343 | kern_return_t RetCode; |
| 344 | task_t target_task; |
| 345 | task_t child_task; |
| 346 | |
| 347 | __DeclareRcvRpc(3400, "task_create" ) |
| 348 | __BeforeRcvRpc(3400, "task_create" ) |
| 349 | |
| 350 | #if defined(__MIG_check__Request__task_create_t__defined) |
| 351 | check_result = __MIG_check__Request__task_create_t((__Request *)In0P); |
| 352 | if (check_result != MACH_MSG_SUCCESS) |
| 353 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 354 | #endif /* defined(__MIG_check__Request__task_create_t__defined) */ |
| 355 | |
| 356 | #if UseStaticTemplates |
| 357 | OutP->child_task = child_taskTemplate; |
| 358 | #else /* UseStaticTemplates */ |
| 359 | #if __MigKernelSpecificCode |
| 360 | OutP->child_task.disposition = 17; |
| 361 | #else |
| 362 | OutP->child_task.disposition = 19; |
| 363 | #endif /* __MigKernelSpecificCode */ |
| 364 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 365 | OutP->child_task.pad1 = 0; |
| 366 | #endif |
| 367 | OutP->child_task.pad2 = 0; |
| 368 | OutP->child_task.type = MACH_MSG_PORT_DESCRIPTOR; |
| 369 | #if defined(KERNEL) |
| 370 | OutP->child_task.pad_end = 0; |
| 371 | #endif |
| 372 | #endif /* UseStaticTemplates */ |
| 373 | |
| 374 | |
| 375 | target_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 376 | |
| 377 | RetCode = task_create(target_task, (ledger_array_t)(In0P->ledgers.address), In0P->ledgers.count, In0P->inherit_memory, &child_task); |
| 378 | task_deallocate(target_task); |
| 379 | if (RetCode != KERN_SUCCESS) { |
| 380 | MIG_RETURN_ERROR(OutP, RetCode); |
| 381 | } |
| 382 | #if __MigKernelSpecificCode |
| 383 | #endif /* __MigKernelSpecificCode */ |
| 384 | OutP->child_task.name = (mach_port_t)convert_task_to_port(child_task); |
| 385 | |
| 386 | |
| 387 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 388 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 389 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 390 | __AfterRcvRpc(3400, "task_create" ) |
| 391 | } |
| 392 | |
| 393 | #if ( __MigTypeCheck ) |
| 394 | #if __MIG_check__Request__task_subsystem__ |
| 395 | #if !defined(__MIG_check__Request__task_terminate_t__defined) |
| 396 | #define __MIG_check__Request__task_terminate_t__defined |
| 397 | |
| 398 | mig_internal kern_return_t __MIG_check__Request__task_terminate_t(__attribute__((__unused__)) __Request__task_terminate_t *In0P) |
| 399 | { |
| 400 | |
| 401 | typedef __Request__task_terminate_t __Request; |
| 402 | #if __MigTypeCheck |
| 403 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 404 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 405 | return MIG_BAD_ARGUMENTS; |
| 406 | #endif /* __MigTypeCheck */ |
| 407 | |
| 408 | return MACH_MSG_SUCCESS; |
| 409 | } |
| 410 | #endif /* !defined(__MIG_check__Request__task_terminate_t__defined) */ |
| 411 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 412 | #endif /* ( __MigTypeCheck ) */ |
| 413 | |
| 414 | |
| 415 | /* Routine task_terminate */ |
| 416 | mig_internal novalue _Xtask_terminate |
| 417 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 418 | { |
| 419 | |
| 420 | #ifdef __MigPackStructs |
| 421 | #pragma pack(4) |
| 422 | #endif |
| 423 | typedef struct { |
| 424 | mach_msg_header_t Head; |
| 425 | mach_msg_trailer_t trailer; |
| 426 | } Request __attribute__((unused)); |
| 427 | #ifdef __MigPackStructs |
| 428 | #pragma pack() |
| 429 | #endif |
| 430 | typedef __Request__task_terminate_t __Request; |
| 431 | typedef __Reply__task_terminate_t Reply __attribute__((unused)); |
| 432 | |
| 433 | /* |
| 434 | * typedef struct { |
| 435 | * mach_msg_header_t Head; |
| 436 | * NDR_record_t NDR; |
| 437 | * kern_return_t RetCode; |
| 438 | * } mig_reply_error_t; |
| 439 | */ |
| 440 | |
| 441 | Request *In0P = (Request *) InHeadP; |
| 442 | Reply *OutP = (Reply *) OutHeadP; |
| 443 | #ifdef __MIG_check__Request__task_terminate_t__defined |
| 444 | kern_return_t check_result; |
| 445 | #endif /* __MIG_check__Request__task_terminate_t__defined */ |
| 446 | |
| 447 | #if __MigKernelSpecificCode |
| 448 | #else |
| 449 | #endif /* __MigKernelSpecificCode */ |
| 450 | task_t target_task; |
| 451 | |
| 452 | __DeclareRcvRpc(3401, "task_terminate" ) |
| 453 | __BeforeRcvRpc(3401, "task_terminate" ) |
| 454 | |
| 455 | #if defined(__MIG_check__Request__task_terminate_t__defined) |
| 456 | check_result = __MIG_check__Request__task_terminate_t((__Request *)In0P); |
| 457 | if (check_result != MACH_MSG_SUCCESS) |
| 458 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 459 | #endif /* defined(__MIG_check__Request__task_terminate_t__defined) */ |
| 460 | |
| 461 | target_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 462 | |
| 463 | OutP->RetCode = task_terminate(target_task); |
| 464 | task_deallocate(target_task); |
| 465 | #if __MigKernelSpecificCode |
| 466 | #endif /* __MigKernelSpecificCode */ |
| 467 | |
| 468 | OutP->NDR = NDR_record; |
| 469 | |
| 470 | |
| 471 | __AfterRcvRpc(3401, "task_terminate" ) |
| 472 | } |
| 473 | |
| 474 | #if ( __MigTypeCheck ) |
| 475 | #if __MIG_check__Request__task_subsystem__ |
| 476 | #if !defined(__MIG_check__Request__task_threads_t__defined) |
| 477 | #define __MIG_check__Request__task_threads_t__defined |
| 478 | |
| 479 | mig_internal kern_return_t __MIG_check__Request__task_threads_t(__attribute__((__unused__)) __Request__task_threads_t *In0P) |
| 480 | { |
| 481 | |
| 482 | typedef __Request__task_threads_t __Request; |
| 483 | #if __MigTypeCheck |
| 484 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 485 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 486 | return MIG_BAD_ARGUMENTS; |
| 487 | #endif /* __MigTypeCheck */ |
| 488 | |
| 489 | return MACH_MSG_SUCCESS; |
| 490 | } |
| 491 | #endif /* !defined(__MIG_check__Request__task_threads_t__defined) */ |
| 492 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 493 | #endif /* ( __MigTypeCheck ) */ |
| 494 | |
| 495 | |
| 496 | /* Routine task_threads */ |
| 497 | mig_internal novalue _Xtask_threads |
| 498 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 499 | { |
| 500 | |
| 501 | #ifdef __MigPackStructs |
| 502 | #pragma pack(4) |
| 503 | #endif |
| 504 | typedef struct { |
| 505 | mach_msg_header_t Head; |
| 506 | mach_msg_trailer_t trailer; |
| 507 | } Request __attribute__((unused)); |
| 508 | #ifdef __MigPackStructs |
| 509 | #pragma pack() |
| 510 | #endif |
| 511 | typedef __Request__task_threads_t __Request; |
| 512 | typedef __Reply__task_threads_t Reply __attribute__((unused)); |
| 513 | |
| 514 | /* |
| 515 | * typedef struct { |
| 516 | * mach_msg_header_t Head; |
| 517 | * NDR_record_t NDR; |
| 518 | * kern_return_t RetCode; |
| 519 | * } mig_reply_error_t; |
| 520 | */ |
| 521 | |
| 522 | Request *In0P = (Request *) InHeadP; |
| 523 | Reply *OutP = (Reply *) OutHeadP; |
| 524 | #ifdef __MIG_check__Request__task_threads_t__defined |
| 525 | kern_return_t check_result; |
| 526 | #endif /* __MIG_check__Request__task_threads_t__defined */ |
| 527 | |
| 528 | #if __MigKernelSpecificCode |
| 529 | #if UseStaticTemplates |
| 530 | const static mach_msg_ool_ports_descriptor_t act_listTemplate = { |
| 531 | /* addr = */ (void *)0, |
| 532 | /* coun = */ 0, |
| 533 | /* deal = */ FALSE, |
| 534 | /* copy is meaningful only in overwrite mode */ |
| 535 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
| 536 | /* disp = */ 17, |
| 537 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
| 538 | }; |
| 539 | #endif /* UseStaticTemplates */ |
| 540 | |
| 541 | #else |
| 542 | #if UseStaticTemplates |
| 543 | const static mach_msg_ool_ports_descriptor_t act_listTemplate = { |
| 544 | /* addr = */ (void *)0, |
| 545 | /* coun = */ 0, |
| 546 | /* deal = */ FALSE, |
| 547 | /* copy is meaningful only in overwrite mode */ |
| 548 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
| 549 | /* disp = */ 19, |
| 550 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
| 551 | }; |
| 552 | #endif /* UseStaticTemplates */ |
| 553 | |
| 554 | #endif /* __MigKernelSpecificCode */ |
| 555 | kern_return_t RetCode; |
| 556 | task_inspect_t target_task; |
| 557 | |
| 558 | __DeclareRcvRpc(3402, "task_threads" ) |
| 559 | __BeforeRcvRpc(3402, "task_threads" ) |
| 560 | |
| 561 | #if defined(__MIG_check__Request__task_threads_t__defined) |
| 562 | check_result = __MIG_check__Request__task_threads_t((__Request *)In0P); |
| 563 | if (check_result != MACH_MSG_SUCCESS) |
| 564 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 565 | #endif /* defined(__MIG_check__Request__task_threads_t__defined) */ |
| 566 | |
| 567 | #if UseStaticTemplates |
| 568 | OutP->act_list = act_listTemplate; |
| 569 | #else /* UseStaticTemplates */ |
| 570 | #if __MigKernelSpecificCode |
| 571 | OutP->act_list.disposition = 17; |
| 572 | #else |
| 573 | OutP->act_list.disposition = 19; |
| 574 | #endif /* __MigKernelSpecificCode */ |
| 575 | OutP->act_list.deallocate = FALSE; |
| 576 | OutP->act_list.type = MACH_MSG_OOL_PORTS_DESCRIPTOR; |
| 577 | #endif /* UseStaticTemplates */ |
| 578 | |
| 579 | |
| 580 | target_task = convert_port_to_task_inspect(In0P->Head.msgh_request_port); |
| 581 | |
| 582 | RetCode = task_threads(target_task, (thread_act_array_t *)&(OutP->act_list.address), &OutP->act_listCnt); |
| 583 | task_inspect_deallocate(target_task); |
| 584 | if (RetCode != KERN_SUCCESS) { |
| 585 | MIG_RETURN_ERROR(OutP, RetCode); |
| 586 | } |
| 587 | #if __MigKernelSpecificCode |
| 588 | #endif /* __MigKernelSpecificCode */ |
| 589 | OutP->act_list.count = OutP->act_listCnt; |
| 590 | |
| 591 | |
| 592 | OutP->NDR = NDR_record; |
| 593 | |
| 594 | |
| 595 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 596 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 597 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 598 | __AfterRcvRpc(3402, "task_threads" ) |
| 599 | } |
| 600 | |
| 601 | #if ( __MigTypeCheck ) |
| 602 | #if __MIG_check__Request__task_subsystem__ |
| 603 | #if !defined(__MIG_check__Request__mach_ports_register_t__defined) |
| 604 | #define __MIG_check__Request__mach_ports_register_t__defined |
| 605 | |
| 606 | mig_internal kern_return_t __MIG_check__Request__mach_ports_register_t(__attribute__((__unused__)) __Request__mach_ports_register_t *In0P) |
| 607 | { |
| 608 | |
| 609 | typedef __Request__mach_ports_register_t __Request; |
| 610 | #if __MigTypeCheck |
| 611 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 612 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 613 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 614 | return MIG_BAD_ARGUMENTS; |
| 615 | #endif /* __MigTypeCheck */ |
| 616 | |
| 617 | #if __MigTypeCheck |
| 618 | if (In0P->init_port_set.type != MACH_MSG_OOL_PORTS_DESCRIPTOR || |
| 619 | In0P->init_port_set.disposition != 17) |
| 620 | return MIG_TYPE_ERROR; |
| 621 | #endif /* __MigTypeCheck */ |
| 622 | |
| 623 | return MACH_MSG_SUCCESS; |
| 624 | } |
| 625 | #endif /* !defined(__MIG_check__Request__mach_ports_register_t__defined) */ |
| 626 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 627 | #endif /* ( __MigTypeCheck ) */ |
| 628 | |
| 629 | |
| 630 | /* Routine mach_ports_register */ |
| 631 | mig_internal novalue _Xmach_ports_register |
| 632 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 633 | { |
| 634 | |
| 635 | #ifdef __MigPackStructs |
| 636 | #pragma pack(4) |
| 637 | #endif |
| 638 | typedef struct { |
| 639 | mach_msg_header_t Head; |
| 640 | /* start of the kernel processed data */ |
| 641 | mach_msg_body_t msgh_body; |
| 642 | mach_msg_ool_ports_descriptor_t init_port_set; |
| 643 | /* end of the kernel processed data */ |
| 644 | NDR_record_t NDR; |
| 645 | mach_msg_type_number_t init_port_setCnt; |
| 646 | mach_msg_trailer_t trailer; |
| 647 | } Request __attribute__((unused)); |
| 648 | #ifdef __MigPackStructs |
| 649 | #pragma pack() |
| 650 | #endif |
| 651 | typedef __Request__mach_ports_register_t __Request; |
| 652 | typedef __Reply__mach_ports_register_t Reply __attribute__((unused)); |
| 653 | |
| 654 | /* |
| 655 | * typedef struct { |
| 656 | * mach_msg_header_t Head; |
| 657 | * NDR_record_t NDR; |
| 658 | * kern_return_t RetCode; |
| 659 | * } mig_reply_error_t; |
| 660 | */ |
| 661 | |
| 662 | Request *In0P = (Request *) InHeadP; |
| 663 | Reply *OutP = (Reply *) OutHeadP; |
| 664 | #ifdef __MIG_check__Request__mach_ports_register_t__defined |
| 665 | kern_return_t check_result; |
| 666 | #endif /* __MIG_check__Request__mach_ports_register_t__defined */ |
| 667 | |
| 668 | #if __MigKernelSpecificCode |
| 669 | #else |
| 670 | #endif /* __MigKernelSpecificCode */ |
| 671 | task_t target_task; |
| 672 | |
| 673 | __DeclareRcvRpc(3403, "mach_ports_register" ) |
| 674 | __BeforeRcvRpc(3403, "mach_ports_register" ) |
| 675 | |
| 676 | #if defined(__MIG_check__Request__mach_ports_register_t__defined) |
| 677 | check_result = __MIG_check__Request__mach_ports_register_t((__Request *)In0P); |
| 678 | if (check_result != MACH_MSG_SUCCESS) |
| 679 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 680 | #endif /* defined(__MIG_check__Request__mach_ports_register_t__defined) */ |
| 681 | |
| 682 | target_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 683 | |
| 684 | OutP->RetCode = mach_ports_register(target_task, (mach_port_array_t)(In0P->init_port_set.address), In0P->init_port_set.count); |
| 685 | task_deallocate(target_task); |
| 686 | #if __MigKernelSpecificCode |
| 687 | #endif /* __MigKernelSpecificCode */ |
| 688 | |
| 689 | OutP->NDR = NDR_record; |
| 690 | |
| 691 | |
| 692 | __AfterRcvRpc(3403, "mach_ports_register" ) |
| 693 | } |
| 694 | |
| 695 | #if ( __MigTypeCheck ) |
| 696 | #if __MIG_check__Request__task_subsystem__ |
| 697 | #if !defined(__MIG_check__Request__mach_ports_lookup_t__defined) |
| 698 | #define __MIG_check__Request__mach_ports_lookup_t__defined |
| 699 | |
| 700 | mig_internal kern_return_t __MIG_check__Request__mach_ports_lookup_t(__attribute__((__unused__)) __Request__mach_ports_lookup_t *In0P) |
| 701 | { |
| 702 | |
| 703 | typedef __Request__mach_ports_lookup_t __Request; |
| 704 | #if __MigTypeCheck |
| 705 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 706 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 707 | return MIG_BAD_ARGUMENTS; |
| 708 | #endif /* __MigTypeCheck */ |
| 709 | |
| 710 | return MACH_MSG_SUCCESS; |
| 711 | } |
| 712 | #endif /* !defined(__MIG_check__Request__mach_ports_lookup_t__defined) */ |
| 713 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 714 | #endif /* ( __MigTypeCheck ) */ |
| 715 | |
| 716 | |
| 717 | /* Routine mach_ports_lookup */ |
| 718 | mig_internal novalue _Xmach_ports_lookup |
| 719 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 720 | { |
| 721 | |
| 722 | #ifdef __MigPackStructs |
| 723 | #pragma pack(4) |
| 724 | #endif |
| 725 | typedef struct { |
| 726 | mach_msg_header_t Head; |
| 727 | mach_msg_trailer_t trailer; |
| 728 | } Request __attribute__((unused)); |
| 729 | #ifdef __MigPackStructs |
| 730 | #pragma pack() |
| 731 | #endif |
| 732 | typedef __Request__mach_ports_lookup_t __Request; |
| 733 | typedef __Reply__mach_ports_lookup_t Reply __attribute__((unused)); |
| 734 | |
| 735 | /* |
| 736 | * typedef struct { |
| 737 | * mach_msg_header_t Head; |
| 738 | * NDR_record_t NDR; |
| 739 | * kern_return_t RetCode; |
| 740 | * } mig_reply_error_t; |
| 741 | */ |
| 742 | |
| 743 | Request *In0P = (Request *) InHeadP; |
| 744 | Reply *OutP = (Reply *) OutHeadP; |
| 745 | #ifdef __MIG_check__Request__mach_ports_lookup_t__defined |
| 746 | kern_return_t check_result; |
| 747 | #endif /* __MIG_check__Request__mach_ports_lookup_t__defined */ |
| 748 | |
| 749 | #if __MigKernelSpecificCode |
| 750 | #if UseStaticTemplates |
| 751 | const static mach_msg_ool_ports_descriptor_t init_port_setTemplate = { |
| 752 | /* addr = */ (void *)0, |
| 753 | /* coun = */ 0, |
| 754 | /* deal = */ FALSE, |
| 755 | /* copy is meaningful only in overwrite mode */ |
| 756 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
| 757 | /* disp = */ 17, |
| 758 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
| 759 | }; |
| 760 | #endif /* UseStaticTemplates */ |
| 761 | |
| 762 | #else |
| 763 | #if UseStaticTemplates |
| 764 | const static mach_msg_ool_ports_descriptor_t init_port_setTemplate = { |
| 765 | /* addr = */ (void *)0, |
| 766 | /* coun = */ 0, |
| 767 | /* deal = */ FALSE, |
| 768 | /* copy is meaningful only in overwrite mode */ |
| 769 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
| 770 | /* disp = */ 19, |
| 771 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
| 772 | }; |
| 773 | #endif /* UseStaticTemplates */ |
| 774 | |
| 775 | #endif /* __MigKernelSpecificCode */ |
| 776 | kern_return_t RetCode; |
| 777 | task_t target_task; |
| 778 | |
| 779 | __DeclareRcvRpc(3404, "mach_ports_lookup" ) |
| 780 | __BeforeRcvRpc(3404, "mach_ports_lookup" ) |
| 781 | |
| 782 | #if defined(__MIG_check__Request__mach_ports_lookup_t__defined) |
| 783 | check_result = __MIG_check__Request__mach_ports_lookup_t((__Request *)In0P); |
| 784 | if (check_result != MACH_MSG_SUCCESS) |
| 785 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 786 | #endif /* defined(__MIG_check__Request__mach_ports_lookup_t__defined) */ |
| 787 | |
| 788 | #if UseStaticTemplates |
| 789 | OutP->init_port_set = init_port_setTemplate; |
| 790 | #else /* UseStaticTemplates */ |
| 791 | #if __MigKernelSpecificCode |
| 792 | OutP->init_port_set.disposition = 17; |
| 793 | #else |
| 794 | OutP->init_port_set.disposition = 19; |
| 795 | #endif /* __MigKernelSpecificCode */ |
| 796 | OutP->init_port_set.deallocate = FALSE; |
| 797 | OutP->init_port_set.type = MACH_MSG_OOL_PORTS_DESCRIPTOR; |
| 798 | #endif /* UseStaticTemplates */ |
| 799 | |
| 800 | |
| 801 | target_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 802 | |
| 803 | RetCode = mach_ports_lookup(target_task, (mach_port_array_t *)&(OutP->init_port_set.address), &OutP->init_port_setCnt); |
| 804 | task_deallocate(target_task); |
| 805 | if (RetCode != KERN_SUCCESS) { |
| 806 | MIG_RETURN_ERROR(OutP, RetCode); |
| 807 | } |
| 808 | #if __MigKernelSpecificCode |
| 809 | #endif /* __MigKernelSpecificCode */ |
| 810 | OutP->init_port_set.count = OutP->init_port_setCnt; |
| 811 | |
| 812 | |
| 813 | OutP->NDR = NDR_record; |
| 814 | |
| 815 | |
| 816 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 817 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 818 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 819 | __AfterRcvRpc(3404, "mach_ports_lookup" ) |
| 820 | } |
| 821 | |
| 822 | #if ( __MigTypeCheck ) |
| 823 | #if __MIG_check__Request__task_subsystem__ |
| 824 | #if !defined(__MIG_check__Request__task_info_from_user_t__defined) |
| 825 | #define __MIG_check__Request__task_info_from_user_t__defined |
| 826 | |
| 827 | mig_internal kern_return_t __MIG_check__Request__task_info_from_user_t(__attribute__((__unused__)) __Request__task_info_from_user_t *In0P) |
| 828 | { |
| 829 | |
| 830 | typedef __Request__task_info_from_user_t __Request; |
| 831 | #if __MigTypeCheck |
| 832 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 833 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 834 | return MIG_BAD_ARGUMENTS; |
| 835 | #endif /* __MigTypeCheck */ |
| 836 | |
| 837 | return MACH_MSG_SUCCESS; |
| 838 | } |
| 839 | #endif /* !defined(__MIG_check__Request__task_info_from_user_t__defined) */ |
| 840 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 841 | #endif /* ( __MigTypeCheck ) */ |
| 842 | |
| 843 | |
| 844 | /* Routine task_info_from_user */ |
| 845 | mig_internal novalue _Xtask_info_from_user |
| 846 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 847 | { |
| 848 | |
| 849 | #ifdef __MigPackStructs |
| 850 | #pragma pack(4) |
| 851 | #endif |
| 852 | typedef struct { |
| 853 | mach_msg_header_t Head; |
| 854 | NDR_record_t NDR; |
| 855 | task_flavor_t flavor; |
| 856 | mach_msg_type_number_t task_info_outCnt; |
| 857 | mach_msg_trailer_t trailer; |
| 858 | } Request __attribute__((unused)); |
| 859 | #ifdef __MigPackStructs |
| 860 | #pragma pack() |
| 861 | #endif |
| 862 | typedef __Request__task_info_from_user_t __Request; |
| 863 | typedef __Reply__task_info_from_user_t Reply __attribute__((unused)); |
| 864 | |
| 865 | /* |
| 866 | * typedef struct { |
| 867 | * mach_msg_header_t Head; |
| 868 | * NDR_record_t NDR; |
| 869 | * kern_return_t RetCode; |
| 870 | * } mig_reply_error_t; |
| 871 | */ |
| 872 | |
| 873 | Request *In0P = (Request *) InHeadP; |
| 874 | Reply *OutP = (Reply *) OutHeadP; |
| 875 | #ifdef __MIG_check__Request__task_info_from_user_t__defined |
| 876 | kern_return_t check_result; |
| 877 | #endif /* __MIG_check__Request__task_info_from_user_t__defined */ |
| 878 | |
| 879 | #if __MigKernelSpecificCode |
| 880 | #else |
| 881 | #endif /* __MigKernelSpecificCode */ |
| 882 | __DeclareRcvRpc(3405, "task_info_from_user" ) |
| 883 | __BeforeRcvRpc(3405, "task_info_from_user" ) |
| 884 | |
| 885 | #if defined(__MIG_check__Request__task_info_from_user_t__defined) |
| 886 | check_result = __MIG_check__Request__task_info_from_user_t((__Request *)In0P); |
| 887 | if (check_result != MACH_MSG_SUCCESS) |
| 888 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 889 | #endif /* defined(__MIG_check__Request__task_info_from_user_t__defined) */ |
| 890 | |
| 891 | OutP->task_info_outCnt = 52; |
| 892 | if (In0P->task_info_outCnt < OutP->task_info_outCnt) |
| 893 | OutP->task_info_outCnt = In0P->task_info_outCnt; |
| 894 | |
| 895 | OutP->RetCode = task_info_from_user(In0P->Head.msgh_request_port, In0P->flavor, OutP->task_info_out, &OutP->task_info_outCnt); |
| 896 | if (OutP->RetCode != KERN_SUCCESS) { |
| 897 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 898 | } |
| 899 | #if __MigKernelSpecificCode |
| 900 | #endif /* __MigKernelSpecificCode */ |
| 901 | |
| 902 | OutP->NDR = NDR_record; |
| 903 | |
| 904 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 208) + (((4 * OutP->task_info_outCnt))); |
| 905 | |
| 906 | __AfterRcvRpc(3405, "task_info_from_user" ) |
| 907 | } |
| 908 | |
| 909 | #if ( __MigTypeCheck ) |
| 910 | #if __MIG_check__Request__task_subsystem__ |
| 911 | #if !defined(__MIG_check__Request__task_set_info_t__defined) |
| 912 | #define __MIG_check__Request__task_set_info_t__defined |
| 913 | |
| 914 | mig_internal kern_return_t __MIG_check__Request__task_set_info_t(__attribute__((__unused__)) __Request__task_set_info_t *In0P) |
| 915 | { |
| 916 | |
| 917 | typedef __Request__task_set_info_t __Request; |
| 918 | #if __MigTypeCheck |
| 919 | unsigned int msgh_size; |
| 920 | #endif /* __MigTypeCheck */ |
| 921 | |
| 922 | #if __MigTypeCheck |
| 923 | msgh_size = In0P->Head.msgh_size; |
| 924 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 925 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 208)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 926 | return MIG_BAD_ARGUMENTS; |
| 927 | #endif /* __MigTypeCheck */ |
| 928 | |
| 929 | #if defined(__NDR_convert__int_rep__Request__task_set_info_t__task_info_inCnt__defined) |
| 930 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 931 | __NDR_convert__int_rep__Request__task_set_info_t__task_info_inCnt(&In0P->task_info_inCnt, In0P->NDR.int_rep); |
| 932 | #endif /* __NDR_convert__int_rep__Request__task_set_info_t__task_info_inCnt__defined */ |
| 933 | #if __MigTypeCheck |
| 934 | if ( In0P->task_info_inCnt > 52 ) |
| 935 | return MIG_BAD_ARGUMENTS; |
| 936 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 208)) / 4 < In0P->task_info_inCnt) || |
| 937 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 208) + (4 * In0P->task_info_inCnt))) |
| 938 | return MIG_BAD_ARGUMENTS; |
| 939 | #endif /* __MigTypeCheck */ |
| 940 | |
| 941 | return MACH_MSG_SUCCESS; |
| 942 | } |
| 943 | #endif /* !defined(__MIG_check__Request__task_set_info_t__defined) */ |
| 944 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 945 | #endif /* ( __MigTypeCheck ) */ |
| 946 | |
| 947 | |
| 948 | /* Routine task_set_info */ |
| 949 | mig_internal novalue _Xtask_set_info |
| 950 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 951 | { |
| 952 | |
| 953 | #ifdef __MigPackStructs |
| 954 | #pragma pack(4) |
| 955 | #endif |
| 956 | typedef struct { |
| 957 | mach_msg_header_t Head; |
| 958 | NDR_record_t NDR; |
| 959 | task_flavor_t flavor; |
| 960 | mach_msg_type_number_t task_info_inCnt; |
| 961 | integer_t task_info_in[52]; |
| 962 | mach_msg_trailer_t trailer; |
| 963 | } Request __attribute__((unused)); |
| 964 | #ifdef __MigPackStructs |
| 965 | #pragma pack() |
| 966 | #endif |
| 967 | typedef __Request__task_set_info_t __Request; |
| 968 | typedef __Reply__task_set_info_t Reply __attribute__((unused)); |
| 969 | |
| 970 | /* |
| 971 | * typedef struct { |
| 972 | * mach_msg_header_t Head; |
| 973 | * NDR_record_t NDR; |
| 974 | * kern_return_t RetCode; |
| 975 | * } mig_reply_error_t; |
| 976 | */ |
| 977 | |
| 978 | Request *In0P = (Request *) InHeadP; |
| 979 | Reply *OutP = (Reply *) OutHeadP; |
| 980 | #ifdef __MIG_check__Request__task_set_info_t__defined |
| 981 | kern_return_t check_result; |
| 982 | #endif /* __MIG_check__Request__task_set_info_t__defined */ |
| 983 | |
| 984 | #if __MigKernelSpecificCode |
| 985 | #else |
| 986 | #endif /* __MigKernelSpecificCode */ |
| 987 | task_t target_task; |
| 988 | |
| 989 | __DeclareRcvRpc(3406, "task_set_info" ) |
| 990 | __BeforeRcvRpc(3406, "task_set_info" ) |
| 991 | |
| 992 | #if defined(__MIG_check__Request__task_set_info_t__defined) |
| 993 | check_result = __MIG_check__Request__task_set_info_t((__Request *)In0P); |
| 994 | if (check_result != MACH_MSG_SUCCESS) |
| 995 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 996 | #endif /* defined(__MIG_check__Request__task_set_info_t__defined) */ |
| 997 | |
| 998 | target_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 999 | |
| 1000 | OutP->RetCode = task_set_info(target_task, In0P->flavor, In0P->task_info_in, In0P->task_info_inCnt); |
| 1001 | task_deallocate(target_task); |
| 1002 | #if __MigKernelSpecificCode |
| 1003 | #endif /* __MigKernelSpecificCode */ |
| 1004 | |
| 1005 | OutP->NDR = NDR_record; |
| 1006 | |
| 1007 | |
| 1008 | __AfterRcvRpc(3406, "task_set_info" ) |
| 1009 | } |
| 1010 | |
| 1011 | #if ( __MigTypeCheck ) |
| 1012 | #if __MIG_check__Request__task_subsystem__ |
| 1013 | #if !defined(__MIG_check__Request__task_suspend_t__defined) |
| 1014 | #define __MIG_check__Request__task_suspend_t__defined |
| 1015 | |
| 1016 | mig_internal kern_return_t __MIG_check__Request__task_suspend_t(__attribute__((__unused__)) __Request__task_suspend_t *In0P) |
| 1017 | { |
| 1018 | |
| 1019 | typedef __Request__task_suspend_t __Request; |
| 1020 | #if __MigTypeCheck |
| 1021 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 1022 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 1023 | return MIG_BAD_ARGUMENTS; |
| 1024 | #endif /* __MigTypeCheck */ |
| 1025 | |
| 1026 | return MACH_MSG_SUCCESS; |
| 1027 | } |
| 1028 | #endif /* !defined(__MIG_check__Request__task_suspend_t__defined) */ |
| 1029 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 1030 | #endif /* ( __MigTypeCheck ) */ |
| 1031 | |
| 1032 | |
| 1033 | /* Routine task_suspend */ |
| 1034 | mig_internal novalue _Xtask_suspend |
| 1035 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1036 | { |
| 1037 | |
| 1038 | #ifdef __MigPackStructs |
| 1039 | #pragma pack(4) |
| 1040 | #endif |
| 1041 | typedef struct { |
| 1042 | mach_msg_header_t Head; |
| 1043 | mach_msg_trailer_t trailer; |
| 1044 | } Request __attribute__((unused)); |
| 1045 | #ifdef __MigPackStructs |
| 1046 | #pragma pack() |
| 1047 | #endif |
| 1048 | typedef __Request__task_suspend_t __Request; |
| 1049 | typedef __Reply__task_suspend_t Reply __attribute__((unused)); |
| 1050 | |
| 1051 | /* |
| 1052 | * typedef struct { |
| 1053 | * mach_msg_header_t Head; |
| 1054 | * NDR_record_t NDR; |
| 1055 | * kern_return_t RetCode; |
| 1056 | * } mig_reply_error_t; |
| 1057 | */ |
| 1058 | |
| 1059 | Request *In0P = (Request *) InHeadP; |
| 1060 | Reply *OutP = (Reply *) OutHeadP; |
| 1061 | #ifdef __MIG_check__Request__task_suspend_t__defined |
| 1062 | kern_return_t check_result; |
| 1063 | #endif /* __MIG_check__Request__task_suspend_t__defined */ |
| 1064 | |
| 1065 | #if __MigKernelSpecificCode |
| 1066 | #else |
| 1067 | #endif /* __MigKernelSpecificCode */ |
| 1068 | task_t target_task; |
| 1069 | |
| 1070 | __DeclareRcvRpc(3407, "task_suspend" ) |
| 1071 | __BeforeRcvRpc(3407, "task_suspend" ) |
| 1072 | |
| 1073 | #if defined(__MIG_check__Request__task_suspend_t__defined) |
| 1074 | check_result = __MIG_check__Request__task_suspend_t((__Request *)In0P); |
| 1075 | if (check_result != MACH_MSG_SUCCESS) |
| 1076 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 1077 | #endif /* defined(__MIG_check__Request__task_suspend_t__defined) */ |
| 1078 | |
| 1079 | target_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 1080 | |
| 1081 | OutP->RetCode = task_suspend(target_task); |
| 1082 | task_deallocate(target_task); |
| 1083 | #if __MigKernelSpecificCode |
| 1084 | #endif /* __MigKernelSpecificCode */ |
| 1085 | |
| 1086 | OutP->NDR = NDR_record; |
| 1087 | |
| 1088 | |
| 1089 | __AfterRcvRpc(3407, "task_suspend" ) |
| 1090 | } |
| 1091 | |
| 1092 | #if ( __MigTypeCheck ) |
| 1093 | #if __MIG_check__Request__task_subsystem__ |
| 1094 | #if !defined(__MIG_check__Request__task_resume_t__defined) |
| 1095 | #define __MIG_check__Request__task_resume_t__defined |
| 1096 | |
| 1097 | mig_internal kern_return_t __MIG_check__Request__task_resume_t(__attribute__((__unused__)) __Request__task_resume_t *In0P) |
| 1098 | { |
| 1099 | |
| 1100 | typedef __Request__task_resume_t __Request; |
| 1101 | #if __MigTypeCheck |
| 1102 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 1103 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 1104 | return MIG_BAD_ARGUMENTS; |
| 1105 | #endif /* __MigTypeCheck */ |
| 1106 | |
| 1107 | return MACH_MSG_SUCCESS; |
| 1108 | } |
| 1109 | #endif /* !defined(__MIG_check__Request__task_resume_t__defined) */ |
| 1110 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 1111 | #endif /* ( __MigTypeCheck ) */ |
| 1112 | |
| 1113 | |
| 1114 | /* Routine task_resume */ |
| 1115 | mig_internal novalue _Xtask_resume |
| 1116 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1117 | { |
| 1118 | |
| 1119 | #ifdef __MigPackStructs |
| 1120 | #pragma pack(4) |
| 1121 | #endif |
| 1122 | typedef struct { |
| 1123 | mach_msg_header_t Head; |
| 1124 | mach_msg_trailer_t trailer; |
| 1125 | } Request __attribute__((unused)); |
| 1126 | #ifdef __MigPackStructs |
| 1127 | #pragma pack() |
| 1128 | #endif |
| 1129 | typedef __Request__task_resume_t __Request; |
| 1130 | typedef __Reply__task_resume_t Reply __attribute__((unused)); |
| 1131 | |
| 1132 | /* |
| 1133 | * typedef struct { |
| 1134 | * mach_msg_header_t Head; |
| 1135 | * NDR_record_t NDR; |
| 1136 | * kern_return_t RetCode; |
| 1137 | * } mig_reply_error_t; |
| 1138 | */ |
| 1139 | |
| 1140 | Request *In0P = (Request *) InHeadP; |
| 1141 | Reply *OutP = (Reply *) OutHeadP; |
| 1142 | #ifdef __MIG_check__Request__task_resume_t__defined |
| 1143 | kern_return_t check_result; |
| 1144 | #endif /* __MIG_check__Request__task_resume_t__defined */ |
| 1145 | |
| 1146 | #if __MigKernelSpecificCode |
| 1147 | #else |
| 1148 | #endif /* __MigKernelSpecificCode */ |
| 1149 | task_t target_task; |
| 1150 | |
| 1151 | __DeclareRcvRpc(3408, "task_resume" ) |
| 1152 | __BeforeRcvRpc(3408, "task_resume" ) |
| 1153 | |
| 1154 | #if defined(__MIG_check__Request__task_resume_t__defined) |
| 1155 | check_result = __MIG_check__Request__task_resume_t((__Request *)In0P); |
| 1156 | if (check_result != MACH_MSG_SUCCESS) |
| 1157 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 1158 | #endif /* defined(__MIG_check__Request__task_resume_t__defined) */ |
| 1159 | |
| 1160 | target_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 1161 | |
| 1162 | OutP->RetCode = task_resume(target_task); |
| 1163 | task_deallocate(target_task); |
| 1164 | #if __MigKernelSpecificCode |
| 1165 | #endif /* __MigKernelSpecificCode */ |
| 1166 | |
| 1167 | OutP->NDR = NDR_record; |
| 1168 | |
| 1169 | |
| 1170 | __AfterRcvRpc(3408, "task_resume" ) |
| 1171 | } |
| 1172 | |
| 1173 | #if ( __MigTypeCheck ) |
| 1174 | #if __MIG_check__Request__task_subsystem__ |
| 1175 | #if !defined(__MIG_check__Request__task_get_special_port_t__defined) |
| 1176 | #define __MIG_check__Request__task_get_special_port_t__defined |
| 1177 | |
| 1178 | mig_internal kern_return_t __MIG_check__Request__task_get_special_port_t(__attribute__((__unused__)) __Request__task_get_special_port_t *In0P) |
| 1179 | { |
| 1180 | |
| 1181 | typedef __Request__task_get_special_port_t __Request; |
| 1182 | #if __MigTypeCheck |
| 1183 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 1184 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 1185 | return MIG_BAD_ARGUMENTS; |
| 1186 | #endif /* __MigTypeCheck */ |
| 1187 | |
| 1188 | return MACH_MSG_SUCCESS; |
| 1189 | } |
| 1190 | #endif /* !defined(__MIG_check__Request__task_get_special_port_t__defined) */ |
| 1191 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 1192 | #endif /* ( __MigTypeCheck ) */ |
| 1193 | |
| 1194 | |
| 1195 | /* Routine task_get_special_port */ |
| 1196 | mig_internal novalue _Xtask_get_special_port |
| 1197 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1198 | { |
| 1199 | |
| 1200 | #ifdef __MigPackStructs |
| 1201 | #pragma pack(4) |
| 1202 | #endif |
| 1203 | typedef struct { |
| 1204 | mach_msg_header_t Head; |
| 1205 | NDR_record_t NDR; |
| 1206 | int which_port; |
| 1207 | mach_msg_trailer_t trailer; |
| 1208 | } Request __attribute__((unused)); |
| 1209 | #ifdef __MigPackStructs |
| 1210 | #pragma pack() |
| 1211 | #endif |
| 1212 | typedef __Request__task_get_special_port_t __Request; |
| 1213 | typedef __Reply__task_get_special_port_t Reply __attribute__((unused)); |
| 1214 | |
| 1215 | /* |
| 1216 | * typedef struct { |
| 1217 | * mach_msg_header_t Head; |
| 1218 | * NDR_record_t NDR; |
| 1219 | * kern_return_t RetCode; |
| 1220 | * } mig_reply_error_t; |
| 1221 | */ |
| 1222 | |
| 1223 | Request *In0P = (Request *) InHeadP; |
| 1224 | Reply *OutP = (Reply *) OutHeadP; |
| 1225 | #ifdef __MIG_check__Request__task_get_special_port_t__defined |
| 1226 | kern_return_t check_result; |
| 1227 | #endif /* __MIG_check__Request__task_get_special_port_t__defined */ |
| 1228 | |
| 1229 | #if __MigKernelSpecificCode |
| 1230 | #if UseStaticTemplates |
| 1231 | const static mach_msg_port_descriptor_t special_portTemplate = { |
| 1232 | /* name = */ MACH_PORT_NULL, |
| 1233 | /* pad1 = */ 0, |
| 1234 | /* pad2 = */ 0, |
| 1235 | /* disp = */ 17, |
| 1236 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 1237 | }; |
| 1238 | #endif /* UseStaticTemplates */ |
| 1239 | |
| 1240 | #else |
| 1241 | #if UseStaticTemplates |
| 1242 | const static mach_msg_port_descriptor_t special_portTemplate = { |
| 1243 | /* name = */ MACH_PORT_NULL, |
| 1244 | /* pad1 = */ 0, |
| 1245 | /* pad2 = */ 0, |
| 1246 | /* disp = */ 19, |
| 1247 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 1248 | }; |
| 1249 | #endif /* UseStaticTemplates */ |
| 1250 | |
| 1251 | #endif /* __MigKernelSpecificCode */ |
| 1252 | kern_return_t RetCode; |
| 1253 | task_inspect_t task; |
| 1254 | |
| 1255 | __DeclareRcvRpc(3409, "task_get_special_port" ) |
| 1256 | __BeforeRcvRpc(3409, "task_get_special_port" ) |
| 1257 | |
| 1258 | #if defined(__MIG_check__Request__task_get_special_port_t__defined) |
| 1259 | check_result = __MIG_check__Request__task_get_special_port_t((__Request *)In0P); |
| 1260 | if (check_result != MACH_MSG_SUCCESS) |
| 1261 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 1262 | #endif /* defined(__MIG_check__Request__task_get_special_port_t__defined) */ |
| 1263 | |
| 1264 | #if UseStaticTemplates |
| 1265 | OutP->special_port = special_portTemplate; |
| 1266 | #else /* UseStaticTemplates */ |
| 1267 | #if __MigKernelSpecificCode |
| 1268 | OutP->special_port.disposition = 17; |
| 1269 | #else |
| 1270 | OutP->special_port.disposition = 19; |
| 1271 | #endif /* __MigKernelSpecificCode */ |
| 1272 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 1273 | OutP->special_port.pad1 = 0; |
| 1274 | #endif |
| 1275 | OutP->special_port.pad2 = 0; |
| 1276 | OutP->special_port.type = MACH_MSG_PORT_DESCRIPTOR; |
| 1277 | #if defined(KERNEL) |
| 1278 | OutP->special_port.pad_end = 0; |
| 1279 | #endif |
| 1280 | #endif /* UseStaticTemplates */ |
| 1281 | |
| 1282 | |
| 1283 | task = convert_port_to_task_inspect(In0P->Head.msgh_request_port); |
| 1284 | |
| 1285 | RetCode = task_get_special_port(task, In0P->which_port, &OutP->special_port.name); |
| 1286 | task_inspect_deallocate(task); |
| 1287 | if (RetCode != KERN_SUCCESS) { |
| 1288 | MIG_RETURN_ERROR(OutP, RetCode); |
| 1289 | } |
| 1290 | #if __MigKernelSpecificCode |
| 1291 | #endif /* __MigKernelSpecificCode */ |
| 1292 | |
| 1293 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 1294 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 1295 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 1296 | __AfterRcvRpc(3409, "task_get_special_port" ) |
| 1297 | } |
| 1298 | |
| 1299 | #if ( __MigTypeCheck ) |
| 1300 | #if __MIG_check__Request__task_subsystem__ |
| 1301 | #if !defined(__MIG_check__Request__task_set_special_port_t__defined) |
| 1302 | #define __MIG_check__Request__task_set_special_port_t__defined |
| 1303 | |
| 1304 | mig_internal kern_return_t __MIG_check__Request__task_set_special_port_t(__attribute__((__unused__)) __Request__task_set_special_port_t *In0P) |
| 1305 | { |
| 1306 | |
| 1307 | typedef __Request__task_set_special_port_t __Request; |
| 1308 | #if __MigTypeCheck |
| 1309 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 1310 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 1311 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 1312 | return MIG_BAD_ARGUMENTS; |
| 1313 | #endif /* __MigTypeCheck */ |
| 1314 | |
| 1315 | #if __MigTypeCheck |
| 1316 | if (In0P->special_port.type != MACH_MSG_PORT_DESCRIPTOR || |
| 1317 | In0P->special_port.disposition != 17) |
| 1318 | return MIG_TYPE_ERROR; |
| 1319 | #endif /* __MigTypeCheck */ |
| 1320 | |
| 1321 | return MACH_MSG_SUCCESS; |
| 1322 | } |
| 1323 | #endif /* !defined(__MIG_check__Request__task_set_special_port_t__defined) */ |
| 1324 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 1325 | #endif /* ( __MigTypeCheck ) */ |
| 1326 | |
| 1327 | |
| 1328 | /* Routine task_set_special_port */ |
| 1329 | mig_internal novalue _Xtask_set_special_port |
| 1330 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1331 | { |
| 1332 | |
| 1333 | #ifdef __MigPackStructs |
| 1334 | #pragma pack(4) |
| 1335 | #endif |
| 1336 | typedef struct { |
| 1337 | mach_msg_header_t Head; |
| 1338 | /* start of the kernel processed data */ |
| 1339 | mach_msg_body_t msgh_body; |
| 1340 | mach_msg_port_descriptor_t special_port; |
| 1341 | /* end of the kernel processed data */ |
| 1342 | NDR_record_t NDR; |
| 1343 | int which_port; |
| 1344 | mach_msg_trailer_t trailer; |
| 1345 | } Request __attribute__((unused)); |
| 1346 | #ifdef __MigPackStructs |
| 1347 | #pragma pack() |
| 1348 | #endif |
| 1349 | typedef __Request__task_set_special_port_t __Request; |
| 1350 | typedef __Reply__task_set_special_port_t Reply __attribute__((unused)); |
| 1351 | |
| 1352 | /* |
| 1353 | * typedef struct { |
| 1354 | * mach_msg_header_t Head; |
| 1355 | * NDR_record_t NDR; |
| 1356 | * kern_return_t RetCode; |
| 1357 | * } mig_reply_error_t; |
| 1358 | */ |
| 1359 | |
| 1360 | Request *In0P = (Request *) InHeadP; |
| 1361 | Reply *OutP = (Reply *) OutHeadP; |
| 1362 | #ifdef __MIG_check__Request__task_set_special_port_t__defined |
| 1363 | kern_return_t check_result; |
| 1364 | #endif /* __MIG_check__Request__task_set_special_port_t__defined */ |
| 1365 | |
| 1366 | #if __MigKernelSpecificCode |
| 1367 | #else |
| 1368 | #endif /* __MigKernelSpecificCode */ |
| 1369 | task_t task; |
| 1370 | |
| 1371 | __DeclareRcvRpc(3410, "task_set_special_port" ) |
| 1372 | __BeforeRcvRpc(3410, "task_set_special_port" ) |
| 1373 | |
| 1374 | #if defined(__MIG_check__Request__task_set_special_port_t__defined) |
| 1375 | check_result = __MIG_check__Request__task_set_special_port_t((__Request *)In0P); |
| 1376 | if (check_result != MACH_MSG_SUCCESS) |
| 1377 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 1378 | #endif /* defined(__MIG_check__Request__task_set_special_port_t__defined) */ |
| 1379 | |
| 1380 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 1381 | |
| 1382 | OutP->RetCode = task_set_special_port(task, In0P->which_port, In0P->special_port.name); |
| 1383 | task_deallocate(task); |
| 1384 | #if __MigKernelSpecificCode |
| 1385 | #endif /* __MigKernelSpecificCode */ |
| 1386 | |
| 1387 | OutP->NDR = NDR_record; |
| 1388 | |
| 1389 | |
| 1390 | __AfterRcvRpc(3410, "task_set_special_port" ) |
| 1391 | } |
| 1392 | |
| 1393 | #if ( __MigTypeCheck ) |
| 1394 | #if __MIG_check__Request__task_subsystem__ |
| 1395 | #if !defined(__MIG_check__Request__thread_create_from_user_t__defined) |
| 1396 | #define __MIG_check__Request__thread_create_from_user_t__defined |
| 1397 | |
| 1398 | mig_internal kern_return_t __MIG_check__Request__thread_create_from_user_t(__attribute__((__unused__)) __Request__thread_create_from_user_t *In0P) |
| 1399 | { |
| 1400 | |
| 1401 | typedef __Request__thread_create_from_user_t __Request; |
| 1402 | #if __MigTypeCheck |
| 1403 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 1404 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 1405 | return MIG_BAD_ARGUMENTS; |
| 1406 | #endif /* __MigTypeCheck */ |
| 1407 | |
| 1408 | return MACH_MSG_SUCCESS; |
| 1409 | } |
| 1410 | #endif /* !defined(__MIG_check__Request__thread_create_from_user_t__defined) */ |
| 1411 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 1412 | #endif /* ( __MigTypeCheck ) */ |
| 1413 | |
| 1414 | |
| 1415 | /* Routine thread_create_from_user */ |
| 1416 | mig_internal novalue _Xthread_create_from_user |
| 1417 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1418 | { |
| 1419 | |
| 1420 | #ifdef __MigPackStructs |
| 1421 | #pragma pack(4) |
| 1422 | #endif |
| 1423 | typedef struct { |
| 1424 | mach_msg_header_t Head; |
| 1425 | mach_msg_trailer_t trailer; |
| 1426 | } Request __attribute__((unused)); |
| 1427 | #ifdef __MigPackStructs |
| 1428 | #pragma pack() |
| 1429 | #endif |
| 1430 | typedef __Request__thread_create_from_user_t __Request; |
| 1431 | typedef __Reply__thread_create_from_user_t Reply __attribute__((unused)); |
| 1432 | |
| 1433 | /* |
| 1434 | * typedef struct { |
| 1435 | * mach_msg_header_t Head; |
| 1436 | * NDR_record_t NDR; |
| 1437 | * kern_return_t RetCode; |
| 1438 | * } mig_reply_error_t; |
| 1439 | */ |
| 1440 | |
| 1441 | Request *In0P = (Request *) InHeadP; |
| 1442 | Reply *OutP = (Reply *) OutHeadP; |
| 1443 | #ifdef __MIG_check__Request__thread_create_from_user_t__defined |
| 1444 | kern_return_t check_result; |
| 1445 | #endif /* __MIG_check__Request__thread_create_from_user_t__defined */ |
| 1446 | |
| 1447 | #if __MigKernelSpecificCode |
| 1448 | #if UseStaticTemplates |
| 1449 | const static mach_msg_port_descriptor_t child_actTemplate = { |
| 1450 | /* name = */ MACH_PORT_NULL, |
| 1451 | /* pad1 = */ 0, |
| 1452 | /* pad2 = */ 0, |
| 1453 | /* disp = */ 17, |
| 1454 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 1455 | }; |
| 1456 | #endif /* UseStaticTemplates */ |
| 1457 | |
| 1458 | #else |
| 1459 | #if UseStaticTemplates |
| 1460 | const static mach_msg_port_descriptor_t child_actTemplate = { |
| 1461 | /* name = */ MACH_PORT_NULL, |
| 1462 | /* pad1 = */ 0, |
| 1463 | /* pad2 = */ 0, |
| 1464 | /* disp = */ 19, |
| 1465 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 1466 | }; |
| 1467 | #endif /* UseStaticTemplates */ |
| 1468 | |
| 1469 | #endif /* __MigKernelSpecificCode */ |
| 1470 | kern_return_t RetCode; |
| 1471 | task_t parent_task; |
| 1472 | thread_act_t child_act; |
| 1473 | |
| 1474 | __DeclareRcvRpc(3411, "thread_create_from_user" ) |
| 1475 | __BeforeRcvRpc(3411, "thread_create_from_user" ) |
| 1476 | |
| 1477 | #if defined(__MIG_check__Request__thread_create_from_user_t__defined) |
| 1478 | check_result = __MIG_check__Request__thread_create_from_user_t((__Request *)In0P); |
| 1479 | if (check_result != MACH_MSG_SUCCESS) |
| 1480 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 1481 | #endif /* defined(__MIG_check__Request__thread_create_from_user_t__defined) */ |
| 1482 | |
| 1483 | #if UseStaticTemplates |
| 1484 | OutP->child_act = child_actTemplate; |
| 1485 | #else /* UseStaticTemplates */ |
| 1486 | #if __MigKernelSpecificCode |
| 1487 | OutP->child_act.disposition = 17; |
| 1488 | #else |
| 1489 | OutP->child_act.disposition = 19; |
| 1490 | #endif /* __MigKernelSpecificCode */ |
| 1491 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 1492 | OutP->child_act.pad1 = 0; |
| 1493 | #endif |
| 1494 | OutP->child_act.pad2 = 0; |
| 1495 | OutP->child_act.type = MACH_MSG_PORT_DESCRIPTOR; |
| 1496 | #if defined(KERNEL) |
| 1497 | OutP->child_act.pad_end = 0; |
| 1498 | #endif |
| 1499 | #endif /* UseStaticTemplates */ |
| 1500 | |
| 1501 | |
| 1502 | parent_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 1503 | |
| 1504 | RetCode = thread_create_from_user(parent_task, &child_act); |
| 1505 | task_deallocate(parent_task); |
| 1506 | if (RetCode != KERN_SUCCESS) { |
| 1507 | MIG_RETURN_ERROR(OutP, RetCode); |
| 1508 | } |
| 1509 | #if __MigKernelSpecificCode |
| 1510 | #endif /* __MigKernelSpecificCode */ |
| 1511 | OutP->child_act.name = (mach_port_t)convert_thread_to_port(child_act); |
| 1512 | |
| 1513 | |
| 1514 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 1515 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 1516 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 1517 | __AfterRcvRpc(3411, "thread_create_from_user" ) |
| 1518 | } |
| 1519 | |
| 1520 | #if ( __MigTypeCheck ) |
| 1521 | #if __MIG_check__Request__task_subsystem__ |
| 1522 | #if !defined(__MIG_check__Request__thread_create_running_from_user_t__defined) |
| 1523 | #define __MIG_check__Request__thread_create_running_from_user_t__defined |
| 1524 | |
| 1525 | mig_internal kern_return_t __MIG_check__Request__thread_create_running_from_user_t(__attribute__((__unused__)) __Request__thread_create_running_from_user_t *In0P) |
| 1526 | { |
| 1527 | |
| 1528 | typedef __Request__thread_create_running_from_user_t __Request; |
| 1529 | #if __MigTypeCheck |
| 1530 | unsigned int msgh_size; |
| 1531 | #endif /* __MigTypeCheck */ |
| 1532 | |
| 1533 | #if __MigTypeCheck |
| 1534 | msgh_size = In0P->Head.msgh_size; |
| 1535 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 1536 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 2456)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 1537 | return MIG_BAD_ARGUMENTS; |
| 1538 | #endif /* __MigTypeCheck */ |
| 1539 | |
| 1540 | #if defined(__NDR_convert__int_rep__Request__thread_create_running_from_user_t__new_stateCnt__defined) |
| 1541 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 1542 | __NDR_convert__int_rep__Request__thread_create_running_from_user_t__new_stateCnt(&In0P->new_stateCnt, In0P->NDR.int_rep); |
| 1543 | #endif /* __NDR_convert__int_rep__Request__thread_create_running_from_user_t__new_stateCnt__defined */ |
| 1544 | #if __MigTypeCheck |
| 1545 | if ( In0P->new_stateCnt > 614 ) |
| 1546 | return MIG_BAD_ARGUMENTS; |
| 1547 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 2456)) / 4 < In0P->new_stateCnt) || |
| 1548 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 2456) + (4 * In0P->new_stateCnt))) |
| 1549 | return MIG_BAD_ARGUMENTS; |
| 1550 | #endif /* __MigTypeCheck */ |
| 1551 | |
| 1552 | return MACH_MSG_SUCCESS; |
| 1553 | } |
| 1554 | #endif /* !defined(__MIG_check__Request__thread_create_running_from_user_t__defined) */ |
| 1555 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 1556 | #endif /* ( __MigTypeCheck ) */ |
| 1557 | |
| 1558 | |
| 1559 | /* Routine thread_create_running_from_user */ |
| 1560 | mig_internal novalue _Xthread_create_running_from_user |
| 1561 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1562 | { |
| 1563 | |
| 1564 | #ifdef __MigPackStructs |
| 1565 | #pragma pack(4) |
| 1566 | #endif |
| 1567 | typedef struct { |
| 1568 | mach_msg_header_t Head; |
| 1569 | NDR_record_t NDR; |
| 1570 | thread_state_flavor_t flavor; |
| 1571 | mach_msg_type_number_t new_stateCnt; |
| 1572 | natural_t new_state[614]; |
| 1573 | mach_msg_trailer_t trailer; |
| 1574 | } Request __attribute__((unused)); |
| 1575 | #ifdef __MigPackStructs |
| 1576 | #pragma pack() |
| 1577 | #endif |
| 1578 | typedef __Request__thread_create_running_from_user_t __Request; |
| 1579 | typedef __Reply__thread_create_running_from_user_t Reply __attribute__((unused)); |
| 1580 | |
| 1581 | /* |
| 1582 | * typedef struct { |
| 1583 | * mach_msg_header_t Head; |
| 1584 | * NDR_record_t NDR; |
| 1585 | * kern_return_t RetCode; |
| 1586 | * } mig_reply_error_t; |
| 1587 | */ |
| 1588 | |
| 1589 | Request *In0P = (Request *) InHeadP; |
| 1590 | Reply *OutP = (Reply *) OutHeadP; |
| 1591 | #ifdef __MIG_check__Request__thread_create_running_from_user_t__defined |
| 1592 | kern_return_t check_result; |
| 1593 | #endif /* __MIG_check__Request__thread_create_running_from_user_t__defined */ |
| 1594 | |
| 1595 | #if __MigKernelSpecificCode |
| 1596 | #if UseStaticTemplates |
| 1597 | const static mach_msg_port_descriptor_t child_actTemplate = { |
| 1598 | /* name = */ MACH_PORT_NULL, |
| 1599 | /* pad1 = */ 0, |
| 1600 | /* pad2 = */ 0, |
| 1601 | /* disp = */ 17, |
| 1602 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 1603 | }; |
| 1604 | #endif /* UseStaticTemplates */ |
| 1605 | |
| 1606 | #else |
| 1607 | #if UseStaticTemplates |
| 1608 | const static mach_msg_port_descriptor_t child_actTemplate = { |
| 1609 | /* name = */ MACH_PORT_NULL, |
| 1610 | /* pad1 = */ 0, |
| 1611 | /* pad2 = */ 0, |
| 1612 | /* disp = */ 19, |
| 1613 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 1614 | }; |
| 1615 | #endif /* UseStaticTemplates */ |
| 1616 | |
| 1617 | #endif /* __MigKernelSpecificCode */ |
| 1618 | kern_return_t RetCode; |
| 1619 | task_t parent_task; |
| 1620 | thread_act_t child_act; |
| 1621 | |
| 1622 | __DeclareRcvRpc(3412, "thread_create_running_from_user" ) |
| 1623 | __BeforeRcvRpc(3412, "thread_create_running_from_user" ) |
| 1624 | |
| 1625 | #if defined(__MIG_check__Request__thread_create_running_from_user_t__defined) |
| 1626 | check_result = __MIG_check__Request__thread_create_running_from_user_t((__Request *)In0P); |
| 1627 | if (check_result != MACH_MSG_SUCCESS) |
| 1628 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 1629 | #endif /* defined(__MIG_check__Request__thread_create_running_from_user_t__defined) */ |
| 1630 | |
| 1631 | #if UseStaticTemplates |
| 1632 | OutP->child_act = child_actTemplate; |
| 1633 | #else /* UseStaticTemplates */ |
| 1634 | #if __MigKernelSpecificCode |
| 1635 | OutP->child_act.disposition = 17; |
| 1636 | #else |
| 1637 | OutP->child_act.disposition = 19; |
| 1638 | #endif /* __MigKernelSpecificCode */ |
| 1639 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 1640 | OutP->child_act.pad1 = 0; |
| 1641 | #endif |
| 1642 | OutP->child_act.pad2 = 0; |
| 1643 | OutP->child_act.type = MACH_MSG_PORT_DESCRIPTOR; |
| 1644 | #if defined(KERNEL) |
| 1645 | OutP->child_act.pad_end = 0; |
| 1646 | #endif |
| 1647 | #endif /* UseStaticTemplates */ |
| 1648 | |
| 1649 | |
| 1650 | parent_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 1651 | |
| 1652 | RetCode = thread_create_running_from_user(parent_task, In0P->flavor, In0P->new_state, In0P->new_stateCnt, &child_act); |
| 1653 | task_deallocate(parent_task); |
| 1654 | if (RetCode != KERN_SUCCESS) { |
| 1655 | MIG_RETURN_ERROR(OutP, RetCode); |
| 1656 | } |
| 1657 | #if __MigKernelSpecificCode |
| 1658 | #endif /* __MigKernelSpecificCode */ |
| 1659 | OutP->child_act.name = (mach_port_t)convert_thread_to_port(child_act); |
| 1660 | |
| 1661 | |
| 1662 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 1663 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 1664 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 1665 | __AfterRcvRpc(3412, "thread_create_running_from_user" ) |
| 1666 | } |
| 1667 | |
| 1668 | #if ( __MigTypeCheck ) |
| 1669 | #if __MIG_check__Request__task_subsystem__ |
| 1670 | #if !defined(__MIG_check__Request__task_set_exception_ports_t__defined) |
| 1671 | #define __MIG_check__Request__task_set_exception_ports_t__defined |
| 1672 | |
| 1673 | mig_internal kern_return_t __MIG_check__Request__task_set_exception_ports_t(__attribute__((__unused__)) __Request__task_set_exception_ports_t *In0P) |
| 1674 | { |
| 1675 | |
| 1676 | typedef __Request__task_set_exception_ports_t __Request; |
| 1677 | #if __MigTypeCheck |
| 1678 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 1679 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 1680 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 1681 | return MIG_BAD_ARGUMENTS; |
| 1682 | #endif /* __MigTypeCheck */ |
| 1683 | |
| 1684 | #if __MigTypeCheck |
| 1685 | if (In0P->new_port.type != MACH_MSG_PORT_DESCRIPTOR || |
| 1686 | In0P->new_port.disposition != 17) |
| 1687 | return MIG_TYPE_ERROR; |
| 1688 | #endif /* __MigTypeCheck */ |
| 1689 | |
| 1690 | return MACH_MSG_SUCCESS; |
| 1691 | } |
| 1692 | #endif /* !defined(__MIG_check__Request__task_set_exception_ports_t__defined) */ |
| 1693 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 1694 | #endif /* ( __MigTypeCheck ) */ |
| 1695 | |
| 1696 | |
| 1697 | /* Routine task_set_exception_ports */ |
| 1698 | mig_internal novalue _Xtask_set_exception_ports |
| 1699 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1700 | { |
| 1701 | |
| 1702 | #ifdef __MigPackStructs |
| 1703 | #pragma pack(4) |
| 1704 | #endif |
| 1705 | typedef struct { |
| 1706 | mach_msg_header_t Head; |
| 1707 | /* start of the kernel processed data */ |
| 1708 | mach_msg_body_t msgh_body; |
| 1709 | mach_msg_port_descriptor_t new_port; |
| 1710 | /* end of the kernel processed data */ |
| 1711 | NDR_record_t NDR; |
| 1712 | exception_mask_t exception_mask; |
| 1713 | exception_behavior_t behavior; |
| 1714 | thread_state_flavor_t new_flavor; |
| 1715 | mach_msg_trailer_t trailer; |
| 1716 | } Request __attribute__((unused)); |
| 1717 | #ifdef __MigPackStructs |
| 1718 | #pragma pack() |
| 1719 | #endif |
| 1720 | typedef __Request__task_set_exception_ports_t __Request; |
| 1721 | typedef __Reply__task_set_exception_ports_t Reply __attribute__((unused)); |
| 1722 | |
| 1723 | /* |
| 1724 | * typedef struct { |
| 1725 | * mach_msg_header_t Head; |
| 1726 | * NDR_record_t NDR; |
| 1727 | * kern_return_t RetCode; |
| 1728 | * } mig_reply_error_t; |
| 1729 | */ |
| 1730 | |
| 1731 | Request *In0P = (Request *) InHeadP; |
| 1732 | Reply *OutP = (Reply *) OutHeadP; |
| 1733 | #ifdef __MIG_check__Request__task_set_exception_ports_t__defined |
| 1734 | kern_return_t check_result; |
| 1735 | #endif /* __MIG_check__Request__task_set_exception_ports_t__defined */ |
| 1736 | |
| 1737 | #if __MigKernelSpecificCode |
| 1738 | #else |
| 1739 | #endif /* __MigKernelSpecificCode */ |
| 1740 | task_t task; |
| 1741 | |
| 1742 | __DeclareRcvRpc(3413, "task_set_exception_ports" ) |
| 1743 | __BeforeRcvRpc(3413, "task_set_exception_ports" ) |
| 1744 | |
| 1745 | #if defined(__MIG_check__Request__task_set_exception_ports_t__defined) |
| 1746 | check_result = __MIG_check__Request__task_set_exception_ports_t((__Request *)In0P); |
| 1747 | if (check_result != MACH_MSG_SUCCESS) |
| 1748 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 1749 | #endif /* defined(__MIG_check__Request__task_set_exception_ports_t__defined) */ |
| 1750 | |
| 1751 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 1752 | |
| 1753 | OutP->RetCode = task_set_exception_ports(task, In0P->exception_mask, In0P->new_port.name, In0P->behavior, In0P->new_flavor); |
| 1754 | task_deallocate(task); |
| 1755 | #if __MigKernelSpecificCode |
| 1756 | #endif /* __MigKernelSpecificCode */ |
| 1757 | |
| 1758 | OutP->NDR = NDR_record; |
| 1759 | |
| 1760 | |
| 1761 | __AfterRcvRpc(3413, "task_set_exception_ports" ) |
| 1762 | } |
| 1763 | |
| 1764 | #if ( __MigTypeCheck ) |
| 1765 | #if __MIG_check__Request__task_subsystem__ |
| 1766 | #if !defined(__MIG_check__Request__task_get_exception_ports_t__defined) |
| 1767 | #define __MIG_check__Request__task_get_exception_ports_t__defined |
| 1768 | |
| 1769 | mig_internal kern_return_t __MIG_check__Request__task_get_exception_ports_t(__attribute__((__unused__)) __Request__task_get_exception_ports_t *In0P) |
| 1770 | { |
| 1771 | |
| 1772 | typedef __Request__task_get_exception_ports_t __Request; |
| 1773 | #if __MigTypeCheck |
| 1774 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 1775 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 1776 | return MIG_BAD_ARGUMENTS; |
| 1777 | #endif /* __MigTypeCheck */ |
| 1778 | |
| 1779 | return MACH_MSG_SUCCESS; |
| 1780 | } |
| 1781 | #endif /* !defined(__MIG_check__Request__task_get_exception_ports_t__defined) */ |
| 1782 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 1783 | #endif /* ( __MigTypeCheck ) */ |
| 1784 | |
| 1785 | |
| 1786 | /* Routine task_get_exception_ports */ |
| 1787 | mig_internal novalue _Xtask_get_exception_ports |
| 1788 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1789 | { |
| 1790 | |
| 1791 | #ifdef __MigPackStructs |
| 1792 | #pragma pack(4) |
| 1793 | #endif |
| 1794 | typedef struct { |
| 1795 | mach_msg_header_t Head; |
| 1796 | NDR_record_t NDR; |
| 1797 | exception_mask_t exception_mask; |
| 1798 | mach_msg_trailer_t trailer; |
| 1799 | } Request __attribute__((unused)); |
| 1800 | #ifdef __MigPackStructs |
| 1801 | #pragma pack() |
| 1802 | #endif |
| 1803 | typedef __Request__task_get_exception_ports_t __Request; |
| 1804 | typedef __Reply__task_get_exception_ports_t Reply __attribute__((unused)); |
| 1805 | |
| 1806 | /* |
| 1807 | * typedef struct { |
| 1808 | * mach_msg_header_t Head; |
| 1809 | * NDR_record_t NDR; |
| 1810 | * kern_return_t RetCode; |
| 1811 | * } mig_reply_error_t; |
| 1812 | */ |
| 1813 | |
| 1814 | Request *In0P = (Request *) InHeadP; |
| 1815 | Reply *OutP = (Reply *) OutHeadP; |
| 1816 | unsigned int msgh_size; |
| 1817 | unsigned int msgh_size_delta; |
| 1818 | |
| 1819 | #ifdef __MIG_check__Request__task_get_exception_ports_t__defined |
| 1820 | kern_return_t check_result; |
| 1821 | #endif /* __MIG_check__Request__task_get_exception_ports_t__defined */ |
| 1822 | |
| 1823 | #if __MigKernelSpecificCode |
| 1824 | #if UseStaticTemplates |
| 1825 | const static mach_msg_port_descriptor_t old_handlersTemplate = { |
| 1826 | /* name = */ MACH_PORT_NULL, |
| 1827 | /* pad1 = */ 0, |
| 1828 | /* pad2 = */ 0, |
| 1829 | /* disp = */ 17, |
| 1830 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 1831 | }; |
| 1832 | #endif /* UseStaticTemplates */ |
| 1833 | |
| 1834 | #else |
| 1835 | #if UseStaticTemplates |
| 1836 | const static mach_msg_port_descriptor_t old_handlersTemplate = { |
| 1837 | /* name = */ MACH_PORT_NULL, |
| 1838 | /* pad1 = */ 0, |
| 1839 | /* pad2 = */ 0, |
| 1840 | /* disp = */ 19, |
| 1841 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 1842 | }; |
| 1843 | #endif /* UseStaticTemplates */ |
| 1844 | |
| 1845 | #endif /* __MigKernelSpecificCode */ |
| 1846 | kern_return_t RetCode; |
| 1847 | task_inspect_t task; |
| 1848 | mach_msg_type_number_t masksCnt; |
| 1849 | exception_handler_t old_handlers[32]; |
| 1850 | exception_behavior_t old_behaviors[32]; |
| 1851 | thread_state_flavor_t old_flavors[32]; |
| 1852 | |
| 1853 | __DeclareRcvRpc(3414, "task_get_exception_ports" ) |
| 1854 | __BeforeRcvRpc(3414, "task_get_exception_ports" ) |
| 1855 | |
| 1856 | #if defined(__MIG_check__Request__task_get_exception_ports_t__defined) |
| 1857 | check_result = __MIG_check__Request__task_get_exception_ports_t((__Request *)In0P); |
| 1858 | if (check_result != MACH_MSG_SUCCESS) |
| 1859 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 1860 | #endif /* defined(__MIG_check__Request__task_get_exception_ports_t__defined) */ |
| 1861 | |
| 1862 | { |
| 1863 | register mach_msg_port_descriptor_t *ptr; |
| 1864 | register int i; |
| 1865 | |
| 1866 | ptr = &OutP->old_handlers[0]; |
| 1867 | for (i = 0; i < 32; ptr++, i++) { |
| 1868 | #if UseStaticTemplates |
| 1869 | *ptr = old_handlersTemplate; |
| 1870 | #else /* UseStaticTemplates */ |
| 1871 | ptr->name = MACH_PORT_NULL; |
| 1872 | #if __MigKernelSpecificCode |
| 1873 | ptr->disposition = 17; |
| 1874 | #else |
| 1875 | ptr->disposition = 19; |
| 1876 | #endif /* __MigKernelSpecificCode */ |
| 1877 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 1878 | ptr->pad1 = 0; |
| 1879 | #endif |
| 1880 | ptr->pad2 = 0; |
| 1881 | ptr->type = MACH_MSG_PORT_DESCRIPTOR; |
| 1882 | #if defined(KERNEL) |
| 1883 | ptr->pad_end = 0; |
| 1884 | #endif |
| 1885 | #endif /* UseStaticTemplates */ |
| 1886 | } |
| 1887 | } |
| 1888 | |
| 1889 | |
| 1890 | task = convert_port_to_task_inspect(In0P->Head.msgh_request_port); |
| 1891 | |
| 1892 | masksCnt = 32; |
| 1893 | |
| 1894 | RetCode = task_get_exception_ports(task, In0P->exception_mask, OutP->masks, &masksCnt, old_handlers, old_behaviors, old_flavors); |
| 1895 | task_inspect_deallocate(task); |
| 1896 | if (RetCode != KERN_SUCCESS) { |
| 1897 | MIG_RETURN_ERROR(OutP, RetCode); |
| 1898 | } |
| 1899 | #if __MigKernelSpecificCode |
| 1900 | #endif /* __MigKernelSpecificCode */ |
| 1901 | { |
| 1902 | register mach_msg_port_descriptor_t *ptr; |
| 1903 | register int i, j; |
| 1904 | |
| 1905 | ptr = &OutP->old_handlers[0]; |
| 1906 | j = min(32, masksCnt); |
| 1907 | for (i = 0; i < j; ptr++, i++) { |
| 1908 | ptr->name = old_handlers[i]; |
| 1909 | } |
| 1910 | } |
| 1911 | |
| 1912 | |
| 1913 | OutP->NDR = NDR_record; |
| 1914 | |
| 1915 | OutP->masksCnt = masksCnt; |
| 1916 | msgh_size_delta = ((4 * masksCnt)); |
| 1917 | msgh_size = (mach_msg_size_t)(sizeof(Reply) - 384) + msgh_size_delta; |
| 1918 | OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); |
| 1919 | (void)memcpy((char *) OutP->old_behaviors, (const char *) old_behaviors, 4 * masksCnt); |
| 1920 | msgh_size_delta = ((4 * masksCnt)); |
| 1921 | msgh_size += msgh_size_delta; |
| 1922 | OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); |
| 1923 | (void)memcpy((char *) OutP->old_flavors, (const char *) old_flavors, 4 * masksCnt); |
| 1924 | msgh_size += ((4 * masksCnt)); |
| 1925 | |
| 1926 | OutP = (Reply *) OutHeadP; |
| 1927 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 1928 | OutP->Head.msgh_size = msgh_size; |
| 1929 | OutP->msgh_body.msgh_descriptor_count = 32; |
| 1930 | __AfterRcvRpc(3414, "task_get_exception_ports" ) |
| 1931 | } |
| 1932 | |
| 1933 | #if ( __MigTypeCheck ) |
| 1934 | #if __MIG_check__Request__task_subsystem__ |
| 1935 | #if !defined(__MIG_check__Request__task_swap_exception_ports_t__defined) |
| 1936 | #define __MIG_check__Request__task_swap_exception_ports_t__defined |
| 1937 | |
| 1938 | mig_internal kern_return_t __MIG_check__Request__task_swap_exception_ports_t(__attribute__((__unused__)) __Request__task_swap_exception_ports_t *In0P) |
| 1939 | { |
| 1940 | |
| 1941 | typedef __Request__task_swap_exception_ports_t __Request; |
| 1942 | #if __MigTypeCheck |
| 1943 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 1944 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 1945 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 1946 | return MIG_BAD_ARGUMENTS; |
| 1947 | #endif /* __MigTypeCheck */ |
| 1948 | |
| 1949 | #if __MigTypeCheck |
| 1950 | if (In0P->new_port.type != MACH_MSG_PORT_DESCRIPTOR || |
| 1951 | In0P->new_port.disposition != 17) |
| 1952 | return MIG_TYPE_ERROR; |
| 1953 | #endif /* __MigTypeCheck */ |
| 1954 | |
| 1955 | return MACH_MSG_SUCCESS; |
| 1956 | } |
| 1957 | #endif /* !defined(__MIG_check__Request__task_swap_exception_ports_t__defined) */ |
| 1958 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 1959 | #endif /* ( __MigTypeCheck ) */ |
| 1960 | |
| 1961 | |
| 1962 | /* Routine task_swap_exception_ports */ |
| 1963 | mig_internal novalue _Xtask_swap_exception_ports |
| 1964 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1965 | { |
| 1966 | |
| 1967 | #ifdef __MigPackStructs |
| 1968 | #pragma pack(4) |
| 1969 | #endif |
| 1970 | typedef struct { |
| 1971 | mach_msg_header_t Head; |
| 1972 | /* start of the kernel processed data */ |
| 1973 | mach_msg_body_t msgh_body; |
| 1974 | mach_msg_port_descriptor_t new_port; |
| 1975 | /* end of the kernel processed data */ |
| 1976 | NDR_record_t NDR; |
| 1977 | exception_mask_t exception_mask; |
| 1978 | exception_behavior_t behavior; |
| 1979 | thread_state_flavor_t new_flavor; |
| 1980 | mach_msg_trailer_t trailer; |
| 1981 | } Request __attribute__((unused)); |
| 1982 | #ifdef __MigPackStructs |
| 1983 | #pragma pack() |
| 1984 | #endif |
| 1985 | typedef __Request__task_swap_exception_ports_t __Request; |
| 1986 | typedef __Reply__task_swap_exception_ports_t Reply __attribute__((unused)); |
| 1987 | |
| 1988 | /* |
| 1989 | * typedef struct { |
| 1990 | * mach_msg_header_t Head; |
| 1991 | * NDR_record_t NDR; |
| 1992 | * kern_return_t RetCode; |
| 1993 | * } mig_reply_error_t; |
| 1994 | */ |
| 1995 | |
| 1996 | Request *In0P = (Request *) InHeadP; |
| 1997 | Reply *OutP = (Reply *) OutHeadP; |
| 1998 | unsigned int msgh_size; |
| 1999 | unsigned int msgh_size_delta; |
| 2000 | |
| 2001 | #ifdef __MIG_check__Request__task_swap_exception_ports_t__defined |
| 2002 | kern_return_t check_result; |
| 2003 | #endif /* __MIG_check__Request__task_swap_exception_ports_t__defined */ |
| 2004 | |
| 2005 | #if __MigKernelSpecificCode |
| 2006 | #if UseStaticTemplates |
| 2007 | const static mach_msg_port_descriptor_t old_handlerssTemplate = { |
| 2008 | /* name = */ MACH_PORT_NULL, |
| 2009 | /* pad1 = */ 0, |
| 2010 | /* pad2 = */ 0, |
| 2011 | /* disp = */ 17, |
| 2012 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 2013 | }; |
| 2014 | #endif /* UseStaticTemplates */ |
| 2015 | |
| 2016 | #else |
| 2017 | #if UseStaticTemplates |
| 2018 | const static mach_msg_port_descriptor_t old_handlerssTemplate = { |
| 2019 | /* name = */ MACH_PORT_NULL, |
| 2020 | /* pad1 = */ 0, |
| 2021 | /* pad2 = */ 0, |
| 2022 | /* disp = */ 19, |
| 2023 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 2024 | }; |
| 2025 | #endif /* UseStaticTemplates */ |
| 2026 | |
| 2027 | #endif /* __MigKernelSpecificCode */ |
| 2028 | kern_return_t RetCode; |
| 2029 | task_t task; |
| 2030 | mach_msg_type_number_t masksCnt; |
| 2031 | exception_handler_t old_handlerss[32]; |
| 2032 | exception_behavior_t old_behaviors[32]; |
| 2033 | thread_state_flavor_t old_flavors[32]; |
| 2034 | |
| 2035 | __DeclareRcvRpc(3415, "task_swap_exception_ports" ) |
| 2036 | __BeforeRcvRpc(3415, "task_swap_exception_ports" ) |
| 2037 | |
| 2038 | #if defined(__MIG_check__Request__task_swap_exception_ports_t__defined) |
| 2039 | check_result = __MIG_check__Request__task_swap_exception_ports_t((__Request *)In0P); |
| 2040 | if (check_result != MACH_MSG_SUCCESS) |
| 2041 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 2042 | #endif /* defined(__MIG_check__Request__task_swap_exception_ports_t__defined) */ |
| 2043 | |
| 2044 | { |
| 2045 | register mach_msg_port_descriptor_t *ptr; |
| 2046 | register int i; |
| 2047 | |
| 2048 | ptr = &OutP->old_handlerss[0]; |
| 2049 | for (i = 0; i < 32; ptr++, i++) { |
| 2050 | #if UseStaticTemplates |
| 2051 | *ptr = old_handlerssTemplate; |
| 2052 | #else /* UseStaticTemplates */ |
| 2053 | ptr->name = MACH_PORT_NULL; |
| 2054 | #if __MigKernelSpecificCode |
| 2055 | ptr->disposition = 17; |
| 2056 | #else |
| 2057 | ptr->disposition = 19; |
| 2058 | #endif /* __MigKernelSpecificCode */ |
| 2059 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 2060 | ptr->pad1 = 0; |
| 2061 | #endif |
| 2062 | ptr->pad2 = 0; |
| 2063 | ptr->type = MACH_MSG_PORT_DESCRIPTOR; |
| 2064 | #if defined(KERNEL) |
| 2065 | ptr->pad_end = 0; |
| 2066 | #endif |
| 2067 | #endif /* UseStaticTemplates */ |
| 2068 | } |
| 2069 | } |
| 2070 | |
| 2071 | |
| 2072 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 2073 | |
| 2074 | masksCnt = 32; |
| 2075 | |
| 2076 | RetCode = task_swap_exception_ports(task, In0P->exception_mask, In0P->new_port.name, In0P->behavior, In0P->new_flavor, OutP->masks, &masksCnt, old_handlerss, old_behaviors, old_flavors); |
| 2077 | task_deallocate(task); |
| 2078 | if (RetCode != KERN_SUCCESS) { |
| 2079 | MIG_RETURN_ERROR(OutP, RetCode); |
| 2080 | } |
| 2081 | #if __MigKernelSpecificCode |
| 2082 | #endif /* __MigKernelSpecificCode */ |
| 2083 | { |
| 2084 | register mach_msg_port_descriptor_t *ptr; |
| 2085 | register int i, j; |
| 2086 | |
| 2087 | ptr = &OutP->old_handlerss[0]; |
| 2088 | j = min(32, masksCnt); |
| 2089 | for (i = 0; i < j; ptr++, i++) { |
| 2090 | ptr->name = old_handlerss[i]; |
| 2091 | } |
| 2092 | } |
| 2093 | |
| 2094 | |
| 2095 | OutP->NDR = NDR_record; |
| 2096 | |
| 2097 | OutP->masksCnt = masksCnt; |
| 2098 | msgh_size_delta = ((4 * masksCnt)); |
| 2099 | msgh_size = (mach_msg_size_t)(sizeof(Reply) - 384) + msgh_size_delta; |
| 2100 | OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); |
| 2101 | (void)memcpy((char *) OutP->old_behaviors, (const char *) old_behaviors, 4 * masksCnt); |
| 2102 | msgh_size_delta = ((4 * masksCnt)); |
| 2103 | msgh_size += msgh_size_delta; |
| 2104 | OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128); |
| 2105 | (void)memcpy((char *) OutP->old_flavors, (const char *) old_flavors, 4 * masksCnt); |
| 2106 | msgh_size += ((4 * masksCnt)); |
| 2107 | |
| 2108 | OutP = (Reply *) OutHeadP; |
| 2109 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 2110 | OutP->Head.msgh_size = msgh_size; |
| 2111 | OutP->msgh_body.msgh_descriptor_count = 32; |
| 2112 | __AfterRcvRpc(3415, "task_swap_exception_ports" ) |
| 2113 | } |
| 2114 | |
| 2115 | #if ( __MigTypeCheck ) |
| 2116 | #if __MIG_check__Request__task_subsystem__ |
| 2117 | #if !defined(__MIG_check__Request__lock_set_create_t__defined) |
| 2118 | #define __MIG_check__Request__lock_set_create_t__defined |
| 2119 | |
| 2120 | mig_internal kern_return_t __MIG_check__Request__lock_set_create_t(__attribute__((__unused__)) __Request__lock_set_create_t *In0P) |
| 2121 | { |
| 2122 | |
| 2123 | typedef __Request__lock_set_create_t __Request; |
| 2124 | #if __MigTypeCheck |
| 2125 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 2126 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 2127 | return MIG_BAD_ARGUMENTS; |
| 2128 | #endif /* __MigTypeCheck */ |
| 2129 | |
| 2130 | return MACH_MSG_SUCCESS; |
| 2131 | } |
| 2132 | #endif /* !defined(__MIG_check__Request__lock_set_create_t__defined) */ |
| 2133 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 2134 | #endif /* ( __MigTypeCheck ) */ |
| 2135 | |
| 2136 | |
| 2137 | /* Routine lock_set_create */ |
| 2138 | mig_internal novalue _Xlock_set_create |
| 2139 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2140 | { |
| 2141 | |
| 2142 | #ifdef __MigPackStructs |
| 2143 | #pragma pack(4) |
| 2144 | #endif |
| 2145 | typedef struct { |
| 2146 | mach_msg_header_t Head; |
| 2147 | NDR_record_t NDR; |
| 2148 | int n_ulocks; |
| 2149 | int policy; |
| 2150 | mach_msg_trailer_t trailer; |
| 2151 | } Request __attribute__((unused)); |
| 2152 | #ifdef __MigPackStructs |
| 2153 | #pragma pack() |
| 2154 | #endif |
| 2155 | typedef __Request__lock_set_create_t __Request; |
| 2156 | typedef __Reply__lock_set_create_t Reply __attribute__((unused)); |
| 2157 | |
| 2158 | /* |
| 2159 | * typedef struct { |
| 2160 | * mach_msg_header_t Head; |
| 2161 | * NDR_record_t NDR; |
| 2162 | * kern_return_t RetCode; |
| 2163 | * } mig_reply_error_t; |
| 2164 | */ |
| 2165 | |
| 2166 | Request *In0P = (Request *) InHeadP; |
| 2167 | Reply *OutP = (Reply *) OutHeadP; |
| 2168 | #ifdef __MIG_check__Request__lock_set_create_t__defined |
| 2169 | kern_return_t check_result; |
| 2170 | #endif /* __MIG_check__Request__lock_set_create_t__defined */ |
| 2171 | |
| 2172 | #if __MigKernelSpecificCode |
| 2173 | #if UseStaticTemplates |
| 2174 | const static mach_msg_port_descriptor_t new_lock_setTemplate = { |
| 2175 | /* name = */ MACH_PORT_NULL, |
| 2176 | /* pad1 = */ 0, |
| 2177 | /* pad2 = */ 0, |
| 2178 | /* disp = */ 17, |
| 2179 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 2180 | }; |
| 2181 | #endif /* UseStaticTemplates */ |
| 2182 | |
| 2183 | #else |
| 2184 | #if UseStaticTemplates |
| 2185 | const static mach_msg_port_descriptor_t new_lock_setTemplate = { |
| 2186 | /* name = */ MACH_PORT_NULL, |
| 2187 | /* pad1 = */ 0, |
| 2188 | /* pad2 = */ 0, |
| 2189 | /* disp = */ 19, |
| 2190 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 2191 | }; |
| 2192 | #endif /* UseStaticTemplates */ |
| 2193 | |
| 2194 | #endif /* __MigKernelSpecificCode */ |
| 2195 | kern_return_t RetCode; |
| 2196 | task_t task; |
| 2197 | lock_set_t new_lock_set; |
| 2198 | |
| 2199 | __DeclareRcvRpc(3416, "lock_set_create" ) |
| 2200 | __BeforeRcvRpc(3416, "lock_set_create" ) |
| 2201 | |
| 2202 | #if defined(__MIG_check__Request__lock_set_create_t__defined) |
| 2203 | check_result = __MIG_check__Request__lock_set_create_t((__Request *)In0P); |
| 2204 | if (check_result != MACH_MSG_SUCCESS) |
| 2205 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 2206 | #endif /* defined(__MIG_check__Request__lock_set_create_t__defined) */ |
| 2207 | |
| 2208 | #if UseStaticTemplates |
| 2209 | OutP->new_lock_set = new_lock_setTemplate; |
| 2210 | #else /* UseStaticTemplates */ |
| 2211 | #if __MigKernelSpecificCode |
| 2212 | OutP->new_lock_set.disposition = 17; |
| 2213 | #else |
| 2214 | OutP->new_lock_set.disposition = 19; |
| 2215 | #endif /* __MigKernelSpecificCode */ |
| 2216 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 2217 | OutP->new_lock_set.pad1 = 0; |
| 2218 | #endif |
| 2219 | OutP->new_lock_set.pad2 = 0; |
| 2220 | OutP->new_lock_set.type = MACH_MSG_PORT_DESCRIPTOR; |
| 2221 | #if defined(KERNEL) |
| 2222 | OutP->new_lock_set.pad_end = 0; |
| 2223 | #endif |
| 2224 | #endif /* UseStaticTemplates */ |
| 2225 | |
| 2226 | |
| 2227 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 2228 | |
| 2229 | RetCode = lock_set_create(task, &new_lock_set, In0P->n_ulocks, In0P->policy); |
| 2230 | task_deallocate(task); |
| 2231 | if (RetCode != KERN_SUCCESS) { |
| 2232 | MIG_RETURN_ERROR(OutP, RetCode); |
| 2233 | } |
| 2234 | #if __MigKernelSpecificCode |
| 2235 | #endif /* __MigKernelSpecificCode */ |
| 2236 | OutP->new_lock_set.name = (mach_port_t)convert_lock_set_to_port(new_lock_set); |
| 2237 | |
| 2238 | |
| 2239 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 2240 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 2241 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 2242 | __AfterRcvRpc(3416, "lock_set_create" ) |
| 2243 | } |
| 2244 | |
| 2245 | #if ( __MigTypeCheck ) |
| 2246 | #if __MIG_check__Request__task_subsystem__ |
| 2247 | #if !defined(__MIG_check__Request__lock_set_destroy_t__defined) |
| 2248 | #define __MIG_check__Request__lock_set_destroy_t__defined |
| 2249 | |
| 2250 | mig_internal kern_return_t __MIG_check__Request__lock_set_destroy_t(__attribute__((__unused__)) __Request__lock_set_destroy_t *In0P) |
| 2251 | { |
| 2252 | |
| 2253 | typedef __Request__lock_set_destroy_t __Request; |
| 2254 | #if __MigTypeCheck |
| 2255 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 2256 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 2257 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 2258 | return MIG_BAD_ARGUMENTS; |
| 2259 | #endif /* __MigTypeCheck */ |
| 2260 | |
| 2261 | #if __MigTypeCheck |
| 2262 | if (In0P->lock_set.type != MACH_MSG_PORT_DESCRIPTOR || |
| 2263 | In0P->lock_set.disposition != 17) |
| 2264 | return MIG_TYPE_ERROR; |
| 2265 | #endif /* __MigTypeCheck */ |
| 2266 | |
| 2267 | return MACH_MSG_SUCCESS; |
| 2268 | } |
| 2269 | #endif /* !defined(__MIG_check__Request__lock_set_destroy_t__defined) */ |
| 2270 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 2271 | #endif /* ( __MigTypeCheck ) */ |
| 2272 | |
| 2273 | |
| 2274 | /* Routine lock_set_destroy */ |
| 2275 | mig_internal novalue _Xlock_set_destroy |
| 2276 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2277 | { |
| 2278 | |
| 2279 | #ifdef __MigPackStructs |
| 2280 | #pragma pack(4) |
| 2281 | #endif |
| 2282 | typedef struct { |
| 2283 | mach_msg_header_t Head; |
| 2284 | /* start of the kernel processed data */ |
| 2285 | mach_msg_body_t msgh_body; |
| 2286 | mach_msg_port_descriptor_t lock_set; |
| 2287 | /* end of the kernel processed data */ |
| 2288 | mach_msg_trailer_t trailer; |
| 2289 | } Request __attribute__((unused)); |
| 2290 | #ifdef __MigPackStructs |
| 2291 | #pragma pack() |
| 2292 | #endif |
| 2293 | typedef __Request__lock_set_destroy_t __Request; |
| 2294 | typedef __Reply__lock_set_destroy_t Reply __attribute__((unused)); |
| 2295 | |
| 2296 | /* |
| 2297 | * typedef struct { |
| 2298 | * mach_msg_header_t Head; |
| 2299 | * NDR_record_t NDR; |
| 2300 | * kern_return_t RetCode; |
| 2301 | * } mig_reply_error_t; |
| 2302 | */ |
| 2303 | |
| 2304 | Request *In0P = (Request *) InHeadP; |
| 2305 | Reply *OutP = (Reply *) OutHeadP; |
| 2306 | #ifdef __MIG_check__Request__lock_set_destroy_t__defined |
| 2307 | kern_return_t check_result; |
| 2308 | #endif /* __MIG_check__Request__lock_set_destroy_t__defined */ |
| 2309 | |
| 2310 | #if __MigKernelSpecificCode |
| 2311 | #else |
| 2312 | #endif /* __MigKernelSpecificCode */ |
| 2313 | task_t task; |
| 2314 | lock_set_t lock_set; |
| 2315 | |
| 2316 | __DeclareRcvRpc(3417, "lock_set_destroy" ) |
| 2317 | __BeforeRcvRpc(3417, "lock_set_destroy" ) |
| 2318 | |
| 2319 | #if defined(__MIG_check__Request__lock_set_destroy_t__defined) |
| 2320 | check_result = __MIG_check__Request__lock_set_destroy_t((__Request *)In0P); |
| 2321 | if (check_result != MACH_MSG_SUCCESS) |
| 2322 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 2323 | #endif /* defined(__MIG_check__Request__lock_set_destroy_t__defined) */ |
| 2324 | |
| 2325 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 2326 | |
| 2327 | lock_set = convert_port_to_lock_set(In0P->lock_set.name); |
| 2328 | |
| 2329 | OutP->RetCode = lock_set_destroy(task, lock_set); |
| 2330 | lock_set_dereference(lock_set); |
| 2331 | task_deallocate(task); |
| 2332 | #if __MigKernelSpecificCode |
| 2333 | if (OutP->RetCode != KERN_SUCCESS) { |
| 2334 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 2335 | } |
| 2336 | |
| 2337 | if (IP_VALID((ipc_port_t)In0P->lock_set.name)) |
| 2338 | ipc_port_release_send((ipc_port_t)In0P->lock_set.name); |
| 2339 | #endif /* __MigKernelSpecificCode */ |
| 2340 | |
| 2341 | OutP->NDR = NDR_record; |
| 2342 | |
| 2343 | |
| 2344 | __AfterRcvRpc(3417, "lock_set_destroy" ) |
| 2345 | } |
| 2346 | |
| 2347 | #if ( __MigTypeCheck ) |
| 2348 | #if __MIG_check__Request__task_subsystem__ |
| 2349 | #if !defined(__MIG_check__Request__semaphore_create_t__defined) |
| 2350 | #define __MIG_check__Request__semaphore_create_t__defined |
| 2351 | |
| 2352 | mig_internal kern_return_t __MIG_check__Request__semaphore_create_t(__attribute__((__unused__)) __Request__semaphore_create_t *In0P) |
| 2353 | { |
| 2354 | |
| 2355 | typedef __Request__semaphore_create_t __Request; |
| 2356 | #if __MigTypeCheck |
| 2357 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 2358 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 2359 | return MIG_BAD_ARGUMENTS; |
| 2360 | #endif /* __MigTypeCheck */ |
| 2361 | |
| 2362 | return MACH_MSG_SUCCESS; |
| 2363 | } |
| 2364 | #endif /* !defined(__MIG_check__Request__semaphore_create_t__defined) */ |
| 2365 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 2366 | #endif /* ( __MigTypeCheck ) */ |
| 2367 | |
| 2368 | |
| 2369 | /* Routine semaphore_create */ |
| 2370 | mig_internal novalue _Xsemaphore_create |
| 2371 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2372 | { |
| 2373 | |
| 2374 | #ifdef __MigPackStructs |
| 2375 | #pragma pack(4) |
| 2376 | #endif |
| 2377 | typedef struct { |
| 2378 | mach_msg_header_t Head; |
| 2379 | NDR_record_t NDR; |
| 2380 | int policy; |
| 2381 | int value; |
| 2382 | mach_msg_trailer_t trailer; |
| 2383 | } Request __attribute__((unused)); |
| 2384 | #ifdef __MigPackStructs |
| 2385 | #pragma pack() |
| 2386 | #endif |
| 2387 | typedef __Request__semaphore_create_t __Request; |
| 2388 | typedef __Reply__semaphore_create_t Reply __attribute__((unused)); |
| 2389 | |
| 2390 | /* |
| 2391 | * typedef struct { |
| 2392 | * mach_msg_header_t Head; |
| 2393 | * NDR_record_t NDR; |
| 2394 | * kern_return_t RetCode; |
| 2395 | * } mig_reply_error_t; |
| 2396 | */ |
| 2397 | |
| 2398 | Request *In0P = (Request *) InHeadP; |
| 2399 | Reply *OutP = (Reply *) OutHeadP; |
| 2400 | #ifdef __MIG_check__Request__semaphore_create_t__defined |
| 2401 | kern_return_t check_result; |
| 2402 | #endif /* __MIG_check__Request__semaphore_create_t__defined */ |
| 2403 | |
| 2404 | #if __MigKernelSpecificCode |
| 2405 | #if UseStaticTemplates |
| 2406 | const static mach_msg_port_descriptor_t semaphoreTemplate = { |
| 2407 | /* name = */ MACH_PORT_NULL, |
| 2408 | /* pad1 = */ 0, |
| 2409 | /* pad2 = */ 0, |
| 2410 | /* disp = */ 17, |
| 2411 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 2412 | }; |
| 2413 | #endif /* UseStaticTemplates */ |
| 2414 | |
| 2415 | #else |
| 2416 | #if UseStaticTemplates |
| 2417 | const static mach_msg_port_descriptor_t semaphoreTemplate = { |
| 2418 | /* name = */ MACH_PORT_NULL, |
| 2419 | /* pad1 = */ 0, |
| 2420 | /* pad2 = */ 0, |
| 2421 | /* disp = */ 19, |
| 2422 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 2423 | }; |
| 2424 | #endif /* UseStaticTemplates */ |
| 2425 | |
| 2426 | #endif /* __MigKernelSpecificCode */ |
| 2427 | kern_return_t RetCode; |
| 2428 | task_t task; |
| 2429 | semaphore_t semaphore; |
| 2430 | |
| 2431 | __DeclareRcvRpc(3418, "semaphore_create" ) |
| 2432 | __BeforeRcvRpc(3418, "semaphore_create" ) |
| 2433 | |
| 2434 | #if defined(__MIG_check__Request__semaphore_create_t__defined) |
| 2435 | check_result = __MIG_check__Request__semaphore_create_t((__Request *)In0P); |
| 2436 | if (check_result != MACH_MSG_SUCCESS) |
| 2437 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 2438 | #endif /* defined(__MIG_check__Request__semaphore_create_t__defined) */ |
| 2439 | |
| 2440 | #if UseStaticTemplates |
| 2441 | OutP->semaphore = semaphoreTemplate; |
| 2442 | #else /* UseStaticTemplates */ |
| 2443 | #if __MigKernelSpecificCode |
| 2444 | OutP->semaphore.disposition = 17; |
| 2445 | #else |
| 2446 | OutP->semaphore.disposition = 19; |
| 2447 | #endif /* __MigKernelSpecificCode */ |
| 2448 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 2449 | OutP->semaphore.pad1 = 0; |
| 2450 | #endif |
| 2451 | OutP->semaphore.pad2 = 0; |
| 2452 | OutP->semaphore.type = MACH_MSG_PORT_DESCRIPTOR; |
| 2453 | #if defined(KERNEL) |
| 2454 | OutP->semaphore.pad_end = 0; |
| 2455 | #endif |
| 2456 | #endif /* UseStaticTemplates */ |
| 2457 | |
| 2458 | |
| 2459 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 2460 | |
| 2461 | RetCode = semaphore_create(task, &semaphore, In0P->policy, In0P->value); |
| 2462 | task_deallocate(task); |
| 2463 | if (RetCode != KERN_SUCCESS) { |
| 2464 | MIG_RETURN_ERROR(OutP, RetCode); |
| 2465 | } |
| 2466 | #if __MigKernelSpecificCode |
| 2467 | #endif /* __MigKernelSpecificCode */ |
| 2468 | OutP->semaphore.name = (mach_port_t)convert_semaphore_to_port(semaphore); |
| 2469 | |
| 2470 | |
| 2471 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 2472 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 2473 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 2474 | __AfterRcvRpc(3418, "semaphore_create" ) |
| 2475 | } |
| 2476 | |
| 2477 | #if ( __MigTypeCheck ) |
| 2478 | #if __MIG_check__Request__task_subsystem__ |
| 2479 | #if !defined(__MIG_check__Request__semaphore_destroy_t__defined) |
| 2480 | #define __MIG_check__Request__semaphore_destroy_t__defined |
| 2481 | |
| 2482 | mig_internal kern_return_t __MIG_check__Request__semaphore_destroy_t(__attribute__((__unused__)) __Request__semaphore_destroy_t *In0P) |
| 2483 | { |
| 2484 | |
| 2485 | typedef __Request__semaphore_destroy_t __Request; |
| 2486 | #if __MigTypeCheck |
| 2487 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 2488 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 2489 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 2490 | return MIG_BAD_ARGUMENTS; |
| 2491 | #endif /* __MigTypeCheck */ |
| 2492 | |
| 2493 | #if __MigTypeCheck |
| 2494 | if (In0P->semaphore.type != MACH_MSG_PORT_DESCRIPTOR || |
| 2495 | In0P->semaphore.disposition != 17) |
| 2496 | return MIG_TYPE_ERROR; |
| 2497 | #endif /* __MigTypeCheck */ |
| 2498 | |
| 2499 | return MACH_MSG_SUCCESS; |
| 2500 | } |
| 2501 | #endif /* !defined(__MIG_check__Request__semaphore_destroy_t__defined) */ |
| 2502 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 2503 | #endif /* ( __MigTypeCheck ) */ |
| 2504 | |
| 2505 | |
| 2506 | /* Routine semaphore_destroy */ |
| 2507 | mig_internal novalue _Xsemaphore_destroy |
| 2508 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2509 | { |
| 2510 | |
| 2511 | #ifdef __MigPackStructs |
| 2512 | #pragma pack(4) |
| 2513 | #endif |
| 2514 | typedef struct { |
| 2515 | mach_msg_header_t Head; |
| 2516 | /* start of the kernel processed data */ |
| 2517 | mach_msg_body_t msgh_body; |
| 2518 | mach_msg_port_descriptor_t semaphore; |
| 2519 | /* end of the kernel processed data */ |
| 2520 | mach_msg_trailer_t trailer; |
| 2521 | } Request __attribute__((unused)); |
| 2522 | #ifdef __MigPackStructs |
| 2523 | #pragma pack() |
| 2524 | #endif |
| 2525 | typedef __Request__semaphore_destroy_t __Request; |
| 2526 | typedef __Reply__semaphore_destroy_t Reply __attribute__((unused)); |
| 2527 | |
| 2528 | /* |
| 2529 | * typedef struct { |
| 2530 | * mach_msg_header_t Head; |
| 2531 | * NDR_record_t NDR; |
| 2532 | * kern_return_t RetCode; |
| 2533 | * } mig_reply_error_t; |
| 2534 | */ |
| 2535 | |
| 2536 | Request *In0P = (Request *) InHeadP; |
| 2537 | Reply *OutP = (Reply *) OutHeadP; |
| 2538 | #ifdef __MIG_check__Request__semaphore_destroy_t__defined |
| 2539 | kern_return_t check_result; |
| 2540 | #endif /* __MIG_check__Request__semaphore_destroy_t__defined */ |
| 2541 | |
| 2542 | #if __MigKernelSpecificCode |
| 2543 | #else |
| 2544 | #endif /* __MigKernelSpecificCode */ |
| 2545 | task_t task; |
| 2546 | |
| 2547 | __DeclareRcvRpc(3419, "semaphore_destroy" ) |
| 2548 | __BeforeRcvRpc(3419, "semaphore_destroy" ) |
| 2549 | |
| 2550 | #if defined(__MIG_check__Request__semaphore_destroy_t__defined) |
| 2551 | check_result = __MIG_check__Request__semaphore_destroy_t((__Request *)In0P); |
| 2552 | if (check_result != MACH_MSG_SUCCESS) |
| 2553 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 2554 | #endif /* defined(__MIG_check__Request__semaphore_destroy_t__defined) */ |
| 2555 | |
| 2556 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 2557 | |
| 2558 | OutP->RetCode = semaphore_destroy(task, convert_port_to_semaphore(In0P->semaphore.name)); |
| 2559 | task_deallocate(task); |
| 2560 | #if __MigKernelSpecificCode |
| 2561 | if (OutP->RetCode != KERN_SUCCESS) { |
| 2562 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 2563 | } |
| 2564 | |
| 2565 | if (IP_VALID((ipc_port_t)In0P->semaphore.name)) |
| 2566 | ipc_port_release_send((ipc_port_t)In0P->semaphore.name); |
| 2567 | #endif /* __MigKernelSpecificCode */ |
| 2568 | |
| 2569 | OutP->NDR = NDR_record; |
| 2570 | |
| 2571 | |
| 2572 | __AfterRcvRpc(3419, "semaphore_destroy" ) |
| 2573 | } |
| 2574 | |
| 2575 | #if ( __MigTypeCheck ) |
| 2576 | #if __MIG_check__Request__task_subsystem__ |
| 2577 | #if !defined(__MIG_check__Request__task_policy_set_t__defined) |
| 2578 | #define __MIG_check__Request__task_policy_set_t__defined |
| 2579 | |
| 2580 | mig_internal kern_return_t __MIG_check__Request__task_policy_set_t(__attribute__((__unused__)) __Request__task_policy_set_t *In0P) |
| 2581 | { |
| 2582 | |
| 2583 | typedef __Request__task_policy_set_t __Request; |
| 2584 | #if __MigTypeCheck |
| 2585 | unsigned int msgh_size; |
| 2586 | #endif /* __MigTypeCheck */ |
| 2587 | |
| 2588 | #if __MigTypeCheck |
| 2589 | msgh_size = In0P->Head.msgh_size; |
| 2590 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 2591 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 64)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 2592 | return MIG_BAD_ARGUMENTS; |
| 2593 | #endif /* __MigTypeCheck */ |
| 2594 | |
| 2595 | #if defined(__NDR_convert__int_rep__Request__task_policy_set_t__policy_infoCnt__defined) |
| 2596 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 2597 | __NDR_convert__int_rep__Request__task_policy_set_t__policy_infoCnt(&In0P->policy_infoCnt, In0P->NDR.int_rep); |
| 2598 | #endif /* __NDR_convert__int_rep__Request__task_policy_set_t__policy_infoCnt__defined */ |
| 2599 | #if __MigTypeCheck |
| 2600 | if ( In0P->policy_infoCnt > 16 ) |
| 2601 | return MIG_BAD_ARGUMENTS; |
| 2602 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 64)) / 4 < In0P->policy_infoCnt) || |
| 2603 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 64) + (4 * In0P->policy_infoCnt))) |
| 2604 | return MIG_BAD_ARGUMENTS; |
| 2605 | #endif /* __MigTypeCheck */ |
| 2606 | |
| 2607 | return MACH_MSG_SUCCESS; |
| 2608 | } |
| 2609 | #endif /* !defined(__MIG_check__Request__task_policy_set_t__defined) */ |
| 2610 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 2611 | #endif /* ( __MigTypeCheck ) */ |
| 2612 | |
| 2613 | |
| 2614 | /* Routine task_policy_set */ |
| 2615 | mig_internal novalue _Xtask_policy_set |
| 2616 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2617 | { |
| 2618 | |
| 2619 | #ifdef __MigPackStructs |
| 2620 | #pragma pack(4) |
| 2621 | #endif |
| 2622 | typedef struct { |
| 2623 | mach_msg_header_t Head; |
| 2624 | NDR_record_t NDR; |
| 2625 | task_policy_flavor_t flavor; |
| 2626 | mach_msg_type_number_t policy_infoCnt; |
| 2627 | integer_t policy_info[16]; |
| 2628 | mach_msg_trailer_t trailer; |
| 2629 | } Request __attribute__((unused)); |
| 2630 | #ifdef __MigPackStructs |
| 2631 | #pragma pack() |
| 2632 | #endif |
| 2633 | typedef __Request__task_policy_set_t __Request; |
| 2634 | typedef __Reply__task_policy_set_t Reply __attribute__((unused)); |
| 2635 | |
| 2636 | /* |
| 2637 | * typedef struct { |
| 2638 | * mach_msg_header_t Head; |
| 2639 | * NDR_record_t NDR; |
| 2640 | * kern_return_t RetCode; |
| 2641 | * } mig_reply_error_t; |
| 2642 | */ |
| 2643 | |
| 2644 | Request *In0P = (Request *) InHeadP; |
| 2645 | Reply *OutP = (Reply *) OutHeadP; |
| 2646 | #ifdef __MIG_check__Request__task_policy_set_t__defined |
| 2647 | kern_return_t check_result; |
| 2648 | #endif /* __MIG_check__Request__task_policy_set_t__defined */ |
| 2649 | |
| 2650 | #if __MigKernelSpecificCode |
| 2651 | #else |
| 2652 | #endif /* __MigKernelSpecificCode */ |
| 2653 | task_t task; |
| 2654 | |
| 2655 | __DeclareRcvRpc(3420, "task_policy_set" ) |
| 2656 | __BeforeRcvRpc(3420, "task_policy_set" ) |
| 2657 | |
| 2658 | #if defined(__MIG_check__Request__task_policy_set_t__defined) |
| 2659 | check_result = __MIG_check__Request__task_policy_set_t((__Request *)In0P); |
| 2660 | if (check_result != MACH_MSG_SUCCESS) |
| 2661 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 2662 | #endif /* defined(__MIG_check__Request__task_policy_set_t__defined) */ |
| 2663 | |
| 2664 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 2665 | |
| 2666 | OutP->RetCode = task_policy_set(task, In0P->flavor, In0P->policy_info, In0P->policy_infoCnt); |
| 2667 | task_deallocate(task); |
| 2668 | #if __MigKernelSpecificCode |
| 2669 | #endif /* __MigKernelSpecificCode */ |
| 2670 | |
| 2671 | OutP->NDR = NDR_record; |
| 2672 | |
| 2673 | |
| 2674 | __AfterRcvRpc(3420, "task_policy_set" ) |
| 2675 | } |
| 2676 | |
| 2677 | #if ( __MigTypeCheck ) |
| 2678 | #if __MIG_check__Request__task_subsystem__ |
| 2679 | #if !defined(__MIG_check__Request__task_policy_get_t__defined) |
| 2680 | #define __MIG_check__Request__task_policy_get_t__defined |
| 2681 | |
| 2682 | mig_internal kern_return_t __MIG_check__Request__task_policy_get_t(__attribute__((__unused__)) __Request__task_policy_get_t *In0P) |
| 2683 | { |
| 2684 | |
| 2685 | typedef __Request__task_policy_get_t __Request; |
| 2686 | #if __MigTypeCheck |
| 2687 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 2688 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 2689 | return MIG_BAD_ARGUMENTS; |
| 2690 | #endif /* __MigTypeCheck */ |
| 2691 | |
| 2692 | return MACH_MSG_SUCCESS; |
| 2693 | } |
| 2694 | #endif /* !defined(__MIG_check__Request__task_policy_get_t__defined) */ |
| 2695 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 2696 | #endif /* ( __MigTypeCheck ) */ |
| 2697 | |
| 2698 | |
| 2699 | /* Routine task_policy_get */ |
| 2700 | mig_internal novalue _Xtask_policy_get |
| 2701 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2702 | { |
| 2703 | |
| 2704 | #ifdef __MigPackStructs |
| 2705 | #pragma pack(4) |
| 2706 | #endif |
| 2707 | typedef struct { |
| 2708 | mach_msg_header_t Head; |
| 2709 | NDR_record_t NDR; |
| 2710 | task_policy_flavor_t flavor; |
| 2711 | mach_msg_type_number_t policy_infoCnt; |
| 2712 | boolean_t get_default; |
| 2713 | mach_msg_trailer_t trailer; |
| 2714 | } Request __attribute__((unused)); |
| 2715 | #ifdef __MigPackStructs |
| 2716 | #pragma pack() |
| 2717 | #endif |
| 2718 | typedef __Request__task_policy_get_t __Request; |
| 2719 | typedef __Reply__task_policy_get_t Reply __attribute__((unused)); |
| 2720 | |
| 2721 | /* |
| 2722 | * typedef struct { |
| 2723 | * mach_msg_header_t Head; |
| 2724 | * NDR_record_t NDR; |
| 2725 | * kern_return_t RetCode; |
| 2726 | * } mig_reply_error_t; |
| 2727 | */ |
| 2728 | |
| 2729 | Request *In0P = (Request *) InHeadP; |
| 2730 | Reply *OutP = (Reply *) OutHeadP; |
| 2731 | unsigned int msgh_size_delta; |
| 2732 | |
| 2733 | #ifdef __MIG_check__Request__task_policy_get_t__defined |
| 2734 | kern_return_t check_result; |
| 2735 | #endif /* __MIG_check__Request__task_policy_get_t__defined */ |
| 2736 | |
| 2737 | #if __MigKernelSpecificCode |
| 2738 | #else |
| 2739 | #endif /* __MigKernelSpecificCode */ |
| 2740 | task_t task; |
| 2741 | |
| 2742 | __DeclareRcvRpc(3421, "task_policy_get" ) |
| 2743 | __BeforeRcvRpc(3421, "task_policy_get" ) |
| 2744 | |
| 2745 | #if defined(__MIG_check__Request__task_policy_get_t__defined) |
| 2746 | check_result = __MIG_check__Request__task_policy_get_t((__Request *)In0P); |
| 2747 | if (check_result != MACH_MSG_SUCCESS) |
| 2748 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 2749 | #endif /* defined(__MIG_check__Request__task_policy_get_t__defined) */ |
| 2750 | |
| 2751 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 2752 | |
| 2753 | OutP->policy_infoCnt = 16; |
| 2754 | if (In0P->policy_infoCnt < OutP->policy_infoCnt) |
| 2755 | OutP->policy_infoCnt = In0P->policy_infoCnt; |
| 2756 | |
| 2757 | OutP->RetCode = task_policy_get(task, In0P->flavor, OutP->policy_info, &OutP->policy_infoCnt, &In0P->get_default); |
| 2758 | task_deallocate(task); |
| 2759 | if (OutP->RetCode != KERN_SUCCESS) { |
| 2760 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 2761 | } |
| 2762 | #if __MigKernelSpecificCode |
| 2763 | #endif /* __MigKernelSpecificCode */ |
| 2764 | |
| 2765 | OutP->NDR = NDR_record; |
| 2766 | |
| 2767 | msgh_size_delta = ((4 * OutP->policy_infoCnt)); |
| 2768 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 64) + msgh_size_delta; |
| 2769 | OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 64); |
| 2770 | |
| 2771 | OutP->get_default = In0P->get_default; |
| 2772 | |
| 2773 | OutP = (Reply *) OutHeadP; |
| 2774 | __AfterRcvRpc(3421, "task_policy_get" ) |
| 2775 | } |
| 2776 | |
| 2777 | #if ( __MigTypeCheck ) |
| 2778 | #if __MIG_check__Request__task_subsystem__ |
| 2779 | #if !defined(__MIG_check__Request__task_policy_t__defined) |
| 2780 | #define __MIG_check__Request__task_policy_t__defined |
| 2781 | |
| 2782 | mig_internal kern_return_t __MIG_check__Request__task_policy_t(__attribute__((__unused__)) __Request__task_policy_t *In0P, __attribute__((__unused__)) __Request__task_policy_t **In1PP) |
| 2783 | { |
| 2784 | |
| 2785 | typedef __Request__task_policy_t __Request; |
| 2786 | __Request *In1P; |
| 2787 | #if __MigTypeCheck |
| 2788 | unsigned int msgh_size; |
| 2789 | #endif /* __MigTypeCheck */ |
| 2790 | unsigned int msgh_size_delta; |
| 2791 | |
| 2792 | #if __MigTypeCheck |
| 2793 | msgh_size = In0P->Head.msgh_size; |
| 2794 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 2795 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 20)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 2796 | return MIG_BAD_ARGUMENTS; |
| 2797 | #endif /* __MigTypeCheck */ |
| 2798 | |
| 2799 | #if defined(__NDR_convert__int_rep__Request__task_policy_t__baseCnt__defined) |
| 2800 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 2801 | __NDR_convert__int_rep__Request__task_policy_t__baseCnt(&In0P->baseCnt, In0P->NDR.int_rep); |
| 2802 | #endif /* __NDR_convert__int_rep__Request__task_policy_t__baseCnt__defined */ |
| 2803 | msgh_size_delta = (4 * In0P->baseCnt); |
| 2804 | #if __MigTypeCheck |
| 2805 | if ( In0P->baseCnt > 5 ) |
| 2806 | return MIG_BAD_ARGUMENTS; |
| 2807 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 20)) / 4 < In0P->baseCnt) || |
| 2808 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 20) + (4 * In0P->baseCnt))) |
| 2809 | return MIG_BAD_ARGUMENTS; |
| 2810 | #endif /* __MigTypeCheck */ |
| 2811 | |
| 2812 | *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 20); |
| 2813 | |
| 2814 | return MACH_MSG_SUCCESS; |
| 2815 | } |
| 2816 | #endif /* !defined(__MIG_check__Request__task_policy_t__defined) */ |
| 2817 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 2818 | #endif /* ( __MigTypeCheck ) */ |
| 2819 | |
| 2820 | |
| 2821 | /* Routine task_policy */ |
| 2822 | mig_internal novalue _Xtask_policy |
| 2823 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2824 | { |
| 2825 | |
| 2826 | #ifdef __MigPackStructs |
| 2827 | #pragma pack(4) |
| 2828 | #endif |
| 2829 | typedef struct { |
| 2830 | mach_msg_header_t Head; |
| 2831 | NDR_record_t NDR; |
| 2832 | policy_t policy; |
| 2833 | mach_msg_type_number_t baseCnt; |
| 2834 | integer_t base[5]; |
| 2835 | boolean_t set_limit; |
| 2836 | boolean_t change; |
| 2837 | mach_msg_trailer_t trailer; |
| 2838 | } Request __attribute__((unused)); |
| 2839 | #ifdef __MigPackStructs |
| 2840 | #pragma pack() |
| 2841 | #endif |
| 2842 | typedef __Request__task_policy_t __Request; |
| 2843 | typedef __Reply__task_policy_t Reply __attribute__((unused)); |
| 2844 | |
| 2845 | /* |
| 2846 | * typedef struct { |
| 2847 | * mach_msg_header_t Head; |
| 2848 | * NDR_record_t NDR; |
| 2849 | * kern_return_t RetCode; |
| 2850 | * } mig_reply_error_t; |
| 2851 | */ |
| 2852 | |
| 2853 | Request *In0P = (Request *) InHeadP; |
| 2854 | Request *In1P; |
| 2855 | Reply *OutP = (Reply *) OutHeadP; |
| 2856 | #ifdef __MIG_check__Request__task_policy_t__defined |
| 2857 | kern_return_t check_result; |
| 2858 | #endif /* __MIG_check__Request__task_policy_t__defined */ |
| 2859 | |
| 2860 | #if __MigKernelSpecificCode |
| 2861 | #else |
| 2862 | #endif /* __MigKernelSpecificCode */ |
| 2863 | task_t task; |
| 2864 | |
| 2865 | __DeclareRcvRpc(3423, "task_policy" ) |
| 2866 | __BeforeRcvRpc(3423, "task_policy" ) |
| 2867 | |
| 2868 | #if defined(__MIG_check__Request__task_policy_t__defined) |
| 2869 | check_result = __MIG_check__Request__task_policy_t((__Request *)In0P, (__Request **)&In1P); |
| 2870 | if (check_result != MACH_MSG_SUCCESS) |
| 2871 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 2872 | #endif /* defined(__MIG_check__Request__task_policy_t__defined) */ |
| 2873 | |
| 2874 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 2875 | |
| 2876 | OutP->RetCode = task_policy(task, In0P->policy, In0P->base, In0P->baseCnt, In1P->set_limit, In1P->change); |
| 2877 | task_deallocate(task); |
| 2878 | #if __MigKernelSpecificCode |
| 2879 | #endif /* __MigKernelSpecificCode */ |
| 2880 | |
| 2881 | OutP->NDR = NDR_record; |
| 2882 | |
| 2883 | |
| 2884 | __AfterRcvRpc(3423, "task_policy" ) |
| 2885 | } |
| 2886 | |
| 2887 | #if ( __MigTypeCheck ) |
| 2888 | #if __MIG_check__Request__task_subsystem__ |
| 2889 | #if !defined(__MIG_check__Request__task_set_emulation_t__defined) |
| 2890 | #define __MIG_check__Request__task_set_emulation_t__defined |
| 2891 | |
| 2892 | mig_internal kern_return_t __MIG_check__Request__task_set_emulation_t(__attribute__((__unused__)) __Request__task_set_emulation_t *In0P) |
| 2893 | { |
| 2894 | |
| 2895 | typedef __Request__task_set_emulation_t __Request; |
| 2896 | #if __MigTypeCheck |
| 2897 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 2898 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 2899 | return MIG_BAD_ARGUMENTS; |
| 2900 | #endif /* __MigTypeCheck */ |
| 2901 | |
| 2902 | return MACH_MSG_SUCCESS; |
| 2903 | } |
| 2904 | #endif /* !defined(__MIG_check__Request__task_set_emulation_t__defined) */ |
| 2905 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 2906 | #endif /* ( __MigTypeCheck ) */ |
| 2907 | |
| 2908 | |
| 2909 | /* Routine task_set_emulation */ |
| 2910 | mig_internal novalue _Xtask_set_emulation |
| 2911 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2912 | { |
| 2913 | |
| 2914 | #ifdef __MigPackStructs |
| 2915 | #pragma pack(4) |
| 2916 | #endif |
| 2917 | typedef struct { |
| 2918 | mach_msg_header_t Head; |
| 2919 | NDR_record_t NDR; |
| 2920 | vm_address_t routine_entry_pt; |
| 2921 | int routine_number; |
| 2922 | mach_msg_trailer_t trailer; |
| 2923 | } Request __attribute__((unused)); |
| 2924 | #ifdef __MigPackStructs |
| 2925 | #pragma pack() |
| 2926 | #endif |
| 2927 | typedef __Request__task_set_emulation_t __Request; |
| 2928 | typedef __Reply__task_set_emulation_t Reply __attribute__((unused)); |
| 2929 | |
| 2930 | /* |
| 2931 | * typedef struct { |
| 2932 | * mach_msg_header_t Head; |
| 2933 | * NDR_record_t NDR; |
| 2934 | * kern_return_t RetCode; |
| 2935 | * } mig_reply_error_t; |
| 2936 | */ |
| 2937 | |
| 2938 | Request *In0P = (Request *) InHeadP; |
| 2939 | Reply *OutP = (Reply *) OutHeadP; |
| 2940 | #ifdef __MIG_check__Request__task_set_emulation_t__defined |
| 2941 | kern_return_t check_result; |
| 2942 | #endif /* __MIG_check__Request__task_set_emulation_t__defined */ |
| 2943 | |
| 2944 | #if __MigKernelSpecificCode |
| 2945 | #else |
| 2946 | #endif /* __MigKernelSpecificCode */ |
| 2947 | task_t target_port; |
| 2948 | |
| 2949 | __DeclareRcvRpc(3424, "task_set_emulation" ) |
| 2950 | __BeforeRcvRpc(3424, "task_set_emulation" ) |
| 2951 | |
| 2952 | #if defined(__MIG_check__Request__task_set_emulation_t__defined) |
| 2953 | check_result = __MIG_check__Request__task_set_emulation_t((__Request *)In0P); |
| 2954 | if (check_result != MACH_MSG_SUCCESS) |
| 2955 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 2956 | #endif /* defined(__MIG_check__Request__task_set_emulation_t__defined) */ |
| 2957 | |
| 2958 | target_port = convert_port_to_task(In0P->Head.msgh_request_port); |
| 2959 | |
| 2960 | OutP->RetCode = task_set_emulation(target_port, In0P->routine_entry_pt, In0P->routine_number); |
| 2961 | task_deallocate(target_port); |
| 2962 | #if __MigKernelSpecificCode |
| 2963 | #endif /* __MigKernelSpecificCode */ |
| 2964 | |
| 2965 | OutP->NDR = NDR_record; |
| 2966 | |
| 2967 | |
| 2968 | __AfterRcvRpc(3424, "task_set_emulation" ) |
| 2969 | } |
| 2970 | |
| 2971 | #if ( __MigTypeCheck ) |
| 2972 | #if __MIG_check__Request__task_subsystem__ |
| 2973 | #if !defined(__MIG_check__Request__task_get_emulation_vector_t__defined) |
| 2974 | #define __MIG_check__Request__task_get_emulation_vector_t__defined |
| 2975 | |
| 2976 | mig_internal kern_return_t __MIG_check__Request__task_get_emulation_vector_t(__attribute__((__unused__)) __Request__task_get_emulation_vector_t *In0P) |
| 2977 | { |
| 2978 | |
| 2979 | typedef __Request__task_get_emulation_vector_t __Request; |
| 2980 | #if __MigTypeCheck |
| 2981 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 2982 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 2983 | return MIG_BAD_ARGUMENTS; |
| 2984 | #endif /* __MigTypeCheck */ |
| 2985 | |
| 2986 | return MACH_MSG_SUCCESS; |
| 2987 | } |
| 2988 | #endif /* !defined(__MIG_check__Request__task_get_emulation_vector_t__defined) */ |
| 2989 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 2990 | #endif /* ( __MigTypeCheck ) */ |
| 2991 | |
| 2992 | |
| 2993 | /* Routine task_get_emulation_vector */ |
| 2994 | mig_internal novalue _Xtask_get_emulation_vector |
| 2995 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2996 | { |
| 2997 | |
| 2998 | #ifdef __MigPackStructs |
| 2999 | #pragma pack(4) |
| 3000 | #endif |
| 3001 | typedef struct { |
| 3002 | mach_msg_header_t Head; |
| 3003 | mach_msg_trailer_t trailer; |
| 3004 | } Request __attribute__((unused)); |
| 3005 | #ifdef __MigPackStructs |
| 3006 | #pragma pack() |
| 3007 | #endif |
| 3008 | typedef __Request__task_get_emulation_vector_t __Request; |
| 3009 | typedef __Reply__task_get_emulation_vector_t Reply __attribute__((unused)); |
| 3010 | |
| 3011 | /* |
| 3012 | * typedef struct { |
| 3013 | * mach_msg_header_t Head; |
| 3014 | * NDR_record_t NDR; |
| 3015 | * kern_return_t RetCode; |
| 3016 | * } mig_reply_error_t; |
| 3017 | */ |
| 3018 | |
| 3019 | Request *In0P = (Request *) InHeadP; |
| 3020 | Reply *OutP = (Reply *) OutHeadP; |
| 3021 | #ifdef __MIG_check__Request__task_get_emulation_vector_t__defined |
| 3022 | kern_return_t check_result; |
| 3023 | #endif /* __MIG_check__Request__task_get_emulation_vector_t__defined */ |
| 3024 | |
| 3025 | #if __MigKernelSpecificCode |
| 3026 | #if UseStaticTemplates |
| 3027 | const static mach_msg_ool_descriptor_t emulation_vectorTemplate = { |
| 3028 | /* addr = */ (void *)0, |
| 3029 | /* size = */ 0, |
| 3030 | /* deal = */ FALSE, |
| 3031 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
| 3032 | /* pad2 = */ 0, |
| 3033 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
| 3034 | }; |
| 3035 | #endif /* UseStaticTemplates */ |
| 3036 | |
| 3037 | #else |
| 3038 | #if UseStaticTemplates |
| 3039 | const static mach_msg_ool_descriptor_t emulation_vectorTemplate = { |
| 3040 | /* addr = */ (void *)0, |
| 3041 | /* size = */ 0, |
| 3042 | /* deal = */ FALSE, |
| 3043 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
| 3044 | /* pad2 = */ 0, |
| 3045 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
| 3046 | }; |
| 3047 | #endif /* UseStaticTemplates */ |
| 3048 | |
| 3049 | #endif /* __MigKernelSpecificCode */ |
| 3050 | kern_return_t RetCode; |
| 3051 | task_t task; |
| 3052 | |
| 3053 | __DeclareRcvRpc(3425, "task_get_emulation_vector" ) |
| 3054 | __BeforeRcvRpc(3425, "task_get_emulation_vector" ) |
| 3055 | |
| 3056 | #if defined(__MIG_check__Request__task_get_emulation_vector_t__defined) |
| 3057 | check_result = __MIG_check__Request__task_get_emulation_vector_t((__Request *)In0P); |
| 3058 | if (check_result != MACH_MSG_SUCCESS) |
| 3059 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 3060 | #endif /* defined(__MIG_check__Request__task_get_emulation_vector_t__defined) */ |
| 3061 | |
| 3062 | #if UseStaticTemplates |
| 3063 | OutP->emulation_vector = emulation_vectorTemplate; |
| 3064 | #else /* UseStaticTemplates */ |
| 3065 | OutP->emulation_vector.deallocate = FALSE; |
| 3066 | OutP->emulation_vector.copy = MACH_MSG_VIRTUAL_COPY; |
| 3067 | OutP->emulation_vector.pad1 = 0; |
| 3068 | OutP->emulation_vector.type = MACH_MSG_OOL_DESCRIPTOR; |
| 3069 | #if defined(KERNEL) && !defined(__LP64__) |
| 3070 | OutP->emulation_vector.pad_end = 0; |
| 3071 | #endif |
| 3072 | #endif /* UseStaticTemplates */ |
| 3073 | |
| 3074 | |
| 3075 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 3076 | |
| 3077 | RetCode = task_get_emulation_vector(task, &OutP->vector_start, (emulation_vector_t *)&(OutP->emulation_vector.address), &OutP->emulation_vectorCnt); |
| 3078 | task_deallocate(task); |
| 3079 | if (RetCode != KERN_SUCCESS) { |
| 3080 | MIG_RETURN_ERROR(OutP, RetCode); |
| 3081 | } |
| 3082 | #if __MigKernelSpecificCode |
| 3083 | #endif /* __MigKernelSpecificCode */ |
| 3084 | OutP->emulation_vector.size = OutP->emulation_vectorCnt * 8; |
| 3085 | |
| 3086 | |
| 3087 | OutP->NDR = NDR_record; |
| 3088 | |
| 3089 | |
| 3090 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 3091 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 3092 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 3093 | __AfterRcvRpc(3425, "task_get_emulation_vector" ) |
| 3094 | } |
| 3095 | |
| 3096 | #if ( __MigTypeCheck ) |
| 3097 | #if __MIG_check__Request__task_subsystem__ |
| 3098 | #if !defined(__MIG_check__Request__task_set_emulation_vector_t__defined) |
| 3099 | #define __MIG_check__Request__task_set_emulation_vector_t__defined |
| 3100 | |
| 3101 | mig_internal kern_return_t __MIG_check__Request__task_set_emulation_vector_t(__attribute__((__unused__)) __Request__task_set_emulation_vector_t *In0P) |
| 3102 | { |
| 3103 | |
| 3104 | typedef __Request__task_set_emulation_vector_t __Request; |
| 3105 | #if __MigTypeCheck |
| 3106 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 3107 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 3108 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 3109 | return MIG_BAD_ARGUMENTS; |
| 3110 | #endif /* __MigTypeCheck */ |
| 3111 | |
| 3112 | #if __MigTypeCheck |
| 3113 | if (In0P->emulation_vector.type != MACH_MSG_OOL_DESCRIPTOR) |
| 3114 | return MIG_TYPE_ERROR; |
| 3115 | #endif /* __MigTypeCheck */ |
| 3116 | |
| 3117 | #if __MigTypeCheck |
| 3118 | if (In0P->emulation_vector.size / 8 != In0P->emulation_vectorCnt) |
| 3119 | return MIG_TYPE_ERROR; |
| 3120 | #endif /* __MigTypeCheck */ |
| 3121 | |
| 3122 | return MACH_MSG_SUCCESS; |
| 3123 | } |
| 3124 | #endif /* !defined(__MIG_check__Request__task_set_emulation_vector_t__defined) */ |
| 3125 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 3126 | #endif /* ( __MigTypeCheck ) */ |
| 3127 | |
| 3128 | |
| 3129 | /* Routine task_set_emulation_vector */ |
| 3130 | mig_internal novalue _Xtask_set_emulation_vector |
| 3131 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3132 | { |
| 3133 | |
| 3134 | #ifdef __MigPackStructs |
| 3135 | #pragma pack(4) |
| 3136 | #endif |
| 3137 | typedef struct { |
| 3138 | mach_msg_header_t Head; |
| 3139 | /* start of the kernel processed data */ |
| 3140 | mach_msg_body_t msgh_body; |
| 3141 | mach_msg_ool_descriptor_t emulation_vector; |
| 3142 | /* end of the kernel processed data */ |
| 3143 | NDR_record_t NDR; |
| 3144 | int vector_start; |
| 3145 | mach_msg_type_number_t emulation_vectorCnt; |
| 3146 | mach_msg_trailer_t trailer; |
| 3147 | } Request __attribute__((unused)); |
| 3148 | #ifdef __MigPackStructs |
| 3149 | #pragma pack() |
| 3150 | #endif |
| 3151 | typedef __Request__task_set_emulation_vector_t __Request; |
| 3152 | typedef __Reply__task_set_emulation_vector_t Reply __attribute__((unused)); |
| 3153 | |
| 3154 | /* |
| 3155 | * typedef struct { |
| 3156 | * mach_msg_header_t Head; |
| 3157 | * NDR_record_t NDR; |
| 3158 | * kern_return_t RetCode; |
| 3159 | * } mig_reply_error_t; |
| 3160 | */ |
| 3161 | |
| 3162 | Request *In0P = (Request *) InHeadP; |
| 3163 | Reply *OutP = (Reply *) OutHeadP; |
| 3164 | #ifdef __MIG_check__Request__task_set_emulation_vector_t__defined |
| 3165 | kern_return_t check_result; |
| 3166 | #endif /* __MIG_check__Request__task_set_emulation_vector_t__defined */ |
| 3167 | |
| 3168 | #if __MigKernelSpecificCode |
| 3169 | #else |
| 3170 | #endif /* __MigKernelSpecificCode */ |
| 3171 | task_t task; |
| 3172 | |
| 3173 | __DeclareRcvRpc(3426, "task_set_emulation_vector" ) |
| 3174 | __BeforeRcvRpc(3426, "task_set_emulation_vector" ) |
| 3175 | |
| 3176 | #if defined(__MIG_check__Request__task_set_emulation_vector_t__defined) |
| 3177 | check_result = __MIG_check__Request__task_set_emulation_vector_t((__Request *)In0P); |
| 3178 | if (check_result != MACH_MSG_SUCCESS) |
| 3179 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 3180 | #endif /* defined(__MIG_check__Request__task_set_emulation_vector_t__defined) */ |
| 3181 | |
| 3182 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 3183 | |
| 3184 | OutP->RetCode = task_set_emulation_vector(task, In0P->vector_start, (emulation_vector_t)(In0P->emulation_vector.address), In0P->emulation_vector.size / 8); |
| 3185 | task_deallocate(task); |
| 3186 | #if __MigKernelSpecificCode |
| 3187 | #endif /* __MigKernelSpecificCode */ |
| 3188 | |
| 3189 | OutP->NDR = NDR_record; |
| 3190 | |
| 3191 | |
| 3192 | __AfterRcvRpc(3426, "task_set_emulation_vector" ) |
| 3193 | } |
| 3194 | |
| 3195 | #if ( __MigTypeCheck ) |
| 3196 | #if __MIG_check__Request__task_subsystem__ |
| 3197 | #if !defined(__MIG_check__Request__task_set_ras_pc_t__defined) |
| 3198 | #define __MIG_check__Request__task_set_ras_pc_t__defined |
| 3199 | |
| 3200 | mig_internal kern_return_t __MIG_check__Request__task_set_ras_pc_t(__attribute__((__unused__)) __Request__task_set_ras_pc_t *In0P) |
| 3201 | { |
| 3202 | |
| 3203 | typedef __Request__task_set_ras_pc_t __Request; |
| 3204 | #if __MigTypeCheck |
| 3205 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 3206 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 3207 | return MIG_BAD_ARGUMENTS; |
| 3208 | #endif /* __MigTypeCheck */ |
| 3209 | |
| 3210 | return MACH_MSG_SUCCESS; |
| 3211 | } |
| 3212 | #endif /* !defined(__MIG_check__Request__task_set_ras_pc_t__defined) */ |
| 3213 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 3214 | #endif /* ( __MigTypeCheck ) */ |
| 3215 | |
| 3216 | |
| 3217 | /* Routine task_set_ras_pc */ |
| 3218 | mig_internal novalue _Xtask_set_ras_pc |
| 3219 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3220 | { |
| 3221 | |
| 3222 | #ifdef __MigPackStructs |
| 3223 | #pragma pack(4) |
| 3224 | #endif |
| 3225 | typedef struct { |
| 3226 | mach_msg_header_t Head; |
| 3227 | NDR_record_t NDR; |
| 3228 | vm_address_t basepc; |
| 3229 | vm_address_t boundspc; |
| 3230 | mach_msg_trailer_t trailer; |
| 3231 | } Request __attribute__((unused)); |
| 3232 | #ifdef __MigPackStructs |
| 3233 | #pragma pack() |
| 3234 | #endif |
| 3235 | typedef __Request__task_set_ras_pc_t __Request; |
| 3236 | typedef __Reply__task_set_ras_pc_t Reply __attribute__((unused)); |
| 3237 | |
| 3238 | /* |
| 3239 | * typedef struct { |
| 3240 | * mach_msg_header_t Head; |
| 3241 | * NDR_record_t NDR; |
| 3242 | * kern_return_t RetCode; |
| 3243 | * } mig_reply_error_t; |
| 3244 | */ |
| 3245 | |
| 3246 | Request *In0P = (Request *) InHeadP; |
| 3247 | Reply *OutP = (Reply *) OutHeadP; |
| 3248 | #ifdef __MIG_check__Request__task_set_ras_pc_t__defined |
| 3249 | kern_return_t check_result; |
| 3250 | #endif /* __MIG_check__Request__task_set_ras_pc_t__defined */ |
| 3251 | |
| 3252 | #if __MigKernelSpecificCode |
| 3253 | #else |
| 3254 | #endif /* __MigKernelSpecificCode */ |
| 3255 | task_t target_task; |
| 3256 | |
| 3257 | __DeclareRcvRpc(3427, "task_set_ras_pc" ) |
| 3258 | __BeforeRcvRpc(3427, "task_set_ras_pc" ) |
| 3259 | |
| 3260 | #if defined(__MIG_check__Request__task_set_ras_pc_t__defined) |
| 3261 | check_result = __MIG_check__Request__task_set_ras_pc_t((__Request *)In0P); |
| 3262 | if (check_result != MACH_MSG_SUCCESS) |
| 3263 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 3264 | #endif /* defined(__MIG_check__Request__task_set_ras_pc_t__defined) */ |
| 3265 | |
| 3266 | target_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 3267 | |
| 3268 | OutP->RetCode = task_set_ras_pc(target_task, In0P->basepc, In0P->boundspc); |
| 3269 | task_deallocate(target_task); |
| 3270 | #if __MigKernelSpecificCode |
| 3271 | #endif /* __MigKernelSpecificCode */ |
| 3272 | |
| 3273 | OutP->NDR = NDR_record; |
| 3274 | |
| 3275 | |
| 3276 | __AfterRcvRpc(3427, "task_set_ras_pc" ) |
| 3277 | } |
| 3278 | |
| 3279 | #if ( __MigTypeCheck ) |
| 3280 | #if __MIG_check__Request__task_subsystem__ |
| 3281 | #if !defined(__MIG_check__Request__task_zone_info_t__defined) |
| 3282 | #define __MIG_check__Request__task_zone_info_t__defined |
| 3283 | |
| 3284 | mig_internal kern_return_t __MIG_check__Request__task_zone_info_t(__attribute__((__unused__)) __Request__task_zone_info_t *In0P) |
| 3285 | { |
| 3286 | |
| 3287 | typedef __Request__task_zone_info_t __Request; |
| 3288 | #if __MigTypeCheck |
| 3289 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 3290 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 3291 | return MIG_BAD_ARGUMENTS; |
| 3292 | #endif /* __MigTypeCheck */ |
| 3293 | |
| 3294 | return MACH_MSG_SUCCESS; |
| 3295 | } |
| 3296 | #endif /* !defined(__MIG_check__Request__task_zone_info_t__defined) */ |
| 3297 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 3298 | #endif /* ( __MigTypeCheck ) */ |
| 3299 | |
| 3300 | |
| 3301 | /* Routine task_zone_info */ |
| 3302 | mig_internal novalue _Xtask_zone_info |
| 3303 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3304 | { |
| 3305 | |
| 3306 | #ifdef __MigPackStructs |
| 3307 | #pragma pack(4) |
| 3308 | #endif |
| 3309 | typedef struct { |
| 3310 | mach_msg_header_t Head; |
| 3311 | mach_msg_trailer_t trailer; |
| 3312 | } Request __attribute__((unused)); |
| 3313 | #ifdef __MigPackStructs |
| 3314 | #pragma pack() |
| 3315 | #endif |
| 3316 | typedef __Request__task_zone_info_t __Request; |
| 3317 | typedef __Reply__task_zone_info_t Reply __attribute__((unused)); |
| 3318 | |
| 3319 | /* |
| 3320 | * typedef struct { |
| 3321 | * mach_msg_header_t Head; |
| 3322 | * NDR_record_t NDR; |
| 3323 | * kern_return_t RetCode; |
| 3324 | * } mig_reply_error_t; |
| 3325 | */ |
| 3326 | |
| 3327 | Request *In0P = (Request *) InHeadP; |
| 3328 | Reply *OutP = (Reply *) OutHeadP; |
| 3329 | #ifdef __MIG_check__Request__task_zone_info_t__defined |
| 3330 | kern_return_t check_result; |
| 3331 | #endif /* __MIG_check__Request__task_zone_info_t__defined */ |
| 3332 | |
| 3333 | #if __MigKernelSpecificCode |
| 3334 | #if UseStaticTemplates |
| 3335 | const static mach_msg_ool_descriptor_t namesTemplate = { |
| 3336 | /* addr = */ (void *)0, |
| 3337 | /* size = */ 0, |
| 3338 | /* deal = */ TRUE, |
| 3339 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
| 3340 | /* pad2 = */ 0, |
| 3341 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
| 3342 | }; |
| 3343 | #endif /* UseStaticTemplates */ |
| 3344 | |
| 3345 | #if UseStaticTemplates |
| 3346 | const static mach_msg_ool_descriptor_t infoTemplate = { |
| 3347 | /* addr = */ (void *)0, |
| 3348 | /* size = */ 0, |
| 3349 | /* deal = */ TRUE, |
| 3350 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
| 3351 | /* pad2 = */ 0, |
| 3352 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
| 3353 | }; |
| 3354 | #endif /* UseStaticTemplates */ |
| 3355 | |
| 3356 | #else |
| 3357 | #if UseStaticTemplates |
| 3358 | const static mach_msg_ool_descriptor_t namesTemplate = { |
| 3359 | /* addr = */ (void *)0, |
| 3360 | /* size = */ 0, |
| 3361 | /* deal = */ TRUE, |
| 3362 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
| 3363 | /* pad2 = */ 0, |
| 3364 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
| 3365 | }; |
| 3366 | #endif /* UseStaticTemplates */ |
| 3367 | |
| 3368 | #if UseStaticTemplates |
| 3369 | const static mach_msg_ool_descriptor_t infoTemplate = { |
| 3370 | /* addr = */ (void *)0, |
| 3371 | /* size = */ 0, |
| 3372 | /* deal = */ TRUE, |
| 3373 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
| 3374 | /* pad2 = */ 0, |
| 3375 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
| 3376 | }; |
| 3377 | #endif /* UseStaticTemplates */ |
| 3378 | |
| 3379 | #endif /* __MigKernelSpecificCode */ |
| 3380 | kern_return_t RetCode; |
| 3381 | task_t target_task; |
| 3382 | |
| 3383 | __DeclareRcvRpc(3428, "task_zone_info" ) |
| 3384 | __BeforeRcvRpc(3428, "task_zone_info" ) |
| 3385 | |
| 3386 | #if defined(__MIG_check__Request__task_zone_info_t__defined) |
| 3387 | check_result = __MIG_check__Request__task_zone_info_t((__Request *)In0P); |
| 3388 | if (check_result != MACH_MSG_SUCCESS) |
| 3389 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 3390 | #endif /* defined(__MIG_check__Request__task_zone_info_t__defined) */ |
| 3391 | |
| 3392 | #if UseStaticTemplates |
| 3393 | OutP->names = namesTemplate; |
| 3394 | #else /* UseStaticTemplates */ |
| 3395 | OutP->names.deallocate = TRUE; |
| 3396 | OutP->names.copy = MACH_MSG_VIRTUAL_COPY; |
| 3397 | OutP->names.pad1 = 0; |
| 3398 | OutP->names.type = MACH_MSG_OOL_DESCRIPTOR; |
| 3399 | #if defined(KERNEL) && !defined(__LP64__) |
| 3400 | OutP->names.pad_end = 0; |
| 3401 | #endif |
| 3402 | #endif /* UseStaticTemplates */ |
| 3403 | |
| 3404 | |
| 3405 | #if UseStaticTemplates |
| 3406 | OutP->info = infoTemplate; |
| 3407 | #else /* UseStaticTemplates */ |
| 3408 | OutP->info.deallocate = TRUE; |
| 3409 | OutP->info.copy = MACH_MSG_VIRTUAL_COPY; |
| 3410 | OutP->info.pad1 = 0; |
| 3411 | OutP->info.type = MACH_MSG_OOL_DESCRIPTOR; |
| 3412 | #if defined(KERNEL) && !defined(__LP64__) |
| 3413 | OutP->info.pad_end = 0; |
| 3414 | #endif |
| 3415 | #endif /* UseStaticTemplates */ |
| 3416 | |
| 3417 | |
| 3418 | target_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 3419 | |
| 3420 | OutP->namesCnt = 0; |
| 3421 | |
| 3422 | OutP->infoCnt = 0; |
| 3423 | |
| 3424 | RetCode = task_zone_info(target_task, (mach_zone_name_array_t *)&(OutP->names.address), &OutP->namesCnt, (task_zone_info_array_t *)&(OutP->info.address), &OutP->infoCnt); |
| 3425 | task_deallocate(target_task); |
| 3426 | if (RetCode != KERN_SUCCESS) { |
| 3427 | MIG_RETURN_ERROR(OutP, RetCode); |
| 3428 | } |
| 3429 | #if __MigKernelSpecificCode |
| 3430 | #endif /* __MigKernelSpecificCode */ |
| 3431 | OutP->names.size = OutP->namesCnt * 80; |
| 3432 | |
| 3433 | OutP->info.size = OutP->infoCnt * 88; |
| 3434 | |
| 3435 | |
| 3436 | OutP->NDR = NDR_record; |
| 3437 | |
| 3438 | |
| 3439 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 3440 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 3441 | OutP->msgh_body.msgh_descriptor_count = 2; |
| 3442 | __AfterRcvRpc(3428, "task_zone_info" ) |
| 3443 | } |
| 3444 | |
| 3445 | #if ( __MigTypeCheck ) |
| 3446 | #if __MIG_check__Request__task_subsystem__ |
| 3447 | #if !defined(__MIG_check__Request__task_assign_t__defined) |
| 3448 | #define __MIG_check__Request__task_assign_t__defined |
| 3449 | |
| 3450 | mig_internal kern_return_t __MIG_check__Request__task_assign_t(__attribute__((__unused__)) __Request__task_assign_t *In0P) |
| 3451 | { |
| 3452 | |
| 3453 | typedef __Request__task_assign_t __Request; |
| 3454 | #if __MigTypeCheck |
| 3455 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 3456 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 3457 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 3458 | return MIG_BAD_ARGUMENTS; |
| 3459 | #endif /* __MigTypeCheck */ |
| 3460 | |
| 3461 | #if __MigTypeCheck |
| 3462 | if (In0P->new_set.type != MACH_MSG_PORT_DESCRIPTOR || |
| 3463 | In0P->new_set.disposition != 17) |
| 3464 | return MIG_TYPE_ERROR; |
| 3465 | #endif /* __MigTypeCheck */ |
| 3466 | |
| 3467 | return MACH_MSG_SUCCESS; |
| 3468 | } |
| 3469 | #endif /* !defined(__MIG_check__Request__task_assign_t__defined) */ |
| 3470 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 3471 | #endif /* ( __MigTypeCheck ) */ |
| 3472 | |
| 3473 | |
| 3474 | /* Routine task_assign */ |
| 3475 | mig_internal novalue _Xtask_assign |
| 3476 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3477 | { |
| 3478 | |
| 3479 | #ifdef __MigPackStructs |
| 3480 | #pragma pack(4) |
| 3481 | #endif |
| 3482 | typedef struct { |
| 3483 | mach_msg_header_t Head; |
| 3484 | /* start of the kernel processed data */ |
| 3485 | mach_msg_body_t msgh_body; |
| 3486 | mach_msg_port_descriptor_t new_set; |
| 3487 | /* end of the kernel processed data */ |
| 3488 | NDR_record_t NDR; |
| 3489 | boolean_t assign_threads; |
| 3490 | mach_msg_trailer_t trailer; |
| 3491 | } Request __attribute__((unused)); |
| 3492 | #ifdef __MigPackStructs |
| 3493 | #pragma pack() |
| 3494 | #endif |
| 3495 | typedef __Request__task_assign_t __Request; |
| 3496 | typedef __Reply__task_assign_t Reply __attribute__((unused)); |
| 3497 | |
| 3498 | /* |
| 3499 | * typedef struct { |
| 3500 | * mach_msg_header_t Head; |
| 3501 | * NDR_record_t NDR; |
| 3502 | * kern_return_t RetCode; |
| 3503 | * } mig_reply_error_t; |
| 3504 | */ |
| 3505 | |
| 3506 | Request *In0P = (Request *) InHeadP; |
| 3507 | Reply *OutP = (Reply *) OutHeadP; |
| 3508 | #ifdef __MIG_check__Request__task_assign_t__defined |
| 3509 | kern_return_t check_result; |
| 3510 | #endif /* __MIG_check__Request__task_assign_t__defined */ |
| 3511 | |
| 3512 | #if __MigKernelSpecificCode |
| 3513 | #else |
| 3514 | #endif /* __MigKernelSpecificCode */ |
| 3515 | task_t task; |
| 3516 | processor_set_t new_set; |
| 3517 | |
| 3518 | __DeclareRcvRpc(3429, "task_assign" ) |
| 3519 | __BeforeRcvRpc(3429, "task_assign" ) |
| 3520 | |
| 3521 | #if defined(__MIG_check__Request__task_assign_t__defined) |
| 3522 | check_result = __MIG_check__Request__task_assign_t((__Request *)In0P); |
| 3523 | if (check_result != MACH_MSG_SUCCESS) |
| 3524 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 3525 | #endif /* defined(__MIG_check__Request__task_assign_t__defined) */ |
| 3526 | |
| 3527 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 3528 | |
| 3529 | new_set = convert_port_to_pset(In0P->new_set.name); |
| 3530 | |
| 3531 | OutP->RetCode = task_assign(task, new_set, In0P->assign_threads); |
| 3532 | pset_deallocate(new_set); |
| 3533 | task_deallocate(task); |
| 3534 | #if __MigKernelSpecificCode |
| 3535 | if (OutP->RetCode != KERN_SUCCESS) { |
| 3536 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 3537 | } |
| 3538 | |
| 3539 | if (IP_VALID((ipc_port_t)In0P->new_set.name)) |
| 3540 | ipc_port_release_send((ipc_port_t)In0P->new_set.name); |
| 3541 | #endif /* __MigKernelSpecificCode */ |
| 3542 | |
| 3543 | OutP->NDR = NDR_record; |
| 3544 | |
| 3545 | |
| 3546 | __AfterRcvRpc(3429, "task_assign" ) |
| 3547 | } |
| 3548 | |
| 3549 | #if ( __MigTypeCheck ) |
| 3550 | #if __MIG_check__Request__task_subsystem__ |
| 3551 | #if !defined(__MIG_check__Request__task_assign_default_t__defined) |
| 3552 | #define __MIG_check__Request__task_assign_default_t__defined |
| 3553 | |
| 3554 | mig_internal kern_return_t __MIG_check__Request__task_assign_default_t(__attribute__((__unused__)) __Request__task_assign_default_t *In0P) |
| 3555 | { |
| 3556 | |
| 3557 | typedef __Request__task_assign_default_t __Request; |
| 3558 | #if __MigTypeCheck |
| 3559 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 3560 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 3561 | return MIG_BAD_ARGUMENTS; |
| 3562 | #endif /* __MigTypeCheck */ |
| 3563 | |
| 3564 | return MACH_MSG_SUCCESS; |
| 3565 | } |
| 3566 | #endif /* !defined(__MIG_check__Request__task_assign_default_t__defined) */ |
| 3567 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 3568 | #endif /* ( __MigTypeCheck ) */ |
| 3569 | |
| 3570 | |
| 3571 | /* Routine task_assign_default */ |
| 3572 | mig_internal novalue _Xtask_assign_default |
| 3573 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3574 | { |
| 3575 | |
| 3576 | #ifdef __MigPackStructs |
| 3577 | #pragma pack(4) |
| 3578 | #endif |
| 3579 | typedef struct { |
| 3580 | mach_msg_header_t Head; |
| 3581 | NDR_record_t NDR; |
| 3582 | boolean_t assign_threads; |
| 3583 | mach_msg_trailer_t trailer; |
| 3584 | } Request __attribute__((unused)); |
| 3585 | #ifdef __MigPackStructs |
| 3586 | #pragma pack() |
| 3587 | #endif |
| 3588 | typedef __Request__task_assign_default_t __Request; |
| 3589 | typedef __Reply__task_assign_default_t Reply __attribute__((unused)); |
| 3590 | |
| 3591 | /* |
| 3592 | * typedef struct { |
| 3593 | * mach_msg_header_t Head; |
| 3594 | * NDR_record_t NDR; |
| 3595 | * kern_return_t RetCode; |
| 3596 | * } mig_reply_error_t; |
| 3597 | */ |
| 3598 | |
| 3599 | Request *In0P = (Request *) InHeadP; |
| 3600 | Reply *OutP = (Reply *) OutHeadP; |
| 3601 | #ifdef __MIG_check__Request__task_assign_default_t__defined |
| 3602 | kern_return_t check_result; |
| 3603 | #endif /* __MIG_check__Request__task_assign_default_t__defined */ |
| 3604 | |
| 3605 | #if __MigKernelSpecificCode |
| 3606 | #else |
| 3607 | #endif /* __MigKernelSpecificCode */ |
| 3608 | task_t task; |
| 3609 | |
| 3610 | __DeclareRcvRpc(3430, "task_assign_default" ) |
| 3611 | __BeforeRcvRpc(3430, "task_assign_default" ) |
| 3612 | |
| 3613 | #if defined(__MIG_check__Request__task_assign_default_t__defined) |
| 3614 | check_result = __MIG_check__Request__task_assign_default_t((__Request *)In0P); |
| 3615 | if (check_result != MACH_MSG_SUCCESS) |
| 3616 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 3617 | #endif /* defined(__MIG_check__Request__task_assign_default_t__defined) */ |
| 3618 | |
| 3619 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 3620 | |
| 3621 | OutP->RetCode = task_assign_default(task, In0P->assign_threads); |
| 3622 | task_deallocate(task); |
| 3623 | #if __MigKernelSpecificCode |
| 3624 | #endif /* __MigKernelSpecificCode */ |
| 3625 | |
| 3626 | OutP->NDR = NDR_record; |
| 3627 | |
| 3628 | |
| 3629 | __AfterRcvRpc(3430, "task_assign_default" ) |
| 3630 | } |
| 3631 | |
| 3632 | #if ( __MigTypeCheck ) |
| 3633 | #if __MIG_check__Request__task_subsystem__ |
| 3634 | #if !defined(__MIG_check__Request__task_get_assignment_t__defined) |
| 3635 | #define __MIG_check__Request__task_get_assignment_t__defined |
| 3636 | |
| 3637 | mig_internal kern_return_t __MIG_check__Request__task_get_assignment_t(__attribute__((__unused__)) __Request__task_get_assignment_t *In0P) |
| 3638 | { |
| 3639 | |
| 3640 | typedef __Request__task_get_assignment_t __Request; |
| 3641 | #if __MigTypeCheck |
| 3642 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 3643 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 3644 | return MIG_BAD_ARGUMENTS; |
| 3645 | #endif /* __MigTypeCheck */ |
| 3646 | |
| 3647 | return MACH_MSG_SUCCESS; |
| 3648 | } |
| 3649 | #endif /* !defined(__MIG_check__Request__task_get_assignment_t__defined) */ |
| 3650 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 3651 | #endif /* ( __MigTypeCheck ) */ |
| 3652 | |
| 3653 | |
| 3654 | /* Routine task_get_assignment */ |
| 3655 | mig_internal novalue _Xtask_get_assignment |
| 3656 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3657 | { |
| 3658 | |
| 3659 | #ifdef __MigPackStructs |
| 3660 | #pragma pack(4) |
| 3661 | #endif |
| 3662 | typedef struct { |
| 3663 | mach_msg_header_t Head; |
| 3664 | mach_msg_trailer_t trailer; |
| 3665 | } Request __attribute__((unused)); |
| 3666 | #ifdef __MigPackStructs |
| 3667 | #pragma pack() |
| 3668 | #endif |
| 3669 | typedef __Request__task_get_assignment_t __Request; |
| 3670 | typedef __Reply__task_get_assignment_t Reply __attribute__((unused)); |
| 3671 | |
| 3672 | /* |
| 3673 | * typedef struct { |
| 3674 | * mach_msg_header_t Head; |
| 3675 | * NDR_record_t NDR; |
| 3676 | * kern_return_t RetCode; |
| 3677 | * } mig_reply_error_t; |
| 3678 | */ |
| 3679 | |
| 3680 | Request *In0P = (Request *) InHeadP; |
| 3681 | Reply *OutP = (Reply *) OutHeadP; |
| 3682 | #ifdef __MIG_check__Request__task_get_assignment_t__defined |
| 3683 | kern_return_t check_result; |
| 3684 | #endif /* __MIG_check__Request__task_get_assignment_t__defined */ |
| 3685 | |
| 3686 | #if __MigKernelSpecificCode |
| 3687 | #if UseStaticTemplates |
| 3688 | const static mach_msg_port_descriptor_t assigned_setTemplate = { |
| 3689 | /* name = */ MACH_PORT_NULL, |
| 3690 | /* pad1 = */ 0, |
| 3691 | /* pad2 = */ 0, |
| 3692 | /* disp = */ 17, |
| 3693 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 3694 | }; |
| 3695 | #endif /* UseStaticTemplates */ |
| 3696 | |
| 3697 | #else |
| 3698 | #if UseStaticTemplates |
| 3699 | const static mach_msg_port_descriptor_t assigned_setTemplate = { |
| 3700 | /* name = */ MACH_PORT_NULL, |
| 3701 | /* pad1 = */ 0, |
| 3702 | /* pad2 = */ 0, |
| 3703 | /* disp = */ 19, |
| 3704 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 3705 | }; |
| 3706 | #endif /* UseStaticTemplates */ |
| 3707 | |
| 3708 | #endif /* __MigKernelSpecificCode */ |
| 3709 | kern_return_t RetCode; |
| 3710 | task_t task; |
| 3711 | processor_set_name_t assigned_set; |
| 3712 | |
| 3713 | __DeclareRcvRpc(3431, "task_get_assignment" ) |
| 3714 | __BeforeRcvRpc(3431, "task_get_assignment" ) |
| 3715 | |
| 3716 | #if defined(__MIG_check__Request__task_get_assignment_t__defined) |
| 3717 | check_result = __MIG_check__Request__task_get_assignment_t((__Request *)In0P); |
| 3718 | if (check_result != MACH_MSG_SUCCESS) |
| 3719 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 3720 | #endif /* defined(__MIG_check__Request__task_get_assignment_t__defined) */ |
| 3721 | |
| 3722 | #if UseStaticTemplates |
| 3723 | OutP->assigned_set = assigned_setTemplate; |
| 3724 | #else /* UseStaticTemplates */ |
| 3725 | #if __MigKernelSpecificCode |
| 3726 | OutP->assigned_set.disposition = 17; |
| 3727 | #else |
| 3728 | OutP->assigned_set.disposition = 19; |
| 3729 | #endif /* __MigKernelSpecificCode */ |
| 3730 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 3731 | OutP->assigned_set.pad1 = 0; |
| 3732 | #endif |
| 3733 | OutP->assigned_set.pad2 = 0; |
| 3734 | OutP->assigned_set.type = MACH_MSG_PORT_DESCRIPTOR; |
| 3735 | #if defined(KERNEL) |
| 3736 | OutP->assigned_set.pad_end = 0; |
| 3737 | #endif |
| 3738 | #endif /* UseStaticTemplates */ |
| 3739 | |
| 3740 | |
| 3741 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 3742 | |
| 3743 | RetCode = task_get_assignment(task, &assigned_set); |
| 3744 | task_deallocate(task); |
| 3745 | if (RetCode != KERN_SUCCESS) { |
| 3746 | MIG_RETURN_ERROR(OutP, RetCode); |
| 3747 | } |
| 3748 | #if __MigKernelSpecificCode |
| 3749 | #endif /* __MigKernelSpecificCode */ |
| 3750 | OutP->assigned_set.name = (mach_port_t)convert_pset_name_to_port(assigned_set); |
| 3751 | |
| 3752 | |
| 3753 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 3754 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 3755 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 3756 | __AfterRcvRpc(3431, "task_get_assignment" ) |
| 3757 | } |
| 3758 | |
| 3759 | #if ( __MigTypeCheck ) |
| 3760 | #if __MIG_check__Request__task_subsystem__ |
| 3761 | #if !defined(__MIG_check__Request__task_set_policy_t__defined) |
| 3762 | #define __MIG_check__Request__task_set_policy_t__defined |
| 3763 | |
| 3764 | mig_internal kern_return_t __MIG_check__Request__task_set_policy_t(__attribute__((__unused__)) __Request__task_set_policy_t *In0P, __attribute__((__unused__)) __Request__task_set_policy_t **In1PP, __attribute__((__unused__)) __Request__task_set_policy_t **In2PP) |
| 3765 | { |
| 3766 | |
| 3767 | typedef __Request__task_set_policy_t __Request; |
| 3768 | __Request *In1P; |
| 3769 | __Request *In2P; |
| 3770 | #if __MigTypeCheck |
| 3771 | unsigned int msgh_size; |
| 3772 | #endif /* __MigTypeCheck */ |
| 3773 | unsigned int msgh_size_delta; |
| 3774 | |
| 3775 | #if __MigTypeCheck |
| 3776 | msgh_size = In0P->Head.msgh_size; |
| 3777 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 3778 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 3779 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 24)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 3780 | return MIG_BAD_ARGUMENTS; |
| 3781 | #endif /* __MigTypeCheck */ |
| 3782 | |
| 3783 | #if __MigTypeCheck |
| 3784 | if (In0P->pset.type != MACH_MSG_PORT_DESCRIPTOR || |
| 3785 | In0P->pset.disposition != 17) |
| 3786 | return MIG_TYPE_ERROR; |
| 3787 | #endif /* __MigTypeCheck */ |
| 3788 | |
| 3789 | #if defined(__NDR_convert__int_rep__Request__task_set_policy_t__baseCnt__defined) |
| 3790 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 3791 | __NDR_convert__int_rep__Request__task_set_policy_t__baseCnt(&In0P->baseCnt, In0P->NDR.int_rep); |
| 3792 | #endif /* __NDR_convert__int_rep__Request__task_set_policy_t__baseCnt__defined */ |
| 3793 | msgh_size_delta = (4 * In0P->baseCnt); |
| 3794 | #if __MigTypeCheck |
| 3795 | if ( In0P->baseCnt > 5 ) |
| 3796 | return MIG_BAD_ARGUMENTS; |
| 3797 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 24)) / 4 < In0P->baseCnt) || |
| 3798 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 24) + (4 * In0P->baseCnt))) |
| 3799 | return MIG_BAD_ARGUMENTS; |
| 3800 | msgh_size -= msgh_size_delta; |
| 3801 | #endif /* __MigTypeCheck */ |
| 3802 | |
| 3803 | *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 20); |
| 3804 | |
| 3805 | #if defined(__NDR_convert__int_rep__Request__task_set_policy_t__limitCnt__defined) |
| 3806 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 3807 | __NDR_convert__int_rep__Request__task_set_policy_t__limitCnt(&In1P->limitCnt, In1P->NDR.int_rep); |
| 3808 | #endif /* __NDR_convert__int_rep__Request__task_set_policy_t__limitCnt__defined */ |
| 3809 | msgh_size_delta = (4 * In1P->limitCnt); |
| 3810 | #if __MigTypeCheck |
| 3811 | if ( In1P->limitCnt > 1 ) |
| 3812 | return MIG_BAD_ARGUMENTS; |
| 3813 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 24)) / 4 < In1P->limitCnt) || |
| 3814 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 24) + (4 * In1P->limitCnt))) |
| 3815 | return MIG_BAD_ARGUMENTS; |
| 3816 | #endif /* __MigTypeCheck */ |
| 3817 | |
| 3818 | *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 4); |
| 3819 | |
| 3820 | return MACH_MSG_SUCCESS; |
| 3821 | } |
| 3822 | #endif /* !defined(__MIG_check__Request__task_set_policy_t__defined) */ |
| 3823 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 3824 | #endif /* ( __MigTypeCheck ) */ |
| 3825 | |
| 3826 | |
| 3827 | /* Routine task_set_policy */ |
| 3828 | mig_internal novalue _Xtask_set_policy |
| 3829 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3830 | { |
| 3831 | |
| 3832 | #ifdef __MigPackStructs |
| 3833 | #pragma pack(4) |
| 3834 | #endif |
| 3835 | typedef struct { |
| 3836 | mach_msg_header_t Head; |
| 3837 | /* start of the kernel processed data */ |
| 3838 | mach_msg_body_t msgh_body; |
| 3839 | mach_msg_port_descriptor_t pset; |
| 3840 | /* end of the kernel processed data */ |
| 3841 | NDR_record_t NDR; |
| 3842 | policy_t policy; |
| 3843 | mach_msg_type_number_t baseCnt; |
| 3844 | integer_t base[5]; |
| 3845 | mach_msg_type_number_t limitCnt; |
| 3846 | integer_t limit[1]; |
| 3847 | boolean_t change; |
| 3848 | mach_msg_trailer_t trailer; |
| 3849 | } Request __attribute__((unused)); |
| 3850 | #ifdef __MigPackStructs |
| 3851 | #pragma pack() |
| 3852 | #endif |
| 3853 | typedef __Request__task_set_policy_t __Request; |
| 3854 | typedef __Reply__task_set_policy_t Reply __attribute__((unused)); |
| 3855 | |
| 3856 | /* |
| 3857 | * typedef struct { |
| 3858 | * mach_msg_header_t Head; |
| 3859 | * NDR_record_t NDR; |
| 3860 | * kern_return_t RetCode; |
| 3861 | * } mig_reply_error_t; |
| 3862 | */ |
| 3863 | |
| 3864 | Request *In0P = (Request *) InHeadP; |
| 3865 | Request *In1P; |
| 3866 | Request *In2P; |
| 3867 | Reply *OutP = (Reply *) OutHeadP; |
| 3868 | #ifdef __MIG_check__Request__task_set_policy_t__defined |
| 3869 | kern_return_t check_result; |
| 3870 | #endif /* __MIG_check__Request__task_set_policy_t__defined */ |
| 3871 | |
| 3872 | #if __MigKernelSpecificCode |
| 3873 | #else |
| 3874 | #endif /* __MigKernelSpecificCode */ |
| 3875 | task_t task; |
| 3876 | processor_set_t pset; |
| 3877 | |
| 3878 | __DeclareRcvRpc(3432, "task_set_policy" ) |
| 3879 | __BeforeRcvRpc(3432, "task_set_policy" ) |
| 3880 | |
| 3881 | #if defined(__MIG_check__Request__task_set_policy_t__defined) |
| 3882 | check_result = __MIG_check__Request__task_set_policy_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P); |
| 3883 | if (check_result != MACH_MSG_SUCCESS) |
| 3884 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 3885 | #endif /* defined(__MIG_check__Request__task_set_policy_t__defined) */ |
| 3886 | |
| 3887 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 3888 | |
| 3889 | pset = convert_port_to_pset(In0P->pset.name); |
| 3890 | |
| 3891 | OutP->RetCode = task_set_policy(task, pset, In0P->policy, In0P->base, In0P->baseCnt, In1P->limit, In1P->limitCnt, In2P->change); |
| 3892 | pset_deallocate(pset); |
| 3893 | task_deallocate(task); |
| 3894 | #if __MigKernelSpecificCode |
| 3895 | if (OutP->RetCode != KERN_SUCCESS) { |
| 3896 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 3897 | } |
| 3898 | |
| 3899 | if (IP_VALID((ipc_port_t)In0P->pset.name)) |
| 3900 | ipc_port_release_send((ipc_port_t)In0P->pset.name); |
| 3901 | #endif /* __MigKernelSpecificCode */ |
| 3902 | |
| 3903 | OutP->NDR = NDR_record; |
| 3904 | |
| 3905 | |
| 3906 | __AfterRcvRpc(3432, "task_set_policy" ) |
| 3907 | } |
| 3908 | |
| 3909 | #if ( __MigTypeCheck ) |
| 3910 | #if __MIG_check__Request__task_subsystem__ |
| 3911 | #if !defined(__MIG_check__Request__task_get_state_t__defined) |
| 3912 | #define __MIG_check__Request__task_get_state_t__defined |
| 3913 | |
| 3914 | mig_internal kern_return_t __MIG_check__Request__task_get_state_t(__attribute__((__unused__)) __Request__task_get_state_t *In0P) |
| 3915 | { |
| 3916 | |
| 3917 | typedef __Request__task_get_state_t __Request; |
| 3918 | #if __MigTypeCheck |
| 3919 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 3920 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 3921 | return MIG_BAD_ARGUMENTS; |
| 3922 | #endif /* __MigTypeCheck */ |
| 3923 | |
| 3924 | return MACH_MSG_SUCCESS; |
| 3925 | } |
| 3926 | #endif /* !defined(__MIG_check__Request__task_get_state_t__defined) */ |
| 3927 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 3928 | #endif /* ( __MigTypeCheck ) */ |
| 3929 | |
| 3930 | |
| 3931 | /* Routine task_get_state */ |
| 3932 | mig_internal novalue _Xtask_get_state |
| 3933 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3934 | { |
| 3935 | |
| 3936 | #ifdef __MigPackStructs |
| 3937 | #pragma pack(4) |
| 3938 | #endif |
| 3939 | typedef struct { |
| 3940 | mach_msg_header_t Head; |
| 3941 | NDR_record_t NDR; |
| 3942 | thread_state_flavor_t flavor; |
| 3943 | mach_msg_type_number_t old_stateCnt; |
| 3944 | mach_msg_trailer_t trailer; |
| 3945 | } Request __attribute__((unused)); |
| 3946 | #ifdef __MigPackStructs |
| 3947 | #pragma pack() |
| 3948 | #endif |
| 3949 | typedef __Request__task_get_state_t __Request; |
| 3950 | typedef __Reply__task_get_state_t Reply __attribute__((unused)); |
| 3951 | |
| 3952 | /* |
| 3953 | * typedef struct { |
| 3954 | * mach_msg_header_t Head; |
| 3955 | * NDR_record_t NDR; |
| 3956 | * kern_return_t RetCode; |
| 3957 | * } mig_reply_error_t; |
| 3958 | */ |
| 3959 | |
| 3960 | Request *In0P = (Request *) InHeadP; |
| 3961 | Reply *OutP = (Reply *) OutHeadP; |
| 3962 | #ifdef __MIG_check__Request__task_get_state_t__defined |
| 3963 | kern_return_t check_result; |
| 3964 | #endif /* __MIG_check__Request__task_get_state_t__defined */ |
| 3965 | |
| 3966 | #if __MigKernelSpecificCode |
| 3967 | #else |
| 3968 | #endif /* __MigKernelSpecificCode */ |
| 3969 | task_t task; |
| 3970 | |
| 3971 | __DeclareRcvRpc(3433, "task_get_state" ) |
| 3972 | __BeforeRcvRpc(3433, "task_get_state" ) |
| 3973 | |
| 3974 | #if defined(__MIG_check__Request__task_get_state_t__defined) |
| 3975 | check_result = __MIG_check__Request__task_get_state_t((__Request *)In0P); |
| 3976 | if (check_result != MACH_MSG_SUCCESS) |
| 3977 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 3978 | #endif /* defined(__MIG_check__Request__task_get_state_t__defined) */ |
| 3979 | |
| 3980 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 3981 | |
| 3982 | OutP->old_stateCnt = 614; |
| 3983 | if (In0P->old_stateCnt < OutP->old_stateCnt) |
| 3984 | OutP->old_stateCnt = In0P->old_stateCnt; |
| 3985 | |
| 3986 | OutP->RetCode = task_get_state(task, In0P->flavor, OutP->old_state, &OutP->old_stateCnt); |
| 3987 | task_deallocate(task); |
| 3988 | if (OutP->RetCode != KERN_SUCCESS) { |
| 3989 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 3990 | } |
| 3991 | #if __MigKernelSpecificCode |
| 3992 | #endif /* __MigKernelSpecificCode */ |
| 3993 | |
| 3994 | OutP->NDR = NDR_record; |
| 3995 | |
| 3996 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 2456) + (((4 * OutP->old_stateCnt))); |
| 3997 | |
| 3998 | __AfterRcvRpc(3433, "task_get_state" ) |
| 3999 | } |
| 4000 | |
| 4001 | #if ( __MigTypeCheck ) |
| 4002 | #if __MIG_check__Request__task_subsystem__ |
| 4003 | #if !defined(__MIG_check__Request__task_set_state_t__defined) |
| 4004 | #define __MIG_check__Request__task_set_state_t__defined |
| 4005 | |
| 4006 | mig_internal kern_return_t __MIG_check__Request__task_set_state_t(__attribute__((__unused__)) __Request__task_set_state_t *In0P) |
| 4007 | { |
| 4008 | |
| 4009 | typedef __Request__task_set_state_t __Request; |
| 4010 | #if __MigTypeCheck |
| 4011 | unsigned int msgh_size; |
| 4012 | #endif /* __MigTypeCheck */ |
| 4013 | |
| 4014 | #if __MigTypeCheck |
| 4015 | msgh_size = In0P->Head.msgh_size; |
| 4016 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 4017 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 2456)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 4018 | return MIG_BAD_ARGUMENTS; |
| 4019 | #endif /* __MigTypeCheck */ |
| 4020 | |
| 4021 | #if defined(__NDR_convert__int_rep__Request__task_set_state_t__new_stateCnt__defined) |
| 4022 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 4023 | __NDR_convert__int_rep__Request__task_set_state_t__new_stateCnt(&In0P->new_stateCnt, In0P->NDR.int_rep); |
| 4024 | #endif /* __NDR_convert__int_rep__Request__task_set_state_t__new_stateCnt__defined */ |
| 4025 | #if __MigTypeCheck |
| 4026 | if ( In0P->new_stateCnt > 614 ) |
| 4027 | return MIG_BAD_ARGUMENTS; |
| 4028 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 2456)) / 4 < In0P->new_stateCnt) || |
| 4029 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 2456) + (4 * In0P->new_stateCnt))) |
| 4030 | return MIG_BAD_ARGUMENTS; |
| 4031 | #endif /* __MigTypeCheck */ |
| 4032 | |
| 4033 | return MACH_MSG_SUCCESS; |
| 4034 | } |
| 4035 | #endif /* !defined(__MIG_check__Request__task_set_state_t__defined) */ |
| 4036 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 4037 | #endif /* ( __MigTypeCheck ) */ |
| 4038 | |
| 4039 | |
| 4040 | /* Routine task_set_state */ |
| 4041 | mig_internal novalue _Xtask_set_state |
| 4042 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 4043 | { |
| 4044 | |
| 4045 | #ifdef __MigPackStructs |
| 4046 | #pragma pack(4) |
| 4047 | #endif |
| 4048 | typedef struct { |
| 4049 | mach_msg_header_t Head; |
| 4050 | NDR_record_t NDR; |
| 4051 | thread_state_flavor_t flavor; |
| 4052 | mach_msg_type_number_t new_stateCnt; |
| 4053 | natural_t new_state[614]; |
| 4054 | mach_msg_trailer_t trailer; |
| 4055 | } Request __attribute__((unused)); |
| 4056 | #ifdef __MigPackStructs |
| 4057 | #pragma pack() |
| 4058 | #endif |
| 4059 | typedef __Request__task_set_state_t __Request; |
| 4060 | typedef __Reply__task_set_state_t Reply __attribute__((unused)); |
| 4061 | |
| 4062 | /* |
| 4063 | * typedef struct { |
| 4064 | * mach_msg_header_t Head; |
| 4065 | * NDR_record_t NDR; |
| 4066 | * kern_return_t RetCode; |
| 4067 | * } mig_reply_error_t; |
| 4068 | */ |
| 4069 | |
| 4070 | Request *In0P = (Request *) InHeadP; |
| 4071 | Reply *OutP = (Reply *) OutHeadP; |
| 4072 | #ifdef __MIG_check__Request__task_set_state_t__defined |
| 4073 | kern_return_t check_result; |
| 4074 | #endif /* __MIG_check__Request__task_set_state_t__defined */ |
| 4075 | |
| 4076 | #if __MigKernelSpecificCode |
| 4077 | #else |
| 4078 | #endif /* __MigKernelSpecificCode */ |
| 4079 | task_t task; |
| 4080 | |
| 4081 | __DeclareRcvRpc(3434, "task_set_state" ) |
| 4082 | __BeforeRcvRpc(3434, "task_set_state" ) |
| 4083 | |
| 4084 | #if defined(__MIG_check__Request__task_set_state_t__defined) |
| 4085 | check_result = __MIG_check__Request__task_set_state_t((__Request *)In0P); |
| 4086 | if (check_result != MACH_MSG_SUCCESS) |
| 4087 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 4088 | #endif /* defined(__MIG_check__Request__task_set_state_t__defined) */ |
| 4089 | |
| 4090 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 4091 | |
| 4092 | OutP->RetCode = task_set_state(task, In0P->flavor, In0P->new_state, In0P->new_stateCnt); |
| 4093 | task_deallocate(task); |
| 4094 | #if __MigKernelSpecificCode |
| 4095 | #endif /* __MigKernelSpecificCode */ |
| 4096 | |
| 4097 | OutP->NDR = NDR_record; |
| 4098 | |
| 4099 | |
| 4100 | __AfterRcvRpc(3434, "task_set_state" ) |
| 4101 | } |
| 4102 | |
| 4103 | #if ( __MigTypeCheck ) |
| 4104 | #if __MIG_check__Request__task_subsystem__ |
| 4105 | #if !defined(__MIG_check__Request__task_set_phys_footprint_limit_t__defined) |
| 4106 | #define |
| 4107 | |
| 4108 | mig_internal kern_return_t (__attribute__((__unused__)) __Request__task_set_phys_footprint_limit_t *In0P) |
| 4109 | { |
| 4110 | |
| 4111 | typedef __Request__task_set_phys_footprint_limit_t __Request; |
| 4112 | #if __MigTypeCheck |
| 4113 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 4114 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 4115 | return MIG_BAD_ARGUMENTS; |
| 4116 | #endif /* __MigTypeCheck */ |
| 4117 | |
| 4118 | return MACH_MSG_SUCCESS; |
| 4119 | } |
| 4120 | #endif /* !defined(__MIG_check__Request__task_set_phys_footprint_limit_t__defined) */ |
| 4121 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 4122 | #endif /* ( __MigTypeCheck ) */ |
| 4123 | |
| 4124 | |
| 4125 | /* Routine task_set_phys_footprint_limit */ |
| 4126 | mig_internal novalue |
| 4127 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 4128 | { |
| 4129 | |
| 4130 | #ifdef __MigPackStructs |
| 4131 | #pragma pack(4) |
| 4132 | #endif |
| 4133 | typedef struct { |
| 4134 | mach_msg_header_t Head; |
| 4135 | NDR_record_t NDR; |
| 4136 | int new_limit; |
| 4137 | mach_msg_trailer_t trailer; |
| 4138 | } Request __attribute__((unused)); |
| 4139 | #ifdef __MigPackStructs |
| 4140 | #pragma pack() |
| 4141 | #endif |
| 4142 | typedef __Request__task_set_phys_footprint_limit_t __Request; |
| 4143 | typedef __Reply__task_set_phys_footprint_limit_t Reply __attribute__((unused)); |
| 4144 | |
| 4145 | /* |
| 4146 | * typedef struct { |
| 4147 | * mach_msg_header_t Head; |
| 4148 | * NDR_record_t NDR; |
| 4149 | * kern_return_t RetCode; |
| 4150 | * } mig_reply_error_t; |
| 4151 | */ |
| 4152 | |
| 4153 | Request *In0P = (Request *) InHeadP; |
| 4154 | Reply *OutP = (Reply *) OutHeadP; |
| 4155 | #ifdef __MIG_check__Request__task_set_phys_footprint_limit_t__defined |
| 4156 | kern_return_t check_result; |
| 4157 | #endif /* __MIG_check__Request__task_set_phys_footprint_limit_t__defined */ |
| 4158 | |
| 4159 | #if __MigKernelSpecificCode |
| 4160 | #else |
| 4161 | #endif /* __MigKernelSpecificCode */ |
| 4162 | task_t task; |
| 4163 | |
| 4164 | __DeclareRcvRpc(3435, "task_set_phys_footprint_limit" ) |
| 4165 | __BeforeRcvRpc(3435, "task_set_phys_footprint_limit" ) |
| 4166 | |
| 4167 | #if defined(__MIG_check__Request__task_set_phys_footprint_limit_t__defined) |
| 4168 | check_result = __MIG_check__Request__task_set_phys_footprint_limit_t((__Request *)In0P); |
| 4169 | if (check_result != MACH_MSG_SUCCESS) |
| 4170 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 4171 | #endif /* defined(__MIG_check__Request__task_set_phys_footprint_limit_t__defined) */ |
| 4172 | |
| 4173 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 4174 | |
| 4175 | OutP->RetCode = task_set_phys_footprint_limit(task, In0P->new_limit, &OutP->old_limit); |
| 4176 | task_deallocate(task); |
| 4177 | if (OutP->RetCode != KERN_SUCCESS) { |
| 4178 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 4179 | } |
| 4180 | #if __MigKernelSpecificCode |
| 4181 | #endif /* __MigKernelSpecificCode */ |
| 4182 | |
| 4183 | OutP->NDR = NDR_record; |
| 4184 | |
| 4185 | |
| 4186 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 4187 | __AfterRcvRpc(3435, "task_set_phys_footprint_limit" ) |
| 4188 | } |
| 4189 | |
| 4190 | #if ( __MigTypeCheck ) |
| 4191 | #if __MIG_check__Request__task_subsystem__ |
| 4192 | #if !defined(__MIG_check__Request__task_suspend2_t__defined) |
| 4193 | #define __MIG_check__Request__task_suspend2_t__defined |
| 4194 | |
| 4195 | mig_internal kern_return_t __MIG_check__Request__task_suspend2_t(__attribute__((__unused__)) __Request__task_suspend2_t *In0P) |
| 4196 | { |
| 4197 | |
| 4198 | typedef __Request__task_suspend2_t __Request; |
| 4199 | #if __MigTypeCheck |
| 4200 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 4201 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 4202 | return MIG_BAD_ARGUMENTS; |
| 4203 | #endif /* __MigTypeCheck */ |
| 4204 | |
| 4205 | return MACH_MSG_SUCCESS; |
| 4206 | } |
| 4207 | #endif /* !defined(__MIG_check__Request__task_suspend2_t__defined) */ |
| 4208 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 4209 | #endif /* ( __MigTypeCheck ) */ |
| 4210 | |
| 4211 | |
| 4212 | /* Routine task_suspend2 */ |
| 4213 | mig_internal novalue _Xtask_suspend2 |
| 4214 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 4215 | { |
| 4216 | |
| 4217 | #ifdef __MigPackStructs |
| 4218 | #pragma pack(4) |
| 4219 | #endif |
| 4220 | typedef struct { |
| 4221 | mach_msg_header_t Head; |
| 4222 | mach_msg_trailer_t trailer; |
| 4223 | } Request __attribute__((unused)); |
| 4224 | #ifdef __MigPackStructs |
| 4225 | #pragma pack() |
| 4226 | #endif |
| 4227 | typedef __Request__task_suspend2_t __Request; |
| 4228 | typedef __Reply__task_suspend2_t Reply __attribute__((unused)); |
| 4229 | |
| 4230 | /* |
| 4231 | * typedef struct { |
| 4232 | * mach_msg_header_t Head; |
| 4233 | * NDR_record_t NDR; |
| 4234 | * kern_return_t RetCode; |
| 4235 | * } mig_reply_error_t; |
| 4236 | */ |
| 4237 | |
| 4238 | Request *In0P = (Request *) InHeadP; |
| 4239 | Reply *OutP = (Reply *) OutHeadP; |
| 4240 | #ifdef __MIG_check__Request__task_suspend2_t__defined |
| 4241 | kern_return_t check_result; |
| 4242 | #endif /* __MIG_check__Request__task_suspend2_t__defined */ |
| 4243 | |
| 4244 | #if __MigKernelSpecificCode |
| 4245 | #if UseStaticTemplates |
| 4246 | const static mach_msg_port_descriptor_t suspend_tokenTemplate = { |
| 4247 | /* name = */ MACH_PORT_NULL, |
| 4248 | /* pad1 = */ 0, |
| 4249 | /* pad2 = */ 0, |
| 4250 | /* disp = */ 18, |
| 4251 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 4252 | }; |
| 4253 | #endif /* UseStaticTemplates */ |
| 4254 | |
| 4255 | #else |
| 4256 | #if UseStaticTemplates |
| 4257 | const static mach_msg_port_descriptor_t suspend_tokenTemplate = { |
| 4258 | /* name = */ MACH_PORT_NULL, |
| 4259 | /* pad1 = */ 0, |
| 4260 | /* pad2 = */ 0, |
| 4261 | /* disp = */ 18, |
| 4262 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 4263 | }; |
| 4264 | #endif /* UseStaticTemplates */ |
| 4265 | |
| 4266 | #endif /* __MigKernelSpecificCode */ |
| 4267 | kern_return_t RetCode; |
| 4268 | task_t target_task; |
| 4269 | task_suspension_token_t suspend_token; |
| 4270 | |
| 4271 | __DeclareRcvRpc(3436, "task_suspend2" ) |
| 4272 | __BeforeRcvRpc(3436, "task_suspend2" ) |
| 4273 | |
| 4274 | #if defined(__MIG_check__Request__task_suspend2_t__defined) |
| 4275 | check_result = __MIG_check__Request__task_suspend2_t((__Request *)In0P); |
| 4276 | if (check_result != MACH_MSG_SUCCESS) |
| 4277 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 4278 | #endif /* defined(__MIG_check__Request__task_suspend2_t__defined) */ |
| 4279 | |
| 4280 | #if UseStaticTemplates |
| 4281 | OutP->suspend_token = suspend_tokenTemplate; |
| 4282 | #else /* UseStaticTemplates */ |
| 4283 | #if __MigKernelSpecificCode |
| 4284 | OutP->suspend_token.disposition = 18; |
| 4285 | #else |
| 4286 | OutP->suspend_token.disposition = 18; |
| 4287 | #endif /* __MigKernelSpecificCode */ |
| 4288 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 4289 | OutP->suspend_token.pad1 = 0; |
| 4290 | #endif |
| 4291 | OutP->suspend_token.pad2 = 0; |
| 4292 | OutP->suspend_token.type = MACH_MSG_PORT_DESCRIPTOR; |
| 4293 | #if defined(KERNEL) |
| 4294 | OutP->suspend_token.pad_end = 0; |
| 4295 | #endif |
| 4296 | #endif /* UseStaticTemplates */ |
| 4297 | |
| 4298 | |
| 4299 | target_task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 4300 | |
| 4301 | RetCode = task_suspend2(target_task, &suspend_token); |
| 4302 | task_deallocate(target_task); |
| 4303 | if (RetCode != KERN_SUCCESS) { |
| 4304 | MIG_RETURN_ERROR(OutP, RetCode); |
| 4305 | } |
| 4306 | #if __MigKernelSpecificCode |
| 4307 | #endif /* __MigKernelSpecificCode */ |
| 4308 | OutP->suspend_token.name = (mach_port_t)convert_task_suspension_token_to_port(suspend_token); |
| 4309 | |
| 4310 | |
| 4311 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 4312 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 4313 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 4314 | __AfterRcvRpc(3436, "task_suspend2" ) |
| 4315 | } |
| 4316 | |
| 4317 | #if ( __MigTypeCheck ) |
| 4318 | #if __MIG_check__Request__task_subsystem__ |
| 4319 | #if !defined(__MIG_check__Request__task_resume2_t__defined) |
| 4320 | #define __MIG_check__Request__task_resume2_t__defined |
| 4321 | |
| 4322 | mig_internal kern_return_t __MIG_check__Request__task_resume2_t(__attribute__((__unused__)) __Request__task_resume2_t *In0P) |
| 4323 | { |
| 4324 | |
| 4325 | typedef __Request__task_resume2_t __Request; |
| 4326 | #if __MigTypeCheck |
| 4327 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 4328 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 4329 | return MIG_BAD_ARGUMENTS; |
| 4330 | #endif /* __MigTypeCheck */ |
| 4331 | |
| 4332 | return MACH_MSG_SUCCESS; |
| 4333 | } |
| 4334 | #endif /* !defined(__MIG_check__Request__task_resume2_t__defined) */ |
| 4335 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 4336 | #endif /* ( __MigTypeCheck ) */ |
| 4337 | |
| 4338 | |
| 4339 | /* Routine task_resume2 */ |
| 4340 | mig_internal novalue _Xtask_resume2 |
| 4341 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 4342 | { |
| 4343 | |
| 4344 | #ifdef __MigPackStructs |
| 4345 | #pragma pack(4) |
| 4346 | #endif |
| 4347 | typedef struct { |
| 4348 | mach_msg_header_t Head; |
| 4349 | mach_msg_trailer_t trailer; |
| 4350 | } Request __attribute__((unused)); |
| 4351 | #ifdef __MigPackStructs |
| 4352 | #pragma pack() |
| 4353 | #endif |
| 4354 | typedef __Request__task_resume2_t __Request; |
| 4355 | typedef __Reply__task_resume2_t Reply __attribute__((unused)); |
| 4356 | |
| 4357 | /* |
| 4358 | * typedef struct { |
| 4359 | * mach_msg_header_t Head; |
| 4360 | * NDR_record_t NDR; |
| 4361 | * kern_return_t RetCode; |
| 4362 | * } mig_reply_error_t; |
| 4363 | */ |
| 4364 | |
| 4365 | Request *In0P = (Request *) InHeadP; |
| 4366 | Reply *OutP = (Reply *) OutHeadP; |
| 4367 | #ifdef __MIG_check__Request__task_resume2_t__defined |
| 4368 | kern_return_t check_result; |
| 4369 | #endif /* __MIG_check__Request__task_resume2_t__defined */ |
| 4370 | |
| 4371 | #if __MigKernelSpecificCode |
| 4372 | #else |
| 4373 | #endif /* __MigKernelSpecificCode */ |
| 4374 | __DeclareRcvRpc(3437, "task_resume2" ) |
| 4375 | __BeforeRcvRpc(3437, "task_resume2" ) |
| 4376 | |
| 4377 | #if defined(__MIG_check__Request__task_resume2_t__defined) |
| 4378 | check_result = __MIG_check__Request__task_resume2_t((__Request *)In0P); |
| 4379 | if (check_result != MACH_MSG_SUCCESS) |
| 4380 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 4381 | #endif /* defined(__MIG_check__Request__task_resume2_t__defined) */ |
| 4382 | |
| 4383 | OutP->RetCode = task_resume2(convert_port_to_task_suspension_token(In0P->Head.msgh_request_port)); |
| 4384 | #if __MigKernelSpecificCode |
| 4385 | #endif /* __MigKernelSpecificCode */ |
| 4386 | |
| 4387 | OutP->NDR = NDR_record; |
| 4388 | |
| 4389 | |
| 4390 | __AfterRcvRpc(3437, "task_resume2" ) |
| 4391 | } |
| 4392 | |
| 4393 | #if ( __MigTypeCheck ) |
| 4394 | #if __MIG_check__Request__task_subsystem__ |
| 4395 | #if !defined(__MIG_check__Request__task_purgable_info_t__defined) |
| 4396 | #define __MIG_check__Request__task_purgable_info_t__defined |
| 4397 | |
| 4398 | mig_internal kern_return_t __MIG_check__Request__task_purgable_info_t(__attribute__((__unused__)) __Request__task_purgable_info_t *In0P) |
| 4399 | { |
| 4400 | |
| 4401 | typedef __Request__task_purgable_info_t __Request; |
| 4402 | #if __MigTypeCheck |
| 4403 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 4404 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 4405 | return MIG_BAD_ARGUMENTS; |
| 4406 | #endif /* __MigTypeCheck */ |
| 4407 | |
| 4408 | return MACH_MSG_SUCCESS; |
| 4409 | } |
| 4410 | #endif /* !defined(__MIG_check__Request__task_purgable_info_t__defined) */ |
| 4411 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 4412 | #endif /* ( __MigTypeCheck ) */ |
| 4413 | |
| 4414 | |
| 4415 | /* Routine task_purgable_info */ |
| 4416 | mig_internal novalue _Xtask_purgable_info |
| 4417 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 4418 | { |
| 4419 | |
| 4420 | #ifdef __MigPackStructs |
| 4421 | #pragma pack(4) |
| 4422 | #endif |
| 4423 | typedef struct { |
| 4424 | mach_msg_header_t Head; |
| 4425 | mach_msg_trailer_t trailer; |
| 4426 | } Request __attribute__((unused)); |
| 4427 | #ifdef __MigPackStructs |
| 4428 | #pragma pack() |
| 4429 | #endif |
| 4430 | typedef __Request__task_purgable_info_t __Request; |
| 4431 | typedef __Reply__task_purgable_info_t Reply __attribute__((unused)); |
| 4432 | |
| 4433 | /* |
| 4434 | * typedef struct { |
| 4435 | * mach_msg_header_t Head; |
| 4436 | * NDR_record_t NDR; |
| 4437 | * kern_return_t RetCode; |
| 4438 | * } mig_reply_error_t; |
| 4439 | */ |
| 4440 | |
| 4441 | Request *In0P = (Request *) InHeadP; |
| 4442 | Reply *OutP = (Reply *) OutHeadP; |
| 4443 | #ifdef __MIG_check__Request__task_purgable_info_t__defined |
| 4444 | kern_return_t check_result; |
| 4445 | #endif /* __MIG_check__Request__task_purgable_info_t__defined */ |
| 4446 | |
| 4447 | #if __MigKernelSpecificCode |
| 4448 | #else |
| 4449 | #endif /* __MigKernelSpecificCode */ |
| 4450 | task_t task; |
| 4451 | |
| 4452 | __DeclareRcvRpc(3438, "task_purgable_info" ) |
| 4453 | __BeforeRcvRpc(3438, "task_purgable_info" ) |
| 4454 | |
| 4455 | #if defined(__MIG_check__Request__task_purgable_info_t__defined) |
| 4456 | check_result = __MIG_check__Request__task_purgable_info_t((__Request *)In0P); |
| 4457 | if (check_result != MACH_MSG_SUCCESS) |
| 4458 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 4459 | #endif /* defined(__MIG_check__Request__task_purgable_info_t__defined) */ |
| 4460 | |
| 4461 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 4462 | |
| 4463 | OutP->RetCode = task_purgable_info(task, &OutP->stats); |
| 4464 | task_deallocate(task); |
| 4465 | if (OutP->RetCode != KERN_SUCCESS) { |
| 4466 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 4467 | } |
| 4468 | #if __MigKernelSpecificCode |
| 4469 | #endif /* __MigKernelSpecificCode */ |
| 4470 | |
| 4471 | OutP->NDR = NDR_record; |
| 4472 | |
| 4473 | |
| 4474 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 4475 | __AfterRcvRpc(3438, "task_purgable_info" ) |
| 4476 | } |
| 4477 | |
| 4478 | #if ( __MigTypeCheck ) |
| 4479 | #if __MIG_check__Request__task_subsystem__ |
| 4480 | #if !defined(__MIG_check__Request__task_get_mach_voucher_t__defined) |
| 4481 | #define __MIG_check__Request__task_get_mach_voucher_t__defined |
| 4482 | |
| 4483 | mig_internal kern_return_t __MIG_check__Request__task_get_mach_voucher_t(__attribute__((__unused__)) __Request__task_get_mach_voucher_t *In0P) |
| 4484 | { |
| 4485 | |
| 4486 | typedef __Request__task_get_mach_voucher_t __Request; |
| 4487 | #if __MigTypeCheck |
| 4488 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 4489 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 4490 | return MIG_BAD_ARGUMENTS; |
| 4491 | #endif /* __MigTypeCheck */ |
| 4492 | |
| 4493 | return MACH_MSG_SUCCESS; |
| 4494 | } |
| 4495 | #endif /* !defined(__MIG_check__Request__task_get_mach_voucher_t__defined) */ |
| 4496 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 4497 | #endif /* ( __MigTypeCheck ) */ |
| 4498 | |
| 4499 | |
| 4500 | /* Routine task_get_mach_voucher */ |
| 4501 | mig_internal novalue _Xtask_get_mach_voucher |
| 4502 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 4503 | { |
| 4504 | |
| 4505 | #ifdef __MigPackStructs |
| 4506 | #pragma pack(4) |
| 4507 | #endif |
| 4508 | typedef struct { |
| 4509 | mach_msg_header_t Head; |
| 4510 | NDR_record_t NDR; |
| 4511 | mach_voucher_selector_t which; |
| 4512 | mach_msg_trailer_t trailer; |
| 4513 | } Request __attribute__((unused)); |
| 4514 | #ifdef __MigPackStructs |
| 4515 | #pragma pack() |
| 4516 | #endif |
| 4517 | typedef __Request__task_get_mach_voucher_t __Request; |
| 4518 | typedef __Reply__task_get_mach_voucher_t Reply __attribute__((unused)); |
| 4519 | |
| 4520 | /* |
| 4521 | * typedef struct { |
| 4522 | * mach_msg_header_t Head; |
| 4523 | * NDR_record_t NDR; |
| 4524 | * kern_return_t RetCode; |
| 4525 | * } mig_reply_error_t; |
| 4526 | */ |
| 4527 | |
| 4528 | Request *In0P = (Request *) InHeadP; |
| 4529 | Reply *OutP = (Reply *) OutHeadP; |
| 4530 | #ifdef __MIG_check__Request__task_get_mach_voucher_t__defined |
| 4531 | kern_return_t check_result; |
| 4532 | #endif /* __MIG_check__Request__task_get_mach_voucher_t__defined */ |
| 4533 | |
| 4534 | #if __MigKernelSpecificCode |
| 4535 | #if UseStaticTemplates |
| 4536 | const static mach_msg_port_descriptor_t voucherTemplate = { |
| 4537 | /* name = */ MACH_PORT_NULL, |
| 4538 | /* pad1 = */ 0, |
| 4539 | /* pad2 = */ 0, |
| 4540 | /* disp = */ 17, |
| 4541 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 4542 | }; |
| 4543 | #endif /* UseStaticTemplates */ |
| 4544 | |
| 4545 | #else |
| 4546 | #if UseStaticTemplates |
| 4547 | const static mach_msg_port_descriptor_t voucherTemplate = { |
| 4548 | /* name = */ MACH_PORT_NULL, |
| 4549 | /* pad1 = */ 0, |
| 4550 | /* pad2 = */ 0, |
| 4551 | /* disp = */ 19, |
| 4552 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 4553 | }; |
| 4554 | #endif /* UseStaticTemplates */ |
| 4555 | |
| 4556 | #endif /* __MigKernelSpecificCode */ |
| 4557 | kern_return_t RetCode; |
| 4558 | task_t task; |
| 4559 | ipc_voucher_t voucher; |
| 4560 | |
| 4561 | __DeclareRcvRpc(3439, "task_get_mach_voucher" ) |
| 4562 | __BeforeRcvRpc(3439, "task_get_mach_voucher" ) |
| 4563 | |
| 4564 | #if defined(__MIG_check__Request__task_get_mach_voucher_t__defined) |
| 4565 | check_result = __MIG_check__Request__task_get_mach_voucher_t((__Request *)In0P); |
| 4566 | if (check_result != MACH_MSG_SUCCESS) |
| 4567 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 4568 | #endif /* defined(__MIG_check__Request__task_get_mach_voucher_t__defined) */ |
| 4569 | |
| 4570 | #if UseStaticTemplates |
| 4571 | OutP->voucher = voucherTemplate; |
| 4572 | #else /* UseStaticTemplates */ |
| 4573 | #if __MigKernelSpecificCode |
| 4574 | OutP->voucher.disposition = 17; |
| 4575 | #else |
| 4576 | OutP->voucher.disposition = 19; |
| 4577 | #endif /* __MigKernelSpecificCode */ |
| 4578 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 4579 | OutP->voucher.pad1 = 0; |
| 4580 | #endif |
| 4581 | OutP->voucher.pad2 = 0; |
| 4582 | OutP->voucher.type = MACH_MSG_PORT_DESCRIPTOR; |
| 4583 | #if defined(KERNEL) |
| 4584 | OutP->voucher.pad_end = 0; |
| 4585 | #endif |
| 4586 | #endif /* UseStaticTemplates */ |
| 4587 | |
| 4588 | |
| 4589 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 4590 | |
| 4591 | RetCode = task_get_mach_voucher(task, In0P->which, &voucher); |
| 4592 | task_deallocate(task); |
| 4593 | if (RetCode != KERN_SUCCESS) { |
| 4594 | MIG_RETURN_ERROR(OutP, RetCode); |
| 4595 | } |
| 4596 | #if __MigKernelSpecificCode |
| 4597 | #endif /* __MigKernelSpecificCode */ |
| 4598 | OutP->voucher.name = (mach_port_t)convert_voucher_to_port(voucher); |
| 4599 | |
| 4600 | |
| 4601 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 4602 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 4603 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 4604 | __AfterRcvRpc(3439, "task_get_mach_voucher" ) |
| 4605 | } |
| 4606 | |
| 4607 | #if ( __MigTypeCheck ) |
| 4608 | #if __MIG_check__Request__task_subsystem__ |
| 4609 | #if !defined(__MIG_check__Request__task_set_mach_voucher_t__defined) |
| 4610 | #define __MIG_check__Request__task_set_mach_voucher_t__defined |
| 4611 | |
| 4612 | mig_internal kern_return_t __MIG_check__Request__task_set_mach_voucher_t(__attribute__((__unused__)) __Request__task_set_mach_voucher_t *In0P) |
| 4613 | { |
| 4614 | |
| 4615 | typedef __Request__task_set_mach_voucher_t __Request; |
| 4616 | #if __MigTypeCheck |
| 4617 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 4618 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 4619 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 4620 | return MIG_BAD_ARGUMENTS; |
| 4621 | #endif /* __MigTypeCheck */ |
| 4622 | |
| 4623 | #if __MigTypeCheck |
| 4624 | if (In0P->voucher.type != MACH_MSG_PORT_DESCRIPTOR || |
| 4625 | In0P->voucher.disposition != 17) |
| 4626 | return MIG_TYPE_ERROR; |
| 4627 | #endif /* __MigTypeCheck */ |
| 4628 | |
| 4629 | return MACH_MSG_SUCCESS; |
| 4630 | } |
| 4631 | #endif /* !defined(__MIG_check__Request__task_set_mach_voucher_t__defined) */ |
| 4632 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 4633 | #endif /* ( __MigTypeCheck ) */ |
| 4634 | |
| 4635 | |
| 4636 | /* Routine task_set_mach_voucher */ |
| 4637 | mig_internal novalue _Xtask_set_mach_voucher |
| 4638 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 4639 | { |
| 4640 | |
| 4641 | #ifdef __MigPackStructs |
| 4642 | #pragma pack(4) |
| 4643 | #endif |
| 4644 | typedef struct { |
| 4645 | mach_msg_header_t Head; |
| 4646 | /* start of the kernel processed data */ |
| 4647 | mach_msg_body_t msgh_body; |
| 4648 | mach_msg_port_descriptor_t voucher; |
| 4649 | /* end of the kernel processed data */ |
| 4650 | mach_msg_trailer_t trailer; |
| 4651 | } Request __attribute__((unused)); |
| 4652 | #ifdef __MigPackStructs |
| 4653 | #pragma pack() |
| 4654 | #endif |
| 4655 | typedef __Request__task_set_mach_voucher_t __Request; |
| 4656 | typedef __Reply__task_set_mach_voucher_t Reply __attribute__((unused)); |
| 4657 | |
| 4658 | /* |
| 4659 | * typedef struct { |
| 4660 | * mach_msg_header_t Head; |
| 4661 | * NDR_record_t NDR; |
| 4662 | * kern_return_t RetCode; |
| 4663 | * } mig_reply_error_t; |
| 4664 | */ |
| 4665 | |
| 4666 | Request *In0P = (Request *) InHeadP; |
| 4667 | Reply *OutP = (Reply *) OutHeadP; |
| 4668 | #ifdef __MIG_check__Request__task_set_mach_voucher_t__defined |
| 4669 | kern_return_t check_result; |
| 4670 | #endif /* __MIG_check__Request__task_set_mach_voucher_t__defined */ |
| 4671 | |
| 4672 | #if __MigKernelSpecificCode |
| 4673 | #else |
| 4674 | #endif /* __MigKernelSpecificCode */ |
| 4675 | task_t task; |
| 4676 | ipc_voucher_t voucher; |
| 4677 | |
| 4678 | __DeclareRcvRpc(3440, "task_set_mach_voucher" ) |
| 4679 | __BeforeRcvRpc(3440, "task_set_mach_voucher" ) |
| 4680 | |
| 4681 | #if defined(__MIG_check__Request__task_set_mach_voucher_t__defined) |
| 4682 | check_result = __MIG_check__Request__task_set_mach_voucher_t((__Request *)In0P); |
| 4683 | if (check_result != MACH_MSG_SUCCESS) |
| 4684 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 4685 | #endif /* defined(__MIG_check__Request__task_set_mach_voucher_t__defined) */ |
| 4686 | |
| 4687 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 4688 | |
| 4689 | voucher = convert_port_to_voucher(In0P->voucher.name); |
| 4690 | |
| 4691 | OutP->RetCode = task_set_mach_voucher(task, voucher); |
| 4692 | ipc_voucher_release(voucher); |
| 4693 | task_deallocate(task); |
| 4694 | #if __MigKernelSpecificCode |
| 4695 | if (OutP->RetCode != KERN_SUCCESS) { |
| 4696 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 4697 | } |
| 4698 | |
| 4699 | if (IP_VALID((ipc_port_t)In0P->voucher.name)) |
| 4700 | ipc_port_release_send((ipc_port_t)In0P->voucher.name); |
| 4701 | #endif /* __MigKernelSpecificCode */ |
| 4702 | |
| 4703 | OutP->NDR = NDR_record; |
| 4704 | |
| 4705 | |
| 4706 | __AfterRcvRpc(3440, "task_set_mach_voucher" ) |
| 4707 | } |
| 4708 | |
| 4709 | #if ( __MigTypeCheck ) |
| 4710 | #if __MIG_check__Request__task_subsystem__ |
| 4711 | #if !defined(__MIG_check__Request__task_swap_mach_voucher_t__defined) |
| 4712 | #define __MIG_check__Request__task_swap_mach_voucher_t__defined |
| 4713 | |
| 4714 | mig_internal kern_return_t __MIG_check__Request__task_swap_mach_voucher_t(__attribute__((__unused__)) __Request__task_swap_mach_voucher_t *In0P) |
| 4715 | { |
| 4716 | |
| 4717 | typedef __Request__task_swap_mach_voucher_t __Request; |
| 4718 | #if __MigTypeCheck |
| 4719 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 4720 | (In0P->msgh_body.msgh_descriptor_count != 2) || |
| 4721 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 4722 | return MIG_BAD_ARGUMENTS; |
| 4723 | #endif /* __MigTypeCheck */ |
| 4724 | |
| 4725 | #if __MigTypeCheck |
| 4726 | if (In0P->new_voucher.type != MACH_MSG_PORT_DESCRIPTOR || |
| 4727 | In0P->new_voucher.disposition != 17) |
| 4728 | return MIG_TYPE_ERROR; |
| 4729 | #endif /* __MigTypeCheck */ |
| 4730 | |
| 4731 | #if __MigTypeCheck |
| 4732 | if (In0P->old_voucher.type != MACH_MSG_PORT_DESCRIPTOR || |
| 4733 | In0P->old_voucher.disposition != 17) |
| 4734 | return MIG_TYPE_ERROR; |
| 4735 | #endif /* __MigTypeCheck */ |
| 4736 | |
| 4737 | return MACH_MSG_SUCCESS; |
| 4738 | } |
| 4739 | #endif /* !defined(__MIG_check__Request__task_swap_mach_voucher_t__defined) */ |
| 4740 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 4741 | #endif /* ( __MigTypeCheck ) */ |
| 4742 | |
| 4743 | |
| 4744 | /* Routine task_swap_mach_voucher */ |
| 4745 | mig_internal novalue _Xtask_swap_mach_voucher |
| 4746 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 4747 | { |
| 4748 | |
| 4749 | #ifdef __MigPackStructs |
| 4750 | #pragma pack(4) |
| 4751 | #endif |
| 4752 | typedef struct { |
| 4753 | mach_msg_header_t Head; |
| 4754 | /* start of the kernel processed data */ |
| 4755 | mach_msg_body_t msgh_body; |
| 4756 | mach_msg_port_descriptor_t new_voucher; |
| 4757 | mach_msg_port_descriptor_t old_voucher; |
| 4758 | /* end of the kernel processed data */ |
| 4759 | mach_msg_trailer_t trailer; |
| 4760 | } Request __attribute__((unused)); |
| 4761 | #ifdef __MigPackStructs |
| 4762 | #pragma pack() |
| 4763 | #endif |
| 4764 | typedef __Request__task_swap_mach_voucher_t __Request; |
| 4765 | typedef __Reply__task_swap_mach_voucher_t Reply __attribute__((unused)); |
| 4766 | |
| 4767 | /* |
| 4768 | * typedef struct { |
| 4769 | * mach_msg_header_t Head; |
| 4770 | * NDR_record_t NDR; |
| 4771 | * kern_return_t RetCode; |
| 4772 | * } mig_reply_error_t; |
| 4773 | */ |
| 4774 | |
| 4775 | Request *In0P = (Request *) InHeadP; |
| 4776 | Reply *OutP = (Reply *) OutHeadP; |
| 4777 | #ifdef __MIG_check__Request__task_swap_mach_voucher_t__defined |
| 4778 | kern_return_t check_result; |
| 4779 | #endif /* __MIG_check__Request__task_swap_mach_voucher_t__defined */ |
| 4780 | |
| 4781 | #if __MigKernelSpecificCode |
| 4782 | #if UseStaticTemplates |
| 4783 | const static mach_msg_port_descriptor_t old_voucherTemplate = { |
| 4784 | /* name = */ MACH_PORT_NULL, |
| 4785 | /* pad1 = */ 0, |
| 4786 | /* pad2 = */ 0, |
| 4787 | /* disp = */ 17, |
| 4788 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 4789 | }; |
| 4790 | #endif /* UseStaticTemplates */ |
| 4791 | |
| 4792 | #else |
| 4793 | #if UseStaticTemplates |
| 4794 | const static mach_msg_port_descriptor_t old_voucherTemplate = { |
| 4795 | /* name = */ MACH_PORT_NULL, |
| 4796 | /* pad1 = */ 0, |
| 4797 | /* pad2 = */ 0, |
| 4798 | /* disp = */ 19, |
| 4799 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 4800 | }; |
| 4801 | #endif /* UseStaticTemplates */ |
| 4802 | |
| 4803 | #endif /* __MigKernelSpecificCode */ |
| 4804 | kern_return_t RetCode; |
| 4805 | task_t task; |
| 4806 | ipc_voucher_t new_voucher; |
| 4807 | ipc_voucher_t old_voucher; |
| 4808 | |
| 4809 | __DeclareRcvRpc(3441, "task_swap_mach_voucher" ) |
| 4810 | __BeforeRcvRpc(3441, "task_swap_mach_voucher" ) |
| 4811 | |
| 4812 | #if defined(__MIG_check__Request__task_swap_mach_voucher_t__defined) |
| 4813 | check_result = __MIG_check__Request__task_swap_mach_voucher_t((__Request *)In0P); |
| 4814 | if (check_result != MACH_MSG_SUCCESS) |
| 4815 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 4816 | #endif /* defined(__MIG_check__Request__task_swap_mach_voucher_t__defined) */ |
| 4817 | |
| 4818 | #if UseStaticTemplates |
| 4819 | OutP->old_voucher = old_voucherTemplate; |
| 4820 | #else /* UseStaticTemplates */ |
| 4821 | #if __MigKernelSpecificCode |
| 4822 | OutP->old_voucher.disposition = 17; |
| 4823 | #else |
| 4824 | OutP->old_voucher.disposition = 19; |
| 4825 | #endif /* __MigKernelSpecificCode */ |
| 4826 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 4827 | OutP->old_voucher.pad1 = 0; |
| 4828 | #endif |
| 4829 | OutP->old_voucher.pad2 = 0; |
| 4830 | OutP->old_voucher.type = MACH_MSG_PORT_DESCRIPTOR; |
| 4831 | #if defined(KERNEL) |
| 4832 | OutP->old_voucher.pad_end = 0; |
| 4833 | #endif |
| 4834 | #endif /* UseStaticTemplates */ |
| 4835 | |
| 4836 | |
| 4837 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 4838 | |
| 4839 | new_voucher = convert_port_to_voucher(In0P->new_voucher.name); |
| 4840 | |
| 4841 | old_voucher = convert_port_to_voucher(In0P->old_voucher.name); |
| 4842 | |
| 4843 | RetCode = task_swap_mach_voucher(task, new_voucher, &old_voucher); |
| 4844 | ipc_voucher_release(new_voucher); |
| 4845 | task_deallocate(task); |
| 4846 | if (RetCode != KERN_SUCCESS) { |
| 4847 | MIG_RETURN_ERROR(OutP, RetCode); |
| 4848 | } |
| 4849 | #if __MigKernelSpecificCode |
| 4850 | |
| 4851 | if (IP_VALID((ipc_port_t)In0P->old_voucher.name)) |
| 4852 | ipc_port_release_send((ipc_port_t)In0P->old_voucher.name); |
| 4853 | |
| 4854 | if (IP_VALID((ipc_port_t)In0P->new_voucher.name)) |
| 4855 | ipc_port_release_send((ipc_port_t)In0P->new_voucher.name); |
| 4856 | #endif /* __MigKernelSpecificCode */ |
| 4857 | OutP->old_voucher.name = (mach_port_t)convert_voucher_to_port(old_voucher); |
| 4858 | |
| 4859 | |
| 4860 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 4861 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 4862 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 4863 | __AfterRcvRpc(3441, "task_swap_mach_voucher" ) |
| 4864 | } |
| 4865 | |
| 4866 | #if ( __MigTypeCheck ) |
| 4867 | #if __MIG_check__Request__task_subsystem__ |
| 4868 | #if !defined(__MIG_check__Request__task_generate_corpse_t__defined) |
| 4869 | #define __MIG_check__Request__task_generate_corpse_t__defined |
| 4870 | |
| 4871 | mig_internal kern_return_t __MIG_check__Request__task_generate_corpse_t(__attribute__((__unused__)) __Request__task_generate_corpse_t *In0P) |
| 4872 | { |
| 4873 | |
| 4874 | typedef __Request__task_generate_corpse_t __Request; |
| 4875 | #if __MigTypeCheck |
| 4876 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 4877 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 4878 | return MIG_BAD_ARGUMENTS; |
| 4879 | #endif /* __MigTypeCheck */ |
| 4880 | |
| 4881 | return MACH_MSG_SUCCESS; |
| 4882 | } |
| 4883 | #endif /* !defined(__MIG_check__Request__task_generate_corpse_t__defined) */ |
| 4884 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 4885 | #endif /* ( __MigTypeCheck ) */ |
| 4886 | |
| 4887 | |
| 4888 | /* Routine task_generate_corpse */ |
| 4889 | mig_internal novalue _Xtask_generate_corpse |
| 4890 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 4891 | { |
| 4892 | |
| 4893 | #ifdef __MigPackStructs |
| 4894 | #pragma pack(4) |
| 4895 | #endif |
| 4896 | typedef struct { |
| 4897 | mach_msg_header_t Head; |
| 4898 | mach_msg_trailer_t trailer; |
| 4899 | } Request __attribute__((unused)); |
| 4900 | #ifdef __MigPackStructs |
| 4901 | #pragma pack() |
| 4902 | #endif |
| 4903 | typedef __Request__task_generate_corpse_t __Request; |
| 4904 | typedef __Reply__task_generate_corpse_t Reply __attribute__((unused)); |
| 4905 | |
| 4906 | /* |
| 4907 | * typedef struct { |
| 4908 | * mach_msg_header_t Head; |
| 4909 | * NDR_record_t NDR; |
| 4910 | * kern_return_t RetCode; |
| 4911 | * } mig_reply_error_t; |
| 4912 | */ |
| 4913 | |
| 4914 | Request *In0P = (Request *) InHeadP; |
| 4915 | Reply *OutP = (Reply *) OutHeadP; |
| 4916 | #ifdef __MIG_check__Request__task_generate_corpse_t__defined |
| 4917 | kern_return_t check_result; |
| 4918 | #endif /* __MIG_check__Request__task_generate_corpse_t__defined */ |
| 4919 | |
| 4920 | #if __MigKernelSpecificCode |
| 4921 | #if UseStaticTemplates |
| 4922 | const static mach_msg_port_descriptor_t corpse_task_portTemplate = { |
| 4923 | /* name = */ MACH_PORT_NULL, |
| 4924 | /* pad1 = */ 0, |
| 4925 | /* pad2 = */ 0, |
| 4926 | /* disp = */ 17, |
| 4927 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 4928 | }; |
| 4929 | #endif /* UseStaticTemplates */ |
| 4930 | |
| 4931 | #else |
| 4932 | #if UseStaticTemplates |
| 4933 | const static mach_msg_port_descriptor_t corpse_task_portTemplate = { |
| 4934 | /* name = */ MACH_PORT_NULL, |
| 4935 | /* pad1 = */ 0, |
| 4936 | /* pad2 = */ 0, |
| 4937 | /* disp = */ 19, |
| 4938 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 4939 | }; |
| 4940 | #endif /* UseStaticTemplates */ |
| 4941 | |
| 4942 | #endif /* __MigKernelSpecificCode */ |
| 4943 | kern_return_t RetCode; |
| 4944 | task_t task; |
| 4945 | |
| 4946 | __DeclareRcvRpc(3442, "task_generate_corpse" ) |
| 4947 | __BeforeRcvRpc(3442, "task_generate_corpse" ) |
| 4948 | |
| 4949 | #if defined(__MIG_check__Request__task_generate_corpse_t__defined) |
| 4950 | check_result = __MIG_check__Request__task_generate_corpse_t((__Request *)In0P); |
| 4951 | if (check_result != MACH_MSG_SUCCESS) |
| 4952 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 4953 | #endif /* defined(__MIG_check__Request__task_generate_corpse_t__defined) */ |
| 4954 | |
| 4955 | #if UseStaticTemplates |
| 4956 | OutP->corpse_task_port = corpse_task_portTemplate; |
| 4957 | #else /* UseStaticTemplates */ |
| 4958 | #if __MigKernelSpecificCode |
| 4959 | OutP->corpse_task_port.disposition = 17; |
| 4960 | #else |
| 4961 | OutP->corpse_task_port.disposition = 19; |
| 4962 | #endif /* __MigKernelSpecificCode */ |
| 4963 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 4964 | OutP->corpse_task_port.pad1 = 0; |
| 4965 | #endif |
| 4966 | OutP->corpse_task_port.pad2 = 0; |
| 4967 | OutP->corpse_task_port.type = MACH_MSG_PORT_DESCRIPTOR; |
| 4968 | #if defined(KERNEL) |
| 4969 | OutP->corpse_task_port.pad_end = 0; |
| 4970 | #endif |
| 4971 | #endif /* UseStaticTemplates */ |
| 4972 | |
| 4973 | |
| 4974 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 4975 | |
| 4976 | RetCode = task_generate_corpse(task, &OutP->corpse_task_port.name); |
| 4977 | task_deallocate(task); |
| 4978 | if (RetCode != KERN_SUCCESS) { |
| 4979 | MIG_RETURN_ERROR(OutP, RetCode); |
| 4980 | } |
| 4981 | #if __MigKernelSpecificCode |
| 4982 | #endif /* __MigKernelSpecificCode */ |
| 4983 | |
| 4984 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 4985 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 4986 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 4987 | __AfterRcvRpc(3442, "task_generate_corpse" ) |
| 4988 | } |
| 4989 | |
| 4990 | #if ( __MigTypeCheck ) |
| 4991 | #if __MIG_check__Request__task_subsystem__ |
| 4992 | #if !defined(__MIG_check__Request__task_map_corpse_info_t__defined) |
| 4993 | #define __MIG_check__Request__task_map_corpse_info_t__defined |
| 4994 | |
| 4995 | mig_internal kern_return_t __MIG_check__Request__task_map_corpse_info_t(__attribute__((__unused__)) __Request__task_map_corpse_info_t *In0P) |
| 4996 | { |
| 4997 | |
| 4998 | typedef __Request__task_map_corpse_info_t __Request; |
| 4999 | #if __MigTypeCheck |
| 5000 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 5001 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 5002 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 5003 | return MIG_BAD_ARGUMENTS; |
| 5004 | #endif /* __MigTypeCheck */ |
| 5005 | |
| 5006 | #if __MigTypeCheck |
| 5007 | if (In0P->corspe_task.type != MACH_MSG_PORT_DESCRIPTOR || |
| 5008 | In0P->corspe_task.disposition != 17) |
| 5009 | return MIG_TYPE_ERROR; |
| 5010 | #endif /* __MigTypeCheck */ |
| 5011 | |
| 5012 | return MACH_MSG_SUCCESS; |
| 5013 | } |
| 5014 | #endif /* !defined(__MIG_check__Request__task_map_corpse_info_t__defined) */ |
| 5015 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 5016 | #endif /* ( __MigTypeCheck ) */ |
| 5017 | |
| 5018 | |
| 5019 | /* Routine task_map_corpse_info */ |
| 5020 | mig_internal novalue _Xtask_map_corpse_info |
| 5021 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 5022 | { |
| 5023 | |
| 5024 | #ifdef __MigPackStructs |
| 5025 | #pragma pack(4) |
| 5026 | #endif |
| 5027 | typedef struct { |
| 5028 | mach_msg_header_t Head; |
| 5029 | /* start of the kernel processed data */ |
| 5030 | mach_msg_body_t msgh_body; |
| 5031 | mach_msg_port_descriptor_t corspe_task; |
| 5032 | /* end of the kernel processed data */ |
| 5033 | mach_msg_trailer_t trailer; |
| 5034 | } Request __attribute__((unused)); |
| 5035 | #ifdef __MigPackStructs |
| 5036 | #pragma pack() |
| 5037 | #endif |
| 5038 | typedef __Request__task_map_corpse_info_t __Request; |
| 5039 | typedef __Reply__task_map_corpse_info_t Reply __attribute__((unused)); |
| 5040 | |
| 5041 | /* |
| 5042 | * typedef struct { |
| 5043 | * mach_msg_header_t Head; |
| 5044 | * NDR_record_t NDR; |
| 5045 | * kern_return_t RetCode; |
| 5046 | * } mig_reply_error_t; |
| 5047 | */ |
| 5048 | |
| 5049 | Request *In0P = (Request *) InHeadP; |
| 5050 | Reply *OutP = (Reply *) OutHeadP; |
| 5051 | #ifdef __MIG_check__Request__task_map_corpse_info_t__defined |
| 5052 | kern_return_t check_result; |
| 5053 | #endif /* __MIG_check__Request__task_map_corpse_info_t__defined */ |
| 5054 | |
| 5055 | #if __MigKernelSpecificCode |
| 5056 | #else |
| 5057 | #endif /* __MigKernelSpecificCode */ |
| 5058 | task_t task; |
| 5059 | task_t corspe_task; |
| 5060 | |
| 5061 | __DeclareRcvRpc(3443, "task_map_corpse_info" ) |
| 5062 | __BeforeRcvRpc(3443, "task_map_corpse_info" ) |
| 5063 | |
| 5064 | #if defined(__MIG_check__Request__task_map_corpse_info_t__defined) |
| 5065 | check_result = __MIG_check__Request__task_map_corpse_info_t((__Request *)In0P); |
| 5066 | if (check_result != MACH_MSG_SUCCESS) |
| 5067 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 5068 | #endif /* defined(__MIG_check__Request__task_map_corpse_info_t__defined) */ |
| 5069 | |
| 5070 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 5071 | |
| 5072 | corspe_task = convert_port_to_task(In0P->corspe_task.name); |
| 5073 | |
| 5074 | OutP->RetCode = task_map_corpse_info(task, corspe_task, &OutP->kcd_addr_begin, &OutP->kcd_size); |
| 5075 | task_deallocate(corspe_task); |
| 5076 | task_deallocate(task); |
| 5077 | if (OutP->RetCode != KERN_SUCCESS) { |
| 5078 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 5079 | } |
| 5080 | #if __MigKernelSpecificCode |
| 5081 | |
| 5082 | if (IP_VALID((ipc_port_t)In0P->corspe_task.name)) |
| 5083 | ipc_port_release_send((ipc_port_t)In0P->corspe_task.name); |
| 5084 | #endif /* __MigKernelSpecificCode */ |
| 5085 | |
| 5086 | OutP->NDR = NDR_record; |
| 5087 | |
| 5088 | |
| 5089 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 5090 | __AfterRcvRpc(3443, "task_map_corpse_info" ) |
| 5091 | } |
| 5092 | |
| 5093 | #if ( __MigTypeCheck ) |
| 5094 | #if __MIG_check__Request__task_subsystem__ |
| 5095 | #if !defined(__MIG_check__Request__task_register_dyld_image_infos_t__defined) |
| 5096 | #define __MIG_check__Request__task_register_dyld_image_infos_t__defined |
| 5097 | |
| 5098 | mig_internal kern_return_t __MIG_check__Request__task_register_dyld_image_infos_t(__attribute__((__unused__)) __Request__task_register_dyld_image_infos_t *In0P) |
| 5099 | { |
| 5100 | |
| 5101 | typedef __Request__task_register_dyld_image_infos_t __Request; |
| 5102 | #if __MigTypeCheck |
| 5103 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 5104 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 5105 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 5106 | return MIG_BAD_ARGUMENTS; |
| 5107 | #endif /* __MigTypeCheck */ |
| 5108 | |
| 5109 | #if __MigTypeCheck |
| 5110 | if (In0P->dyld_images.type != MACH_MSG_OOL_DESCRIPTOR) |
| 5111 | return MIG_TYPE_ERROR; |
| 5112 | #endif /* __MigTypeCheck */ |
| 5113 | |
| 5114 | #if __MigTypeCheck |
| 5115 | if (In0P->dyld_images.size / 40 != In0P->dyld_imagesCnt) |
| 5116 | return MIG_TYPE_ERROR; |
| 5117 | #endif /* __MigTypeCheck */ |
| 5118 | |
| 5119 | return MACH_MSG_SUCCESS; |
| 5120 | } |
| 5121 | #endif /* !defined(__MIG_check__Request__task_register_dyld_image_infos_t__defined) */ |
| 5122 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 5123 | #endif /* ( __MigTypeCheck ) */ |
| 5124 | |
| 5125 | |
| 5126 | /* Routine task_register_dyld_image_infos */ |
| 5127 | mig_internal novalue _Xtask_register_dyld_image_infos |
| 5128 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 5129 | { |
| 5130 | |
| 5131 | #ifdef __MigPackStructs |
| 5132 | #pragma pack(4) |
| 5133 | #endif |
| 5134 | typedef struct { |
| 5135 | mach_msg_header_t Head; |
| 5136 | /* start of the kernel processed data */ |
| 5137 | mach_msg_body_t msgh_body; |
| 5138 | mach_msg_ool_descriptor_t dyld_images; |
| 5139 | /* end of the kernel processed data */ |
| 5140 | NDR_record_t NDR; |
| 5141 | mach_msg_type_number_t dyld_imagesCnt; |
| 5142 | mach_msg_trailer_t trailer; |
| 5143 | } Request __attribute__((unused)); |
| 5144 | #ifdef __MigPackStructs |
| 5145 | #pragma pack() |
| 5146 | #endif |
| 5147 | typedef __Request__task_register_dyld_image_infos_t __Request; |
| 5148 | typedef __Reply__task_register_dyld_image_infos_t Reply __attribute__((unused)); |
| 5149 | |
| 5150 | /* |
| 5151 | * typedef struct { |
| 5152 | * mach_msg_header_t Head; |
| 5153 | * NDR_record_t NDR; |
| 5154 | * kern_return_t RetCode; |
| 5155 | * } mig_reply_error_t; |
| 5156 | */ |
| 5157 | |
| 5158 | Request *In0P = (Request *) InHeadP; |
| 5159 | Reply *OutP = (Reply *) OutHeadP; |
| 5160 | #ifdef __MIG_check__Request__task_register_dyld_image_infos_t__defined |
| 5161 | kern_return_t check_result; |
| 5162 | #endif /* __MIG_check__Request__task_register_dyld_image_infos_t__defined */ |
| 5163 | |
| 5164 | #if __MigKernelSpecificCode |
| 5165 | #else |
| 5166 | #endif /* __MigKernelSpecificCode */ |
| 5167 | task_t task; |
| 5168 | |
| 5169 | __DeclareRcvRpc(3444, "task_register_dyld_image_infos" ) |
| 5170 | __BeforeRcvRpc(3444, "task_register_dyld_image_infos" ) |
| 5171 | |
| 5172 | #if defined(__MIG_check__Request__task_register_dyld_image_infos_t__defined) |
| 5173 | check_result = __MIG_check__Request__task_register_dyld_image_infos_t((__Request *)In0P); |
| 5174 | if (check_result != MACH_MSG_SUCCESS) |
| 5175 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 5176 | #endif /* defined(__MIG_check__Request__task_register_dyld_image_infos_t__defined) */ |
| 5177 | |
| 5178 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 5179 | |
| 5180 | OutP->RetCode = task_register_dyld_image_infos(task, (dyld_kernel_image_info_array_t)(In0P->dyld_images.address), In0P->dyld_images.size / 40); |
| 5181 | task_deallocate(task); |
| 5182 | #if __MigKernelSpecificCode |
| 5183 | #endif /* __MigKernelSpecificCode */ |
| 5184 | |
| 5185 | OutP->NDR = NDR_record; |
| 5186 | |
| 5187 | |
| 5188 | __AfterRcvRpc(3444, "task_register_dyld_image_infos" ) |
| 5189 | } |
| 5190 | |
| 5191 | #if ( __MigTypeCheck ) |
| 5192 | #if __MIG_check__Request__task_subsystem__ |
| 5193 | #if !defined(__MIG_check__Request__task_unregister_dyld_image_infos_t__defined) |
| 5194 | #define __MIG_check__Request__task_unregister_dyld_image_infos_t__defined |
| 5195 | |
| 5196 | mig_internal kern_return_t __MIG_check__Request__task_unregister_dyld_image_infos_t(__attribute__((__unused__)) __Request__task_unregister_dyld_image_infos_t *In0P) |
| 5197 | { |
| 5198 | |
| 5199 | typedef __Request__task_unregister_dyld_image_infos_t __Request; |
| 5200 | #if __MigTypeCheck |
| 5201 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 5202 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 5203 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 5204 | return MIG_BAD_ARGUMENTS; |
| 5205 | #endif /* __MigTypeCheck */ |
| 5206 | |
| 5207 | #if __MigTypeCheck |
| 5208 | if (In0P->dyld_images.type != MACH_MSG_OOL_DESCRIPTOR) |
| 5209 | return MIG_TYPE_ERROR; |
| 5210 | #endif /* __MigTypeCheck */ |
| 5211 | |
| 5212 | #if __MigTypeCheck |
| 5213 | if (In0P->dyld_images.size / 40 != In0P->dyld_imagesCnt) |
| 5214 | return MIG_TYPE_ERROR; |
| 5215 | #endif /* __MigTypeCheck */ |
| 5216 | |
| 5217 | return MACH_MSG_SUCCESS; |
| 5218 | } |
| 5219 | #endif /* !defined(__MIG_check__Request__task_unregister_dyld_image_infos_t__defined) */ |
| 5220 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 5221 | #endif /* ( __MigTypeCheck ) */ |
| 5222 | |
| 5223 | |
| 5224 | /* Routine task_unregister_dyld_image_infos */ |
| 5225 | mig_internal novalue _Xtask_unregister_dyld_image_infos |
| 5226 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 5227 | { |
| 5228 | |
| 5229 | #ifdef __MigPackStructs |
| 5230 | #pragma pack(4) |
| 5231 | #endif |
| 5232 | typedef struct { |
| 5233 | mach_msg_header_t Head; |
| 5234 | /* start of the kernel processed data */ |
| 5235 | mach_msg_body_t msgh_body; |
| 5236 | mach_msg_ool_descriptor_t dyld_images; |
| 5237 | /* end of the kernel processed data */ |
| 5238 | NDR_record_t NDR; |
| 5239 | mach_msg_type_number_t dyld_imagesCnt; |
| 5240 | mach_msg_trailer_t trailer; |
| 5241 | } Request __attribute__((unused)); |
| 5242 | #ifdef __MigPackStructs |
| 5243 | #pragma pack() |
| 5244 | #endif |
| 5245 | typedef __Request__task_unregister_dyld_image_infos_t __Request; |
| 5246 | typedef __Reply__task_unregister_dyld_image_infos_t Reply __attribute__((unused)); |
| 5247 | |
| 5248 | /* |
| 5249 | * typedef struct { |
| 5250 | * mach_msg_header_t Head; |
| 5251 | * NDR_record_t NDR; |
| 5252 | * kern_return_t RetCode; |
| 5253 | * } mig_reply_error_t; |
| 5254 | */ |
| 5255 | |
| 5256 | Request *In0P = (Request *) InHeadP; |
| 5257 | Reply *OutP = (Reply *) OutHeadP; |
| 5258 | #ifdef __MIG_check__Request__task_unregister_dyld_image_infos_t__defined |
| 5259 | kern_return_t check_result; |
| 5260 | #endif /* __MIG_check__Request__task_unregister_dyld_image_infos_t__defined */ |
| 5261 | |
| 5262 | #if __MigKernelSpecificCode |
| 5263 | #else |
| 5264 | #endif /* __MigKernelSpecificCode */ |
| 5265 | task_t task; |
| 5266 | |
| 5267 | __DeclareRcvRpc(3445, "task_unregister_dyld_image_infos" ) |
| 5268 | __BeforeRcvRpc(3445, "task_unregister_dyld_image_infos" ) |
| 5269 | |
| 5270 | #if defined(__MIG_check__Request__task_unregister_dyld_image_infos_t__defined) |
| 5271 | check_result = __MIG_check__Request__task_unregister_dyld_image_infos_t((__Request *)In0P); |
| 5272 | if (check_result != MACH_MSG_SUCCESS) |
| 5273 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 5274 | #endif /* defined(__MIG_check__Request__task_unregister_dyld_image_infos_t__defined) */ |
| 5275 | |
| 5276 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 5277 | |
| 5278 | OutP->RetCode = task_unregister_dyld_image_infos(task, (dyld_kernel_image_info_array_t)(In0P->dyld_images.address), In0P->dyld_images.size / 40); |
| 5279 | task_deallocate(task); |
| 5280 | #if __MigKernelSpecificCode |
| 5281 | #endif /* __MigKernelSpecificCode */ |
| 5282 | |
| 5283 | OutP->NDR = NDR_record; |
| 5284 | |
| 5285 | |
| 5286 | __AfterRcvRpc(3445, "task_unregister_dyld_image_infos" ) |
| 5287 | } |
| 5288 | |
| 5289 | #if ( __MigTypeCheck ) |
| 5290 | #if __MIG_check__Request__task_subsystem__ |
| 5291 | #if !defined(__MIG_check__Request__task_get_dyld_image_infos_t__defined) |
| 5292 | #define __MIG_check__Request__task_get_dyld_image_infos_t__defined |
| 5293 | |
| 5294 | mig_internal kern_return_t __MIG_check__Request__task_get_dyld_image_infos_t(__attribute__((__unused__)) __Request__task_get_dyld_image_infos_t *In0P) |
| 5295 | { |
| 5296 | |
| 5297 | typedef __Request__task_get_dyld_image_infos_t __Request; |
| 5298 | #if __MigTypeCheck |
| 5299 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 5300 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 5301 | return MIG_BAD_ARGUMENTS; |
| 5302 | #endif /* __MigTypeCheck */ |
| 5303 | |
| 5304 | return MACH_MSG_SUCCESS; |
| 5305 | } |
| 5306 | #endif /* !defined(__MIG_check__Request__task_get_dyld_image_infos_t__defined) */ |
| 5307 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 5308 | #endif /* ( __MigTypeCheck ) */ |
| 5309 | |
| 5310 | |
| 5311 | /* Routine task_get_dyld_image_infos */ |
| 5312 | mig_internal novalue _Xtask_get_dyld_image_infos |
| 5313 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 5314 | { |
| 5315 | |
| 5316 | #ifdef __MigPackStructs |
| 5317 | #pragma pack(4) |
| 5318 | #endif |
| 5319 | typedef struct { |
| 5320 | mach_msg_header_t Head; |
| 5321 | mach_msg_trailer_t trailer; |
| 5322 | } Request __attribute__((unused)); |
| 5323 | #ifdef __MigPackStructs |
| 5324 | #pragma pack() |
| 5325 | #endif |
| 5326 | typedef __Request__task_get_dyld_image_infos_t __Request; |
| 5327 | typedef __Reply__task_get_dyld_image_infos_t Reply __attribute__((unused)); |
| 5328 | |
| 5329 | /* |
| 5330 | * typedef struct { |
| 5331 | * mach_msg_header_t Head; |
| 5332 | * NDR_record_t NDR; |
| 5333 | * kern_return_t RetCode; |
| 5334 | * } mig_reply_error_t; |
| 5335 | */ |
| 5336 | |
| 5337 | Request *In0P = (Request *) InHeadP; |
| 5338 | Reply *OutP = (Reply *) OutHeadP; |
| 5339 | #ifdef __MIG_check__Request__task_get_dyld_image_infos_t__defined |
| 5340 | kern_return_t check_result; |
| 5341 | #endif /* __MIG_check__Request__task_get_dyld_image_infos_t__defined */ |
| 5342 | |
| 5343 | #if __MigKernelSpecificCode |
| 5344 | #if UseStaticTemplates |
| 5345 | const static mach_msg_ool_descriptor_t dyld_imagesTemplate = { |
| 5346 | /* addr = */ (void *)0, |
| 5347 | /* size = */ 0, |
| 5348 | /* deal = */ FALSE, |
| 5349 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
| 5350 | /* pad2 = */ 0, |
| 5351 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
| 5352 | }; |
| 5353 | #endif /* UseStaticTemplates */ |
| 5354 | |
| 5355 | #else |
| 5356 | #if UseStaticTemplates |
| 5357 | const static mach_msg_ool_descriptor_t dyld_imagesTemplate = { |
| 5358 | /* addr = */ (void *)0, |
| 5359 | /* size = */ 0, |
| 5360 | /* deal = */ FALSE, |
| 5361 | /* copy = */ MACH_MSG_VIRTUAL_COPY, |
| 5362 | /* pad2 = */ 0, |
| 5363 | /* type = */ MACH_MSG_OOL_DESCRIPTOR, |
| 5364 | }; |
| 5365 | #endif /* UseStaticTemplates */ |
| 5366 | |
| 5367 | #endif /* __MigKernelSpecificCode */ |
| 5368 | kern_return_t RetCode; |
| 5369 | task_inspect_t task; |
| 5370 | |
| 5371 | __DeclareRcvRpc(3446, "task_get_dyld_image_infos" ) |
| 5372 | __BeforeRcvRpc(3446, "task_get_dyld_image_infos" ) |
| 5373 | |
| 5374 | #if defined(__MIG_check__Request__task_get_dyld_image_infos_t__defined) |
| 5375 | check_result = __MIG_check__Request__task_get_dyld_image_infos_t((__Request *)In0P); |
| 5376 | if (check_result != MACH_MSG_SUCCESS) |
| 5377 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 5378 | #endif /* defined(__MIG_check__Request__task_get_dyld_image_infos_t__defined) */ |
| 5379 | |
| 5380 | #if UseStaticTemplates |
| 5381 | OutP->dyld_images = dyld_imagesTemplate; |
| 5382 | #else /* UseStaticTemplates */ |
| 5383 | OutP->dyld_images.deallocate = FALSE; |
| 5384 | OutP->dyld_images.copy = MACH_MSG_VIRTUAL_COPY; |
| 5385 | OutP->dyld_images.pad1 = 0; |
| 5386 | OutP->dyld_images.type = MACH_MSG_OOL_DESCRIPTOR; |
| 5387 | #if defined(KERNEL) && !defined(__LP64__) |
| 5388 | OutP->dyld_images.pad_end = 0; |
| 5389 | #endif |
| 5390 | #endif /* UseStaticTemplates */ |
| 5391 | |
| 5392 | |
| 5393 | task = convert_port_to_task_inspect(In0P->Head.msgh_request_port); |
| 5394 | |
| 5395 | RetCode = task_get_dyld_image_infos(task, (dyld_kernel_image_info_array_t *)&(OutP->dyld_images.address), &OutP->dyld_imagesCnt); |
| 5396 | task_inspect_deallocate(task); |
| 5397 | if (RetCode != KERN_SUCCESS) { |
| 5398 | MIG_RETURN_ERROR(OutP, RetCode); |
| 5399 | } |
| 5400 | #if __MigKernelSpecificCode |
| 5401 | #endif /* __MigKernelSpecificCode */ |
| 5402 | OutP->dyld_images.size = OutP->dyld_imagesCnt * 40; |
| 5403 | |
| 5404 | |
| 5405 | OutP->NDR = NDR_record; |
| 5406 | |
| 5407 | |
| 5408 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 5409 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 5410 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 5411 | __AfterRcvRpc(3446, "task_get_dyld_image_infos" ) |
| 5412 | } |
| 5413 | |
| 5414 | #if ( __MigTypeCheck ) |
| 5415 | #if __MIG_check__Request__task_subsystem__ |
| 5416 | #if !defined(__MIG_check__Request__task_register_dyld_shared_cache_image_info_t__defined) |
| 5417 | #define __MIG_check__Request__task_register_dyld_shared_cache_image_info_t__defined |
| 5418 | |
| 5419 | mig_internal kern_return_t __MIG_check__Request__task_register_dyld_shared_cache_image_info_t(__attribute__((__unused__)) __Request__task_register_dyld_shared_cache_image_info_t *In0P) |
| 5420 | { |
| 5421 | |
| 5422 | typedef __Request__task_register_dyld_shared_cache_image_info_t __Request; |
| 5423 | #if __MigTypeCheck |
| 5424 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 5425 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 5426 | return MIG_BAD_ARGUMENTS; |
| 5427 | #endif /* __MigTypeCheck */ |
| 5428 | |
| 5429 | return MACH_MSG_SUCCESS; |
| 5430 | } |
| 5431 | #endif /* !defined(__MIG_check__Request__task_register_dyld_shared_cache_image_info_t__defined) */ |
| 5432 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 5433 | #endif /* ( __MigTypeCheck ) */ |
| 5434 | |
| 5435 | |
| 5436 | /* Routine task_register_dyld_shared_cache_image_info */ |
| 5437 | mig_internal novalue _Xtask_register_dyld_shared_cache_image_info |
| 5438 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 5439 | { |
| 5440 | |
| 5441 | #ifdef __MigPackStructs |
| 5442 | #pragma pack(4) |
| 5443 | #endif |
| 5444 | typedef struct { |
| 5445 | mach_msg_header_t Head; |
| 5446 | NDR_record_t NDR; |
| 5447 | dyld_kernel_image_info_t dyld_cache_image; |
| 5448 | boolean_t no_cache; |
| 5449 | boolean_t private_cache; |
| 5450 | mach_msg_trailer_t trailer; |
| 5451 | } Request __attribute__((unused)); |
| 5452 | #ifdef __MigPackStructs |
| 5453 | #pragma pack() |
| 5454 | #endif |
| 5455 | typedef __Request__task_register_dyld_shared_cache_image_info_t __Request; |
| 5456 | typedef __Reply__task_register_dyld_shared_cache_image_info_t Reply __attribute__((unused)); |
| 5457 | |
| 5458 | /* |
| 5459 | * typedef struct { |
| 5460 | * mach_msg_header_t Head; |
| 5461 | * NDR_record_t NDR; |
| 5462 | * kern_return_t RetCode; |
| 5463 | * } mig_reply_error_t; |
| 5464 | */ |
| 5465 | |
| 5466 | Request *In0P = (Request *) InHeadP; |
| 5467 | Reply *OutP = (Reply *) OutHeadP; |
| 5468 | #ifdef __MIG_check__Request__task_register_dyld_shared_cache_image_info_t__defined |
| 5469 | kern_return_t check_result; |
| 5470 | #endif /* __MIG_check__Request__task_register_dyld_shared_cache_image_info_t__defined */ |
| 5471 | |
| 5472 | #if __MigKernelSpecificCode |
| 5473 | #else |
| 5474 | #endif /* __MigKernelSpecificCode */ |
| 5475 | task_t task; |
| 5476 | |
| 5477 | __DeclareRcvRpc(3447, "task_register_dyld_shared_cache_image_info" ) |
| 5478 | __BeforeRcvRpc(3447, "task_register_dyld_shared_cache_image_info" ) |
| 5479 | |
| 5480 | #if defined(__MIG_check__Request__task_register_dyld_shared_cache_image_info_t__defined) |
| 5481 | check_result = __MIG_check__Request__task_register_dyld_shared_cache_image_info_t((__Request *)In0P); |
| 5482 | if (check_result != MACH_MSG_SUCCESS) |
| 5483 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 5484 | #endif /* defined(__MIG_check__Request__task_register_dyld_shared_cache_image_info_t__defined) */ |
| 5485 | |
| 5486 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 5487 | |
| 5488 | OutP->RetCode = task_register_dyld_shared_cache_image_info(task, In0P->dyld_cache_image, In0P->no_cache, In0P->private_cache); |
| 5489 | task_deallocate(task); |
| 5490 | #if __MigKernelSpecificCode |
| 5491 | #endif /* __MigKernelSpecificCode */ |
| 5492 | |
| 5493 | OutP->NDR = NDR_record; |
| 5494 | |
| 5495 | |
| 5496 | __AfterRcvRpc(3447, "task_register_dyld_shared_cache_image_info" ) |
| 5497 | } |
| 5498 | |
| 5499 | #if ( __MigTypeCheck ) |
| 5500 | #if __MIG_check__Request__task_subsystem__ |
| 5501 | #if !defined(__MIG_check__Request__task_register_dyld_set_dyld_state_t__defined) |
| 5502 | #define __MIG_check__Request__task_register_dyld_set_dyld_state_t__defined |
| 5503 | |
| 5504 | mig_internal kern_return_t __MIG_check__Request__task_register_dyld_set_dyld_state_t(__attribute__((__unused__)) __Request__task_register_dyld_set_dyld_state_t *In0P) |
| 5505 | { |
| 5506 | |
| 5507 | typedef __Request__task_register_dyld_set_dyld_state_t __Request; |
| 5508 | #if __MigTypeCheck |
| 5509 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 5510 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 5511 | return MIG_BAD_ARGUMENTS; |
| 5512 | #endif /* __MigTypeCheck */ |
| 5513 | |
| 5514 | return MACH_MSG_SUCCESS; |
| 5515 | } |
| 5516 | #endif /* !defined(__MIG_check__Request__task_register_dyld_set_dyld_state_t__defined) */ |
| 5517 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 5518 | #endif /* ( __MigTypeCheck ) */ |
| 5519 | |
| 5520 | |
| 5521 | /* Routine task_register_dyld_set_dyld_state */ |
| 5522 | mig_internal novalue _Xtask_register_dyld_set_dyld_state |
| 5523 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 5524 | { |
| 5525 | |
| 5526 | #ifdef __MigPackStructs |
| 5527 | #pragma pack(4) |
| 5528 | #endif |
| 5529 | typedef struct { |
| 5530 | mach_msg_header_t Head; |
| 5531 | NDR_record_t NDR; |
| 5532 | uint8_t dyld_state; |
| 5533 | char dyld_statePad[3]; |
| 5534 | mach_msg_trailer_t trailer; |
| 5535 | } Request __attribute__((unused)); |
| 5536 | #ifdef __MigPackStructs |
| 5537 | #pragma pack() |
| 5538 | #endif |
| 5539 | typedef __Request__task_register_dyld_set_dyld_state_t __Request; |
| 5540 | typedef __Reply__task_register_dyld_set_dyld_state_t Reply __attribute__((unused)); |
| 5541 | |
| 5542 | /* |
| 5543 | * typedef struct { |
| 5544 | * mach_msg_header_t Head; |
| 5545 | * NDR_record_t NDR; |
| 5546 | * kern_return_t RetCode; |
| 5547 | * } mig_reply_error_t; |
| 5548 | */ |
| 5549 | |
| 5550 | Request *In0P = (Request *) InHeadP; |
| 5551 | Reply *OutP = (Reply *) OutHeadP; |
| 5552 | #ifdef __MIG_check__Request__task_register_dyld_set_dyld_state_t__defined |
| 5553 | kern_return_t check_result; |
| 5554 | #endif /* __MIG_check__Request__task_register_dyld_set_dyld_state_t__defined */ |
| 5555 | |
| 5556 | #if __MigKernelSpecificCode |
| 5557 | #else |
| 5558 | #endif /* __MigKernelSpecificCode */ |
| 5559 | task_t task; |
| 5560 | |
| 5561 | __DeclareRcvRpc(3448, "task_register_dyld_set_dyld_state" ) |
| 5562 | __BeforeRcvRpc(3448, "task_register_dyld_set_dyld_state" ) |
| 5563 | |
| 5564 | #if defined(__MIG_check__Request__task_register_dyld_set_dyld_state_t__defined) |
| 5565 | check_result = __MIG_check__Request__task_register_dyld_set_dyld_state_t((__Request *)In0P); |
| 5566 | if (check_result != MACH_MSG_SUCCESS) |
| 5567 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 5568 | #endif /* defined(__MIG_check__Request__task_register_dyld_set_dyld_state_t__defined) */ |
| 5569 | |
| 5570 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 5571 | |
| 5572 | OutP->RetCode = task_register_dyld_set_dyld_state(task, In0P->dyld_state); |
| 5573 | task_deallocate(task); |
| 5574 | #if __MigKernelSpecificCode |
| 5575 | #endif /* __MigKernelSpecificCode */ |
| 5576 | |
| 5577 | OutP->NDR = NDR_record; |
| 5578 | |
| 5579 | |
| 5580 | __AfterRcvRpc(3448, "task_register_dyld_set_dyld_state" ) |
| 5581 | } |
| 5582 | |
| 5583 | #if ( __MigTypeCheck ) |
| 5584 | #if __MIG_check__Request__task_subsystem__ |
| 5585 | #if !defined(__MIG_check__Request__task_register_dyld_get_process_state_t__defined) |
| 5586 | #define __MIG_check__Request__task_register_dyld_get_process_state_t__defined |
| 5587 | |
| 5588 | mig_internal kern_return_t __MIG_check__Request__task_register_dyld_get_process_state_t(__attribute__((__unused__)) __Request__task_register_dyld_get_process_state_t *In0P) |
| 5589 | { |
| 5590 | |
| 5591 | typedef __Request__task_register_dyld_get_process_state_t __Request; |
| 5592 | #if __MigTypeCheck |
| 5593 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 5594 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 5595 | return MIG_BAD_ARGUMENTS; |
| 5596 | #endif /* __MigTypeCheck */ |
| 5597 | |
| 5598 | return MACH_MSG_SUCCESS; |
| 5599 | } |
| 5600 | #endif /* !defined(__MIG_check__Request__task_register_dyld_get_process_state_t__defined) */ |
| 5601 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 5602 | #endif /* ( __MigTypeCheck ) */ |
| 5603 | |
| 5604 | |
| 5605 | /* Routine task_register_dyld_get_process_state */ |
| 5606 | mig_internal novalue _Xtask_register_dyld_get_process_state |
| 5607 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 5608 | { |
| 5609 | |
| 5610 | #ifdef __MigPackStructs |
| 5611 | #pragma pack(4) |
| 5612 | #endif |
| 5613 | typedef struct { |
| 5614 | mach_msg_header_t Head; |
| 5615 | mach_msg_trailer_t trailer; |
| 5616 | } Request __attribute__((unused)); |
| 5617 | #ifdef __MigPackStructs |
| 5618 | #pragma pack() |
| 5619 | #endif |
| 5620 | typedef __Request__task_register_dyld_get_process_state_t __Request; |
| 5621 | typedef __Reply__task_register_dyld_get_process_state_t Reply __attribute__((unused)); |
| 5622 | |
| 5623 | /* |
| 5624 | * typedef struct { |
| 5625 | * mach_msg_header_t Head; |
| 5626 | * NDR_record_t NDR; |
| 5627 | * kern_return_t RetCode; |
| 5628 | * } mig_reply_error_t; |
| 5629 | */ |
| 5630 | |
| 5631 | Request *In0P = (Request *) InHeadP; |
| 5632 | Reply *OutP = (Reply *) OutHeadP; |
| 5633 | #ifdef __MIG_check__Request__task_register_dyld_get_process_state_t__defined |
| 5634 | kern_return_t check_result; |
| 5635 | #endif /* __MIG_check__Request__task_register_dyld_get_process_state_t__defined */ |
| 5636 | |
| 5637 | #if __MigKernelSpecificCode |
| 5638 | #else |
| 5639 | #endif /* __MigKernelSpecificCode */ |
| 5640 | task_t task; |
| 5641 | |
| 5642 | __DeclareRcvRpc(3449, "task_register_dyld_get_process_state" ) |
| 5643 | __BeforeRcvRpc(3449, "task_register_dyld_get_process_state" ) |
| 5644 | |
| 5645 | #if defined(__MIG_check__Request__task_register_dyld_get_process_state_t__defined) |
| 5646 | check_result = __MIG_check__Request__task_register_dyld_get_process_state_t((__Request *)In0P); |
| 5647 | if (check_result != MACH_MSG_SUCCESS) |
| 5648 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 5649 | #endif /* defined(__MIG_check__Request__task_register_dyld_get_process_state_t__defined) */ |
| 5650 | |
| 5651 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 5652 | |
| 5653 | OutP->RetCode = task_register_dyld_get_process_state(task, &OutP->dyld_process_state); |
| 5654 | task_deallocate(task); |
| 5655 | if (OutP->RetCode != KERN_SUCCESS) { |
| 5656 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 5657 | } |
| 5658 | #if __MigKernelSpecificCode |
| 5659 | #endif /* __MigKernelSpecificCode */ |
| 5660 | |
| 5661 | OutP->NDR = NDR_record; |
| 5662 | |
| 5663 | |
| 5664 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 5665 | __AfterRcvRpc(3449, "task_register_dyld_get_process_state" ) |
| 5666 | } |
| 5667 | |
| 5668 | #if ( __MigTypeCheck ) |
| 5669 | #if __MIG_check__Request__task_subsystem__ |
| 5670 | #if !defined(__MIG_check__Request__task_map_corpse_info_64_t__defined) |
| 5671 | #define __MIG_check__Request__task_map_corpse_info_64_t__defined |
| 5672 | |
| 5673 | mig_internal kern_return_t __MIG_check__Request__task_map_corpse_info_64_t(__attribute__((__unused__)) __Request__task_map_corpse_info_64_t *In0P) |
| 5674 | { |
| 5675 | |
| 5676 | typedef __Request__task_map_corpse_info_64_t __Request; |
| 5677 | #if __MigTypeCheck |
| 5678 | if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 5679 | (In0P->msgh_body.msgh_descriptor_count != 1) || |
| 5680 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 5681 | return MIG_BAD_ARGUMENTS; |
| 5682 | #endif /* __MigTypeCheck */ |
| 5683 | |
| 5684 | #if __MigTypeCheck |
| 5685 | if (In0P->corspe_task.type != MACH_MSG_PORT_DESCRIPTOR || |
| 5686 | In0P->corspe_task.disposition != 17) |
| 5687 | return MIG_TYPE_ERROR; |
| 5688 | #endif /* __MigTypeCheck */ |
| 5689 | |
| 5690 | return MACH_MSG_SUCCESS; |
| 5691 | } |
| 5692 | #endif /* !defined(__MIG_check__Request__task_map_corpse_info_64_t__defined) */ |
| 5693 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 5694 | #endif /* ( __MigTypeCheck ) */ |
| 5695 | |
| 5696 | |
| 5697 | /* Routine task_map_corpse_info_64 */ |
| 5698 | mig_internal novalue _Xtask_map_corpse_info_64 |
| 5699 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 5700 | { |
| 5701 | |
| 5702 | #ifdef __MigPackStructs |
| 5703 | #pragma pack(4) |
| 5704 | #endif |
| 5705 | typedef struct { |
| 5706 | mach_msg_header_t Head; |
| 5707 | /* start of the kernel processed data */ |
| 5708 | mach_msg_body_t msgh_body; |
| 5709 | mach_msg_port_descriptor_t corspe_task; |
| 5710 | /* end of the kernel processed data */ |
| 5711 | mach_msg_trailer_t trailer; |
| 5712 | } Request __attribute__((unused)); |
| 5713 | #ifdef __MigPackStructs |
| 5714 | #pragma pack() |
| 5715 | #endif |
| 5716 | typedef __Request__task_map_corpse_info_64_t __Request; |
| 5717 | typedef __Reply__task_map_corpse_info_64_t Reply __attribute__((unused)); |
| 5718 | |
| 5719 | /* |
| 5720 | * typedef struct { |
| 5721 | * mach_msg_header_t Head; |
| 5722 | * NDR_record_t NDR; |
| 5723 | * kern_return_t RetCode; |
| 5724 | * } mig_reply_error_t; |
| 5725 | */ |
| 5726 | |
| 5727 | Request *In0P = (Request *) InHeadP; |
| 5728 | Reply *OutP = (Reply *) OutHeadP; |
| 5729 | #ifdef __MIG_check__Request__task_map_corpse_info_64_t__defined |
| 5730 | kern_return_t check_result; |
| 5731 | #endif /* __MIG_check__Request__task_map_corpse_info_64_t__defined */ |
| 5732 | |
| 5733 | #if __MigKernelSpecificCode |
| 5734 | #else |
| 5735 | #endif /* __MigKernelSpecificCode */ |
| 5736 | task_t task; |
| 5737 | task_t corspe_task; |
| 5738 | |
| 5739 | __DeclareRcvRpc(3450, "task_map_corpse_info_64" ) |
| 5740 | __BeforeRcvRpc(3450, "task_map_corpse_info_64" ) |
| 5741 | |
| 5742 | #if defined(__MIG_check__Request__task_map_corpse_info_64_t__defined) |
| 5743 | check_result = __MIG_check__Request__task_map_corpse_info_64_t((__Request *)In0P); |
| 5744 | if (check_result != MACH_MSG_SUCCESS) |
| 5745 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 5746 | #endif /* defined(__MIG_check__Request__task_map_corpse_info_64_t__defined) */ |
| 5747 | |
| 5748 | task = convert_port_to_task(In0P->Head.msgh_request_port); |
| 5749 | |
| 5750 | corspe_task = convert_port_to_task(In0P->corspe_task.name); |
| 5751 | |
| 5752 | OutP->RetCode = task_map_corpse_info_64(task, corspe_task, &OutP->kcd_addr_begin, &OutP->kcd_size); |
| 5753 | task_deallocate(corspe_task); |
| 5754 | task_deallocate(task); |
| 5755 | if (OutP->RetCode != KERN_SUCCESS) { |
| 5756 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 5757 | } |
| 5758 | #if __MigKernelSpecificCode |
| 5759 | |
| 5760 | if (IP_VALID((ipc_port_t)In0P->corspe_task.name)) |
| 5761 | ipc_port_release_send((ipc_port_t)In0P->corspe_task.name); |
| 5762 | #endif /* __MigKernelSpecificCode */ |
| 5763 | |
| 5764 | OutP->NDR = NDR_record; |
| 5765 | |
| 5766 | |
| 5767 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 5768 | __AfterRcvRpc(3450, "task_map_corpse_info_64" ) |
| 5769 | } |
| 5770 | |
| 5771 | #if ( __MigTypeCheck ) |
| 5772 | #if __MIG_check__Request__task_subsystem__ |
| 5773 | #if !defined(__MIG_check__Request__task_inspect_t__defined) |
| 5774 | #define __MIG_check__Request__task_inspect_t__defined |
| 5775 | |
| 5776 | mig_internal kern_return_t __MIG_check__Request__task_inspect_t(__attribute__((__unused__)) __Request__task_inspect_t *In0P) |
| 5777 | { |
| 5778 | |
| 5779 | typedef __Request__task_inspect_t __Request; |
| 5780 | #if __MigTypeCheck |
| 5781 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 5782 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 5783 | return MIG_BAD_ARGUMENTS; |
| 5784 | #endif /* __MigTypeCheck */ |
| 5785 | |
| 5786 | return MACH_MSG_SUCCESS; |
| 5787 | } |
| 5788 | #endif /* !defined(__MIG_check__Request__task_inspect_t__defined) */ |
| 5789 | #endif /* __MIG_check__Request__task_subsystem__ */ |
| 5790 | #endif /* ( __MigTypeCheck ) */ |
| 5791 | |
| 5792 | |
| 5793 | /* Routine task_inspect */ |
| 5794 | mig_internal novalue _Xtask_inspect |
| 5795 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 5796 | { |
| 5797 | |
| 5798 | #ifdef __MigPackStructs |
| 5799 | #pragma pack(4) |
| 5800 | #endif |
| 5801 | typedef struct { |
| 5802 | mach_msg_header_t Head; |
| 5803 | NDR_record_t NDR; |
| 5804 | task_inspect_flavor_t flavor; |
| 5805 | mach_msg_type_number_t info_outCnt; |
| 5806 | mach_msg_trailer_t trailer; |
| 5807 | } Request __attribute__((unused)); |
| 5808 | #ifdef __MigPackStructs |
| 5809 | #pragma pack() |
| 5810 | #endif |
| 5811 | typedef __Request__task_inspect_t __Request; |
| 5812 | typedef __Reply__task_inspect_t Reply __attribute__((unused)); |
| 5813 | |
| 5814 | /* |
| 5815 | * typedef struct { |
| 5816 | * mach_msg_header_t Head; |
| 5817 | * NDR_record_t NDR; |
| 5818 | * kern_return_t RetCode; |
| 5819 | * } mig_reply_error_t; |
| 5820 | */ |
| 5821 | |
| 5822 | Request *In0P = (Request *) InHeadP; |
| 5823 | Reply *OutP = (Reply *) OutHeadP; |
| 5824 | #ifdef __MIG_check__Request__task_inspect_t__defined |
| 5825 | kern_return_t check_result; |
| 5826 | #endif /* __MIG_check__Request__task_inspect_t__defined */ |
| 5827 | |
| 5828 | #if __MigKernelSpecificCode |
| 5829 | #else |
| 5830 | #endif /* __MigKernelSpecificCode */ |
| 5831 | task_inspect_t task; |
| 5832 | |
| 5833 | __DeclareRcvRpc(3451, "task_inspect" ) |
| 5834 | __BeforeRcvRpc(3451, "task_inspect" ) |
| 5835 | |
| 5836 | #if defined(__MIG_check__Request__task_inspect_t__defined) |
| 5837 | check_result = __MIG_check__Request__task_inspect_t((__Request *)In0P); |
| 5838 | if (check_result != MACH_MSG_SUCCESS) |
| 5839 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 5840 | #endif /* defined(__MIG_check__Request__task_inspect_t__defined) */ |
| 5841 | |
| 5842 | task = convert_port_to_task_inspect(In0P->Head.msgh_request_port); |
| 5843 | |
| 5844 | OutP->info_outCnt = 4; |
| 5845 | if (In0P->info_outCnt < OutP->info_outCnt) |
| 5846 | OutP->info_outCnt = In0P->info_outCnt; |
| 5847 | |
| 5848 | OutP->RetCode = task_inspect(task, In0P->flavor, OutP->info_out, &OutP->info_outCnt); |
| 5849 | task_inspect_deallocate(task); |
| 5850 | if (OutP->RetCode != KERN_SUCCESS) { |
| 5851 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 5852 | } |
| 5853 | #if __MigKernelSpecificCode |
| 5854 | #endif /* __MigKernelSpecificCode */ |
| 5855 | |
| 5856 | OutP->NDR = NDR_record; |
| 5857 | |
| 5858 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 16) + (((4 * OutP->info_outCnt))); |
| 5859 | |
| 5860 | __AfterRcvRpc(3451, "task_inspect" ) |
| 5861 | } |
| 5862 | |
| 5863 | |
| 5864 | |
| 5865 | /* Description of this subsystem, for use in direct RPC */ |
| 5866 | const struct task_subsystem task_subsystem = { |
| 5867 | task_server_routine, |
| 5868 | 3400, |
| 5869 | 3452, |
| 5870 | (mach_msg_size_t)sizeof(union __ReplyUnion__task_subsystem), |
| 5871 | (vm_address_t)0, |
| 5872 | { |
| 5873 | { (mig_impl_routine_t) 0, |
| 5874 | (mig_stub_routine_t) _Xtask_create, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_create_t)}, |
| 5875 | { (mig_impl_routine_t) 0, |
| 5876 | (mig_stub_routine_t) _Xtask_terminate, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_terminate_t)}, |
| 5877 | { (mig_impl_routine_t) 0, |
| 5878 | (mig_stub_routine_t) _Xtask_threads, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_threads_t)}, |
| 5879 | { (mig_impl_routine_t) 0, |
| 5880 | (mig_stub_routine_t) _Xmach_ports_register, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_ports_register_t)}, |
| 5881 | { (mig_impl_routine_t) 0, |
| 5882 | (mig_stub_routine_t) _Xmach_ports_lookup, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_ports_lookup_t)}, |
| 5883 | { (mig_impl_routine_t) 0, |
| 5884 | (mig_stub_routine_t) _Xtask_info_from_user, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_info_from_user_t)}, |
| 5885 | { (mig_impl_routine_t) 0, |
| 5886 | (mig_stub_routine_t) _Xtask_set_info, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_set_info_t)}, |
| 5887 | { (mig_impl_routine_t) 0, |
| 5888 | (mig_stub_routine_t) _Xtask_suspend, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_suspend_t)}, |
| 5889 | { (mig_impl_routine_t) 0, |
| 5890 | (mig_stub_routine_t) _Xtask_resume, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_resume_t)}, |
| 5891 | { (mig_impl_routine_t) 0, |
| 5892 | (mig_stub_routine_t) _Xtask_get_special_port, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_get_special_port_t)}, |
| 5893 | { (mig_impl_routine_t) 0, |
| 5894 | (mig_stub_routine_t) _Xtask_set_special_port, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_set_special_port_t)}, |
| 5895 | { (mig_impl_routine_t) 0, |
| 5896 | (mig_stub_routine_t) _Xthread_create_from_user, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_create_from_user_t)}, |
| 5897 | { (mig_impl_routine_t) 0, |
| 5898 | (mig_stub_routine_t) _Xthread_create_running_from_user, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__thread_create_running_from_user_t)}, |
| 5899 | { (mig_impl_routine_t) 0, |
| 5900 | (mig_stub_routine_t) _Xtask_set_exception_ports, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_set_exception_ports_t)}, |
| 5901 | { (mig_impl_routine_t) 0, |
| 5902 | (mig_stub_routine_t) _Xtask_get_exception_ports, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_get_exception_ports_t)}, |
| 5903 | { (mig_impl_routine_t) 0, |
| 5904 | (mig_stub_routine_t) _Xtask_swap_exception_ports, 10, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_swap_exception_ports_t)}, |
| 5905 | { (mig_impl_routine_t) 0, |
| 5906 | (mig_stub_routine_t) _Xlock_set_create, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__lock_set_create_t)}, |
| 5907 | { (mig_impl_routine_t) 0, |
| 5908 | (mig_stub_routine_t) _Xlock_set_destroy, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__lock_set_destroy_t)}, |
| 5909 | { (mig_impl_routine_t) 0, |
| 5910 | (mig_stub_routine_t) _Xsemaphore_create, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__semaphore_create_t)}, |
| 5911 | { (mig_impl_routine_t) 0, |
| 5912 | (mig_stub_routine_t) _Xsemaphore_destroy, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__semaphore_destroy_t)}, |
| 5913 | { (mig_impl_routine_t) 0, |
| 5914 | (mig_stub_routine_t) _Xtask_policy_set, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_policy_set_t)}, |
| 5915 | { (mig_impl_routine_t) 0, |
| 5916 | (mig_stub_routine_t) _Xtask_policy_get, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_policy_get_t)}, |
| 5917 | {0, 0, 0, 0, 0, 0}, |
| 5918 | { (mig_impl_routine_t) 0, |
| 5919 | (mig_stub_routine_t) _Xtask_policy, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_policy_t)}, |
| 5920 | { (mig_impl_routine_t) 0, |
| 5921 | (mig_stub_routine_t) _Xtask_set_emulation, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_set_emulation_t)}, |
| 5922 | { (mig_impl_routine_t) 0, |
| 5923 | (mig_stub_routine_t) _Xtask_get_emulation_vector, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_get_emulation_vector_t)}, |
| 5924 | { (mig_impl_routine_t) 0, |
| 5925 | (mig_stub_routine_t) _Xtask_set_emulation_vector, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_set_emulation_vector_t)}, |
| 5926 | { (mig_impl_routine_t) 0, |
| 5927 | (mig_stub_routine_t) _Xtask_set_ras_pc, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_set_ras_pc_t)}, |
| 5928 | { (mig_impl_routine_t) 0, |
| 5929 | (mig_stub_routine_t) _Xtask_zone_info, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_zone_info_t)}, |
| 5930 | { (mig_impl_routine_t) 0, |
| 5931 | (mig_stub_routine_t) _Xtask_assign, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_assign_t)}, |
| 5932 | { (mig_impl_routine_t) 0, |
| 5933 | (mig_stub_routine_t) _Xtask_assign_default, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_assign_default_t)}, |
| 5934 | { (mig_impl_routine_t) 0, |
| 5935 | (mig_stub_routine_t) _Xtask_get_assignment, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_get_assignment_t)}, |
| 5936 | { (mig_impl_routine_t) 0, |
| 5937 | (mig_stub_routine_t) _Xtask_set_policy, 8, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_set_policy_t)}, |
| 5938 | { (mig_impl_routine_t) 0, |
| 5939 | (mig_stub_routine_t) _Xtask_get_state, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_get_state_t)}, |
| 5940 | { (mig_impl_routine_t) 0, |
| 5941 | (mig_stub_routine_t) _Xtask_set_state, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_set_state_t)}, |
| 5942 | { (mig_impl_routine_t) 0, |
| 5943 | (mig_stub_routine_t) _Xtask_set_phys_footprint_limit, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_set_phys_footprint_limit_t)}, |
| 5944 | { (mig_impl_routine_t) 0, |
| 5945 | (mig_stub_routine_t) _Xtask_suspend2, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_suspend2_t)}, |
| 5946 | { (mig_impl_routine_t) 0, |
| 5947 | (mig_stub_routine_t) _Xtask_resume2, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_resume2_t)}, |
| 5948 | { (mig_impl_routine_t) 0, |
| 5949 | (mig_stub_routine_t) _Xtask_purgable_info, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_purgable_info_t)}, |
| 5950 | { (mig_impl_routine_t) 0, |
| 5951 | (mig_stub_routine_t) _Xtask_get_mach_voucher, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_get_mach_voucher_t)}, |
| 5952 | { (mig_impl_routine_t) 0, |
| 5953 | (mig_stub_routine_t) _Xtask_set_mach_voucher, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_set_mach_voucher_t)}, |
| 5954 | { (mig_impl_routine_t) 0, |
| 5955 | (mig_stub_routine_t) _Xtask_swap_mach_voucher, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_swap_mach_voucher_t)}, |
| 5956 | { (mig_impl_routine_t) 0, |
| 5957 | (mig_stub_routine_t) _Xtask_generate_corpse, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_generate_corpse_t)}, |
| 5958 | { (mig_impl_routine_t) 0, |
| 5959 | (mig_stub_routine_t) _Xtask_map_corpse_info, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_map_corpse_info_t)}, |
| 5960 | { (mig_impl_routine_t) 0, |
| 5961 | (mig_stub_routine_t) _Xtask_register_dyld_image_infos, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_register_dyld_image_infos_t)}, |
| 5962 | { (mig_impl_routine_t) 0, |
| 5963 | (mig_stub_routine_t) _Xtask_unregister_dyld_image_infos, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_unregister_dyld_image_infos_t)}, |
| 5964 | { (mig_impl_routine_t) 0, |
| 5965 | (mig_stub_routine_t) _Xtask_get_dyld_image_infos, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_get_dyld_image_infos_t)}, |
| 5966 | { (mig_impl_routine_t) 0, |
| 5967 | (mig_stub_routine_t) _Xtask_register_dyld_shared_cache_image_info, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_register_dyld_shared_cache_image_info_t)}, |
| 5968 | { (mig_impl_routine_t) 0, |
| 5969 | (mig_stub_routine_t) _Xtask_register_dyld_set_dyld_state, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_register_dyld_set_dyld_state_t)}, |
| 5970 | { (mig_impl_routine_t) 0, |
| 5971 | (mig_stub_routine_t) _Xtask_register_dyld_get_process_state, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_register_dyld_get_process_state_t)}, |
| 5972 | { (mig_impl_routine_t) 0, |
| 5973 | (mig_stub_routine_t) _Xtask_map_corpse_info_64, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_map_corpse_info_64_t)}, |
| 5974 | { (mig_impl_routine_t) 0, |
| 5975 | (mig_stub_routine_t) _Xtask_inspect, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__task_inspect_t)}, |
| 5976 | } |
| 5977 | }; |
| 5978 | |
| 5979 | mig_external boolean_t task_server |
| 5980 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 5981 | { |
| 5982 | /* |
| 5983 | * typedef struct { |
| 5984 | * mach_msg_header_t Head; |
| 5985 | * NDR_record_t NDR; |
| 5986 | * kern_return_t RetCode; |
| 5987 | * } mig_reply_error_t; |
| 5988 | */ |
| 5989 | |
| 5990 | register mig_routine_t routine; |
| 5991 | |
| 5992 | OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0); |
| 5993 | OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port; |
| 5994 | /* Minimal size: routine() will update it if different */ |
| 5995 | OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); |
| 5996 | OutHeadP->msgh_local_port = MACH_PORT_NULL; |
| 5997 | OutHeadP->msgh_id = InHeadP->msgh_id + 100; |
| 5998 | OutHeadP->msgh_reserved = 0; |
| 5999 | |
| 6000 | if ((InHeadP->msgh_id > 3451) || (InHeadP->msgh_id < 3400) || |
| 6001 | ((routine = task_subsystem.routine[InHeadP->msgh_id - 3400].stub_routine) == 0)) { |
| 6002 | ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record; |
| 6003 | ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID; |
| 6004 | return FALSE; |
| 6005 | } |
| 6006 | (*routine) (InHeadP, OutHeadP); |
| 6007 | return TRUE; |
| 6008 | } |
| 6009 | |
| 6010 | mig_external mig_routine_t task_server_routine |
| 6011 | (mach_msg_header_t *InHeadP) |
| 6012 | { |
| 6013 | register int msgh_id; |
| 6014 | |
| 6015 | msgh_id = InHeadP->msgh_id - 3400; |
| 6016 | |
| 6017 | if ((msgh_id > 51) || (msgh_id < 0)) |
| 6018 | return 0; |
| 6019 | |
| 6020 | return task_subsystem.routine[msgh_id].stub_routine; |
| 6021 | } |
| 6022 | |