Context structure <nucleus/kernel.h>
The Context structure stores the state of a processor.
This structure is maintained internally by the Processor$context_ family of routines, and is also used by the critical section code.
This structure is only public so that it may be embedded in other structures, such as Thread objects that have a executable state.
Beyond embedding, it should not be touched.
Syntax
struct Context { reg_t regs[N]; uint8_t critical; uint8_t previous; };
Members
regs
An array of saved register values for the architecture's non-volatile registers.
This will typically include any non-volatile general purpose registers, the stack, base and instruction pointers, and the flags register.
N will depend on the number of non-volatile registers the architecture has.
critical
The number of critical sections that have been entered. If this value is non-zero, then this context is in a critical section with interrupts disabled.
previous
The saved state from before any critical sections were entered. This may just store whether or not interrupts were enabled, or it may store more depending on the architecture.