xref: /xnu-8796.121.2/osfmk/man/thread_wire.html (revision c54f35ca767986246321eb901baf8f5ff7923f6a)
1*c54f35caSApple OSS Distributions<h2>thread_wire</h2>
2*c54f35caSApple OSS Distributions<hr>
3*c54f35caSApple OSS Distributions<p>
4*c54f35caSApple OSS Distributions<strong>Function</strong> - Mark the thread as privileged with respect to kernel resources.
5*c54f35caSApple OSS Distributions<h3>SYNOPSIS</h3>
6*c54f35caSApple OSS Distributions<pre>
7*c54f35caSApple OSS Distributions<strong>kern_return_t   thread_wire</strong>
8*c54f35caSApple OSS Distributions                <strong>(host_priv_t</strong>                          <var>host_priv</var>,
9*c54f35caSApple OSS Distributions                 <strong>thread_act_t</strong>                            <var>thread</var>,
10*c54f35caSApple OSS Distributions                 <strong>boolean_t</strong>                                <var>wired</var><strong>);</strong>
11*c54f35caSApple OSS Distributions</pre>
12*c54f35caSApple OSS Distributions<h3>PARAMETERS</h3>
13*c54f35caSApple OSS Distributions<dl>
14*c54f35caSApple OSS Distributions<p>
15*c54f35caSApple OSS Distributions<dt> <var>host_priv</var>
16*c54f35caSApple OSS Distributions<dd>
17*c54f35caSApple OSS Distributions[in host-control send right]
18*c54f35caSApple OSS DistributionsThe privileged control port for the host on
19*c54f35caSApple OSS Distributionswhich the thread executes.
20*c54f35caSApple OSS Distributions<p>
21*c54f35caSApple OSS Distributions<dt> <var>thread</var>
22*c54f35caSApple OSS Distributions<dd>
23*c54f35caSApple OSS Distributions[in thread send right]
24*c54f35caSApple OSS DistributionsThe thread to be wired.
25*c54f35caSApple OSS Distributions<p>
26*c54f35caSApple OSS Distributions<dt> <var>wired</var>
27*c54f35caSApple OSS Distributions<dd>
28*c54f35caSApple OSS Distributions[in scalar]
29*c54f35caSApple OSS Distributions<strong>TRUE</strong> if the thread is to be wired.
30*c54f35caSApple OSS Distributions</dl>
31*c54f35caSApple OSS Distributions<h3>DESCRIPTION</h3>
32*c54f35caSApple OSS Distributions<p>
33*c54f35caSApple OSS DistributionsThe <strong>thread_wire</strong> function marks the thread as "wired".
34*c54f35caSApple OSS DistributionsA "wired" thread is
35*c54f35caSApple OSS Distributionsalways eligible to be scheduled and can consume physical memory even when
36*c54f35caSApple OSS Distributionsfree memory is scarce.  This property should be assigned to threads in the
37*c54f35caSApple OSS Distributionsdefault page-out path.  Threads not in the default page-out path
38*c54f35caSApple OSS Distributionsshould not have
39*c54f35caSApple OSS Distributionsthis property to prevent the kernel's free list of pages from being exhausted.
40*c54f35caSApple OSS Distributions<h3>RETURN VALUES</h3>
41*c54f35caSApple OSS Distributions<dl>
42*c54f35caSApple OSS Distributions<p>
43*c54f35caSApple OSS Distributions<dt> <strong>KERN_INVALID_ARGUMENT</strong>
44*c54f35caSApple OSS Distributions<dd>
45*c54f35caSApple OSS Distributions<var>thread</var> is not a thread port.
46*c54f35caSApple OSS Distributions.P
47*c54f35caSApple OSS Distributions<var>host_priv</var> is not the control port for the host on which <var>thread</var>
48*c54f35caSApple OSS Distributionsexecutes.
49*c54f35caSApple OSS Distributions</dl>
50*c54f35caSApple OSS Distributions<h3>RELATED INFORMATION</h3>
51*c54f35caSApple OSS Distributions<p>
52*c54f35caSApple OSS DistributionsFunctions:
53*c54f35caSApple OSS Distributions<a href="vm_wire.html"><strong>vm_wire</strong></a>.
54