]>
Commit | Line | Data |
---|---|---|
9bccf70c | 1 | <h2>memory_object_data_supply</h2>\r<hr>\r<p>\r<strong>Function</strong> - Provide kernel with data previously requested by the kernel's Memory Management facility.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>kern_return_t memory_object_data_supply</strong>\r <strong>(mem_object_control_port_t</strong> <var>memory_control</var>,\r <strong>vm_offset_t</strong> <var>offset</var>,\r <strong>pointer_t</strong> <var>data</var>,\r <strong>mach_msg_type_number_t</strong> <var>data_count</var>,\r <strong>boolean_t</strong> <var>deallocate</var>,\r <strong>vm_prot_t</strong> <var>lock_value</var>,\r <strong>boolean_t</strong> <var>precious</var>,\r <strong>mach_port_t</strong> <var>reply_port</var><strong>);</strong>\r</pre>\r<h3>PARAMETERS</h3>\r<dl>\r<dt> <var>memory_control</var> \r<dd>\r[in memory-cache-control send right]\rThe memory cache control port \rto be used by the memory manager for cache management requests. \rThis port is provided by the kernel in a <strong>memory_object_init</strong>\r or <strong>memory_object_create</strong> call.\r<p>\r<p>\r<dt> <var>offset</var> \r<dd>\r[in scalar]\rThe offset within the memory object, in bytes.\r<p>\r<p>\r<dt> <var>data</var> \r<dd>\r[pointer to page aligned in array of bytes]\rThe address of the data\rbeing provided to the kernel.\r<p>\r<p>\r<dt> <var>data_count</var> \r<dd>\r[in scalar]\rThe amount of data to be provided. The number must be an \rintegral number of memory object pages.\r<p>\r<p>\r<dt> <var>deallocate</var> \r<dd>\r[in scalar]\rIf <strong>TRUE</strong>, the pages to be copied (starting at data) will be\rdeallocated from the memory manager's address space as a result of\rbeing copied into the message, allowing the pages to be moved into the \rkernel instead of being physically copied.\r<p>\r<p>\r<dt> <var>lock_value</var> \r<dd>\r[in scalar]\rOne or more forms of access <var>not</var> permitted for the specified \rdata. Valid values are:\r<dl>\r<p>\r<p>\r<dt> <strong>VM_PROT_NONE</strong>\r<dd>\rProhibits no access (that is, all forms of access are permitted).\r<p>\r<p>\r<dt> <strong>VM_PROT_READ</strong>\r<dd>\rProhibits read access.\r<p>\r<p>\r<dt> <strong>VM_PROT_WRITE</strong>\r<dd>\rProhibits write access.\r<p>\r<p>\r<dt> <strong>VM_PROT_EXECUTE</strong>\r<dd>\rProhibits execute access.\r<p>\r<p>\r<dt> <strong>VM_PROT_ALL</strong>\r<dd>\rProhibits all forms of access.\r</dl>\r<p>\r<p>\r<dt> <var>precious</var> \r<dd>\r[in scalar]\rIf <strong>TRUE</strong>, the pages being supplied are "precious," that is, \rthe memory manager is not (necessarily) retaining its own copy. These \rpages must be returned to the manager when evicted from memory, \reven if not modified.\r<p>\r<p>\r<dt> <var>reply_port</var> \r<dd>\r[in reply receive (to be converted to send) right]\rA port to which the \rkernel should send a <strong>memory_object_supply_completed</strong> to indicate \rthe status of the accepted data. <strong>MACH_PORT_NULL</strong> is allowed. The \rreply message indicates which pages have been accepted.\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rThe <strong>memory_object_data_supply</strong> function supplies the\rkernel with a range of \rdata for the specified memory object. A memory manager can only provide data \rthat was requested by a <strong>memory_object_data_request</strong>\rcall from the kernel.\r<h3>NOTES</h3>\r<p>\rThe kernel accepts only integral numbers of pages. It discards\rany partial pages \rwithout notification.\r<h3>CAUTIONS</h3>\r<p>\rA memory manager must be careful that it not attempt to provide data that has \rnot been explicitly requested. In particular, a memory manager\rmust ensure that \rit does not provide writable data again before it receives back modifications \rfrom the kernel. This may require that the memory manager remember which \rpages it has provided, or that it exercise other cache control functions (via\r<strong>memory_object_lock_request</strong>) before proceeding. The kernel prohibits the\roverwriting of live data pages and will not accept pages it has not requested.\r<h3>RETURN VALUES</h3>\r<p>\rOnly generic errors apply.\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="memory_object_data_error.html"><strong>memory_object_data_error</strong></a>,\r<a href="memory_object_data_request.html"><strong>memory_object_data_request</strong></a>,\r<a href="MO_data_unavailable.html"><strong>memory_object_data_unavailable</strong></a>,\r<a href="memory_object_lock_request.html"><strong>memory_object_lock_request</strong></a>,\r<a href="MO_supply_completed.html"><strong>memory_object_supply_completed</strong></a>.\r |