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

xmemunpin Kernel Service


Unpins the specified address range in user or system memory.


#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;


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


The xmemunpin kernel service unpins a region of memory previously pinned by the pinu kernel service. 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). If the caller does not have a valid cross-memory descriptor, the pinu and unpinu kernel services must be used. The xmempin and xmemunpin kernel services have shorter pathlength than the pinu and unpinu kernel services.

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

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.

Implementation Specifics

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

Related Information

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

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

[ Previous | Next | Contents | Home | Search ]