pin_context_stack or unpin_context_stack Kernel Service

Purpose

Pins and unpins hidden kernel stack region.

Syntax

#include <sys/pin.h>

kerrno_t pin_context_stack (flags)
long flags;

kerrno_t unpin_context_stack (flags)
long flags;

Parameters

Item Description
flags Various flags to the kernel service. Must be set to 0.

Description

Kernel code that pins its system call stack should call this service before the first kernel stack pin and call the unpin_context_stack() service after the last unpin. These services do not pin or unpin the C execution stack, but instead pin or unpin a hidden stack resource used for the kernel-key support.

Execution Environment

These services must be called in the process environment.

Return Values

Item Description
0 Indicates a successful completion.
ENOMEM_PIN_CONTEXT_STACK Indicates that the memory is not sufficient to satisfy the request.
ENOSPC_PIN_CONTEXT_STACK Indicates that the page space is not sufficient.
EINVAL_PIN_CONTEXT_STACK Indicates that the execution environment is not valid.
EINVAL_UNPIN_CONTEXT_STACK Indicates that the execution environment is not valid. (For example, the service is not in the process environment or the kernel keys are not enabled or the value of the flag parameter is not valid.)