User Tools

Site Tools


solaris:bp_mapin.9f

bp_mapin


NAME

bp_mapin - allocate virtual address space

SYNOPSIS

#include <sys/types.h>
#include <sys/buf.h>

void bp_mapin(struct buf *bp);

INTERFACE LEVEL

Architecture independent level 1 (DDI/DKI).

PARAMETERS

bp

Pointer to the buffer header structure.

DESCRIPTION

The bp_mapin() function makes buffer data accessible to a driver by mapping the data into a contiguous kernel virtual address region. After bp_mapin(), the mapped buffer is accessible via the bp—>b_un.b_addr field of the buf(9S) structure.

If bp_mapin() is unable to establish a mapping, it returns without allocating space and no mapping is performed.

Any resources associated with establishing the mapping are deallocated by the bp_mapout(9F) function.

CONTEXT

The bp_mapin() function can be called from user and kernel contexts.

SEE ALSO

bioaligned(9F), bp_mapout(9F), buf(9S)

Writing Device Drivers in Oracle Solaris 11.4

WARNINGS

Because bp_mapin() does not keep a reference count, bp_mapout() will wipe out any kernel mapping, including mappings that a layer above the device driver might still rely on. See bp_mapout(9F) for details.

When a driver needs to look directly at buffer data, it should call bp_mapin() without conditioning the call on other aspects of the buf(9S) structure like b_flags.

To check alignment of buffer memory, it may be more efficient for a driver to use bioaligned(9F) instead of bp_mapin().


solaris/bp_mapin.9f.txt · Last modified: 2023/07/19 08:58 by A User Not Logged in