xmempin Kernel Service

Purpose

Pins the specified address range in user or system memory.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/uio.h>

int xmempin( base,  len,  xd)
caddr_t base;
int len;
struct xmem *xd;

Parameters

Item Description
base Specifies the address of the first byte to pin.
len Indicates the number of bytes to pin.
xd Specifies the cross-memory descriptor.

Description

The xmempin kernel service is used to pin pages backing a specified memory region which is defined in either system or user address space. Pinning a memory region prohibits the pager from stealing pages from the pages backing the pinned memory region. Once a memory region is pinned, accessing that region does not result in a page fault until the region is subsequently unpinned.

The cross-memory descriptor must have been filled in correctly prior to the xmempin call (for example, by calling the xmattach kernel service).

Execution Environment

The xmempin kernel service can be called from the process environment only.

Return Values

Item Description
0 Indicates successful completion.
EFAULT Indicates that the memory region as specified by the base and len parameters is not within the address space specified by the xd parameter.
EINVAL Indicates that the value of the length parameter is negative or 0. Otherwise, the area of memory beginning at the byte specified by the base parameter and extending for the number of bytes specified by the len parameter is not defined.
ENOMEM Indicates that the xmempin kernel service is unable to pin the region due to insufficient real memory or because it has exceeded the systemwide pin count.