]> git.saurik.com Git - apple/xnu.git/blame - osfmk/man/task_set_policy.html
xnu-2422.1.72.tar.gz
[apple/xnu.git] / osfmk / man / task_set_policy.html
CommitLineData
13fec989
A
1<h2>task_set_policy</h2>
2<hr>
3<p>
4<strong>Function</strong> - Set target task's default scheduling policy state. (Protected Interface.)
5<h3>SYNOPSIS</h3>
6<pre>
7<strong>kern_return_t task_set_policy</strong>
8 <strong>(task_t</strong> <var>task</var>,
9 <strong>processor_set_t</strong> <var>processor_set</var>,
10 <strong>policy_t</strong> <var>policy</var>,
11 <strong>policy_base_t</strong> <var>base</var>,
12 <strong>mach_msg_type_number_t</strong> <var>base_count</var>,
13 <strong>policy_limit_t</strong> <var>limit</var>,
14 <strong>mach_msg_type_number_t</strong> <var>limit_count</var>,
15 <strong>boolean_t</strong> <var>change_threads</var><strong>);</strong>
16</pre>
17<h3>PARAMETERS</h3>
18<dl>
19<dt> <var>task</var>
20<dd>
21[in task send right]
22The task whose scheduling policy is to be set.
23<dt> <var>processor_set</var>
24<dd>
25[in processor-set-control send right]
26The control port for the processor
27set to which the task is currently assigned.
28<dt> <var>policy</var>
29<dd>
30[in scalar]
31Policy to be set. The values currently defined are <strong>POLICY_TIMESHARE</strong>,
32<strong>POLICY_RR</strong> (round robin) and <strong>POLICY_FIFO</strong> (firstin, first-out).
33<dt> <var>base</var>
34<dd>
35[pointer to in structure]
36Base policy specific data, <strong>policy_fifo_base</strong>,
37<strong>policy_rr_base</strong> or <strong>policy_timeshare_base</strong>.
38<dt> <var>base_count</var>
39<dd>
40[in scalar]
41The size of the buffer (in natural-sized units).
42<dt> <var>limit</var>
43<dd>
44[pointer to in structure]
45Policy specific limits, <strong>policy_fifo_limit</strong>,
46<strong>policy_rr_limit</strong> or <strong>policy_timeshare_limit</strong>.
47<dt> <var>limit_count</var>
48<dd>
49[in scalar]
50The size of the buffer (in natural-sized units).
51<dt> <var>change_threads</var>
52<dd>
53[in scalar]
54True if the scheduling attributes for all contained threads
55should be changed as well.
56</dl>
57<h3>DESCRIPTION</h3>
58<p>
59The <strong>task_set_policy</strong> function sets the scheduling attributes,
60both base and limit, for <var>task</var>.
61<var>policy</var> may be any policy implemented by the processor set whether or
62not it is enabled.
63<h3>RETURN VALUES</h3>
64<dl>
65<dt> <strong>KERN_INVALID_PROCESSOR_SET</strong>
66<dd>
67<var>processor_set</var> is not the task's processor set control port.
68</dl>
69<h3>RELATED INFORMATION</h3>
70<p>
71Functions:
72<a href="P_set_policy_control.html"><strong>processor_set_policy_control</strong></a>,
73<a href="thread_policy.html"><strong>thread_policy</strong></a>,
74<a href="thread_set_policy.html"><strong>thread_set_policy</strong></a>,
75<a href="task_policy.html"><strong>task_policy</strong></a>.
76<p>
77Data Structures:
78<a href="policy_fifo_info.html"><strong>policy_fifo_info</strong></a>,
79<a href="policy_rr_info.html"><strong>policy_rr_info</strong></a>,
80<a href="policy_timeshare_info.html"><strong>policy_timeshare_info</strong></a>.