1/*
2 * IDENTIFICATION:
3 * stub generated by bootstrap_cmds-133
4 * OPTIONS:
5 * KernelServer
6 */
7
8/* Module processor_set */
9
10#define __MIG_check__Request__processor_set_subsystem__ 1
11
12#include "processor_set_server.h"
13
14#ifndef mig_internal
15#define mig_internal static __inline__
16#endif /* mig_internal */
17
18#ifndef mig_external
19#define mig_external
20#endif /* mig_external */
21
22#if !defined(__MigTypeCheck) && defined(TypeCheck)
23#define __MigTypeCheck TypeCheck /* Legacy setting */
24#endif /* !defined(__MigTypeCheck) */
25
26#if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_)
27#define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */
28#endif /* !defined(__MigKernelSpecificCode) */
29
30#ifndef LimitCheck
31#define LimitCheck 0
32#endif /* LimitCheck */
33
34#ifndef min
35#define min(a,b) ( ((a) < (b))? (a): (b) )
36#endif /* min */
37
38#if !defined(_WALIGN_)
39#define _WALIGN_(x) (((x) + 3) & ~3)
40#endif /* !defined(_WALIGN_) */
41
42#if !defined(_WALIGNSZ_)
43#define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
44#endif /* !defined(_WALIGNSZ_) */
45
46#ifndef UseStaticTemplates
47#define UseStaticTemplates 0
48#endif /* UseStaticTemplates */
49
50#ifndef MIG_SERVER_ROUTINE
51#define MIG_SERVER_ROUTINE
52#endif
53
54#ifndef __DeclareRcvRpc
55#define __DeclareRcvRpc(_NUM_, _NAME_)
56#endif /* __DeclareRcvRpc */
57
58#ifndef __BeforeRcvRpc
59#define __BeforeRcvRpc(_NUM_, _NAME_)
60#endif /* __BeforeRcvRpc */
61
62#ifndef __AfterRcvRpc
63#define __AfterRcvRpc(_NUM_, _NAME_)
64#endif /* __AfterRcvRpc */
65
66#ifndef __DeclareRcvSimple
67#define __DeclareRcvSimple(_NUM_, _NAME_)
68#endif /* __DeclareRcvSimple */
69
70#ifndef __BeforeRcvSimple
71#define __BeforeRcvSimple(_NUM_, _NAME_)
72#endif /* __BeforeRcvSimple */
73
74#ifndef __AfterRcvSimple
75#define __AfterRcvSimple(_NUM_, _NAME_)
76#endif /* __AfterRcvSimple */
77
78#define novalue void
79
80#if __MigKernelSpecificCode
81#define msgh_request_port msgh_remote_port
82#define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_REMOTE(bits)
83#define msgh_reply_port msgh_local_port
84#define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_LOCAL(bits)
85#else
86#define msgh_request_port msgh_local_port
87#define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits)
88#define msgh_reply_port msgh_remote_port
89#define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits)
90#endif /* __MigKernelSpecificCode */
91
92#define MIG_RETURN_ERROR(X, code) {\
93 ((mig_reply_error_t *)X)->RetCode = code;\
94 ((mig_reply_error_t *)X)->NDR = NDR_record;\
95 return;\
96 }
97
98/* Forward Declarations */
99
100
101mig_internal novalue _Xprocessor_set_statistics
102 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
103
104mig_internal novalue _Xprocessor_set_tasks
105 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
106
107mig_internal novalue _Xprocessor_set_threads
108 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
109
110mig_internal novalue _Xprocessor_set_stack_usage
111 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
112
113mig_internal novalue _Xprocessor_set_info
114 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
115
116mig_internal novalue _Xprocessor_set_tasks_with_flavor
117 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
118
119
120#if ( __MigTypeCheck )
121#if __MIG_check__Request__processor_set_subsystem__
122#if !defined(__MIG_check__Request__processor_set_statistics_t__defined)
123#define __MIG_check__Request__processor_set_statistics_t__defined
124
125mig_internal kern_return_t __MIG_check__Request__processor_set_statistics_t(
126 __attribute__((__unused__)) __RequestKData__processor_set_statistics_t *InKP,
127 __attribute__((__unused__)) __RequestUData__processor_set_statistics_t *In0UP,
128 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
129{
130
131 typedef __Request__processor_set_statistics_t __Request;
132 typedef __RequestUData__processor_set_statistics_t __RequestU __attribute__((unused));
133#if __MigTypeCheck
134 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
135 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
136 return MIG_BAD_ARGUMENTS;
137#endif /* __MigTypeCheck */
138
139 return MACH_MSG_SUCCESS;
140}
141#endif /* !defined(__MIG_check__Request__processor_set_statistics_t__defined) */
142#endif /* __MIG_check__Request__processor_set_subsystem__ */
143#endif /* ( __MigTypeCheck ) */
144
145
146/* Routine processor_set_statistics */
147mig_internal novalue _Xprocessor_set_statistics
148 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
149 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
150 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
151{
152
153#ifdef __MigPackStructs
154#pragma pack(push, 4)
155#endif
156 typedef struct {
157 NDR_record_t NDR;
158 processor_set_flavor_t flavor;
159 mach_msg_type_number_t info_outCnt;
160 mach_msg_trailer_t trailer;
161 char padding[0]; /* Avoid generating empty UData structs */
162 } RequestU __attribute__((unused));
163#ifdef __MigPackStructs
164#pragma pack(pop)
165#endif
166 typedef __RequestKData__processor_set_statistics_t RequestK;
167 typedef __RequestUData__processor_set_statistics_t __RequestU;
168 typedef __ReplyKData__processor_set_statistics_t ReplyK __attribute__((unused));
169 typedef __ReplyUData__processor_set_statistics_t ReplyU __attribute__((unused));
170 typedef __Reply__processor_set_statistics_t Reply __attribute__((unused));
171 typedef __Request__processor_set_statistics_t __Request __attribute__((unused));
172
173 /*
174 * typedef struct {
175 * mach_msg_header_t Head;
176 * NDR_record_t NDR;
177 * kern_return_t RetCode;
178 * } mig_reply_error_t;
179 */
180
181 RequestK *InKP = (RequestK *) InHeadP;
182 RequestU *In0UP = (RequestU *) InDataP;
183 ReplyK *OutKP = (ReplyK *) OutHeadP;
184 ReplyU *OutUP = (ReplyU *) OutDataP;
185 (void)OutUP;
186#ifdef __MIG_check__Request__processor_set_statistics_t__defined
187 kern_return_t check_result;
188#endif /* __MIG_check__Request__processor_set_statistics_t__defined */
189
190#if __MigKernelSpecificCode
191#else
192#endif /* __MigKernelSpecificCode */
193 __DeclareRcvRpc(4000, "processor_set_statistics")
194 __BeforeRcvRpc(4000, "processor_set_statistics")
195
196#if defined(__MIG_check__Request__processor_set_statistics_t__defined)
197 check_result = __MIG_check__Request__processor_set_statistics_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
198 if (check_result != MACH_MSG_SUCCESS)
199 { MIG_RETURN_ERROR(OutKP, check_result); }
200#endif /* defined(__MIG_check__Request__processor_set_statistics_t__defined) */
201
202 OutUP->info_outCnt = 5;
203 if (In0UP->info_outCnt < OutUP->info_outCnt)
204 OutUP->info_outCnt = In0UP->info_outCnt;
205
206 OutUP->RetCode = processor_set_statistics(pset: convert_port_to_pset_name(port: InKP->Head.msgh_request_port), flavor: In0UP->flavor, info_out: OutUP->info_out, info_outCnt: &OutUP->info_outCnt);
207 if (OutUP->RetCode != KERN_SUCCESS) {
208 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
209 }
210#if __MigKernelSpecificCode
211#endif /* __MigKernelSpecificCode */
212
213 OutUP->NDR = NDR_record;
214
215 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 20) + (((4 * OutUP->info_outCnt)));
216
217 __AfterRcvRpc(4000, "processor_set_statistics")
218}
219
220#if ( __MigTypeCheck )
221#if __MIG_check__Request__processor_set_subsystem__
222#if !defined(__MIG_check__Request__processor_set_tasks_t__defined)
223#define __MIG_check__Request__processor_set_tasks_t__defined
224
225mig_internal kern_return_t __MIG_check__Request__processor_set_tasks_t(
226 __attribute__((__unused__)) __RequestKData__processor_set_tasks_t *InKP,
227 __attribute__((__unused__)) __RequestUData__processor_set_tasks_t *In0UP,
228 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
229{
230
231 typedef __Request__processor_set_tasks_t __Request;
232 typedef __RequestUData__processor_set_tasks_t __RequestU __attribute__((unused));
233#if __MigTypeCheck
234 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
235 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
236 return MIG_BAD_ARGUMENTS;
237#endif /* __MigTypeCheck */
238
239 return MACH_MSG_SUCCESS;
240}
241#endif /* !defined(__MIG_check__Request__processor_set_tasks_t__defined) */
242#endif /* __MIG_check__Request__processor_set_subsystem__ */
243#endif /* ( __MigTypeCheck ) */
244
245
246/* Routine processor_set_tasks */
247mig_internal novalue _Xprocessor_set_tasks
248 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
249 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
250 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
251{
252
253#ifdef __MigPackStructs
254#pragma pack(push, 4)
255#endif
256 typedef struct {
257 mach_msg_trailer_t trailer;
258 char padding[0]; /* Avoid generating empty UData structs */
259 } RequestU __attribute__((unused));
260#ifdef __MigPackStructs
261#pragma pack(pop)
262#endif
263 typedef __RequestKData__processor_set_tasks_t RequestK;
264 typedef __RequestUData__processor_set_tasks_t __RequestU;
265 typedef __ReplyKData__processor_set_tasks_t ReplyK __attribute__((unused));
266 typedef __ReplyUData__processor_set_tasks_t ReplyU __attribute__((unused));
267 typedef __Reply__processor_set_tasks_t Reply __attribute__((unused));
268 typedef __Request__processor_set_tasks_t __Request __attribute__((unused));
269
270 /*
271 * typedef struct {
272 * mach_msg_header_t Head;
273 * NDR_record_t NDR;
274 * kern_return_t RetCode;
275 * } mig_reply_error_t;
276 */
277
278 RequestK *InKP = (RequestK *) InHeadP;
279 RequestU *In0UP = (RequestU *) InDataP;
280 ReplyK *OutKP = (ReplyK *) OutHeadP;
281 ReplyU *OutUP = (ReplyU *) OutDataP;
282 (void)OutUP;
283#ifdef __MIG_check__Request__processor_set_tasks_t__defined
284 kern_return_t check_result;
285#endif /* __MIG_check__Request__processor_set_tasks_t__defined */
286
287#if __MigKernelSpecificCode
288#if UseStaticTemplates
289 const static mach_msg_ool_ports_descriptor_t task_listTemplate = {
290 /* addr = */ (void *)0,
291 /* coun = */ 0,
292 /* deal = */ FALSE,
293 /* copy is meaningful only in overwrite mode */
294 /* copy = */ MACH_MSG_PHYSICAL_COPY,
295 /* disp = */ 17,
296 /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR,
297 };
298#endif /* UseStaticTemplates */
299
300#else
301#if UseStaticTemplates
302 const static mach_msg_ool_ports_descriptor_t task_listTemplate = {
303 /* addr = */ (void *)0,
304 /* coun = */ 0,
305 /* deal = */ FALSE,
306 /* copy is meaningful only in overwrite mode */
307 /* copy = */ MACH_MSG_PHYSICAL_COPY,
308 /* disp = */ 19,
309 /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR,
310 };
311#endif /* UseStaticTemplates */
312
313#endif /* __MigKernelSpecificCode */
314 kern_return_t RetCode;
315 __DeclareRcvRpc(4005, "processor_set_tasks")
316 __BeforeRcvRpc(4005, "processor_set_tasks")
317
318#if defined(__MIG_check__Request__processor_set_tasks_t__defined)
319 check_result = __MIG_check__Request__processor_set_tasks_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
320 if (check_result != MACH_MSG_SUCCESS)
321 { MIG_RETURN_ERROR(OutKP, check_result); }
322#endif /* defined(__MIG_check__Request__processor_set_tasks_t__defined) */
323
324#if UseStaticTemplates
325 OutKP->task_list = task_listTemplate;
326#else /* UseStaticTemplates */
327#if __MigKernelSpecificCode
328 OutKP->task_list.disposition = 17;
329#else
330 OutKP->task_list.disposition = 19;
331#endif /* __MigKernelSpecificCode */
332 OutKP->task_list.deallocate = FALSE;
333 OutKP->task_list.type = MACH_MSG_OOL_PORTS_DESCRIPTOR;
334#endif /* UseStaticTemplates */
335
336
337 RetCode = processor_set_tasks(processor_set: convert_port_to_pset(port: InKP->Head.msgh_request_port), task_list: (task_array_t *)&(OutKP->task_list.address), task_listCnt: &OutUP->task_listCnt);
338 if (RetCode != KERN_SUCCESS) {
339 MIG_RETURN_ERROR(OutKP, RetCode);
340 }
341#if __MigKernelSpecificCode
342#endif /* __MigKernelSpecificCode */
343 OutKP->task_list.count = OutUP->task_listCnt;
344
345
346 OutUP->NDR = NDR_record;
347
348
349 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
350 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
351 OutKP->msgh_body.msgh_descriptor_count = 1;
352 __AfterRcvRpc(4005, "processor_set_tasks")
353}
354
355#if ( __MigTypeCheck )
356#if __MIG_check__Request__processor_set_subsystem__
357#if !defined(__MIG_check__Request__processor_set_threads_t__defined)
358#define __MIG_check__Request__processor_set_threads_t__defined
359
360mig_internal kern_return_t __MIG_check__Request__processor_set_threads_t(
361 __attribute__((__unused__)) __RequestKData__processor_set_threads_t *InKP,
362 __attribute__((__unused__)) __RequestUData__processor_set_threads_t *In0UP,
363 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
364{
365
366 typedef __Request__processor_set_threads_t __Request;
367 typedef __RequestUData__processor_set_threads_t __RequestU __attribute__((unused));
368#if __MigTypeCheck
369 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
370 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
371 return MIG_BAD_ARGUMENTS;
372#endif /* __MigTypeCheck */
373
374 return MACH_MSG_SUCCESS;
375}
376#endif /* !defined(__MIG_check__Request__processor_set_threads_t__defined) */
377#endif /* __MIG_check__Request__processor_set_subsystem__ */
378#endif /* ( __MigTypeCheck ) */
379
380
381/* Routine processor_set_threads */
382mig_internal novalue _Xprocessor_set_threads
383 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
384 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
385 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
386{
387
388#ifdef __MigPackStructs
389#pragma pack(push, 4)
390#endif
391 typedef struct {
392 mach_msg_trailer_t trailer;
393 char padding[0]; /* Avoid generating empty UData structs */
394 } RequestU __attribute__((unused));
395#ifdef __MigPackStructs
396#pragma pack(pop)
397#endif
398 typedef __RequestKData__processor_set_threads_t RequestK;
399 typedef __RequestUData__processor_set_threads_t __RequestU;
400 typedef __ReplyKData__processor_set_threads_t ReplyK __attribute__((unused));
401 typedef __ReplyUData__processor_set_threads_t ReplyU __attribute__((unused));
402 typedef __Reply__processor_set_threads_t Reply __attribute__((unused));
403 typedef __Request__processor_set_threads_t __Request __attribute__((unused));
404
405 /*
406 * typedef struct {
407 * mach_msg_header_t Head;
408 * NDR_record_t NDR;
409 * kern_return_t RetCode;
410 * } mig_reply_error_t;
411 */
412
413 RequestK *InKP = (RequestK *) InHeadP;
414 RequestU *In0UP = (RequestU *) InDataP;
415 ReplyK *OutKP = (ReplyK *) OutHeadP;
416 ReplyU *OutUP = (ReplyU *) OutDataP;
417 (void)OutUP;
418#ifdef __MIG_check__Request__processor_set_threads_t__defined
419 kern_return_t check_result;
420#endif /* __MIG_check__Request__processor_set_threads_t__defined */
421
422#if __MigKernelSpecificCode
423#if UseStaticTemplates
424 const static mach_msg_ool_ports_descriptor_t thread_listTemplate = {
425 /* addr = */ (void *)0,
426 /* coun = */ 0,
427 /* deal = */ FALSE,
428 /* copy is meaningful only in overwrite mode */
429 /* copy = */ MACH_MSG_PHYSICAL_COPY,
430 /* disp = */ 17,
431 /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR,
432 };
433#endif /* UseStaticTemplates */
434
435#else
436#if UseStaticTemplates
437 const static mach_msg_ool_ports_descriptor_t thread_listTemplate = {
438 /* addr = */ (void *)0,
439 /* coun = */ 0,
440 /* deal = */ FALSE,
441 /* copy is meaningful only in overwrite mode */
442 /* copy = */ MACH_MSG_PHYSICAL_COPY,
443 /* disp = */ 19,
444 /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR,
445 };
446#endif /* UseStaticTemplates */
447
448#endif /* __MigKernelSpecificCode */
449 kern_return_t RetCode;
450 __DeclareRcvRpc(4006, "processor_set_threads")
451 __BeforeRcvRpc(4006, "processor_set_threads")
452
453#if defined(__MIG_check__Request__processor_set_threads_t__defined)
454 check_result = __MIG_check__Request__processor_set_threads_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
455 if (check_result != MACH_MSG_SUCCESS)
456 { MIG_RETURN_ERROR(OutKP, check_result); }
457#endif /* defined(__MIG_check__Request__processor_set_threads_t__defined) */
458
459#if UseStaticTemplates
460 OutKP->thread_list = thread_listTemplate;
461#else /* UseStaticTemplates */
462#if __MigKernelSpecificCode
463 OutKP->thread_list.disposition = 17;
464#else
465 OutKP->thread_list.disposition = 19;
466#endif /* __MigKernelSpecificCode */
467 OutKP->thread_list.deallocate = FALSE;
468 OutKP->thread_list.type = MACH_MSG_OOL_PORTS_DESCRIPTOR;
469#endif /* UseStaticTemplates */
470
471
472 RetCode = processor_set_threads(processor_set: convert_port_to_pset(port: InKP->Head.msgh_request_port), thread_list: (thread_act_array_t *)&(OutKP->thread_list.address), thread_listCnt: &OutUP->thread_listCnt);
473 if (RetCode != KERN_SUCCESS) {
474 MIG_RETURN_ERROR(OutKP, RetCode);
475 }
476#if __MigKernelSpecificCode
477#endif /* __MigKernelSpecificCode */
478 OutKP->thread_list.count = OutUP->thread_listCnt;
479
480
481 OutUP->NDR = NDR_record;
482
483
484 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
485 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
486 OutKP->msgh_body.msgh_descriptor_count = 1;
487 __AfterRcvRpc(4006, "processor_set_threads")
488}
489
490#if ( __MigTypeCheck )
491#if __MIG_check__Request__processor_set_subsystem__
492#if !defined(__MIG_check__Request__processor_set_stack_usage_t__defined)
493#define __MIG_check__Request__processor_set_stack_usage_t__defined
494
495mig_internal kern_return_t __MIG_check__Request__processor_set_stack_usage_t(
496 __attribute__((__unused__)) __RequestKData__processor_set_stack_usage_t *InKP,
497 __attribute__((__unused__)) __RequestUData__processor_set_stack_usage_t *In0UP,
498 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
499{
500
501 typedef __Request__processor_set_stack_usage_t __Request;
502 typedef __RequestUData__processor_set_stack_usage_t __RequestU __attribute__((unused));
503#if __MigTypeCheck
504 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
505 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
506 return MIG_BAD_ARGUMENTS;
507#endif /* __MigTypeCheck */
508
509 return MACH_MSG_SUCCESS;
510}
511#endif /* !defined(__MIG_check__Request__processor_set_stack_usage_t__defined) */
512#endif /* __MIG_check__Request__processor_set_subsystem__ */
513#endif /* ( __MigTypeCheck ) */
514
515
516/* Routine processor_set_stack_usage */
517mig_internal novalue _Xprocessor_set_stack_usage
518 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
519 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
520 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
521{
522
523#ifdef __MigPackStructs
524#pragma pack(push, 4)
525#endif
526 typedef struct {
527 mach_msg_trailer_t trailer;
528 char padding[0]; /* Avoid generating empty UData structs */
529 } RequestU __attribute__((unused));
530#ifdef __MigPackStructs
531#pragma pack(pop)
532#endif
533 typedef __RequestKData__processor_set_stack_usage_t RequestK;
534 typedef __RequestUData__processor_set_stack_usage_t __RequestU;
535 typedef __ReplyKData__processor_set_stack_usage_t ReplyK __attribute__((unused));
536 typedef __ReplyUData__processor_set_stack_usage_t ReplyU __attribute__((unused));
537 typedef __Reply__processor_set_stack_usage_t Reply __attribute__((unused));
538 typedef __Request__processor_set_stack_usage_t __Request __attribute__((unused));
539
540 /*
541 * typedef struct {
542 * mach_msg_header_t Head;
543 * NDR_record_t NDR;
544 * kern_return_t RetCode;
545 * } mig_reply_error_t;
546 */
547
548 RequestK *InKP = (RequestK *) InHeadP;
549 RequestU *In0UP = (RequestU *) InDataP;
550 ReplyK *OutKP = (ReplyK *) OutHeadP;
551 ReplyU *OutUP = (ReplyU *) OutDataP;
552 (void)OutUP;
553#ifdef __MIG_check__Request__processor_set_stack_usage_t__defined
554 kern_return_t check_result;
555#endif /* __MIG_check__Request__processor_set_stack_usage_t__defined */
556
557#if __MigKernelSpecificCode
558#else
559#endif /* __MigKernelSpecificCode */
560 __DeclareRcvRpc(4008, "processor_set_stack_usage")
561 __BeforeRcvRpc(4008, "processor_set_stack_usage")
562
563#if defined(__MIG_check__Request__processor_set_stack_usage_t__defined)
564 check_result = __MIG_check__Request__processor_set_stack_usage_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
565 if (check_result != MACH_MSG_SUCCESS)
566 { MIG_RETURN_ERROR(OutKP, check_result); }
567#endif /* defined(__MIG_check__Request__processor_set_stack_usage_t__defined) */
568
569 OutUP->RetCode = processor_set_stack_usage(pset: convert_port_to_pset(port: InKP->Head.msgh_request_port), ltotal: &OutUP->ltotal, space: &OutUP->space, resident: &OutUP->resident, maxusage: &OutUP->maxusage, maxstack: &OutUP->maxstack);
570 if (OutUP->RetCode != KERN_SUCCESS) {
571 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
572 }
573#if __MigKernelSpecificCode
574#endif /* __MigKernelSpecificCode */
575
576 OutUP->NDR = NDR_record;
577
578
579 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
580 __AfterRcvRpc(4008, "processor_set_stack_usage")
581}
582
583#if ( __MigTypeCheck )
584#if __MIG_check__Request__processor_set_subsystem__
585#if !defined(__MIG_check__Request__processor_set_info_t__defined)
586#define __MIG_check__Request__processor_set_info_t__defined
587
588mig_internal kern_return_t __MIG_check__Request__processor_set_info_t(
589 __attribute__((__unused__)) __RequestKData__processor_set_info_t *InKP,
590 __attribute__((__unused__)) __RequestUData__processor_set_info_t *In0UP,
591 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
592{
593
594 typedef __Request__processor_set_info_t __Request;
595 typedef __RequestUData__processor_set_info_t __RequestU __attribute__((unused));
596#if __MigTypeCheck
597 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
598 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
599 return MIG_BAD_ARGUMENTS;
600#endif /* __MigTypeCheck */
601
602 return MACH_MSG_SUCCESS;
603}
604#endif /* !defined(__MIG_check__Request__processor_set_info_t__defined) */
605#endif /* __MIG_check__Request__processor_set_subsystem__ */
606#endif /* ( __MigTypeCheck ) */
607
608
609/* Routine processor_set_info */
610mig_internal novalue _Xprocessor_set_info
611 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
612 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
613 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
614{
615
616#ifdef __MigPackStructs
617#pragma pack(push, 4)
618#endif
619 typedef struct {
620 NDR_record_t NDR;
621 int flavor;
622 mach_msg_type_number_t info_outCnt;
623 mach_msg_trailer_t trailer;
624 char padding[0]; /* Avoid generating empty UData structs */
625 } RequestU __attribute__((unused));
626#ifdef __MigPackStructs
627#pragma pack(pop)
628#endif
629 typedef __RequestKData__processor_set_info_t RequestK;
630 typedef __RequestUData__processor_set_info_t __RequestU;
631 typedef __ReplyKData__processor_set_info_t ReplyK __attribute__((unused));
632 typedef __ReplyUData__processor_set_info_t ReplyU __attribute__((unused));
633 typedef __Reply__processor_set_info_t Reply __attribute__((unused));
634 typedef __Request__processor_set_info_t __Request __attribute__((unused));
635
636 /*
637 * typedef struct {
638 * mach_msg_header_t Head;
639 * NDR_record_t NDR;
640 * kern_return_t RetCode;
641 * } mig_reply_error_t;
642 */
643
644 RequestK *InKP = (RequestK *) InHeadP;
645 RequestU *In0UP = (RequestU *) InDataP;
646 ReplyK *OutKP = (ReplyK *) OutHeadP;
647 ReplyU *OutUP = (ReplyU *) OutDataP;
648 (void)OutUP;
649#ifdef __MIG_check__Request__processor_set_info_t__defined
650 kern_return_t check_result;
651#endif /* __MIG_check__Request__processor_set_info_t__defined */
652
653#if __MigKernelSpecificCode
654#if UseStaticTemplates
655 const static mach_msg_port_descriptor_t hostTemplate = {
656 /* name = */ MACH_PORT_NULL,
657 /* pad1 = */ 0,
658 /* pad2 = */ 0,
659 /* disp = */ 17,
660 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
661 };
662#endif /* UseStaticTemplates */
663
664#else
665#if UseStaticTemplates
666 const static mach_msg_port_descriptor_t hostTemplate = {
667 /* name = */ MACH_PORT_NULL,
668 /* pad1 = */ 0,
669 /* pad2 = */ 0,
670 /* disp = */ 19,
671 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
672 };
673#endif /* UseStaticTemplates */
674
675#endif /* __MigKernelSpecificCode */
676 kern_return_t RetCode;
677 host_t host;
678
679 __DeclareRcvRpc(4009, "processor_set_info")
680 __BeforeRcvRpc(4009, "processor_set_info")
681
682#if defined(__MIG_check__Request__processor_set_info_t__defined)
683 check_result = __MIG_check__Request__processor_set_info_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
684 if (check_result != MACH_MSG_SUCCESS)
685 { MIG_RETURN_ERROR(OutKP, check_result); }
686#endif /* defined(__MIG_check__Request__processor_set_info_t__defined) */
687
688#if UseStaticTemplates
689 OutKP->host = hostTemplate;
690#else /* UseStaticTemplates */
691#if __MigKernelSpecificCode
692 OutKP->host.disposition = 17;
693#else
694 OutKP->host.disposition = 19;
695#endif /* __MigKernelSpecificCode */
696#if !(defined(KERNEL) && defined(__LP64__))
697 OutKP->host.pad1 = 0;
698#endif
699 OutKP->host.pad2 = 0;
700 OutKP->host.type = MACH_MSG_PORT_DESCRIPTOR;
701#if defined(KERNEL)
702 OutKP->host.pad_end = 0;
703#endif
704#endif /* UseStaticTemplates */
705
706
707 OutUP->info_outCnt = 5;
708 if (In0UP->info_outCnt < OutUP->info_outCnt)
709 OutUP->info_outCnt = In0UP->info_outCnt;
710
711 RetCode = processor_set_info(set_name: convert_port_to_pset_name(port: InKP->Head.msgh_request_port), flavor: In0UP->flavor, host: &host, info_out: OutUP->info_out, info_outCnt: &OutUP->info_outCnt);
712 if (RetCode != KERN_SUCCESS) {
713 MIG_RETURN_ERROR(OutKP, RetCode);
714 }
715#if __MigKernelSpecificCode
716#endif /* __MigKernelSpecificCode */
717 OutKP->host.name = (mach_port_t)convert_host_to_port(host);
718
719
720 OutUP->NDR = NDR_record;
721
722 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 20) + (((4 * OutUP->info_outCnt)));
723
724 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
725 OutKP->msgh_body.msgh_descriptor_count = 1;
726 __AfterRcvRpc(4009, "processor_set_info")
727}
728
729#if ( __MigTypeCheck )
730#if __MIG_check__Request__processor_set_subsystem__
731#if !defined(__MIG_check__Request__processor_set_tasks_with_flavor_t__defined)
732#define __MIG_check__Request__processor_set_tasks_with_flavor_t__defined
733
734mig_internal kern_return_t __MIG_check__Request__processor_set_tasks_with_flavor_t(
735 __attribute__((__unused__)) __RequestKData__processor_set_tasks_with_flavor_t *InKP,
736 __attribute__((__unused__)) __RequestUData__processor_set_tasks_with_flavor_t *In0UP,
737 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
738{
739
740 typedef __Request__processor_set_tasks_with_flavor_t __Request;
741 typedef __RequestUData__processor_set_tasks_with_flavor_t __RequestU __attribute__((unused));
742#if __MigTypeCheck
743 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
744 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
745 return MIG_BAD_ARGUMENTS;
746#endif /* __MigTypeCheck */
747
748 return MACH_MSG_SUCCESS;
749}
750#endif /* !defined(__MIG_check__Request__processor_set_tasks_with_flavor_t__defined) */
751#endif /* __MIG_check__Request__processor_set_subsystem__ */
752#endif /* ( __MigTypeCheck ) */
753
754
755/* Routine processor_set_tasks_with_flavor */
756mig_internal novalue _Xprocessor_set_tasks_with_flavor
757 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
758 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
759 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
760{
761
762#ifdef __MigPackStructs
763#pragma pack(push, 4)
764#endif
765 typedef struct {
766 NDR_record_t NDR;
767 mach_task_flavor_t flavor;
768 mach_msg_trailer_t trailer;
769 char padding[0]; /* Avoid generating empty UData structs */
770 } RequestU __attribute__((unused));
771#ifdef __MigPackStructs
772#pragma pack(pop)
773#endif
774 typedef __RequestKData__processor_set_tasks_with_flavor_t RequestK;
775 typedef __RequestUData__processor_set_tasks_with_flavor_t __RequestU;
776 typedef __ReplyKData__processor_set_tasks_with_flavor_t ReplyK __attribute__((unused));
777 typedef __ReplyUData__processor_set_tasks_with_flavor_t ReplyU __attribute__((unused));
778 typedef __Reply__processor_set_tasks_with_flavor_t Reply __attribute__((unused));
779 typedef __Request__processor_set_tasks_with_flavor_t __Request __attribute__((unused));
780
781 /*
782 * typedef struct {
783 * mach_msg_header_t Head;
784 * NDR_record_t NDR;
785 * kern_return_t RetCode;
786 * } mig_reply_error_t;
787 */
788
789 RequestK *InKP = (RequestK *) InHeadP;
790 RequestU *In0UP = (RequestU *) InDataP;
791 ReplyK *OutKP = (ReplyK *) OutHeadP;
792 ReplyU *OutUP = (ReplyU *) OutDataP;
793 (void)OutUP;
794#ifdef __MIG_check__Request__processor_set_tasks_with_flavor_t__defined
795 kern_return_t check_result;
796#endif /* __MIG_check__Request__processor_set_tasks_with_flavor_t__defined */
797
798#if __MigKernelSpecificCode
799#if UseStaticTemplates
800 const static mach_msg_ool_ports_descriptor_t task_listTemplate = {
801 /* addr = */ (void *)0,
802 /* coun = */ 0,
803 /* deal = */ FALSE,
804 /* copy is meaningful only in overwrite mode */
805 /* copy = */ MACH_MSG_PHYSICAL_COPY,
806 /* disp = */ 17,
807 /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR,
808 };
809#endif /* UseStaticTemplates */
810
811#else
812#if UseStaticTemplates
813 const static mach_msg_ool_ports_descriptor_t task_listTemplate = {
814 /* addr = */ (void *)0,
815 /* coun = */ 0,
816 /* deal = */ FALSE,
817 /* copy is meaningful only in overwrite mode */
818 /* copy = */ MACH_MSG_PHYSICAL_COPY,
819 /* disp = */ 19,
820 /* type = */ MACH_MSG_OOL_PORTS_DESCRIPTOR,
821 };
822#endif /* UseStaticTemplates */
823
824#endif /* __MigKernelSpecificCode */
825 kern_return_t RetCode;
826 __DeclareRcvRpc(4010, "processor_set_tasks_with_flavor")
827 __BeforeRcvRpc(4010, "processor_set_tasks_with_flavor")
828
829#if defined(__MIG_check__Request__processor_set_tasks_with_flavor_t__defined)
830 check_result = __MIG_check__Request__processor_set_tasks_with_flavor_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
831 if (check_result != MACH_MSG_SUCCESS)
832 { MIG_RETURN_ERROR(OutKP, check_result); }
833#endif /* defined(__MIG_check__Request__processor_set_tasks_with_flavor_t__defined) */
834
835#if UseStaticTemplates
836 OutKP->task_list = task_listTemplate;
837#else /* UseStaticTemplates */
838#if __MigKernelSpecificCode
839 OutKP->task_list.disposition = 17;
840#else
841 OutKP->task_list.disposition = 19;
842#endif /* __MigKernelSpecificCode */
843 OutKP->task_list.deallocate = FALSE;
844 OutKP->task_list.type = MACH_MSG_OOL_PORTS_DESCRIPTOR;
845#endif /* UseStaticTemplates */
846
847
848 RetCode = processor_set_tasks_with_flavor(processor_set: convert_port_to_pset(port: InKP->Head.msgh_request_port), flavor: In0UP->flavor, task_list: (task_array_t *)&(OutKP->task_list.address), task_listCnt: &OutUP->task_listCnt);
849 if (RetCode != KERN_SUCCESS) {
850 MIG_RETURN_ERROR(OutKP, RetCode);
851 }
852#if __MigKernelSpecificCode
853#endif /* __MigKernelSpecificCode */
854 OutKP->task_list.count = OutUP->task_listCnt;
855
856
857 OutUP->NDR = NDR_record;
858
859
860 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
861 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
862 OutKP->msgh_body.msgh_descriptor_count = 1;
863 __AfterRcvRpc(4010, "processor_set_tasks_with_flavor")
864}
865
866
867
868/* Description of this kernel subsystem, for use in direct RPC */
869const struct processor_set_subsystem processor_set_subsystem = {
870 processor_set_server_routine,
871 4000,
872 4011,
873 (mach_msg_size_t)sizeof(union __ReplyUnion__processor_set_subsystem),
874 (vm_address_t)0,
875 {
876 { (mig_impl_routine_t) 0,
877 (mig_stub_kern_routine_t) _Xprocessor_set_statistics, 4, 0, 0, (mach_msg_size_t)sizeof(__Reply__processor_set_statistics_t)},
878 {.impl_routine: 0, .kstub_routine: 0, .argc: 0, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: 0},
879 {.impl_routine: 0, .kstub_routine: 0, .argc: 0, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: 0},
880 {.impl_routine: 0, .kstub_routine: 0, .argc: 0, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: 0},
881 {.impl_routine: 0, .kstub_routine: 0, .argc: 0, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: 0},
882 { .impl_routine: (mig_impl_routine_t) 0,
883 .kstub_routine: (mig_stub_kern_routine_t) _Xprocessor_set_tasks, .argc: 3, .descr_count: 0, .reply_descr_count: 1, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__processor_set_tasks_t)},
884 { .impl_routine: (mig_impl_routine_t) 0,
885 .kstub_routine: (mig_stub_kern_routine_t) _Xprocessor_set_threads, .argc: 3, .descr_count: 0, .reply_descr_count: 1, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__processor_set_threads_t)},
886 {.impl_routine: 0, .kstub_routine: 0, .argc: 0, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: 0},
887 { .impl_routine: (mig_impl_routine_t) 0,
888 .kstub_routine: (mig_stub_kern_routine_t) _Xprocessor_set_stack_usage, .argc: 6, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__processor_set_stack_usage_t)},
889 { .impl_routine: (mig_impl_routine_t) 0,
890 .kstub_routine: (mig_stub_kern_routine_t) _Xprocessor_set_info, .argc: 5, .descr_count: 0, .reply_descr_count: 1, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__processor_set_info_t)},
891 { .impl_routine: (mig_impl_routine_t) 0,
892 .kstub_routine: (mig_stub_kern_routine_t) _Xprocessor_set_tasks_with_flavor, .argc: 4, .descr_count: 0, .reply_descr_count: 1, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__processor_set_tasks_with_flavor_t)},
893 }
894};
895
896mig_external boolean_t processor_set_server
897 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP)
898{
899 /*
900 * typedef struct {
901 * mach_msg_header_t Head;
902 * NDR_record_t NDR;
903 * kern_return_t RetCode;
904 * } mig_reply_error_t;
905 */
906
907 mig_kern_routine_t routine;
908
909 OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0);
910 OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port;
911 /* Minimal size: routine() will update it if different */
912 OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t);
913 OutHeadP->msgh_local_port = MACH_PORT_NULL;
914 OutHeadP->msgh_id = InHeadP->msgh_id + 100;
915 OutHeadP->msgh_reserved = 0;
916
917 if ((InHeadP->msgh_id > 4010) || (InHeadP->msgh_id < 4000) ||
918 ((routine = processor_set_subsystem.kroutine[InHeadP->msgh_id - 4000].kstub_routine) == 0)) {
919 ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record;
920 ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID;
921 return FALSE;
922 }
923 (*routine) (InHeadP, InDataP, InTrailerP, OutHeadP, OutDataP);
924 return TRUE;
925}
926
927mig_external mig_kern_routine_t processor_set_server_routine
928 (mach_msg_header_t *InHeadP)
929{
930 int msgh_id;
931
932 msgh_id = InHeadP->msgh_id - 4000;
933
934 if ((msgh_id > 10) || (msgh_id < 0))
935 return 0;
936
937 return processor_set_subsystem.kroutine[msgh_id].kstub_routine;
938}
939