zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

processor_set.h (15032B) - Raw


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