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