memory_object_init.html   [plain text]


<h2>memory_object_init</h2>
<hr>
<p>
<strong>Server Interface</strong> - Initializes a memory object.
<h3>SYNOPSIS</h3>
<pre>
<strong>kern_return_t   memory_object_init</strong>
		<strong>(memory_object_t</strong>                <var>memory_object</var>,
		 <strong>memory_object_control_t       </strong><var>memory_control</var>,
		 <strong>vm_size_t</strong>            <var>memory_object_page_size</var><strong>);</strong>


<strong>kern_return_t   seqnos_memory_object_init</strong>
		<strong>(memory_object_t</strong>                <var>memory_object</var>,
		 <strong>mach_port_seqno_t</strong>                      <var>seqno</var>,
		 <strong>memory_object_control_t</strong>       <var>memory_control</var>,
		 <strong>vm_size_t</strong>            <var>memory_object_page_size</var><strong>);</strong>
</pre>
<h3>PARAMETERS</h3>
<dl>
<dt> <var>memory_object</var>
<dd>
[in abstract-memory-object port] The abstract memory object port that represents the memory object data, as supplied to the kernel in a vm_map call.
<p>
<dt> <var>seqno</var>
<dd>
[in scalar] The sequence number of this message relative to the abstract memory object port.
<p>
<dt> <var>memory_control</var>
<dd>
[in memory-cache-control port] The memory cache control port to be used by the memory manager. If the memory object has been supplied to more than one kernel, this parameter identifies the kernel that is making the call.
<p>
<dt> <var>memory_object_page_size</var>
<dd>
[in scalar] The page size used by the kernel. All calls involving this kernel must use data sizes that are integral multiples of this page size.
</dl>
<h3>DESCRIPTION</h3>
<p>
A <strong>memory_object_init</strong> function is called as the result
of a kernel message notifying a memory manager that the kernel has
been asked to map the specified memory object into a task's virtual
address space.  When asked to map a memory object for the first time,
the kernel responds by making a <strong>memory_object_init</strong>
call on the abstract memory object. This call is provided as a
convenience to the memory manager, to allow it to initialize data
structures and prepare to receive other requests.
<p>
In addition to the
abstract memory object port itself, the call provides
a memory cache control port that the memory manager can use to
control use of its data by the kernel. The memory manager gets send
rights for this port.
<p>
The kernel holds send rights for the abstract memory object port, and
both send and receive rights for the memory cache control port.
The call also supplies the virtual page size to be used for
the memory mapping. The memory manager can use this size to detect
mappings that use different data structures at initialization time, or
to allocate buffers for use in reading data.
<p>
If a memory object is
mapped into the address space of more than one task on different hosts
(with independent kernels), the memory manager will receive a
<strong>memory_object_init</strong> call from each kernel, containing
a unique set of control and name ports. Note that each kernel may also
use a different page size.
<h3>RETURN VALUES</h3>
<p>

Any return value other than <strong>KERN_SUCCESS</strong>
or <strong>MIG_NO_REPLY</strong>will cause
<strong>mach_msg_server</strong> to remove the memory cache control reference.
<h3>RELATED INFORMATION</h3>
<p>
Functions:
<a href="memory_object_terminate.html"><strong>memory_object_terminate</strong></a>.