xref: /xnu-11215.61.5/osfmk/man/vm_wire.html (revision 4f1223e81cd707a65cc109d0b8ad6653699da3c4)
1*4f1223e8SApple OSS Distributions<h2>vm_wire</h2>
2*4f1223e8SApple OSS Distributions<hr>
3*4f1223e8SApple OSS Distributions<p>
4*4f1223e8SApple OSS Distributions<strong>Function</strong> - Modify the target region's paging characteristics.
5*4f1223e8SApple OSS Distributions<h3>SYNOPSIS</h3>
6*4f1223e8SApple OSS Distributions<pre>
7*4f1223e8SApple OSS Distributions<strong>kern_return_t   vm_wire</strong>
8*4f1223e8SApple OSS Distributions                <strong>(host_priv_t</strong>                               <var>host</var>,
9*4f1223e8SApple OSS Distributions                 <strong>vm_task_t</strong>                          <var>target_task</var>,
10*4f1223e8SApple OSS Distributions                 <strong>vm_address_t</strong>                           <var>address</var>,
11*4f1223e8SApple OSS Distributions                 <strong>vm_size_t</strong>                                 <var>size</var>,
12*4f1223e8SApple OSS Distributions                 <strong>vm_prot_t</strong>                         <var>wired_access</var><strong>);</strong>
13*4f1223e8SApple OSS Distributions</pre>
14*4f1223e8SApple OSS Distributions<h3>PARAMETERS</h3>
15*4f1223e8SApple OSS Distributions<dl>
16*4f1223e8SApple OSS Distributions<p>
17*4f1223e8SApple OSS Distributions<dt> <var>host</var>
18*4f1223e8SApple OSS Distributions<dd>
19*4f1223e8SApple OSS Distributions[in host-control send right]
20*4f1223e8SApple OSS DistributionsThe control port for the host for which
21*4f1223e8SApple OSS Distributionsinformation is to be obtained.
22*4f1223e8SApple OSS Distributions<p>
23*4f1223e8SApple OSS Distributions<dt> <var>target_task</var>
24*4f1223e8SApple OSS Distributions<dd>
25*4f1223e8SApple OSS Distributions[in task send right]
26*4f1223e8SApple OSS DistributionsThe port for the task whose address space contains
27*4f1223e8SApple OSS Distributionsthe region.
28*4f1223e8SApple OSS Distributions<p>
29*4f1223e8SApple OSS Distributions<dt> <var>address</var>
30*4f1223e8SApple OSS Distributions<dd>
31*4f1223e8SApple OSS Distributions[in scalar]
32*4f1223e8SApple OSS DistributionsThe starting address for the region.
33*4f1223e8SApple OSS Distributions<p>
34*4f1223e8SApple OSS Distributions<dt> <var>size</var>
35*4f1223e8SApple OSS Distributions<dd>
36*4f1223e8SApple OSS Distributions[in scalar]
37*4f1223e8SApple OSS DistributionsThe number of bytes in the region.
38*4f1223e8SApple OSS Distributions<p>
39*4f1223e8SApple OSS Distributions<dt> <var>wired_access</var>
40*4f1223e8SApple OSS Distributions<dd>
41*4f1223e8SApple OSS Distributions[in scalar]
42*4f1223e8SApple OSS DistributionsThe pageability of the region. The following values cause
43*4f1223e8SApple OSS Distributionsthe region to be wired and protected as specified
44*4f1223e8SApple OSS Distributions(values may be combined):
45*4f1223e8SApple OSS Distributions<dl>
46*4f1223e8SApple OSS Distributions<dt> <strong>VM_PROT_READ</strong>
47*4f1223e8SApple OSS Distributions<dt> <strong>VM_PROT_WRITE</strong>
48*4f1223e8SApple OSS Distributions<dt> <strong>VM_PROT_execute</strong>
49*4f1223e8SApple OSS Distributions</dl>
50*4f1223e8SApple OSS Distributions<p>
51*4f1223e8SApple OSS DistributionsThe following value causes the region to be unwired (made pageable):
52*4f1223e8SApple OSS Distributions<dl>
53*4f1223e8SApple OSS Distributions<dt> <strong>VM_PROT_NONE</strong>
54*4f1223e8SApple OSS Distributions</dl>
55*4f1223e8SApple OSS Distributions</dl>
56*4f1223e8SApple OSS Distributions<h3>DESCRIPTION</h3>
57*4f1223e8SApple OSS Distributions<p>
58*4f1223e8SApple OSS DistributionsThe <strong>vm_wire</strong> function sets the pageability privileges
59*4f1223e8SApple OSS Distributionsfor a region within the
60*4f1223e8SApple OSS Distributionsspecified task's address space.  <var>wired_access</var> specifies the types
61*4f1223e8SApple OSS Distributionsof accesses to
62*4f1223e8SApple OSS Distributionsthe memory region which must not suffer from (internal) faults
63*4f1223e8SApple OSS Distributionsof any kind after
64*4f1223e8SApple OSS Distributionsthis call returns.  A non-null <var>wired_access</var> value indicates that
65*4f1223e8SApple OSS Distributionsthe page is to be
66*4f1223e8SApple OSS Distributions"wired" into memory; a null value indicates "un-wiring".  The kernel maintains
67*4f1223e8SApple OSS Distributionsfor the region a count of the number of times the region is wired.  A page is
68*4f1223e8SApple OSS Distributionswired into physical memory if any task accessing it has a non-zero wired count
69*4f1223e8SApple OSS Distributionsfor the page.
70*4f1223e8SApple OSS Distributions<p>
71*4f1223e8SApple OSS DistributionsThe region starts at the beginning of the virtual page containing
72*4f1223e8SApple OSS Distributions<var>address</var>; it ends at the end of the virtual page containing
73*4f1223e8SApple OSS Distributions<var>address</var> + <var>size</var> - 1.  Because of this
74*4f1223e8SApple OSS Distributionsrounding to virtual page boundaries, the amount of memory affected may be
75*4f1223e8SApple OSS Distributionsgreater than <var>size</var>.  Use <strong>host_page_size</strong> to find the current
76*4f1223e8SApple OSS Distributionsvirtual page size.
77*4f1223e8SApple OSS Distributions<h3>NOTES</h3>
78*4f1223e8SApple OSS Distributions<p>
79*4f1223e8SApple OSS DistributionsThis interface is machine word length specific because of the virtual address
80*4f1223e8SApple OSS Distributionsparameter.
81*4f1223e8SApple OSS Distributions<h3>RETURN VALUES</h3>
82*4f1223e8SApple OSS Distributions<dl>
83*4f1223e8SApple OSS Distributions<p>
84*4f1223e8SApple OSS Distributions<dt> <strong>KERN_INVALID_ADDRESS</strong>
85*4f1223e8SApple OSS Distributions<dd>
86*4f1223e8SApple OSS DistributionsThe address is illegal or specifies a non-allocated region.
87*4f1223e8SApple OSS Distributions</dl>
88*4f1223e8SApple OSS Distributions<h3>RELATED INFORMATION</h3>
89*4f1223e8SApple OSS Distributions<p>
90*4f1223e8SApple OSS DistributionsFunctions:
91*4f1223e8SApple OSS Distributions<a href="thread_wire.html"><strong>thread_wire</strong></a>.
92