Sets up addressability in the current process context.
int xm_mapin (dp, baddr, count, eaddr) struct xmem *dp; caddr_t baddr; size_t count; caddr_t *eaddr;
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.
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 |
The xm_mapin kernel service can be called from the process or interrupt environments.
xlate_create Kernel Service, xlate_remove Kernel Service, xm_det Kernel Service, xlate_pin Kernel Service, and xlate_unpin Kernel Service.