ddi_map_regs(9F)
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
, off_t offset, off_t len)
void ddi_unmap_regs(dev_info_t ∗dip, u_int rnumber, caddr_t ∗kaddrp
, off_t offset, off_t len)
ARGUMENTS
dip Pointer to device information structure.
rnumber Register set number.
kaddrp Pointer to kernel address set by function.
offset Offset into register space.
len Length to be mapped.
ddi_unmap_regs()
dip Pointer to device information structure.
rnumber Register set number.
kaddrp Kernel address area to be unmapped.
offset Offset into register space.
len Length to be unmapped.
INTERFACE LEVEL
Solaris architecture specific (SunDDI).
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 parent driver gets the information from parent private data and sets up the appropriate mappings and returns the kernel virtual address of the register set 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 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. 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 holds 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:
0 on success.
non-zero on failure.
CONTEXT
These functions can be called from user or interrupt context.
SunOS 5.1 — Last change: 31 May 1993