Pins the address range in the system (kernel) space.
#include <sys/types.h> #include <sys/errno.h> #include <sys/pin.h>
int pin (addr, length) caddr_t addr; int length;
addr | Specifies the address of the first byte to pin. |
length | Specifies the number of bytes to pin. |
The pin service pins the real memory pages touched by the address range specified by the addr and length parameters in the system (kernel) address space. It pins the real-memory pages to ensure that page faults do not occur for memory references in this address range. The pin service increments the pin count for each real-memory page. While the pin count is nonzero, the page cannot be paged out of real memory.
The pin routine pins either the entire address range or none of it. Only a limited number of pages can be pinned in the system. If there are not enough unpinned pages in the system, the pin service returns an error code.
Note: If the requested range is not aligned on a page boundary, then memory outside this range is also pinned. This is because the operating system pins only whole pages at a time.
The pin service can only be called for addresses within the system (kernel) address space. The pinu service should be used for addresses within kernel or user space.
The pin kernel service can be called from the process environment only.
The pin kernel service is part of Base Operating System (BOS) Runtime.
The unpin kernel service.
Understanding Execution Environments and Memory Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.