setjmpx Kernel Service

Purpose

Allows saving the current execution state or context.

Syntax

#include <sys/types.h>
#include <sys/errno.h>

int setjmpx ( jump_buffer)
label_t *jump_buffer;

Parameter

Item Description
jump_buffer Specifies the address of the caller-supplied jump buffer that was specified on the call to the setjmpx service.

Description

The setjmpx kernel service saves the current execution state, or context, so that a subsequent longjmpx call can cause an immediate return from the setjmpx service. The setjmpx service saves the context with the necessary state information including:

Other state variables include the nonvolatile general purpose registers, the current program's table of contents and stack pointers, and the return address.

Calls to the setjmpx service can be nested. Each call to the setjmpx service causes the context at this point to be pushed to the top of the stack of saved contexts.

Execution Environment

The setjmpx kernel service can be called from either the process or interrupt environment.

Return Values

Item Description
Nonzero value Indicates that a longjmpx call caused the setjmpx service to return.
0 Indicates any other circumstances.