]> git.saurik.com Git - apple/xnu.git/blob - osfmk/man/vm_msync.html
xnu-2422.1.72.tar.gz
[apple/xnu.git] / osfmk / man / vm_msync.html
1 <h2>vm_msync</h2>
2 <hr>
3 <p>
4 <strong>Function</strong> - Synchronize the specified region of virtual memory.
5 <h3>SYNOPSIS</h3>
6 <pre>
7 <strong>kern_return_t vm_msync</strong>
8 <strong>(vm_task_t</strong> <var>target_task</var>,
9 <strong>vm_address_t</strong> <var>address</var>,
10 <strong>vm_size_t</strong> <var>size</var>,
11 <strong>target_task</strong> <var>sync_flags</var><strong>);</strong>
12 </pre>
13 <h3>PARAMETERS</h3>
14 <dl>
15 <p>
16 <dt> <var>target_task</var>
17 <dd>
18 [in task send right]
19 The port for the task whose address space contains
20 the region.
21 <p>
22 <dt> <var>address</var>
23 <dd>
24 [in scalar]
25 The starting address for the region.
26 <p>
27 <dt> <var>size</var>
28 <dd>
29 [in scalar]
30 The number of bytes in the region.
31 <p>
32 <dt> <var>sync_flags</var>
33 <dd>
34 [in scalar]
35 The bit-wise <strong>OR</strong> of flags affecting the synchronization.
36 Specifying both <strong>VM_SYNC_SYNCHRONOUS</strong> and
37 <strong>VM_SYNC_ASYNCHRONOUS</strong> is invalid.
38 <dl>
39 <p>
40 <dt> <strong>VM_SYNC_INVALIDATE</strong>
41 <dd>
42 Flushes pages in the range. Only precious pages are returned to
43 the memory manager unless either <strong>VM_SYNC_SYNCHRONOUS</strong> or
44 <strong>VM_SYNC_ASYNCHRONOUS</strong> is also set.
45 <p>
46 <dt> <strong>VM_SYNC_SYNCHRONOUS</strong>
47 <dd>
48 Writes dirty and precious pages back to the memory manager,
49 waits for pages to reach backing storage.
50 <p>
51 <dt> <strong>VM_SYNC_ASYNCHRONOUS</strong>
52 <dd>
53 Writes dirty and precious pages back to the memory manager,
54 returns without waiting for pages to reach backing storage.
55 </dl>
56 </dl>
57 <h3>DESCRIPTION</h3>
58 <p>
59 The <strong>vm_msync</strong> function synchronizes the contents of
60 a memory range with its
61 backing store image by flushing or cleaning the contents of the
62 specified range
63 to the range's memory manager, engaging in a synchronization protocol with
64 the manager (<strong>memory_object_synchronize</strong>).
65 The client does not return from
66 this call until the memory manager responds (to the kernel) with
67 <strong>memory_object_synchronize_completed</strong>.
68 <h3>NOTES</h3>
69 <p>
70 This interface is machine word length specific because of the virtual address
71 parameter.
72 <h3>RETURN VALUES</h3>
73 <dl>
74 <p>
75 <dt> <strong>KERN_INVALID_ADDRESS</strong>
76 <dd>
77 The address is illegal or specifies a non-allocated region.
78 </dl>
79 <h3>RELATED INFORMATION</h3>
80 <p>
81 Functions:
82 <a href="memory_object_synchronize.html"><strong>memory_object_synchronize</strong></a>,
83 <a href="MO_SY_completed.html"><strong>memory_object_synchronize_completed</strong></a>.