[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

xm_mapin Kernel Service

Purpose

Sets up addressability in the current process context.

Syntax

int xm_mapin (dp, baddr, count, eaddr)
struct xmem *dp;
caddr_t baddr;
size_t count;
caddr_t *eaddr;

Description

The xm_mapin kernel service sets up addressability in the current process context to the address space indicated by the cross memory descriptor pointed to by the dp parameter and the offset specified in the low 28 bits of the baddr parameter.

This service is created specifically for Client File Systems, or others who need to setup addressability to an address space defined by an xmem descriptor.

In the case of a segment crossing (XMEM_PROC2), the xm_mapin kernel service will setup addressability to what it can. If the requested mapping is fully contained in either the first or second segments, the entire request will be successfully mapped. If the requested mapping spans a segment boundary, no mapping will be performed, and a return code of EAGAIN is returned to indicate that individual calls to the xm_mapin kernel service are necessary to map the portions of the buffer in each segment. The xm_mapin kernel service must be called again with the original baddr and a count indicating the number of bytes to the next 256 MB boundary. This will provide an effective address to use for accessing this portion of the buffer. Then, xm_mapin must be called with the segment boundary address (previous baddr + count), and a new count indicating the remainder of the buffer. This will provide another effective address to use for accessing the second portion of the buffer.

Parameters

dp Points to the cross memory descriptor.
baddr Points to the virtual buffer.
count Specifies the length of the virtual buffer.
eaddr Points to where the effective address to access the data buffer is returned.

Return Values

0 Successful. (Reference Parameter eaddr contains the address to use)
XMEM_FAIL Invalid cross memory descriptor.
EAGAIN Segment boundary crossing encountered. Caller should make separate xmem_att calls to map each segments worth

Execution Environment

The xm_mapin kernel service can be called from the process or interrupt environments.

Related Information

xlate_create Kernel Service, xlate_remove Kernel Service, xm_det Kernel Service, xlate_pin Kernel Service, and xlate_unpin Kernel Service.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]