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

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

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 pinu kernel service will not work on a mapped file.

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 xmempin kernel service can be called from the process environment only.

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

Implementation Specifics

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

Related Information

The pin kernel service, unpin kernel service, pinu kernel service, xmemunpin kernel service.

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


[ Previous | Next | Contents | Home | Search ]