xref: /xnu-11417.121.6/osfmk/man/memory_object_synchronize.html (revision a1e26a70f38d1d7daa7b49b258e2f8538ad81650)
1*a1e26a70SApple OSS Distributions<h2>memory_object_synchronize</h2>
2*a1e26a70SApple OSS Distributions<hr>
3*a1e26a70SApple OSS Distributions<p>
4*a1e26a70SApple OSS Distributions<strong>Server Interface</strong> - Forward a client's request to synchronize data with its image in backing store.
5*a1e26a70SApple OSS Distributions<h3>SYNOPSIS</h3>
6*a1e26a70SApple OSS Distributions<pre>
7*a1e26a70SApple OSS Distributions<strong>kern_return_t   memory_object_synchronize</strong>
8*a1e26a70SApple OSS Distributions                <strong>(memory_object_t</strong>                  <var>memory_object</var>,
9*a1e26a70SApple OSS Distributions                 <strong>memory_object_control_t</strong>         <var>memory_control</var>,
10*a1e26a70SApple OSS Distributions                 <strong>vm_offset_t</strong>                             <var>offset</var>,
11*a1e26a70SApple OSS Distributions                 <strong>vm_offset_t</strong>                             <var>length</var>,
12*a1e26a70SApple OSS Distributions                 <strong>memory_object</strong>                       <var>sync_flags</var><strong>);</strong>
13*a1e26a70SApple OSS Distributions
14*a1e26a70SApple OSS Distributions
15*a1e26a70SApple OSS Distributions<strong>kern_return_t   seqnos_memory_object_synchronize</strong>
16*a1e26a70SApple OSS Distributions                <strong>(memory_object_t</strong>                  <var>memory_object</var>,
17*a1e26a70SApple OSS Distributions                 <strong>mach_port_seqno_t</strong>                        <var>seqno</var>,
18*a1e26a70SApple OSS Distributions                 <strong>memory_object_control_t</strong>         <var>memory_control</var>,
19*a1e26a70SApple OSS Distributions                 <strong>vm_offset_t</strong>                             <var>offset</var>,
20*a1e26a70SApple OSS Distributions                 <strong>vm_offset_t</strong>                             <var>length</var>,
21*a1e26a70SApple OSS Distributions                 <strong>memory_object</strong>                       <var>sync_flags</var><strong>);</strong>
22*a1e26a70SApple OSS Distributions</pre>
23*a1e26a70SApple OSS Distributions<h3>PARAMETERS</h3>
24*a1e26a70SApple OSS Distributions<dl>
25*a1e26a70SApple OSS Distributions<p>
26*a1e26a70SApple OSS Distributions<dt> <var>memory_object</var>
27*a1e26a70SApple OSS Distributions<dd>
28*a1e26a70SApple OSS Distributions[in abstract-memory-object (receive) right]
29*a1e26a70SApple OSS DistributionsThe abstract memory
30*a1e26a70SApple OSS Distributionsobject port that represents the memory object data.
31*a1e26a70SApple OSS Distributions<p>
32*a1e26a70SApple OSS Distributions<dt> <var>seqno</var>
33*a1e26a70SApple OSS Distributions<dd>
34*a1e26a70SApple OSS Distributions[in scalar]
35*a1e26a70SApple OSS DistributionsThe sequence number of this message relative to the abstract
36*a1e26a70SApple OSS Distributionsmemory object port.
37*a1e26a70SApple OSS Distributions<p>
38*a1e26a70SApple OSS Distributions<dt> <var>memory_control</var>
39*a1e26a70SApple OSS Distributions<dd>
40*a1e26a70SApple OSS Distributions[in memory-cache-control send right]
41*a1e26a70SApple OSS DistributionsThe memory cache control port
42*a1e26a70SApple OSS Distributionsto be used for a response by the memory manager.  If the memory
43*a1e26a70SApple OSS Distributionsobject has been supplied to more than one kernel, this parameter
44*a1e26a70SApple OSS Distributionsidentifies the kernel that is making the call.
45*a1e26a70SApple OSS Distributions<p>
46*a1e26a70SApple OSS Distributions<dt> <var>offset</var>
47*a1e26a70SApple OSS Distributions<dd>
48*a1e26a70SApple OSS Distributions[in scalar]
49*a1e26a70SApple OSS DistributionsThe offset within the memory object.
50*a1e26a70SApple OSS Distributions<p>
51*a1e26a70SApple OSS Distributions<dt> <var>length</var>
52*a1e26a70SApple OSS Distributions<dd>
53*a1e26a70SApple OSS Distributions[in scalar]
54*a1e26a70SApple OSS DistributionsThe number of bytes cleaned or flushed, starting at <var>offset</var>.
55*a1e26a70SApple OSS DistributionsThe number converts to an integral number of virtual pages.
56*a1e26a70SApple OSS Distributions<p>
57*a1e26a70SApple OSS Distributions<dt> <var>sync_flags</var>
58*a1e26a70SApple OSS Distributions<dd>
59*a1e26a70SApple OSS Distributions[in scalar]
60*a1e26a70SApple OSS DistributionsThe bit-wise OR of flags affecting the synchronization.
61*a1e26a70SApple OSS Distributions<dl>
62*a1e26a70SApple OSS Distributions<p>
63*a1e26a70SApple OSS Distributions<dt> <strong>VM_SYNC_INVALIDATE</strong>
64*a1e26a70SApple OSS Distributions<dd>
65*a1e26a70SApple OSS DistributionsFlushes pages in the range.  Only precious pages are returned
66*a1e26a70SApple OSS Distributionsto the memory manager.
67*a1e26a70SApple OSS Distributions<p>
68*a1e26a70SApple OSS Distributions<dt> <strong>VM_SYNC_SYNCHRONOUS</strong>
69*a1e26a70SApple OSS Distributions<dd>
70*a1e26a70SApple OSS DistributionsWrites dirty and precious pages back to the memory manager,
71*a1e26a70SApple OSS Distributionswaits for pages to reach backing storage.
72*a1e26a70SApple OSS Distributions<p>
73*a1e26a70SApple OSS Distributions<dt> <strong>VM_SYNC_ASYNCHRONOUS</strong>
74*a1e26a70SApple OSS Distributions<dd>
75*a1e26a70SApple OSS DistributionsWrites dirty and precious pages back to the memory manager,
76*a1e26a70SApple OSS Distributionsreturns without waiting for pages to reach backing storage.
77*a1e26a70SApple OSS Distributions</dl>
78*a1e26a70SApple OSS Distributions</dl>
79*a1e26a70SApple OSS Distributions<h3>DESCRIPTION</h3>
80*a1e26a70SApple OSS Distributions<p>
81*a1e26a70SApple OSS DistributionsA <strong>memory_object_synchronize</strong> function is called as the
82*a1e26a70SApple OSS Distributionsresult of a kernel
83*a1e26a70SApple OSS Distributionsmessage indicating that a client wishes to synchronize the contents
84*a1e26a70SApple OSS Distributionsof a range of a
85*a1e26a70SApple OSS Distributionsmemory object with its backing storage image.  This message would have been
86*a1e26a70SApple OSS Distributionspreceded by <strong>memory_object_data_return</strong> messages cleaning
87*a1e26a70SApple OSS Distributionsor flushing the
88*a1e26a70SApple OSS Distributionsspecified range.
89*a1e26a70SApple OSS Distributions<p>
90*a1e26a70SApple OSS DistributionsDepending on the client's supplied <var>sync_flags</var>, the manager waits
91*a1e26a70SApple OSS Distributionsfor the pages
92*a1e26a70SApple OSS Distributionsto reach the desired state and then replies with
93*a1e26a70SApple OSS Distributions<strong>memory_object_synchronize_completed</strong> at which time the
94*a1e26a70SApple OSS Distributionsclient returns from its <strong>vm_msync</strong> call.  Multiple
95*a1e26a70SApple OSS Distributionssynchronize requests may be outstanding at a time but they will not overlap.
96*a1e26a70SApple OSS Distributions<h3>RETURN VALUES</h3>
97*a1e26a70SApple OSS Distributions<p>
98*a1e26a70SApple OSS DistributionsOnly generic errors apply.
99*a1e26a70SApple OSS Distributions<h3>RELATED INFORMATION</h3>
100*a1e26a70SApple OSS Distributions<p>
101*a1e26a70SApple OSS DistributionsFunctions:
102*a1e26a70SApple OSS Distributions<a href="vm_msync.html"><strong>vm_msync</strong></a>,
103*a1e26a70SApple OSS Distributions<a href="MO_SY_completed.html"><strong>memory_object_synchronize_completed</strong></a>,
104*a1e26a70SApple OSS Distributions<a href="memory_object_data_return.html"><strong>memory_object_data_return</strong></a>,
105*a1e26a70SApple OSS Distributions<a href="memory_object_server.html"><strong>memory_object_server</strong></a>,
106*a1e26a70SApple OSS Distributions<a href="SMO_server.html"><strong>seqnos_memory_object_server</strong></a>.
107