xmemunpin Kernel Service

Purpose

Unpins the specified address range in user or system memory.

Syntax

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

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

Parameters

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

Description

The xmemunpin kernel service unpins a region of memory. When the pin count is 0, the page is not pinned and can be paged out of real memory. Upon finding an unpinned page, the xmemunpin kernel service returns the EINVAL error code and leaves any remaining pinned pages still pinned.

The xmemunpin service should be used where the address space might be in either user or kernel space.

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 xmemunpin kernel service can be called in the process environment when unpinning data that is in either user space or system space. It can be called in the interrupt environment only when unpinning data that is in system space.

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 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. If neither cause is responsible, an unpinned page was specified.