ddi_segmap(9F)
NAME
ddi_segmap − map a segment
SYNOPSIS
#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,0
u_int prot, u_int maxprot, u_int flags
, cred_t ∗credp)
ARGUMENTS
dev Device number.
offset Offset into device.
asp Pointer to as (address space) structure.
addrp Pointer to virtual address.
len Length in bytes.
prot Protection.
maxprot Protection.
flags. Flags.
credp Pointer to cred structure.
INTERFACE LEVEL
SPARC architecture specific (SPARC DDI).
DESCRIPTION
ddi_segmap() provides the default segment driver. It calls the driver’s mmap(9E) routine to validate the range to be mapped.
It is typically used as the segmap(9E) entry in the cb_ops structure for those devices that do not need to provide their own segment driver, and is not usually called directly by drivers. However, some drivers may have their own segmap(9E) entry to do some initial processing on the parameters (such as picking a virtual address, if the user did not provide one), and then call ddi_segmap() to establish the default memory segment.
RETURN VALUES
ddi_setmap() returns:
0 on success.
non-zero on failure. In particular, it returns ENXIO if the range to be mapped is invalid.
CONTEXT
ddi_segmap() can be called from user or interrupt context.
SEE ALSO
mmap(9E), segmap(9E), cred(9S)
SunOS 5.1 — Last change: 11 Apr 1991