Next: , Previous: Device Write, Up: Device Interface

10.6 Device Map

— Function: kern_return_t device_map (device_t device, vm_prot_t prot, vm_offset_t offset, vm_size_t size, mach_port_t *pager, int unmap)

The function device_map creates a new memory manager for device and returns a port to it in pager. The memory manager is usable as a memory object in a vm_map call. The call is device dependent.

The protection for the memory object is specified by prot. The memory object starts at offset within the device and extends size bytes. unmap is currently unused.

The function returns D_SUCCESS if some data was successfully written and D_NO_SUCH_DEVICE if device does not denote a device port or the device is dead or not completely open.