Future releases of Solaris will provide this function for binary and source compatibility. However, for increased functionality, use devmap_setup(9F) instead. See devmap_setup(9F) for deatils.
ddi_mapdev() sets up user mappings to device space. The driver is notified of user events on the mappings via the entry points defined by ctl.
The user events that the driver is notified of are:
- access
- User has accessed an address in the mapping that has no translations.
- duplication
- User has duplicated the mapping. Mappings are duplicated when the process calls fork(2).
- unmapping
- User has called munmap(2)
on the mapping or is exiting.
See mapdev_access(9E), mapdev_dup(9E), and mapdev_free(9E) for details on these entry points.
The range to be mapped, defined by offset and len must be valid.
The arguments dev, asp, addrp, len, prot, maxprot, flags, and cred are provided by the segmap(9E)
entry point and should not be modified. See segmap(9E) for
a description of these arguments. Unlike ddi_segmap(9F), the drivers mmap(9E) entry point is not called to verify the range to be mapped.
With the handle, device drivers can use ddi_mapdev_intercept(9F) and ddi_mapdev_nointercept(9F) to inform the system of whether or not they are interested
in being notified when the user process accesses the mapping. By default, user accesses to newly created mappings will generate a call to the mapdev_access() entry point. The driver
is always notified of duplications and unmaps.
The device may also use the handle to assign certain characteristics to the mapping. See ddi_mapdev_set_device_acc_attr(9F) for details.
The device driver can use these interfaces to implement a device context and control user accesses to the device space. ddi_mapdev()is typically called from the segmap(9E) entry point.
|