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