|
|
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
int ddi_segmap(dev_t dev, off_t offset,
struct as *asp,
caddr_t *addrp, off_t len,
u_int prot,
u_int maxprot,
u_int flags, cred_t *credp);
int ddi_segmap_setup(dev_t dev,
off_t offset,
struct as *asp,
caddr_t *addrp,
off_t len,
u_int prot,
u_int maxprot, u_int flags,
cred_t *credp,
ddi_device_acc_attr_t dev_acc_attr);
Solaris DDI specific (Solaris DDI).
ddi_segmap() and ddi_segmap_setup() set up user mappings to device space. When setting up the mapping, the ddi_segmap() and ddi_segmap_setup() routines call the mmap.9e entry point to validate the range to be mapped. When a user process accesses the mapping, the drivers mmap() entry point is again called to retrieve the page frame number that needs to be loaded. The mapping translations for that page are then loaded on behalf of the driver by the DDI framework.
ddi_segmap() is typically used as the segmap.9e entry in the cb_ops.9s structure for those devices that do not choose to provide their own segmap.9e entry point. However, some drivers may have their own segmap.9e entry point to do some initial processing on the parameters and then call ddi_segmap() to establish the default memory mapping.
ddi_segmap_setup() is used in the drivers segmap() entry point to set up the mapping and assign device access attributes to that mapping. See ddi_device_acc_attr.9s for details what device access attributes are available.
ddi_segmap_setup() cannot be used directly in the cb_ops.9s structure and requires a driver to have a segmap() entry point.
ddi_segmap() and ddi_segmap_setup() can be called from user or kernel context only.
|
|
Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97