1 <h2>memory_object_data_supply
</h2>
4 <strong>Function
</strong> - Provide kernel with data previously requested by the kernel's Memory Management facility.
7 <strong>kern_return_t memory_object_data_supply
</strong>
8 <strong>(mem_object_control_port_t
</strong> <var>memory_control
</var>,
9 <strong>vm_offset_t
</strong> <var>offset
</var>,
10 <strong>pointer_t
</strong> <var>data
</var>,
11 <strong>mach_msg_type_number_t
</strong> <var>data_count
</var>,
12 <strong>boolean_t
</strong> <var>deallocate
</var>,
13 <strong>vm_prot_t
</strong> <var>lock_value
</var>,
14 <strong>boolean_t
</strong> <var>precious
</var>,
15 <strong>mach_port_t
</strong> <var>reply_port
</var><strong>);
</strong>
19 <dt> <var>memory_control
</var>
21 [in memory-cache-control send right]
22 The memory cache control port
23 to be used by the memory manager for cache management requests.
24 This port is provided by the kernel in a
<strong>memory_object_init
</strong>
25 or
<strong>memory_object_create
</strong> call.
28 <dt> <var>offset
</var>
31 The offset within the memory object, in bytes.
36 [pointer to page aligned in array of bytes]
37 The address of the data
38 being provided to the kernel.
41 <dt> <var>data_count
</var>
44 The amount of data to be provided. The number must be an
45 integral number of memory object pages.
48 <dt> <var>deallocate
</var>
51 If
<strong>TRUE
</strong>, the pages to be copied (starting at data) will be
52 deallocated from the memory manager's address space as a result of
53 being copied into the message, allowing the pages to be moved into the
54 kernel instead of being physically copied.
57 <dt> <var>lock_value
</var>
60 One or more forms of access
<var>not
</var> permitted for the specified
61 data. Valid values are:
65 <dt> <strong>VM_PROT_NONE
</strong>
67 Prohibits no access (that is, all forms of access are permitted).
70 <dt> <strong>VM_PROT_READ
</strong>
72 Prohibits read access.
75 <dt> <strong>VM_PROT_WRITE
</strong>
77 Prohibits write access.
80 <dt> <strong>VM_PROT_EXECUTE
</strong>
82 Prohibits execute access.
85 <dt> <strong>VM_PROT_ALL
</strong>
87 Prohibits all forms of access.
91 <dt> <var>precious
</var>
94 If
<strong>TRUE
</strong>, the pages being supplied are "precious," that is,
95 the memory manager is not (necessarily) retaining its own copy. These
96 pages must be returned to the manager when evicted from memory,
100 <dt> <var>reply_port
</var>
102 [in reply receive (to be converted to send) right]
104 kernel should send a
<strong>memory_object_supply_completed
</strong> to indicate
105 the status of the accepted data.
<strong>MACH_PORT_NULL
</strong> is allowed. The
106 reply message indicates which pages have been accepted.
110 The
<strong>memory_object_data_supply
</strong> function supplies the
111 kernel with a range of
112 data for the specified memory object. A memory manager can only provide data
113 that was requested by a
<strong>memory_object_data_request
</strong>
114 call from the kernel.
117 The kernel accepts only integral numbers of pages. It discards
119 without notification.
122 A memory manager must be careful that it not attempt to provide data that has
123 not been explicitly requested. In particular, a memory manager
125 it does not provide writable data again before it receives back modifications
126 from the kernel. This may require that the memory manager remember which
127 pages it has provided, or that it exercise other cache control functions (via
128 <strong>memory_object_lock_request
</strong>) before proceeding. The kernel prohibits the
129 overwriting of live data pages and will not accept pages it has not requested.
130 <h3>RETURN VALUES
</h3>
132 Only generic errors apply.
133 <h3>RELATED INFORMATION
</h3>
136 <a href=
"memory_object_data_error.html"><strong>memory_object_data_error
</strong></a>,
137 <a href=
"memory_object_data_request.html"><strong>memory_object_data_request
</strong></a>,
138 <a href=
"MO_data_unavailable.html"><strong>memory_object_data_unavailable
</strong></a>,
139 <a href=
"memory_object_lock_request.html"><strong>memory_object_lock_request
</strong></a>,
140 <a href=
"MO_supply_completed.html"><strong>memory_object_supply_completed
</strong></a>.