| 1 | #ifndef _processor_set_user_ |
| 2 | #define _processor_set_user_ |
| 3 | |
| 4 | /* Module processor_set */ |
| 5 | |
| 6 | #include <string.h> |
| 7 | #include <mach/ndr.h> |
| 8 | #include <mach/boolean.h> |
| 9 | #include <mach/kern_return.h> |
| 10 | #include <mach/notify.h> |
| 11 | #include <mach/mach_types.h> |
| 12 | #include <mach/message.h> |
| 13 | #include <mach/mig_errors.h> |
| 14 | #include <mach/port.h> |
| 15 | |
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ |
| 17 | |
| 18 | #if defined(__has_include) |
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) |
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL |
| 21 | #define USING_MIG_STRNCPY_ZEROFILL |
| 22 | #endif |
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ |
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ |
| 25 | #ifdef __cplusplus |
| 26 | extern "C" { |
| 27 | #endif |
| 28 | extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); |
| 29 | #ifdef __cplusplus |
| 30 | } |
| 31 | #endif |
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ |
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ |
| 34 | #endif /* __has_include */ |
| 35 | |
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ |
| 37 | |
| 38 | |
| 39 | #ifdef AUTOTEST |
| 40 | #ifndef FUNCTION_PTR_T |
| 41 | #define FUNCTION_PTR_T |
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); |
| 43 | typedef struct { |
| 44 | char *name; |
| 45 | function_ptr_t function; |
| 46 | } function_table_entry; |
| 47 | typedef function_table_entry *function_table_t; |
| 48 | #endif /* FUNCTION_PTR_T */ |
| 49 | #endif /* AUTOTEST */ |
| 50 | |
| 51 | #ifndef processor_set_MSG_COUNT |
| 52 | #define processor_set_MSG_COUNT 10 |
| 53 | #endif /* processor_set_MSG_COUNT */ |
| 54 | |
| 55 | #include <mach/std_types.h> |
| 56 | #include <mach/mig.h> |
| 57 | #include <mach/mig.h> |
| 58 | #include <mach/mach_types.h> |
| 59 | |
| 60 | #ifdef __BeforeMigUserHeader |
| 61 | __BeforeMigUserHeader |
| 62 | #endif /* __BeforeMigUserHeader */ |
| 63 | |
| 64 | #include <sys/cdefs.h> |
| 65 | __BEGIN_DECLS |
| 66 | |
| 67 | |
| 68 | /* Routine processor_set_statistics */ |
| 69 | #ifdef mig_external |
| 70 | mig_external |
| 71 | #else |
| 72 | extern |
| 73 | #endif /* mig_external */ |
| 74 | kern_return_t processor_set_statistics |
| 75 | ( |
| 76 | processor_set_name_t pset, |
| 77 | processor_set_flavor_t flavor, |
| 78 | processor_set_info_t info_out, |
| 79 | mach_msg_type_number_t *info_outCnt |
| 80 | ); |
| 81 | |
| 82 | /* Routine processor_set_destroy */ |
| 83 | #ifdef mig_external |
| 84 | mig_external |
| 85 | #else |
| 86 | extern |
| 87 | #endif /* mig_external */ |
| 88 | kern_return_t processor_set_destroy |
| 89 | ( |
| 90 | processor_set_t set |
| 91 | ); |
| 92 | |
| 93 | /* Routine processor_set_max_priority */ |
| 94 | #ifdef mig_external |
| 95 | mig_external |
| 96 | #else |
| 97 | extern |
| 98 | #endif /* mig_external */ |
| 99 | kern_return_t processor_set_max_priority |
| 100 | ( |
| 101 | processor_set_t processor_set, |
| 102 | int max_priority, |
| 103 | boolean_t change_threads |
| 104 | ); |
| 105 | |
| 106 | /* Routine processor_set_policy_enable */ |
| 107 | #ifdef mig_external |
| 108 | mig_external |
| 109 | #else |
| 110 | extern |
| 111 | #endif /* mig_external */ |
| 112 | kern_return_t processor_set_policy_enable |
| 113 | ( |
| 114 | processor_set_t processor_set, |
| 115 | int policy |
| 116 | ); |
| 117 | |
| 118 | /* Routine processor_set_policy_disable */ |
| 119 | #ifdef mig_external |
| 120 | mig_external |
| 121 | #else |
| 122 | extern |
| 123 | #endif /* mig_external */ |
| 124 | kern_return_t processor_set_policy_disable |
| 125 | ( |
| 126 | processor_set_t processor_set, |
| 127 | int policy, |
| 128 | boolean_t change_threads |
| 129 | ); |
| 130 | |
| 131 | /* Routine processor_set_tasks */ |
| 132 | #ifdef mig_external |
| 133 | mig_external |
| 134 | #else |
| 135 | extern |
| 136 | #endif /* mig_external */ |
| 137 | kern_return_t processor_set_tasks |
| 138 | ( |
| 139 | processor_set_t processor_set, |
| 140 | task_array_t *task_list, |
| 141 | mach_msg_type_number_t *task_listCnt |
| 142 | ); |
| 143 | |
| 144 | /* Routine processor_set_threads */ |
| 145 | #ifdef mig_external |
| 146 | mig_external |
| 147 | #else |
| 148 | extern |
| 149 | #endif /* mig_external */ |
| 150 | kern_return_t processor_set_threads |
| 151 | ( |
| 152 | processor_set_t processor_set, |
| 153 | thread_act_array_t *thread_list, |
| 154 | mach_msg_type_number_t *thread_listCnt |
| 155 | ); |
| 156 | |
| 157 | /* Routine processor_set_policy_control */ |
| 158 | #ifdef mig_external |
| 159 | mig_external |
| 160 | #else |
| 161 | extern |
| 162 | #endif /* mig_external */ |
| 163 | kern_return_t processor_set_policy_control |
| 164 | ( |
| 165 | processor_set_t pset, |
| 166 | processor_set_flavor_t flavor, |
| 167 | processor_set_info_t policy_info, |
| 168 | mach_msg_type_number_t policy_infoCnt, |
| 169 | boolean_t change |
| 170 | ); |
| 171 | |
| 172 | /* Routine processor_set_stack_usage */ |
| 173 | #ifdef mig_external |
| 174 | mig_external |
| 175 | #else |
| 176 | extern |
| 177 | #endif /* mig_external */ |
| 178 | kern_return_t processor_set_stack_usage |
| 179 | ( |
| 180 | processor_set_t pset, |
| 181 | unsigned *ltotal, |
| 182 | vm_size_t *space, |
| 183 | vm_size_t *resident, |
| 184 | vm_size_t *maxusage, |
| 185 | vm_offset_t *maxstack |
| 186 | ); |
| 187 | |
| 188 | /* Routine processor_set_info */ |
| 189 | #ifdef mig_external |
| 190 | mig_external |
| 191 | #else |
| 192 | extern |
| 193 | #endif /* mig_external */ |
| 194 | kern_return_t processor_set_info |
| 195 | ( |
| 196 | processor_set_name_t set_name, |
| 197 | int flavor, |
| 198 | host_t *host, |
| 199 | processor_set_info_t info_out, |
| 200 | mach_msg_type_number_t *info_outCnt |
| 201 | ); |
| 202 | |
| 203 | __END_DECLS |
| 204 | |
| 205 | /********************** Caution **************************/ |
| 206 | /* The following data types should be used to calculate */ |
| 207 | /* maximum message sizes only. The actual message may be */ |
| 208 | /* smaller, and the position of the arguments within the */ |
| 209 | /* message layout may vary from what is presented here. */ |
| 210 | /* For example, if any of the arguments are variable- */ |
| 211 | /* sized, and less than the maximum is sent, the data */ |
| 212 | /* will be packed tight in the actual message to reduce */ |
| 213 | /* the presence of holes. */ |
| 214 | /********************** Caution **************************/ |
| 215 | |
| 216 | /* typedefs for all requests */ |
| 217 | |
| 218 | #ifndef __Request__processor_set_subsystem__defined |
| 219 | #define __Request__processor_set_subsystem__defined |
| 220 | |
| 221 | #ifdef __MigPackStructs |
| 222 | #pragma pack(4) |
| 223 | #endif |
| 224 | typedef struct { |
| 225 | mach_msg_header_t Head; |
| 226 | NDR_record_t NDR; |
| 227 | processor_set_flavor_t flavor; |
| 228 | mach_msg_type_number_t info_outCnt; |
| 229 | } __Request__processor_set_statistics_t __attribute__((unused)); |
| 230 | #ifdef __MigPackStructs |
| 231 | #pragma pack() |
| 232 | #endif |
| 233 | |
| 234 | #ifdef __MigPackStructs |
| 235 | #pragma pack(4) |
| 236 | #endif |
| 237 | typedef struct { |
| 238 | mach_msg_header_t Head; |
| 239 | } __Request__processor_set_destroy_t __attribute__((unused)); |
| 240 | #ifdef __MigPackStructs |
| 241 | #pragma pack() |
| 242 | #endif |
| 243 | |
| 244 | #ifdef __MigPackStructs |
| 245 | #pragma pack(4) |
| 246 | #endif |
| 247 | typedef struct { |
| 248 | mach_msg_header_t Head; |
| 249 | NDR_record_t NDR; |
| 250 | int max_priority; |
| 251 | boolean_t change_threads; |
| 252 | } __Request__processor_set_max_priority_t __attribute__((unused)); |
| 253 | #ifdef __MigPackStructs |
| 254 | #pragma pack() |
| 255 | #endif |
| 256 | |
| 257 | #ifdef __MigPackStructs |
| 258 | #pragma pack(4) |
| 259 | #endif |
| 260 | typedef struct { |
| 261 | mach_msg_header_t Head; |
| 262 | NDR_record_t NDR; |
| 263 | int policy; |
| 264 | } __Request__processor_set_policy_enable_t __attribute__((unused)); |
| 265 | #ifdef __MigPackStructs |
| 266 | #pragma pack() |
| 267 | #endif |
| 268 | |
| 269 | #ifdef __MigPackStructs |
| 270 | #pragma pack(4) |
| 271 | #endif |
| 272 | typedef struct { |
| 273 | mach_msg_header_t Head; |
| 274 | NDR_record_t NDR; |
| 275 | int policy; |
| 276 | boolean_t change_threads; |
| 277 | } __Request__processor_set_policy_disable_t __attribute__((unused)); |
| 278 | #ifdef __MigPackStructs |
| 279 | #pragma pack() |
| 280 | #endif |
| 281 | |
| 282 | #ifdef __MigPackStructs |
| 283 | #pragma pack(4) |
| 284 | #endif |
| 285 | typedef struct { |
| 286 | mach_msg_header_t Head; |
| 287 | } __Request__processor_set_tasks_t __attribute__((unused)); |
| 288 | #ifdef __MigPackStructs |
| 289 | #pragma pack() |
| 290 | #endif |
| 291 | |
| 292 | #ifdef __MigPackStructs |
| 293 | #pragma pack(4) |
| 294 | #endif |
| 295 | typedef struct { |
| 296 | mach_msg_header_t Head; |
| 297 | } __Request__processor_set_threads_t __attribute__((unused)); |
| 298 | #ifdef __MigPackStructs |
| 299 | #pragma pack() |
| 300 | #endif |
| 301 | |
| 302 | #ifdef __MigPackStructs |
| 303 | #pragma pack(4) |
| 304 | #endif |
| 305 | typedef struct { |
| 306 | mach_msg_header_t Head; |
| 307 | NDR_record_t NDR; |
| 308 | processor_set_flavor_t flavor; |
| 309 | mach_msg_type_number_t policy_infoCnt; |
| 310 | integer_t policy_info[5]; |
| 311 | boolean_t change; |
| 312 | } __Request__processor_set_policy_control_t __attribute__((unused)); |
| 313 | #ifdef __MigPackStructs |
| 314 | #pragma pack() |
| 315 | #endif |
| 316 | |
| 317 | #ifdef __MigPackStructs |
| 318 | #pragma pack(4) |
| 319 | #endif |
| 320 | typedef struct { |
| 321 | mach_msg_header_t Head; |
| 322 | } __Request__processor_set_stack_usage_t __attribute__((unused)); |
| 323 | #ifdef __MigPackStructs |
| 324 | #pragma pack() |
| 325 | #endif |
| 326 | |
| 327 | #ifdef __MigPackStructs |
| 328 | #pragma pack(4) |
| 329 | #endif |
| 330 | typedef struct { |
| 331 | mach_msg_header_t Head; |
| 332 | NDR_record_t NDR; |
| 333 | int flavor; |
| 334 | mach_msg_type_number_t info_outCnt; |
| 335 | } __Request__processor_set_info_t __attribute__((unused)); |
| 336 | #ifdef __MigPackStructs |
| 337 | #pragma pack() |
| 338 | #endif |
| 339 | #endif /* !__Request__processor_set_subsystem__defined */ |
| 340 | |
| 341 | /* union of all requests */ |
| 342 | |
| 343 | #ifndef __RequestUnion__processor_set_subsystem__defined |
| 344 | #define __RequestUnion__processor_set_subsystem__defined |
| 345 | union __RequestUnion__processor_set_subsystem { |
| 346 | __Request__processor_set_statistics_t Request_processor_set_statistics; |
| 347 | __Request__processor_set_destroy_t Request_processor_set_destroy; |
| 348 | __Request__processor_set_max_priority_t Request_processor_set_max_priority; |
| 349 | __Request__processor_set_policy_enable_t Request_processor_set_policy_enable; |
| 350 | __Request__processor_set_policy_disable_t Request_processor_set_policy_disable; |
| 351 | __Request__processor_set_tasks_t Request_processor_set_tasks; |
| 352 | __Request__processor_set_threads_t Request_processor_set_threads; |
| 353 | __Request__processor_set_policy_control_t Request_processor_set_policy_control; |
| 354 | __Request__processor_set_stack_usage_t Request_processor_set_stack_usage; |
| 355 | __Request__processor_set_info_t Request_processor_set_info; |
| 356 | }; |
| 357 | #endif /* !__RequestUnion__processor_set_subsystem__defined */ |
| 358 | /* typedefs for all replies */ |
| 359 | |
| 360 | #ifndef __Reply__processor_set_subsystem__defined |
| 361 | #define __Reply__processor_set_subsystem__defined |
| 362 | |
| 363 | #ifdef __MigPackStructs |
| 364 | #pragma pack(4) |
| 365 | #endif |
| 366 | typedef struct { |
| 367 | mach_msg_header_t Head; |
| 368 | NDR_record_t NDR; |
| 369 | kern_return_t RetCode; |
| 370 | mach_msg_type_number_t info_outCnt; |
| 371 | integer_t info_out[5]; |
| 372 | } __Reply__processor_set_statistics_t __attribute__((unused)); |
| 373 | #ifdef __MigPackStructs |
| 374 | #pragma pack() |
| 375 | #endif |
| 376 | |
| 377 | #ifdef __MigPackStructs |
| 378 | #pragma pack(4) |
| 379 | #endif |
| 380 | typedef struct { |
| 381 | mach_msg_header_t Head; |
| 382 | NDR_record_t NDR; |
| 383 | kern_return_t RetCode; |
| 384 | } __Reply__processor_set_destroy_t __attribute__((unused)); |
| 385 | #ifdef __MigPackStructs |
| 386 | #pragma pack() |
| 387 | #endif |
| 388 | |
| 389 | #ifdef __MigPackStructs |
| 390 | #pragma pack(4) |
| 391 | #endif |
| 392 | typedef struct { |
| 393 | mach_msg_header_t Head; |
| 394 | NDR_record_t NDR; |
| 395 | kern_return_t RetCode; |
| 396 | } __Reply__processor_set_max_priority_t __attribute__((unused)); |
| 397 | #ifdef __MigPackStructs |
| 398 | #pragma pack() |
| 399 | #endif |
| 400 | |
| 401 | #ifdef __MigPackStructs |
| 402 | #pragma pack(4) |
| 403 | #endif |
| 404 | typedef struct { |
| 405 | mach_msg_header_t Head; |
| 406 | NDR_record_t NDR; |
| 407 | kern_return_t RetCode; |
| 408 | } __Reply__processor_set_policy_enable_t __attribute__((unused)); |
| 409 | #ifdef __MigPackStructs |
| 410 | #pragma pack() |
| 411 | #endif |
| 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 | kern_return_t RetCode; |
| 420 | } __Reply__processor_set_policy_disable_t __attribute__((unused)); |
| 421 | #ifdef __MigPackStructs |
| 422 | #pragma pack() |
| 423 | #endif |
| 424 | |
| 425 | #ifdef __MigPackStructs |
| 426 | #pragma pack(4) |
| 427 | #endif |
| 428 | typedef struct { |
| 429 | mach_msg_header_t Head; |
| 430 | /* start of the kernel processed data */ |
| 431 | mach_msg_body_t msgh_body; |
| 432 | mach_msg_ool_ports_descriptor_t task_list; |
| 433 | /* end of the kernel processed data */ |
| 434 | NDR_record_t NDR; |
| 435 | mach_msg_type_number_t task_listCnt; |
| 436 | } __Reply__processor_set_tasks_t __attribute__((unused)); |
| 437 | #ifdef __MigPackStructs |
| 438 | #pragma pack() |
| 439 | #endif |
| 440 | |
| 441 | #ifdef __MigPackStructs |
| 442 | #pragma pack(4) |
| 443 | #endif |
| 444 | typedef struct { |
| 445 | mach_msg_header_t Head; |
| 446 | /* start of the kernel processed data */ |
| 447 | mach_msg_body_t msgh_body; |
| 448 | mach_msg_ool_ports_descriptor_t thread_list; |
| 449 | /* end of the kernel processed data */ |
| 450 | NDR_record_t NDR; |
| 451 | mach_msg_type_number_t thread_listCnt; |
| 452 | } __Reply__processor_set_threads_t __attribute__((unused)); |
| 453 | #ifdef __MigPackStructs |
| 454 | #pragma pack() |
| 455 | #endif |
| 456 | |
| 457 | #ifdef __MigPackStructs |
| 458 | #pragma pack(4) |
| 459 | #endif |
| 460 | typedef struct { |
| 461 | mach_msg_header_t Head; |
| 462 | NDR_record_t NDR; |
| 463 | kern_return_t RetCode; |
| 464 | } __Reply__processor_set_policy_control_t __attribute__((unused)); |
| 465 | #ifdef __MigPackStructs |
| 466 | #pragma pack() |
| 467 | #endif |
| 468 | |
| 469 | #ifdef __MigPackStructs |
| 470 | #pragma pack(4) |
| 471 | #endif |
| 472 | typedef struct { |
| 473 | mach_msg_header_t Head; |
| 474 | NDR_record_t NDR; |
| 475 | kern_return_t RetCode; |
| 476 | unsigned ltotal; |
| 477 | vm_size_t space; |
| 478 | vm_size_t resident; |
| 479 | vm_size_t maxusage; |
| 480 | vm_offset_t maxstack; |
| 481 | } __Reply__processor_set_stack_usage_t __attribute__((unused)); |
| 482 | #ifdef __MigPackStructs |
| 483 | #pragma pack() |
| 484 | #endif |
| 485 | |
| 486 | #ifdef __MigPackStructs |
| 487 | #pragma pack(4) |
| 488 | #endif |
| 489 | typedef struct { |
| 490 | mach_msg_header_t Head; |
| 491 | /* start of the kernel processed data */ |
| 492 | mach_msg_body_t msgh_body; |
| 493 | mach_msg_port_descriptor_t host; |
| 494 | /* end of the kernel processed data */ |
| 495 | NDR_record_t NDR; |
| 496 | mach_msg_type_number_t info_outCnt; |
| 497 | integer_t info_out[5]; |
| 498 | } __Reply__processor_set_info_t __attribute__((unused)); |
| 499 | #ifdef __MigPackStructs |
| 500 | #pragma pack() |
| 501 | #endif |
| 502 | #endif /* !__Reply__processor_set_subsystem__defined */ |
| 503 | |
| 504 | /* union of all replies */ |
| 505 | |
| 506 | #ifndef __ReplyUnion__processor_set_subsystem__defined |
| 507 | #define __ReplyUnion__processor_set_subsystem__defined |
| 508 | union __ReplyUnion__processor_set_subsystem { |
| 509 | __Reply__processor_set_statistics_t Reply_processor_set_statistics; |
| 510 | __Reply__processor_set_destroy_t Reply_processor_set_destroy; |
| 511 | __Reply__processor_set_max_priority_t Reply_processor_set_max_priority; |
| 512 | __Reply__processor_set_policy_enable_t Reply_processor_set_policy_enable; |
| 513 | __Reply__processor_set_policy_disable_t Reply_processor_set_policy_disable; |
| 514 | __Reply__processor_set_tasks_t Reply_processor_set_tasks; |
| 515 | __Reply__processor_set_threads_t Reply_processor_set_threads; |
| 516 | __Reply__processor_set_policy_control_t Reply_processor_set_policy_control; |
| 517 | __Reply__processor_set_stack_usage_t Reply_processor_set_stack_usage; |
| 518 | __Reply__processor_set_info_t Reply_processor_set_info; |
| 519 | }; |
| 520 | #endif /* !__RequestUnion__processor_set_subsystem__defined */ |
| 521 | |
| 522 | #ifndef subsystem_to_name_map_processor_set |
| 523 | #define subsystem_to_name_map_processor_set \ |
| 524 | { "processor_set_statistics", 4000 },\ |
| 525 | { "processor_set_destroy", 4001 },\ |
| 526 | { "processor_set_max_priority", 4002 },\ |
| 527 | { "processor_set_policy_enable", 4003 },\ |
| 528 | { "processor_set_policy_disable", 4004 },\ |
| 529 | { "processor_set_tasks", 4005 },\ |
| 530 | { "processor_set_threads", 4006 },\ |
| 531 | { "processor_set_policy_control", 4007 },\ |
| 532 | { "processor_set_stack_usage", 4008 },\ |
| 533 | { "processor_set_info", 4009 } |
| 534 | #endif |
| 535 | |
| 536 | #ifdef __AfterMigUserHeader |
| 537 | __AfterMigUserHeader |
| 538 | #endif /* __AfterMigUserHeader */ |
| 539 | |
| 540 | #endif /* _processor_set_user_ */ |
| 541 | |