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