Processor$context_save function <nucleus/kernel.h>

The Processor$context_save function saves the state of the processor at the time of the call into a specified Context structure. A return code is given that indicates if the function returned normally or from a jump.

Syntax

int
Processor$context_save(
	struct Context *ctx
) __attribute__((returns_twice));

Parameters

ctx

The address of a Context structure, in which the processor state is to be saved. The context structure will have the value from the moment of the call, except EIP which will be the address of the instruction after the call.

Return value

A value indicating whether or not the function returned normally, or because of a context_load call. The possible values are: