]> git.saurik.com Git - apple/xnu.git/blame - osfmk/man/device_map.html
xnu-517.tar.gz
[apple/xnu.git] / osfmk / man / device_map.html
CommitLineData
9bccf70c 1<h2>device_map</h2>\r<hr>\r<p>\r<strong>Function</strong> - Establish the specified device's memory manager.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>#include&lt device/device.h&gt</strong>\r\r<strong>kern_return_t device_map</strong>\r <strong>(mach_port_t</strong> <var>device</var>,\r <strong>vm_prot_t</strong> <var>prot</var>,\r <strong>vm_offset_t</strong> <var>offset</var>,\r <strong>vm_size_t</strong> <var>size</var>,\r <strong>mach_port_t</strong> <var>mem_obj_t</var>,\r <strong>boolean_t</strong> <var>unmap</var><strong>);</strong>\r</pre>\r<h3>PARAMETERS</h3>\r<dl>\r<p>\r<dt> <var>device</var> \r<dd>\r[in device send right]\rA device port to the device to be mapped.\r<p>\r<dt> <var>prot</var> \r<dd>\r[in scalar]\rProtection for the device memory.\r<p>\r<dt> <var>offset</var> \r<dd>\r[in scalar]\r15~Offset in memory object.\r<p>\r<dt> <var>size</var> \r<dd>\r[in scalar]\rThe size of the device memory object.\r<p>\r<dt> <var>pager</var> \r<dd>\r[out memory-object send right]\rThe returned memory \robject representative port to a memory manager that represents the\rdevice.\r<p>\r<dt> <var>unmap</var>\r<dd>\rUnused.\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rThe <strong>device_map</strong> function establishes a memory manager that presents a\rmemory object representing a device. The resulting port is suitable\rfor use as the\rmemory manager port in a <strong>vm_map</strong> call. This call is device dependent.\r<h3>NOTES</h3>\r<p>\rPort rights are maintained as follows:\r<ul>\r<li>\rMemory object port: the \rdevice memory manager has all rights.\r<li>\rMemory cache control port: the device memory manager has only send rights.\r</ul>\r<p>\rRegardless of how the object is created, the control port is created by \rthe kernel and passed through the memory management interface.\r<p>\rIf the device port used is restricted to use by a single identity,\rthe generated\rrepresentative port will be likewise restricted.\r<h3>CAUTIONS</h3>\r<p>\rThe device memory manager assumes that access to its memory objects will not \rbe propagated to more that one host, and therefore provides no consistency\rguarantees beyond those made by the kernel.\r<p>\rIn the event that more than one host attempts to use a device\rmemory object, the \rdevice memory manager will only record the last set of port names. Currently, \rthe device memory manager assumes that its clients adhere to\rthe initialization \rand termination protocols in the memory management interface; otherwise, port \rrights or out-of-line memory from erroneous messages may be allowed to\raccumulate.\r<h3>RETURN VALUES</h3>\r<dl>\r<p>\r<dt> <strong>D_DEVICE_DOWN</strong>\r<dd>\rDevice has been shut down\r<p>\r<dt> <strong>D_NO_SUCH_DEVICE</strong>\r<dd>\rNo device with that name, or the device is not operational.\r<p>\r<dt> <strong>D_READ_ONLY</strong>\r<dd>\rData cannot be written to this device.\r</dl>\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="vm_map.html"><strong>vm_map</strong></a>.\r