]>
Commit | Line | Data |
---|---|---|
9bccf70c | 1 | <h2>memory_object_init</h2>\r<hr>\r<p>\r<strong>Server Interface</strong> - Initializes a memory object.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>kern_return_t memory_object_init</strong>\r <strong>(memory_object_t</strong> <var>memory_object</var>,\r <strong>memory_object_control_t </strong><var>memory_control</var>,\r <strong>vm_size_t</strong> <var>memory_object_page_size</var><strong>);</strong>\r\r\r<strong>kern_return_t seqnos_memory_object_init</strong>\r <strong>(memory_object_t</strong> <var>memory_object</var>,\r <strong>mach_port_seqno_t</strong> <var>seqno</var>,\r <strong>memory_object_control_t</strong> <var>memory_control</var>,\r <strong>vm_size_t</strong> <var>memory_object_page_size</var><strong>);</strong>\r</pre>\r<h3>PARAMETERS</h3>\r<dl>\r<dt> <var>memory_object</var>\r<dd>\r[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.\r<p>\r<dt> <var>seqno</var>\r<dd>\r[in scalar] The sequence number of this message relative to the abstract memory object port.\r<p>\r<dt> <var>memory_control</var>\r<dd>\r[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.\r<p>\r<dt> <var>memory_object_page_size</var>\r<dd>\r[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.\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rA <strong>memory_object_init</strong> function is called as the result\rof a kernel message notifying a memory manager that the kernel has\rbeen asked to map the specified memory object into a task's virtual\raddress space. When asked to map a memory object for the first time,\rthe kernel responds by making a <strong>memory_object_init</strong>\rcall on the abstract memory object. This call is provided as a\rconvenience to the memory manager, to allow it to initialize data\rstructures and prepare to receive other requests.\r<p>\rIn addition to the\rabstract memory object port itself, the call provides\ra memory cache control port that the memory manager can use to\rcontrol use of its data by the kernel. The memory manager gets send\rrights for this port.\r<p>\rThe kernel holds send rights for the abstract memory object port, and\rboth send and receive rights for the memory cache control port.\rThe call also supplies the virtual page size to be used for\rthe memory mapping. The memory manager can use this size to detect\rmappings that use different data structures at initialization time, or\rto allocate buffers for use in reading data.\r<p>\rIf a memory object is\rmapped into the address space of more than one task on different hosts\r(with independent kernels), the memory manager will receive a\r<strong>memory_object_init</strong> call from each kernel, containing\ra unique set of control and name ports. Note that each kernel may also\ruse a different page size.\r<h3>RETURN VALUES</h3>\r<p>\r\rAny return value other than <strong>KERN_SUCCESS</strong>\ror <strong>MIG_NO_REPLY</strong>will cause\r<strong>mach_msg_server</strong> to remove the memory cache control reference.\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="memory_object_terminate.html"><strong>memory_object_terminate</strong></a>.\r |