[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    ddi_map_regs(9F) manual page Table of Contents

Name

ddi_map_regs, ddi_unmap_regs - map or unmap registers

Synopsis


#include <sys/conf.h>

#include <sys/ddi.h>

#include <sys/sunddi.h>

int ddi_map_regs(dev_info_t *dip, u_int rnumber, caddr_t *kaddrp,p    off_t
offset, off_t len);
void ddi_unmap_regs(dev_info_t *dip, u_int rnumber, caddr_t *kaddrp,p    off_t
offset, off_t len);

Arguments

ddi_map_regs()

dip
Pointer to the device’s dev_info structure.
rnumber
Register set number.
kaddrp
Pointer to the base kernel address of the mapped region (set on return).
offset
Offset into register space.
len
Length to be mapped.

ddi_unmap_regs()

dip
Pointer to the device’s dev_info structure.
rnumber
Register set number.
kaddrp
Pointer to the base kernel address of the region to be unmapped.
offset
Offset into register space.
len
Length to be unmapped.

Interface Level

Solaris DDI specific (Solaris DDI).

Description

ddi_map_regs() maps in the register set given by rnumber. The register number determines which register set will be mapped if more than one exists. The base kernel virtual address of the mapped register set is returned in kaddrp. offset specifies an offset into the register space to start from and len indicates the size of the area to be mapped. If len is non-zero, it overrides the length given in the register set description. See the discussion of the reg property in sbus(4) and vme(4) for more information on register set descriptions. If len and offset are 0, the entire space is mapped.

ddi_unmap_regs() undoes mappings set up by ddi_map_regs(). This is provided for drivers preparing to detach themselves from the system, allowing them to release allocated mappings. Mappings must be released in the same way they were mapped (a call to ddi_unmap_regs() must correspond to a previous call to ddi_map_regs()). Releasing portions of previous mappings is not allowed. rnumber determines which register set will be unmapped if more than one exists. The kaddrp, offset and len specify the area to be unmapped. kaddrp is a pointer to the address returned from ddi_map_regs(); offset and len should match what ddi_map_regs() was called with.

Return Values

ddi_map_regs() returns:

DDI_SUCCESS
on success.

Context

These functions can be called from user or interrupt context.

See Also

sbus(4) , vme(4)


Table of Contents