xref: /xnu-10002.61.3/osfmk/man/memory_object_data_supply.html (revision 0f4c859e951fba394238ab619495c4e1d54d0f34)
1*0f4c859eSApple OSS Distributions<h2>memory_object_data_supply</h2>
2*0f4c859eSApple OSS Distributions<hr>
3*0f4c859eSApple OSS Distributions<p>
4*0f4c859eSApple OSS Distributions<strong>Function</strong> - Provide kernel with data previously requested by the kernel's Memory Management facility.
5*0f4c859eSApple OSS Distributions<h3>SYNOPSIS</h3>
6*0f4c859eSApple OSS Distributions<pre>
7*0f4c859eSApple OSS Distributions<strong>kern_return_t   memory_object_data_supply</strong>
8*0f4c859eSApple OSS Distributions                <strong>(mem_object_control_port_t</strong>       <var>memory_control</var>,
9*0f4c859eSApple OSS Distributions                 <strong>vm_offset_t</strong>                             <var>offset</var>,
10*0f4c859eSApple OSS Distributions                 <strong>pointer_t</strong>                                 <var>data</var>,
11*0f4c859eSApple OSS Distributions                 <strong>mach_msg_type_number_t</strong>              <var>data_count</var>,
12*0f4c859eSApple OSS Distributions                 <strong>boolean_t</strong>                           <var>deallocate</var>,
13*0f4c859eSApple OSS Distributions                 <strong>vm_prot_t</strong>                           <var>lock_value</var>,
14*0f4c859eSApple OSS Distributions                 <strong>boolean_t</strong>                             <var>precious</var>,
15*0f4c859eSApple OSS Distributions                 <strong>mach_port_t</strong>                         <var>reply_port</var><strong>);</strong>
16*0f4c859eSApple OSS Distributions</pre>
17*0f4c859eSApple OSS Distributions<h3>PARAMETERS</h3>
18*0f4c859eSApple OSS Distributions<dl>
19*0f4c859eSApple OSS Distributions<dt> <var>memory_control</var>
20*0f4c859eSApple OSS Distributions<dd>
21*0f4c859eSApple OSS Distributions[in memory-cache-control send right]
22*0f4c859eSApple OSS DistributionsThe memory cache control port
23*0f4c859eSApple OSS Distributionsto be used by the memory manager for cache management requests.
24*0f4c859eSApple OSS DistributionsThis port is provided by the kernel in a <strong>memory_object_init</strong>
25*0f4c859eSApple OSS Distributions     or <strong>memory_object_create</strong> call.
26*0f4c859eSApple OSS Distributions<p>
27*0f4c859eSApple OSS Distributions<p>
28*0f4c859eSApple OSS Distributions<dt> <var>offset</var>
29*0f4c859eSApple OSS Distributions<dd>
30*0f4c859eSApple OSS Distributions[in scalar]
31*0f4c859eSApple OSS DistributionsThe offset within the memory object, in bytes.
32*0f4c859eSApple OSS Distributions<p>
33*0f4c859eSApple OSS Distributions<p>
34*0f4c859eSApple OSS Distributions<dt> <var>data</var>
35*0f4c859eSApple OSS Distributions<dd>
36*0f4c859eSApple OSS Distributions[pointer to page aligned in array of bytes]
37*0f4c859eSApple OSS DistributionsThe address of the data
38*0f4c859eSApple OSS Distributionsbeing provided to the kernel.
39*0f4c859eSApple OSS Distributions<p>
40*0f4c859eSApple OSS Distributions<p>
41*0f4c859eSApple OSS Distributions<dt> <var>data_count</var>
42*0f4c859eSApple OSS Distributions<dd>
43*0f4c859eSApple OSS Distributions[in scalar]
44*0f4c859eSApple OSS DistributionsThe amount of data to be provided.  The number must be an
45*0f4c859eSApple OSS Distributionsintegral number of memory object pages.
46*0f4c859eSApple OSS Distributions<p>
47*0f4c859eSApple OSS Distributions<p>
48*0f4c859eSApple OSS Distributions<dt> <var>deallocate</var>
49*0f4c859eSApple OSS Distributions<dd>
50*0f4c859eSApple OSS Distributions[in scalar]
51*0f4c859eSApple OSS DistributionsIf <strong>TRUE</strong>, the pages to be copied (starting at data) will be
52*0f4c859eSApple OSS Distributionsdeallocated from the memory manager's address space as a result of
53*0f4c859eSApple OSS Distributionsbeing copied into the message, allowing the pages to be moved into the
54*0f4c859eSApple OSS Distributionskernel instead of being physically copied.
55*0f4c859eSApple OSS Distributions<p>
56*0f4c859eSApple OSS Distributions<p>
57*0f4c859eSApple OSS Distributions<dt> <var>lock_value</var>
58*0f4c859eSApple OSS Distributions<dd>
59*0f4c859eSApple OSS Distributions[in scalar]
60*0f4c859eSApple OSS DistributionsOne or more forms of access <var>not</var> permitted for the specified
61*0f4c859eSApple OSS Distributionsdata.  Valid values are:
62*0f4c859eSApple OSS Distributions<dl>
63*0f4c859eSApple OSS Distributions<p>
64*0f4c859eSApple OSS Distributions<p>
65*0f4c859eSApple OSS Distributions<dt> <strong>VM_PROT_NONE</strong>
66*0f4c859eSApple OSS Distributions<dd>
67*0f4c859eSApple OSS DistributionsProhibits no access (that is, all forms of access are permitted).
68*0f4c859eSApple OSS Distributions<p>
69*0f4c859eSApple OSS Distributions<p>
70*0f4c859eSApple OSS Distributions<dt> <strong>VM_PROT_READ</strong>
71*0f4c859eSApple OSS Distributions<dd>
72*0f4c859eSApple OSS DistributionsProhibits read access.
73*0f4c859eSApple OSS Distributions<p>
74*0f4c859eSApple OSS Distributions<p>
75*0f4c859eSApple OSS Distributions<dt> <strong>VM_PROT_WRITE</strong>
76*0f4c859eSApple OSS Distributions<dd>
77*0f4c859eSApple OSS DistributionsProhibits write access.
78*0f4c859eSApple OSS Distributions<p>
79*0f4c859eSApple OSS Distributions<p>
80*0f4c859eSApple OSS Distributions<dt> <strong>VM_PROT_EXECUTE</strong>
81*0f4c859eSApple OSS Distributions<dd>
82*0f4c859eSApple OSS DistributionsProhibits execute access.
83*0f4c859eSApple OSS Distributions<p>
84*0f4c859eSApple OSS Distributions<p>
85*0f4c859eSApple OSS Distributions<dt> <strong>VM_PROT_ALL</strong>
86*0f4c859eSApple OSS Distributions<dd>
87*0f4c859eSApple OSS DistributionsProhibits all forms of access.
88*0f4c859eSApple OSS Distributions</dl>
89*0f4c859eSApple OSS Distributions<p>
90*0f4c859eSApple OSS Distributions<p>
91*0f4c859eSApple OSS Distributions<dt> <var>precious</var>
92*0f4c859eSApple OSS Distributions<dd>
93*0f4c859eSApple OSS Distributions[in scalar]
94*0f4c859eSApple OSS DistributionsIf <strong>TRUE</strong>, the pages being supplied are "precious," that is,
95*0f4c859eSApple OSS Distributionsthe memory manager is not (necessarily) retaining its own copy.  These
96*0f4c859eSApple OSS Distributionspages must be returned to the manager when evicted from memory,
97*0f4c859eSApple OSS Distributionseven if not modified.
98*0f4c859eSApple OSS Distributions<p>
99*0f4c859eSApple OSS Distributions<p>
100*0f4c859eSApple OSS Distributions<dt> <var>reply_port</var>
101*0f4c859eSApple OSS Distributions<dd>
102*0f4c859eSApple OSS Distributions[in reply receive (to be converted to send) right]
103*0f4c859eSApple OSS DistributionsA port to which the
104*0f4c859eSApple OSS Distributionskernel should send a <strong>memory_object_supply_completed</strong> to indicate
105*0f4c859eSApple OSS Distributionsthe status of the accepted data.  <strong>MACH_PORT_NULL</strong> is allowed.  The
106*0f4c859eSApple OSS Distributionsreply message indicates which pages have been accepted.
107*0f4c859eSApple OSS Distributions</dl>
108*0f4c859eSApple OSS Distributions<h3>DESCRIPTION</h3>
109*0f4c859eSApple OSS Distributions<p>
110*0f4c859eSApple OSS DistributionsThe <strong>memory_object_data_supply</strong> function supplies the
111*0f4c859eSApple OSS Distributionskernel with a range of
112*0f4c859eSApple OSS Distributionsdata for the specified memory object.  A memory manager can only provide data
113*0f4c859eSApple OSS Distributionsthat was requested by a <strong>memory_object_data_request</strong>
114*0f4c859eSApple OSS Distributionscall from the kernel.
115*0f4c859eSApple OSS Distributions<h3>NOTES</h3>
116*0f4c859eSApple OSS Distributions<p>
117*0f4c859eSApple OSS DistributionsThe kernel accepts only integral numbers of pages.  It discards
118*0f4c859eSApple OSS Distributionsany partial pages
119*0f4c859eSApple OSS Distributionswithout notification.
120*0f4c859eSApple OSS Distributions<h3>CAUTIONS</h3>
121*0f4c859eSApple OSS Distributions<p>
122*0f4c859eSApple OSS DistributionsA memory manager must be careful that it not attempt to provide data that has
123*0f4c859eSApple OSS Distributionsnot been explicitly requested.  In particular, a memory manager
124*0f4c859eSApple OSS Distributionsmust ensure that
125*0f4c859eSApple OSS Distributionsit does not provide writable data again before it receives back modifications
126*0f4c859eSApple OSS Distributionsfrom the kernel.  This may require that the memory manager remember which
127*0f4c859eSApple OSS Distributionspages it has provided, or that it exercise other cache control functions (via
128*0f4c859eSApple OSS Distributions<strong>memory_object_lock_request</strong>) before proceeding.  The kernel prohibits the
129*0f4c859eSApple OSS Distributionsoverwriting of live data pages and will not accept pages it has not requested.
130*0f4c859eSApple OSS Distributions<h3>RETURN VALUES</h3>
131*0f4c859eSApple OSS Distributions<p>
132*0f4c859eSApple OSS DistributionsOnly generic errors apply.
133*0f4c859eSApple OSS Distributions<h3>RELATED INFORMATION</h3>
134*0f4c859eSApple OSS Distributions<p>
135*0f4c859eSApple OSS DistributionsFunctions:
136*0f4c859eSApple OSS Distributions<a href="memory_object_data_error.html"><strong>memory_object_data_error</strong></a>,
137*0f4c859eSApple OSS Distributions<a href="memory_object_data_request.html"><strong>memory_object_data_request</strong></a>,
138*0f4c859eSApple OSS Distributions<a href="MO_data_unavailable.html"><strong>memory_object_data_unavailable</strong></a>,
139*0f4c859eSApple OSS Distributions<a href="memory_object_lock_request.html"><strong>memory_object_lock_request</strong></a>,
140*0f4c859eSApple OSS Distributions<a href="MO_supply_completed.html"><strong>memory_object_supply_completed</strong></a>.
141