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