[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

unpin Kernel Service


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


#include <sys/types.h>
#include <sys/errno.h>
#include <sys/pin.h>
int unpin (addr, length)
caddr addr;
int length;


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


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 unpinu 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

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.

Implementation Specifics

The unpin kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The pin kernel service, pinu kernel service, unpinu kernel service.

Understanding Execution Environments and Memory Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.

[ Previous | Next | Contents | Home | Search ]