unpin Kernel Service

Purpose

Unpins the address range in system (kernel) address space.

Syntax

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

int unpin ( addr,  length)
caddr addr;
int length;

Parameters

Item Description
addr Specifies the address of the first byte to unpin in the system (kernel) address space.
length Specifies the number of bytes to unpin.

Description

The unpin kernel service decreases the pin count of each page in the address range. 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 unpin service returns the EINVAL error code and leaves any remaining pinned pages still pinned.

The unpin service can only be called with addresses in the system (kernel) address space. The xmemunpin service should be used where the address space might be in either user or kernel space.

Execution Environment

The unpin kernel service can be called from either the process or interrupt environment.

Return Values

Item Description
0 Indicates successful completion.
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.