| 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 processor_set */ |
| 10 | |
| 11 | #define __MIG_check__Request__processor_set_subsystem__ 1 |
| 12 | |
| 13 | #include "processor_set_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 _Xprocessor_set_statistics |
| 99 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 100 | |
| 101 | mig_internal novalue _Xprocessor_set_destroy |
| 102 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 103 | |
| 104 | mig_internal novalue _Xprocessor_set_max_priority |
| 105 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 106 | |
| 107 | mig_internal novalue _Xprocessor_set_policy_enable |
| 108 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 109 | |
| 110 | mig_internal novalue _Xprocessor_set_policy_disable |
| 111 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 112 | |
| 113 | mig_internal novalue _Xprocessor_set_tasks |
| 114 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 115 | |
| 116 | mig_internal novalue _Xprocessor_set_threads |
| 117 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 118 | |
| 119 | mig_internal novalue _Xprocessor_set_policy_control |
| 120 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 121 | |
| 122 | mig_internal novalue _Xprocessor_set_stack_usage |
| 123 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 124 | |
| 125 | mig_internal novalue _Xprocessor_set_info |
| 126 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 127 | |
| 128 | |
| 129 | #if ( __MigTypeCheck ) |
| 130 | #if __MIG_check__Request__processor_set_subsystem__ |
| 131 | #if !defined(__MIG_check__Request__processor_set_statistics_t__defined) |
| 132 | #define __MIG_check__Request__processor_set_statistics_t__defined |
| 133 | |
| 134 | mig_internal kern_return_t __MIG_check__Request__processor_set_statistics_t(__attribute__((__unused__)) __Request__processor_set_statistics_t *In0P) |
| 135 | { |
| 136 | |
| 137 | typedef __Request__processor_set_statistics_t __Request; |
| 138 | #if __MigTypeCheck |
| 139 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 140 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 141 | return MIG_BAD_ARGUMENTS; |
| 142 | #endif /* __MigTypeCheck */ |
| 143 | |
| 144 | return MACH_MSG_SUCCESS; |
| 145 | } |
| 146 | #endif /* !defined(__MIG_check__Request__processor_set_statistics_t__defined) */ |
| 147 | #endif /* __MIG_check__Request__processor_set_subsystem__ */ |
| 148 | #endif /* ( __MigTypeCheck ) */ |
| 149 | |
| 150 | |
| 151 | /* Routine processor_set_statistics */ |
| 152 | mig_internal novalue _Xprocessor_set_statistics |
| 153 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 154 | { |
| 155 | |
| 156 | #ifdef __MigPackStructs |
| 157 | #pragma pack(4) |
| 158 | #endif |
| 159 | typedef struct { |
| 160 | mach_msg_header_t Head; |
| 161 | NDR_record_t NDR; |
| 162 | processor_set_flavor_t flavor; |
| 163 | mach_msg_type_number_t info_outCnt; |
| 164 | mach_msg_trailer_t trailer; |
| 165 | } Request __attribute__((unused)); |
| 166 | #ifdef __MigPackStructs |
| 167 | #pragma pack() |
| 168 | #endif |
| 169 | typedef __Request__processor_set_statistics_t __Request; |
| 170 | typedef __Reply__processor_set_statistics_t Reply __attribute__((unused)); |
| 171 | |
| 172 | /* |
| 173 | * typedef struct { |
| 174 | * mach_msg_header_t Head; |
| 175 | * NDR_record_t NDR; |
| 176 | * kern_return_t RetCode; |
| 177 | * } mig_reply_error_t; |
| 178 | */ |
| 179 | |
| 180 | Request *In0P = (Request *) InHeadP; |
| 181 | Reply *OutP = (Reply *) OutHeadP; |
| 182 | #ifdef __MIG_check__Request__processor_set_statistics_t__defined |
| 183 | kern_return_t check_result; |
| 184 | #endif /* __MIG_check__Request__processor_set_statistics_t__defined */ |
| 185 | |
| 186 | #if __MigKernelSpecificCode |
| 187 | #else |
| 188 | #endif /* __MigKernelSpecificCode */ |
| 189 | processor_set_name_t pset; |
| 190 | |
| 191 | __DeclareRcvRpc(4000, "processor_set_statistics" ) |
| 192 | __BeforeRcvRpc(4000, "processor_set_statistics" ) |
| 193 | |
| 194 | #if defined(__MIG_check__Request__processor_set_statistics_t__defined) |
| 195 | check_result = __MIG_check__Request__processor_set_statistics_t((__Request *)In0P); |
| 196 | if (check_result != MACH_MSG_SUCCESS) |
| 197 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 198 | #endif /* defined(__MIG_check__Request__processor_set_statistics_t__defined) */ |
| 199 | |
| 200 | pset = convert_port_to_pset_name(In0P->Head.msgh_request_port); |
| 201 | |
| 202 | OutP->info_outCnt = 5; |
| 203 | if (In0P->info_outCnt < OutP->info_outCnt) |
| 204 | OutP->info_outCnt = In0P->info_outCnt; |
| 205 | |
| 206 | OutP->RetCode = processor_set_statistics(pset, In0P->flavor, OutP->info_out, &OutP->info_outCnt); |
| 207 | pset_deallocate(pset); |
| 208 | if (OutP->RetCode != KERN_SUCCESS) { |
| 209 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 210 | } |
| 211 | #if __MigKernelSpecificCode |
| 212 | #endif /* __MigKernelSpecificCode */ |
| 213 | |
| 214 | OutP->NDR = NDR_record; |
| 215 | |
| 216 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 20) + (((4 * OutP->info_outCnt))); |
| 217 | |
| 218 | __AfterRcvRpc(4000, "processor_set_statistics" ) |
| 219 | } |
| 220 | |
| 221 | #if ( __MigTypeCheck ) |
| 222 | #if __MIG_check__Request__processor_set_subsystem__ |
| 223 | #if !defined(__MIG_check__Request__processor_set_destroy_t__defined) |
| 224 | #define __MIG_check__Request__processor_set_destroy_t__defined |
| 225 | |
| 226 | mig_internal kern_return_t __MIG_check__Request__processor_set_destroy_t(__attribute__((__unused__)) __Request__processor_set_destroy_t *In0P) |
| 227 | { |
| 228 | |
| 229 | typedef __Request__processor_set_destroy_t __Request; |
| 230 | #if __MigTypeCheck |
| 231 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 232 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 233 | return MIG_BAD_ARGUMENTS; |
| 234 | #endif /* __MigTypeCheck */ |
| 235 | |
| 236 | return MACH_MSG_SUCCESS; |
| 237 | } |
| 238 | #endif /* !defined(__MIG_check__Request__processor_set_destroy_t__defined) */ |
| 239 | #endif /* __MIG_check__Request__processor_set_subsystem__ */ |
| 240 | #endif /* ( __MigTypeCheck ) */ |
| 241 | |
| 242 | |
| 243 | /* Routine processor_set_destroy */ |
| 244 | mig_internal novalue _Xprocessor_set_destroy |
| 245 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 246 | { |
| 247 | |
| 248 | #ifdef __MigPackStructs |
| 249 | #pragma pack(4) |
| 250 | #endif |
| 251 | typedef struct { |
| 252 | mach_msg_header_t Head; |
| 253 | mach_msg_trailer_t trailer; |
| 254 | } Request __attribute__((unused)); |
| 255 | #ifdef __MigPackStructs |
| 256 | #pragma pack() |
| 257 | #endif |
| 258 | typedef __Request__processor_set_destroy_t __Request; |
| 259 | typedef __Reply__processor_set_destroy_t Reply __attribute__((unused)); |
| 260 | |
| 261 | /* |
| 262 | * typedef struct { |
| 263 | * mach_msg_header_t Head; |
| 264 | * NDR_record_t NDR; |
| 265 | * kern_return_t RetCode; |
| 266 | * } mig_reply_error_t; |
| 267 | */ |
| 268 | |
| 269 | Request *In0P = (Request *) InHeadP; |
| 270 | Reply *OutP = (Reply *) OutHeadP; |
| 271 | #ifdef __MIG_check__Request__processor_set_destroy_t__defined |
| 272 | kern_return_t check_result; |
| 273 | #endif /* __MIG_check__Request__processor_set_destroy_t__defined */ |
| 274 | |
| 275 | #if __MigKernelSpecificCode |
| 276 | #else |
| 277 | #endif /* __MigKernelSpecificCode */ |
| 278 | processor_set_t set; |
| 279 | |
| 280 | __DeclareRcvRpc(4001, "processor_set_destroy" ) |
| 281 | __BeforeRcvRpc(4001, "processor_set_destroy" ) |
| 282 | |
| 283 | #if defined(__MIG_check__Request__processor_set_destroy_t__defined) |
| 284 | check_result = __MIG_check__Request__processor_set_destroy_t((__Request *)In0P); |
| 285 | if (check_result != MACH_MSG_SUCCESS) |
| 286 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 287 | #endif /* defined(__MIG_check__Request__processor_set_destroy_t__defined) */ |
| 288 | |
| 289 | set = convert_port_to_pset(In0P->Head.msgh_request_port); |
| 290 | |
| 291 | OutP->RetCode = processor_set_destroy(set); |
| 292 | pset_deallocate(set); |
| 293 | #if __MigKernelSpecificCode |
| 294 | #endif /* __MigKernelSpecificCode */ |
| 295 | |
| 296 | OutP->NDR = NDR_record; |
| 297 | |
| 298 | |
| 299 | __AfterRcvRpc(4001, "processor_set_destroy" ) |
| 300 | } |
| 301 | |
| 302 | #if ( __MigTypeCheck ) |
| 303 | #if __MIG_check__Request__processor_set_subsystem__ |
| 304 | #if !defined(__MIG_check__Request__processor_set_max_priority_t__defined) |
| 305 | #define __MIG_check__Request__processor_set_max_priority_t__defined |
| 306 | |
| 307 | mig_internal kern_return_t __MIG_check__Request__processor_set_max_priority_t(__attribute__((__unused__)) __Request__processor_set_max_priority_t *In0P) |
| 308 | { |
| 309 | |
| 310 | typedef __Request__processor_set_max_priority_t __Request; |
| 311 | #if __MigTypeCheck |
| 312 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 313 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 314 | return MIG_BAD_ARGUMENTS; |
| 315 | #endif /* __MigTypeCheck */ |
| 316 | |
| 317 | return MACH_MSG_SUCCESS; |
| 318 | } |
| 319 | #endif /* !defined(__MIG_check__Request__processor_set_max_priority_t__defined) */ |
| 320 | #endif /* __MIG_check__Request__processor_set_subsystem__ */ |
| 321 | #endif /* ( __MigTypeCheck ) */ |
| 322 | |
| 323 | |
| 324 | /* Routine processor_set_max_priority */ |
| 325 | mig_internal novalue _Xprocessor_set_max_priority |
| 326 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 327 | { |
| 328 | |
| 329 | #ifdef __MigPackStructs |
| 330 | #pragma pack(4) |
| 331 | #endif |
| 332 | typedef struct { |
| 333 | mach_msg_header_t Head; |
| 334 | NDR_record_t NDR; |
| 335 | int max_priority; |
| 336 | boolean_t change_threads; |
| 337 | mach_msg_trailer_t trailer; |
| 338 | } Request __attribute__((unused)); |
| 339 | #ifdef __MigPackStructs |
| 340 | #pragma pack() |
| 341 | #endif |
| 342 | typedef __Request__processor_set_max_priority_t __Request; |
| 343 | typedef __Reply__processor_set_max_priority_t Reply __attribute__((unused)); |
| 344 | |
| 345 | /* |
| 346 | * typedef struct { |
| 347 | * mach_msg_header_t Head; |
| 348 | * NDR_record_t NDR; |
| 349 | * kern_return_t RetCode; |
| 350 | * } mig_reply_error_t; |
| 351 | */ |
| 352 | |
| 353 | Request *In0P = (Request *) InHeadP; |
| 354 | Reply *OutP = (Reply *) OutHeadP; |
| 355 | #ifdef __MIG_check__Request__processor_set_max_priority_t__defined |
| 356 | kern_return_t check_result; |
| 357 | #endif /* __MIG_check__Request__processor_set_max_priority_t__defined */ |
| 358 | |
| 359 | #if __MigKernelSpecificCode |
| 360 | #else |
| 361 | #endif /* __MigKernelSpecificCode */ |
| 362 | processor_set_t processor_set; |
| 363 | |
| 364 | __DeclareRcvRpc(4002, "processor_set_max_priority" ) |
| 365 | __BeforeRcvRpc(4002, "processor_set_max_priority" ) |
| 366 | |
| 367 | #if defined(__MIG_check__Request__processor_set_max_priority_t__defined) |
| 368 | check_result = __MIG_check__Request__processor_set_max_priority_t((__Request *)In0P); |
| 369 | if (check_result != MACH_MSG_SUCCESS) |
| 370 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 371 | #endif /* defined(__MIG_check__Request__processor_set_max_priority_t__defined) */ |
| 372 | |
| 373 | processor_set = convert_port_to_pset(In0P->Head.msgh_request_port); |
| 374 | |
| 375 | OutP->RetCode = processor_set_max_priority(processor_set, In0P->max_priority, In0P->change_threads); |
| 376 | pset_deallocate(processor_set); |
| 377 | #if __MigKernelSpecificCode |
| 378 | #endif /* __MigKernelSpecificCode */ |
| 379 | |
| 380 | OutP->NDR = NDR_record; |
| 381 | |
| 382 | |
| 383 | __AfterRcvRpc(4002, "processor_set_max_priority" ) |
| 384 | } |
| 385 | |
| 386 | #if ( __MigTypeCheck ) |
| 387 | #if __MIG_check__Request__processor_set_subsystem__ |
| 388 | #if !defined(__MIG_check__Request__processor_set_policy_enable_t__defined) |
| 389 | #define __MIG_check__Request__processor_set_policy_enable_t__defined |
| 390 | |
| 391 | mig_internal kern_return_t __MIG_check__Request__processor_set_policy_enable_t(__attribute__((__unused__)) __Request__processor_set_policy_enable_t *In0P) |
| 392 | { |
| 393 | |
| 394 | typedef __Request__processor_set_policy_enable_t __Request; |
| 395 | #if __MigTypeCheck |
| 396 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 397 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 398 | return MIG_BAD_ARGUMENTS; |
| 399 | #endif /* __MigTypeCheck */ |
| 400 | |
| 401 | return MACH_MSG_SUCCESS; |
| 402 | } |
| 403 | #endif /* !defined(__MIG_check__Request__processor_set_policy_enable_t__defined) */ |
| 404 | #endif /* __MIG_check__Request__processor_set_subsystem__ */ |
| 405 | #endif /* ( __MigTypeCheck ) */ |
| 406 | |
| 407 | |
| 408 | /* Routine processor_set_policy_enable */ |
| 409 | mig_internal novalue _Xprocessor_set_policy_enable |
| 410 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 411 | { |
| 412 | |
| 413 | #ifdef __MigPackStructs |
| 414 | #pragma pack(4) |
| 415 | #endif |
| 416 | typedef struct { |
| 417 | mach_msg_header_t Head; |
| 418 | NDR_record_t NDR; |
| 419 | int policy; |
| 420 | mach_msg_trailer_t trailer; |
| 421 | } Request __attribute__((unused)); |
| 422 | #ifdef __MigPackStructs |
| 423 | #pragma pack() |
| 424 | #endif |
| 425 | typedef __Request__processor_set_policy_enable_t __Request; |
| 426 | typedef __Reply__processor_set_policy_enable_t Reply __attribute__((unused)); |
| 427 | |
| 428 | /* |
| 429 | * typedef struct { |
| 430 | * mach_msg_header_t Head; |
| 431 | * NDR_record_t NDR; |
| 432 | * kern_return_t RetCode; |
| 433 | * } mig_reply_error_t; |
| 434 | */ |
| 435 | |
| 436 | Request *In0P = (Request *) InHeadP; |
| 437 | Reply *OutP = (Reply *) OutHeadP; |
| 438 | #ifdef __MIG_check__Request__processor_set_policy_enable_t__defined |
| 439 | kern_return_t check_result; |
| 440 | #endif /* __MIG_check__Request__processor_set_policy_enable_t__defined */ |
| 441 | |
| 442 | #if __MigKernelSpecificCode |
| 443 | #else |
| 444 | #endif /* __MigKernelSpecificCode */ |
| 445 | processor_set_t processor_set; |
| 446 | |
| 447 | __DeclareRcvRpc(4003, "processor_set_policy_enable" ) |
| 448 | __BeforeRcvRpc(4003, "processor_set_policy_enable" ) |
| 449 | |
| 450 | #if defined(__MIG_check__Request__processor_set_policy_enable_t__defined) |
| 451 | check_result = __MIG_check__Request__processor_set_policy_enable_t((__Request *)In0P); |
| 452 | if (check_result != MACH_MSG_SUCCESS) |
| 453 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 454 | #endif /* defined(__MIG_check__Request__processor_set_policy_enable_t__defined) */ |
| 455 | |
| 456 | processor_set = convert_port_to_pset(In0P->Head.msgh_request_port); |
| 457 | |
| 458 | OutP->RetCode = processor_set_policy_enable(processor_set, In0P->policy); |
| 459 | pset_deallocate(processor_set); |
| 460 | #if __MigKernelSpecificCode |
| 461 | #endif /* __MigKernelSpecificCode */ |
| 462 | |
| 463 | OutP->NDR = NDR_record; |
| 464 | |
| 465 | |
| 466 | __AfterRcvRpc(4003, "processor_set_policy_enable" ) |
| 467 | } |
| 468 | |
| 469 | #if ( __MigTypeCheck ) |
| 470 | #if __MIG_check__Request__processor_set_subsystem__ |
| 471 | #if !defined(__MIG_check__Request__processor_set_policy_disable_t__defined) |
| 472 | #define __MIG_check__Request__processor_set_policy_disable_t__defined |
| 473 | |
| 474 | mig_internal kern_return_t __MIG_check__Request__processor_set_policy_disable_t(__attribute__((__unused__)) __Request__processor_set_policy_disable_t *In0P) |
| 475 | { |
| 476 | |
| 477 | typedef __Request__processor_set_policy_disable_t __Request; |
| 478 | #if __MigTypeCheck |
| 479 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 480 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 481 | return MIG_BAD_ARGUMENTS; |
| 482 | #endif /* __MigTypeCheck */ |
| 483 | |
| 484 | return MACH_MSG_SUCCESS; |
| 485 | } |
| 486 | #endif /* !defined(__MIG_check__Request__processor_set_policy_disable_t__defined) */ |
| 487 | #endif /* __MIG_check__Request__processor_set_subsystem__ */ |
| 488 | #endif /* ( __MigTypeCheck ) */ |
| 489 | |
| 490 | |
| 491 | /* Routine processor_set_policy_disable */ |
| 492 | mig_internal novalue _Xprocessor_set_policy_disable |
| 493 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 494 | { |
| 495 | |
| 496 | #ifdef __MigPackStructs |
| 497 | #pragma pack(4) |
| 498 | #endif |
| 499 | typedef struct { |
| 500 | mach_msg_header_t Head; |
| 501 | NDR_record_t NDR; |
| 502 | int policy; |
| 503 | boolean_t change_threads; |
| 504 | mach_msg_trailer_t trailer; |
| 505 | } Request __attribute__((unused)); |
| 506 | #ifdef __MigPackStructs |
| 507 | #pragma pack() |
| 508 | #endif |
| 509 | typedef __Request__processor_set_policy_disable_t __Request; |
| 510 | typedef __Reply__processor_set_policy_disable_t Reply __attribute__((unused)); |
| 511 | |
| 512 | /* |
| 513 | * typedef struct { |
| 514 | * mach_msg_header_t Head; |
| 515 | * NDR_record_t NDR; |
| 516 | * kern_return_t RetCode; |
| 517 | * } mig_reply_error_t; |
| 518 | */ |
| 519 | |
| 520 | Request *In0P = (Request *) InHeadP; |
| 521 | Reply *OutP = (Reply *) OutHeadP; |
| 522 | #ifdef __MIG_check__Request__processor_set_policy_disable_t__defined |
| 523 | kern_return_t check_result; |
| 524 | #endif /* __MIG_check__Request__processor_set_policy_disable_t__defined */ |
| 525 | |
| 526 | #if __MigKernelSpecificCode |
| 527 | #else |
| 528 | #endif /* __MigKernelSpecificCode */ |
| 529 | processor_set_t processor_set; |
| 530 | |
| 531 | __DeclareRcvRpc(4004, "processor_set_policy_disable" ) |
| 532 | __BeforeRcvRpc(4004, "processor_set_policy_disable" ) |
| 533 | |
| 534 | #if defined(__MIG_check__Request__processor_set_policy_disable_t__defined) |
| 535 | check_result = __MIG_check__Request__processor_set_policy_disable_t((__Request *)In0P); |
| 536 | if (check_result != MACH_MSG_SUCCESS) |
| 537 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 538 | #endif /* defined(__MIG_check__Request__processor_set_policy_disable_t__defined) */ |
| 539 | |
| 540 | processor_set = convert_port_to_pset(In0P->Head.msgh_request_port); |
| 541 | |
| 542 | OutP->RetCode = processor_set_policy_disable(processor_set, In0P->policy, In0P->change_threads); |
| 543 | pset_deallocate(processor_set); |
| 544 | #if __MigKernelSpecificCode |
| 545 | #endif /* __MigKernelSpecificCode */ |
| 546 | |
| 547 | OutP->NDR = NDR_record; |
| 548 | |
| 549 | |
| 550 | __AfterRcvRpc(4004, "processor_set_policy_disable" ) |
| 551 | } |
| 552 | |
| 553 | #if ( __MigTypeCheck ) |
| 554 | #if __MIG_check__Request__processor_set_subsystem__ |
| 555 | #if !defined(__MIG_check__Request__processor_set_tasks_t__defined) |
| 556 | #define __MIG_check__Request__processor_set_tasks_t__defined |
| 557 | |
| 558 | mig_internal kern_return_t __MIG_check__Request__processor_set_tasks_t(__attribute__((__unused__)) __Request__processor_set_tasks_t *In0P) |
| 559 | { |
| 560 | |
| 561 | typedef __Request__processor_set_tasks_t __Request; |
| 562 | #if __MigTypeCheck |
| 563 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 564 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 565 | return MIG_BAD_ARGUMENTS; |
| 566 | #endif /* __MigTypeCheck */ |
| 567 | |
| 568 | return MACH_MSG_SUCCESS; |
| 569 | } |
| 570 | #endif /* !defined(__MIG_check__Request__processor_set_tasks_t__defined) */ |
| 571 | #endif /* __MIG_check__Request__processor_set_subsystem__ */ |
| 572 | #endif /* ( __MigTypeCheck ) */ |
| 573 | |
| 574 | |
| 575 | /* Routine processor_set_tasks */ |
| 576 | mig_internal novalue _Xprocessor_set_tasks |
| 577 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 578 | { |
| 579 | |
| 580 | #ifdef __MigPackStructs |
| 581 | #pragma pack(4) |
| 582 | #endif |
| 583 | typedef struct { |
| 584 | mach_msg_header_t Head; |
| 585 | mach_msg_trailer_t trailer; |
| 586 | } Request __attribute__((unused)); |
| 587 | #ifdef __MigPackStructs |
| 588 | #pragma pack() |
| 589 | #endif |
| 590 | typedef __Request__processor_set_tasks_t __Request; |
| 591 | typedef __Reply__processor_set_tasks_t Reply __attribute__((unused)); |
| 592 | |
| 593 | /* |
| 594 | * typedef struct { |
| 595 | * mach_msg_header_t Head; |
| 596 | * NDR_record_t NDR; |
| 597 | * kern_return_t RetCode; |
| 598 | * } mig_reply_error_t; |
| 599 | */ |
| 600 | |
| 601 | Request *In0P = (Request *) InHeadP; |
| 602 | Reply *OutP = (Reply *) OutHeadP; |
| 603 | #ifdef __MIG_check__Request__processor_set_tasks_t__defined |
| 604 | kern_return_t check_result; |
| 605 | #endif /* __MIG_check__Request__processor_set_tasks_t__defined */ |
| 606 | |
| 607 | #if __MigKernelSpecificCode |
| 608 | #if UseStaticTemplates |
| 609 | const static mach_msg_ool_ports_descriptor_t task_listTemplate = { |
| 610 | /* addr = */ (void *)0, |
| 611 | /* coun = */ 0, |
| 612 | /* deal = */ FALSE, |
| 613 | /* copy is meaningful only in overwrite mode */ |
| 614 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
| 615 | /* disp = */ 17, |
| 616 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
| 617 | }; |
| 618 | #endif /* UseStaticTemplates */ |
| 619 | |
| 620 | #else |
| 621 | #if UseStaticTemplates |
| 622 | const static mach_msg_ool_ports_descriptor_t task_listTemplate = { |
| 623 | /* addr = */ (void *)0, |
| 624 | /* coun = */ 0, |
| 625 | /* deal = */ FALSE, |
| 626 | /* copy is meaningful only in overwrite mode */ |
| 627 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
| 628 | /* disp = */ 19, |
| 629 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
| 630 | }; |
| 631 | #endif /* UseStaticTemplates */ |
| 632 | |
| 633 | #endif /* __MigKernelSpecificCode */ |
| 634 | kern_return_t RetCode; |
| 635 | processor_set_t processor_set; |
| 636 | |
| 637 | __DeclareRcvRpc(4005, "processor_set_tasks" ) |
| 638 | __BeforeRcvRpc(4005, "processor_set_tasks" ) |
| 639 | |
| 640 | #if defined(__MIG_check__Request__processor_set_tasks_t__defined) |
| 641 | check_result = __MIG_check__Request__processor_set_tasks_t((__Request *)In0P); |
| 642 | if (check_result != MACH_MSG_SUCCESS) |
| 643 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 644 | #endif /* defined(__MIG_check__Request__processor_set_tasks_t__defined) */ |
| 645 | |
| 646 | #if UseStaticTemplates |
| 647 | OutP->task_list = task_listTemplate; |
| 648 | #else /* UseStaticTemplates */ |
| 649 | #if __MigKernelSpecificCode |
| 650 | OutP->task_list.disposition = 17; |
| 651 | #else |
| 652 | OutP->task_list.disposition = 19; |
| 653 | #endif /* __MigKernelSpecificCode */ |
| 654 | OutP->task_list.deallocate = FALSE; |
| 655 | OutP->task_list.type = MACH_MSG_OOL_PORTS_DESCRIPTOR; |
| 656 | #endif /* UseStaticTemplates */ |
| 657 | |
| 658 | |
| 659 | processor_set = convert_port_to_pset(In0P->Head.msgh_request_port); |
| 660 | |
| 661 | RetCode = processor_set_tasks(processor_set, (task_array_t *)&(OutP->task_list.address), &OutP->task_listCnt); |
| 662 | pset_deallocate(processor_set); |
| 663 | if (RetCode != KERN_SUCCESS) { |
| 664 | MIG_RETURN_ERROR(OutP, RetCode); |
| 665 | } |
| 666 | #if __MigKernelSpecificCode |
| 667 | #endif /* __MigKernelSpecificCode */ |
| 668 | OutP->task_list.count = OutP->task_listCnt; |
| 669 | |
| 670 | |
| 671 | OutP->NDR = NDR_record; |
| 672 | |
| 673 | |
| 674 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 675 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 676 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 677 | __AfterRcvRpc(4005, "processor_set_tasks" ) |
| 678 | } |
| 679 | |
| 680 | #if ( __MigTypeCheck ) |
| 681 | #if __MIG_check__Request__processor_set_subsystem__ |
| 682 | #if !defined(__MIG_check__Request__processor_set_threads_t__defined) |
| 683 | #define __MIG_check__Request__processor_set_threads_t__defined |
| 684 | |
| 685 | mig_internal kern_return_t __MIG_check__Request__processor_set_threads_t(__attribute__((__unused__)) __Request__processor_set_threads_t *In0P) |
| 686 | { |
| 687 | |
| 688 | typedef __Request__processor_set_threads_t __Request; |
| 689 | #if __MigTypeCheck |
| 690 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 691 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 692 | return MIG_BAD_ARGUMENTS; |
| 693 | #endif /* __MigTypeCheck */ |
| 694 | |
| 695 | return MACH_MSG_SUCCESS; |
| 696 | } |
| 697 | #endif /* !defined(__MIG_check__Request__processor_set_threads_t__defined) */ |
| 698 | #endif /* __MIG_check__Request__processor_set_subsystem__ */ |
| 699 | #endif /* ( __MigTypeCheck ) */ |
| 700 | |
| 701 | |
| 702 | /* Routine processor_set_threads */ |
| 703 | mig_internal novalue _Xprocessor_set_threads |
| 704 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 705 | { |
| 706 | |
| 707 | #ifdef __MigPackStructs |
| 708 | #pragma pack(4) |
| 709 | #endif |
| 710 | typedef struct { |
| 711 | mach_msg_header_t Head; |
| 712 | mach_msg_trailer_t trailer; |
| 713 | } Request __attribute__((unused)); |
| 714 | #ifdef __MigPackStructs |
| 715 | #pragma pack() |
| 716 | #endif |
| 717 | typedef __Request__processor_set_threads_t __Request; |
| 718 | typedef __Reply__processor_set_threads_t Reply __attribute__((unused)); |
| 719 | |
| 720 | /* |
| 721 | * typedef struct { |
| 722 | * mach_msg_header_t Head; |
| 723 | * NDR_record_t NDR; |
| 724 | * kern_return_t RetCode; |
| 725 | * } mig_reply_error_t; |
| 726 | */ |
| 727 | |
| 728 | Request *In0P = (Request *) InHeadP; |
| 729 | Reply *OutP = (Reply *) OutHeadP; |
| 730 | #ifdef __MIG_check__Request__processor_set_threads_t__defined |
| 731 | kern_return_t check_result; |
| 732 | #endif /* __MIG_check__Request__processor_set_threads_t__defined */ |
| 733 | |
| 734 | #if __MigKernelSpecificCode |
| 735 | #if UseStaticTemplates |
| 736 | const static mach_msg_ool_ports_descriptor_t thread_listTemplate = { |
| 737 | /* addr = */ (void *)0, |
| 738 | /* coun = */ 0, |
| 739 | /* deal = */ FALSE, |
| 740 | /* copy is meaningful only in overwrite mode */ |
| 741 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
| 742 | /* disp = */ 17, |
| 743 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
| 744 | }; |
| 745 | #endif /* UseStaticTemplates */ |
| 746 | |
| 747 | #else |
| 748 | #if UseStaticTemplates |
| 749 | const static mach_msg_ool_ports_descriptor_t thread_listTemplate = { |
| 750 | /* addr = */ (void *)0, |
| 751 | /* coun = */ 0, |
| 752 | /* deal = */ FALSE, |
| 753 | /* copy is meaningful only in overwrite mode */ |
| 754 | /* copy = */ MACH_MSG_PHYSICAL_COPY, |
| 755 | /* disp = */ 19, |
| 756 | /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR, |
| 757 | }; |
| 758 | #endif /* UseStaticTemplates */ |
| 759 | |
| 760 | #endif /* __MigKernelSpecificCode */ |
| 761 | kern_return_t RetCode; |
| 762 | processor_set_t processor_set; |
| 763 | |
| 764 | __DeclareRcvRpc(4006, "processor_set_threads" ) |
| 765 | __BeforeRcvRpc(4006, "processor_set_threads" ) |
| 766 | |
| 767 | #if defined(__MIG_check__Request__processor_set_threads_t__defined) |
| 768 | check_result = __MIG_check__Request__processor_set_threads_t((__Request *)In0P); |
| 769 | if (check_result != MACH_MSG_SUCCESS) |
| 770 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 771 | #endif /* defined(__MIG_check__Request__processor_set_threads_t__defined) */ |
| 772 | |
| 773 | #if UseStaticTemplates |
| 774 | OutP->thread_list = thread_listTemplate; |
| 775 | #else /* UseStaticTemplates */ |
| 776 | #if __MigKernelSpecificCode |
| 777 | OutP->thread_list.disposition = 17; |
| 778 | #else |
| 779 | OutP->thread_list.disposition = 19; |
| 780 | #endif /* __MigKernelSpecificCode */ |
| 781 | OutP->thread_list.deallocate = FALSE; |
| 782 | OutP->thread_list.type = MACH_MSG_OOL_PORTS_DESCRIPTOR; |
| 783 | #endif /* UseStaticTemplates */ |
| 784 | |
| 785 | |
| 786 | processor_set = convert_port_to_pset(In0P->Head.msgh_request_port); |
| 787 | |
| 788 | RetCode = processor_set_threads(processor_set, (thread_act_array_t *)&(OutP->thread_list.address), &OutP->thread_listCnt); |
| 789 | pset_deallocate(processor_set); |
| 790 | if (RetCode != KERN_SUCCESS) { |
| 791 | MIG_RETURN_ERROR(OutP, RetCode); |
| 792 | } |
| 793 | #if __MigKernelSpecificCode |
| 794 | #endif /* __MigKernelSpecificCode */ |
| 795 | OutP->thread_list.count = OutP->thread_listCnt; |
| 796 | |
| 797 | |
| 798 | OutP->NDR = NDR_record; |
| 799 | |
| 800 | |
| 801 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 802 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 803 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 804 | __AfterRcvRpc(4006, "processor_set_threads" ) |
| 805 | } |
| 806 | |
| 807 | #if ( __MigTypeCheck ) |
| 808 | #if __MIG_check__Request__processor_set_subsystem__ |
| 809 | #if !defined(__MIG_check__Request__processor_set_policy_control_t__defined) |
| 810 | #define __MIG_check__Request__processor_set_policy_control_t__defined |
| 811 | |
| 812 | mig_internal kern_return_t __MIG_check__Request__processor_set_policy_control_t(__attribute__((__unused__)) __Request__processor_set_policy_control_t *In0P, __attribute__((__unused__)) __Request__processor_set_policy_control_t **In1PP) |
| 813 | { |
| 814 | |
| 815 | typedef __Request__processor_set_policy_control_t __Request; |
| 816 | __Request *In1P; |
| 817 | #if __MigTypeCheck |
| 818 | unsigned int msgh_size; |
| 819 | #endif /* __MigTypeCheck */ |
| 820 | unsigned int msgh_size_delta; |
| 821 | |
| 822 | #if __MigTypeCheck |
| 823 | msgh_size = In0P->Head.msgh_size; |
| 824 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 825 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 20)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 826 | return MIG_BAD_ARGUMENTS; |
| 827 | #endif /* __MigTypeCheck */ |
| 828 | |
| 829 | #if defined(__NDR_convert__int_rep__Request__processor_set_policy_control_t__policy_infoCnt__defined) |
| 830 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 831 | __NDR_convert__int_rep__Request__processor_set_policy_control_t__policy_infoCnt(&In0P->policy_infoCnt, In0P->NDR.int_rep); |
| 832 | #endif /* __NDR_convert__int_rep__Request__processor_set_policy_control_t__policy_infoCnt__defined */ |
| 833 | msgh_size_delta = (4 * In0P->policy_infoCnt); |
| 834 | #if __MigTypeCheck |
| 835 | if ( In0P->policy_infoCnt > 5 ) |
| 836 | return MIG_BAD_ARGUMENTS; |
| 837 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 20)) / 4 < In0P->policy_infoCnt) || |
| 838 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 20) + (4 * In0P->policy_infoCnt))) |
| 839 | return MIG_BAD_ARGUMENTS; |
| 840 | #endif /* __MigTypeCheck */ |
| 841 | |
| 842 | *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 20); |
| 843 | |
| 844 | return MACH_MSG_SUCCESS; |
| 845 | } |
| 846 | #endif /* !defined(__MIG_check__Request__processor_set_policy_control_t__defined) */ |
| 847 | #endif /* __MIG_check__Request__processor_set_subsystem__ */ |
| 848 | #endif /* ( __MigTypeCheck ) */ |
| 849 | |
| 850 | |
| 851 | /* Routine processor_set_policy_control */ |
| 852 | mig_internal novalue _Xprocessor_set_policy_control |
| 853 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 854 | { |
| 855 | |
| 856 | #ifdef __MigPackStructs |
| 857 | #pragma pack(4) |
| 858 | #endif |
| 859 | typedef struct { |
| 860 | mach_msg_header_t Head; |
| 861 | NDR_record_t NDR; |
| 862 | processor_set_flavor_t flavor; |
| 863 | mach_msg_type_number_t policy_infoCnt; |
| 864 | integer_t policy_info[5]; |
| 865 | boolean_t change; |
| 866 | mach_msg_trailer_t trailer; |
| 867 | } Request __attribute__((unused)); |
| 868 | #ifdef __MigPackStructs |
| 869 | #pragma pack() |
| 870 | #endif |
| 871 | typedef __Request__processor_set_policy_control_t __Request; |
| 872 | typedef __Reply__processor_set_policy_control_t Reply __attribute__((unused)); |
| 873 | |
| 874 | /* |
| 875 | * typedef struct { |
| 876 | * mach_msg_header_t Head; |
| 877 | * NDR_record_t NDR; |
| 878 | * kern_return_t RetCode; |
| 879 | * } mig_reply_error_t; |
| 880 | */ |
| 881 | |
| 882 | Request *In0P = (Request *) InHeadP; |
| 883 | Request *In1P; |
| 884 | Reply *OutP = (Reply *) OutHeadP; |
| 885 | #ifdef __MIG_check__Request__processor_set_policy_control_t__defined |
| 886 | kern_return_t check_result; |
| 887 | #endif /* __MIG_check__Request__processor_set_policy_control_t__defined */ |
| 888 | |
| 889 | #if __MigKernelSpecificCode |
| 890 | #else |
| 891 | #endif /* __MigKernelSpecificCode */ |
| 892 | processor_set_t pset; |
| 893 | |
| 894 | __DeclareRcvRpc(4007, "processor_set_policy_control" ) |
| 895 | __BeforeRcvRpc(4007, "processor_set_policy_control" ) |
| 896 | |
| 897 | #if defined(__MIG_check__Request__processor_set_policy_control_t__defined) |
| 898 | check_result = __MIG_check__Request__processor_set_policy_control_t((__Request *)In0P, (__Request **)&In1P); |
| 899 | if (check_result != MACH_MSG_SUCCESS) |
| 900 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 901 | #endif /* defined(__MIG_check__Request__processor_set_policy_control_t__defined) */ |
| 902 | |
| 903 | pset = convert_port_to_pset(In0P->Head.msgh_request_port); |
| 904 | |
| 905 | OutP->RetCode = processor_set_policy_control(pset, In0P->flavor, In0P->policy_info, In0P->policy_infoCnt, In1P->change); |
| 906 | pset_deallocate(pset); |
| 907 | #if __MigKernelSpecificCode |
| 908 | #endif /* __MigKernelSpecificCode */ |
| 909 | |
| 910 | OutP->NDR = NDR_record; |
| 911 | |
| 912 | |
| 913 | __AfterRcvRpc(4007, "processor_set_policy_control" ) |
| 914 | } |
| 915 | |
| 916 | #if ( __MigTypeCheck ) |
| 917 | #if __MIG_check__Request__processor_set_subsystem__ |
| 918 | #if !defined(__MIG_check__Request__processor_set_stack_usage_t__defined) |
| 919 | #define __MIG_check__Request__processor_set_stack_usage_t__defined |
| 920 | |
| 921 | mig_internal kern_return_t __MIG_check__Request__processor_set_stack_usage_t(__attribute__((__unused__)) __Request__processor_set_stack_usage_t *In0P) |
| 922 | { |
| 923 | |
| 924 | typedef __Request__processor_set_stack_usage_t __Request; |
| 925 | #if __MigTypeCheck |
| 926 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 927 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 928 | return MIG_BAD_ARGUMENTS; |
| 929 | #endif /* __MigTypeCheck */ |
| 930 | |
| 931 | return MACH_MSG_SUCCESS; |
| 932 | } |
| 933 | #endif /* !defined(__MIG_check__Request__processor_set_stack_usage_t__defined) */ |
| 934 | #endif /* __MIG_check__Request__processor_set_subsystem__ */ |
| 935 | #endif /* ( __MigTypeCheck ) */ |
| 936 | |
| 937 | |
| 938 | /* Routine processor_set_stack_usage */ |
| 939 | mig_internal novalue _Xprocessor_set_stack_usage |
| 940 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 941 | { |
| 942 | |
| 943 | #ifdef __MigPackStructs |
| 944 | #pragma pack(4) |
| 945 | #endif |
| 946 | typedef struct { |
| 947 | mach_msg_header_t Head; |
| 948 | mach_msg_trailer_t trailer; |
| 949 | } Request __attribute__((unused)); |
| 950 | #ifdef __MigPackStructs |
| 951 | #pragma pack() |
| 952 | #endif |
| 953 | typedef __Request__processor_set_stack_usage_t __Request; |
| 954 | typedef __Reply__processor_set_stack_usage_t Reply __attribute__((unused)); |
| 955 | |
| 956 | /* |
| 957 | * typedef struct { |
| 958 | * mach_msg_header_t Head; |
| 959 | * NDR_record_t NDR; |
| 960 | * kern_return_t RetCode; |
| 961 | * } mig_reply_error_t; |
| 962 | */ |
| 963 | |
| 964 | Request *In0P = (Request *) InHeadP; |
| 965 | Reply *OutP = (Reply *) OutHeadP; |
| 966 | #ifdef __MIG_check__Request__processor_set_stack_usage_t__defined |
| 967 | kern_return_t check_result; |
| 968 | #endif /* __MIG_check__Request__processor_set_stack_usage_t__defined */ |
| 969 | |
| 970 | #if __MigKernelSpecificCode |
| 971 | #else |
| 972 | #endif /* __MigKernelSpecificCode */ |
| 973 | processor_set_t pset; |
| 974 | |
| 975 | __DeclareRcvRpc(4008, "processor_set_stack_usage" ) |
| 976 | __BeforeRcvRpc(4008, "processor_set_stack_usage" ) |
| 977 | |
| 978 | #if defined(__MIG_check__Request__processor_set_stack_usage_t__defined) |
| 979 | check_result = __MIG_check__Request__processor_set_stack_usage_t((__Request *)In0P); |
| 980 | if (check_result != MACH_MSG_SUCCESS) |
| 981 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 982 | #endif /* defined(__MIG_check__Request__processor_set_stack_usage_t__defined) */ |
| 983 | |
| 984 | pset = convert_port_to_pset(In0P->Head.msgh_request_port); |
| 985 | |
| 986 | OutP->RetCode = processor_set_stack_usage(pset, &OutP->ltotal, &OutP->space, &OutP->resident, &OutP->maxusage, &OutP->maxstack); |
| 987 | pset_deallocate(pset); |
| 988 | if (OutP->RetCode != KERN_SUCCESS) { |
| 989 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 990 | } |
| 991 | #if __MigKernelSpecificCode |
| 992 | #endif /* __MigKernelSpecificCode */ |
| 993 | |
| 994 | OutP->NDR = NDR_record; |
| 995 | |
| 996 | |
| 997 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 998 | __AfterRcvRpc(4008, "processor_set_stack_usage" ) |
| 999 | } |
| 1000 | |
| 1001 | #if ( __MigTypeCheck ) |
| 1002 | #if __MIG_check__Request__processor_set_subsystem__ |
| 1003 | #if !defined(__MIG_check__Request__processor_set_info_t__defined) |
| 1004 | #define __MIG_check__Request__processor_set_info_t__defined |
| 1005 | |
| 1006 | mig_internal kern_return_t __MIG_check__Request__processor_set_info_t(__attribute__((__unused__)) __Request__processor_set_info_t *In0P) |
| 1007 | { |
| 1008 | |
| 1009 | typedef __Request__processor_set_info_t __Request; |
| 1010 | #if __MigTypeCheck |
| 1011 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 1012 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 1013 | return MIG_BAD_ARGUMENTS; |
| 1014 | #endif /* __MigTypeCheck */ |
| 1015 | |
| 1016 | return MACH_MSG_SUCCESS; |
| 1017 | } |
| 1018 | #endif /* !defined(__MIG_check__Request__processor_set_info_t__defined) */ |
| 1019 | #endif /* __MIG_check__Request__processor_set_subsystem__ */ |
| 1020 | #endif /* ( __MigTypeCheck ) */ |
| 1021 | |
| 1022 | |
| 1023 | /* Routine processor_set_info */ |
| 1024 | mig_internal novalue _Xprocessor_set_info |
| 1025 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1026 | { |
| 1027 | |
| 1028 | #ifdef __MigPackStructs |
| 1029 | #pragma pack(4) |
| 1030 | #endif |
| 1031 | typedef struct { |
| 1032 | mach_msg_header_t Head; |
| 1033 | NDR_record_t NDR; |
| 1034 | int flavor; |
| 1035 | mach_msg_type_number_t info_outCnt; |
| 1036 | mach_msg_trailer_t trailer; |
| 1037 | } Request __attribute__((unused)); |
| 1038 | #ifdef __MigPackStructs |
| 1039 | #pragma pack() |
| 1040 | #endif |
| 1041 | typedef __Request__processor_set_info_t __Request; |
| 1042 | typedef __Reply__processor_set_info_t Reply __attribute__((unused)); |
| 1043 | |
| 1044 | /* |
| 1045 | * typedef struct { |
| 1046 | * mach_msg_header_t Head; |
| 1047 | * NDR_record_t NDR; |
| 1048 | * kern_return_t RetCode; |
| 1049 | * } mig_reply_error_t; |
| 1050 | */ |
| 1051 | |
| 1052 | Request *In0P = (Request *) InHeadP; |
| 1053 | Reply *OutP = (Reply *) OutHeadP; |
| 1054 | #ifdef __MIG_check__Request__processor_set_info_t__defined |
| 1055 | kern_return_t check_result; |
| 1056 | #endif /* __MIG_check__Request__processor_set_info_t__defined */ |
| 1057 | |
| 1058 | #if __MigKernelSpecificCode |
| 1059 | #if UseStaticTemplates |
| 1060 | const static mach_msg_port_descriptor_t hostTemplate = { |
| 1061 | /* name = */ MACH_PORT_NULL, |
| 1062 | /* pad1 = */ 0, |
| 1063 | /* pad2 = */ 0, |
| 1064 | /* disp = */ 17, |
| 1065 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 1066 | }; |
| 1067 | #endif /* UseStaticTemplates */ |
| 1068 | |
| 1069 | #else |
| 1070 | #if UseStaticTemplates |
| 1071 | const static mach_msg_port_descriptor_t hostTemplate = { |
| 1072 | /* name = */ MACH_PORT_NULL, |
| 1073 | /* pad1 = */ 0, |
| 1074 | /* pad2 = */ 0, |
| 1075 | /* disp = */ 19, |
| 1076 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
| 1077 | }; |
| 1078 | #endif /* UseStaticTemplates */ |
| 1079 | |
| 1080 | #endif /* __MigKernelSpecificCode */ |
| 1081 | kern_return_t RetCode; |
| 1082 | processor_set_name_t set_name; |
| 1083 | host_t host; |
| 1084 | |
| 1085 | __DeclareRcvRpc(4009, "processor_set_info" ) |
| 1086 | __BeforeRcvRpc(4009, "processor_set_info" ) |
| 1087 | |
| 1088 | #if defined(__MIG_check__Request__processor_set_info_t__defined) |
| 1089 | check_result = __MIG_check__Request__processor_set_info_t((__Request *)In0P); |
| 1090 | if (check_result != MACH_MSG_SUCCESS) |
| 1091 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 1092 | #endif /* defined(__MIG_check__Request__processor_set_info_t__defined) */ |
| 1093 | |
| 1094 | #if UseStaticTemplates |
| 1095 | OutP->host = hostTemplate; |
| 1096 | #else /* UseStaticTemplates */ |
| 1097 | #if __MigKernelSpecificCode |
| 1098 | OutP->host.disposition = 17; |
| 1099 | #else |
| 1100 | OutP->host.disposition = 19; |
| 1101 | #endif /* __MigKernelSpecificCode */ |
| 1102 | #if !(defined(KERNEL) && defined(__LP64__)) |
| 1103 | OutP->host.pad1 = 0; |
| 1104 | #endif |
| 1105 | OutP->host.pad2 = 0; |
| 1106 | OutP->host.type = MACH_MSG_PORT_DESCRIPTOR; |
| 1107 | #if defined(KERNEL) |
| 1108 | OutP->host.pad_end = 0; |
| 1109 | #endif |
| 1110 | #endif /* UseStaticTemplates */ |
| 1111 | |
| 1112 | |
| 1113 | set_name = convert_port_to_pset_name(In0P->Head.msgh_request_port); |
| 1114 | |
| 1115 | OutP->info_outCnt = 5; |
| 1116 | if (In0P->info_outCnt < OutP->info_outCnt) |
| 1117 | OutP->info_outCnt = In0P->info_outCnt; |
| 1118 | |
| 1119 | RetCode = processor_set_info(set_name, In0P->flavor, &host, OutP->info_out, &OutP->info_outCnt); |
| 1120 | pset_deallocate(set_name); |
| 1121 | if (RetCode != KERN_SUCCESS) { |
| 1122 | MIG_RETURN_ERROR(OutP, RetCode); |
| 1123 | } |
| 1124 | #if __MigKernelSpecificCode |
| 1125 | #endif /* __MigKernelSpecificCode */ |
| 1126 | OutP->host.name = (mach_port_t)convert_host_to_port(host); |
| 1127 | |
| 1128 | |
| 1129 | OutP->NDR = NDR_record; |
| 1130 | |
| 1131 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 20) + (((4 * OutP->info_outCnt))); |
| 1132 | |
| 1133 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; |
| 1134 | OutP->msgh_body.msgh_descriptor_count = 1; |
| 1135 | __AfterRcvRpc(4009, "processor_set_info" ) |
| 1136 | } |
| 1137 | |
| 1138 | |
| 1139 | |
| 1140 | /* Description of this subsystem, for use in direct RPC */ |
| 1141 | const struct processor_set_subsystem processor_set_subsystem = { |
| 1142 | processor_set_server_routine, |
| 1143 | 4000, |
| 1144 | 4010, |
| 1145 | (mach_msg_size_t)sizeof(union __ReplyUnion__processor_set_subsystem), |
| 1146 | (vm_address_t)0, |
| 1147 | { |
| 1148 | { (mig_impl_routine_t) 0, |
| 1149 | (mig_stub_routine_t) _Xprocessor_set_statistics, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__processor_set_statistics_t)}, |
| 1150 | { (mig_impl_routine_t) 0, |
| 1151 | (mig_stub_routine_t) _Xprocessor_set_destroy, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__processor_set_destroy_t)}, |
| 1152 | { (mig_impl_routine_t) 0, |
| 1153 | (mig_stub_routine_t) _Xprocessor_set_max_priority, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__processor_set_max_priority_t)}, |
| 1154 | { (mig_impl_routine_t) 0, |
| 1155 | (mig_stub_routine_t) _Xprocessor_set_policy_enable, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__processor_set_policy_enable_t)}, |
| 1156 | { (mig_impl_routine_t) 0, |
| 1157 | (mig_stub_routine_t) _Xprocessor_set_policy_disable, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__processor_set_policy_disable_t)}, |
| 1158 | { (mig_impl_routine_t) 0, |
| 1159 | (mig_stub_routine_t) _Xprocessor_set_tasks, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__processor_set_tasks_t)}, |
| 1160 | { (mig_impl_routine_t) 0, |
| 1161 | (mig_stub_routine_t) _Xprocessor_set_threads, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__processor_set_threads_t)}, |
| 1162 | { (mig_impl_routine_t) 0, |
| 1163 | (mig_stub_routine_t) _Xprocessor_set_policy_control, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__processor_set_policy_control_t)}, |
| 1164 | { (mig_impl_routine_t) 0, |
| 1165 | (mig_stub_routine_t) _Xprocessor_set_stack_usage, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__processor_set_stack_usage_t)}, |
| 1166 | { (mig_impl_routine_t) 0, |
| 1167 | (mig_stub_routine_t) _Xprocessor_set_info, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__processor_set_info_t)}, |
| 1168 | } |
| 1169 | }; |
| 1170 | |
| 1171 | mig_external boolean_t processor_set_server |
| 1172 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1173 | { |
| 1174 | /* |
| 1175 | * typedef struct { |
| 1176 | * mach_msg_header_t Head; |
| 1177 | * NDR_record_t NDR; |
| 1178 | * kern_return_t RetCode; |
| 1179 | * } mig_reply_error_t; |
| 1180 | */ |
| 1181 | |
| 1182 | register mig_routine_t routine; |
| 1183 | |
| 1184 | OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0); |
| 1185 | OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port; |
| 1186 | /* Minimal size: routine() will update it if different */ |
| 1187 | OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); |
| 1188 | OutHeadP->msgh_local_port = MACH_PORT_NULL; |
| 1189 | OutHeadP->msgh_id = InHeadP->msgh_id + 100; |
| 1190 | OutHeadP->msgh_reserved = 0; |
| 1191 | |
| 1192 | if ((InHeadP->msgh_id > 4009) || (InHeadP->msgh_id < 4000) || |
| 1193 | ((routine = processor_set_subsystem.routine[InHeadP->msgh_id - 4000].stub_routine) == 0)) { |
| 1194 | ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record; |
| 1195 | ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID; |
| 1196 | return FALSE; |
| 1197 | } |
| 1198 | (*routine) (InHeadP, OutHeadP); |
| 1199 | return TRUE; |
| 1200 | } |
| 1201 | |
| 1202 | mig_external mig_routine_t processor_set_server_routine |
| 1203 | (mach_msg_header_t *InHeadP) |
| 1204 | { |
| 1205 | register int msgh_id; |
| 1206 | |
| 1207 | msgh_id = InHeadP->msgh_id - 4000; |
| 1208 | |
| 1209 | if ((msgh_id > 9) || (msgh_id < 0)) |
| 1210 | return 0; |
| 1211 | |
| 1212 | return processor_set_subsystem.routine[msgh_id].stub_routine; |
| 1213 | } |
| 1214 | |