hexo/context.h header reference
[Hardware abstraction layer module]

The source code of this header can be browsed online.

Description  

The struct context_s data structure is used to store execution state of a processor. Hexo provides some services associated with execution contexts which allow managing processor states but does not handle context scheduling directly.

Available execution context operations are mainly creation and switch related.

Members  

Types  

Functions  

Variables  

Macros  

Members detail  

#define CONTEXT_ENTRY(n) void (n) (void *param)  

This macro is declared in hexo/context.h source file, line 78.

This macro is the context entry point function prototype

#define CONTEXT_H_  

This macro is declared in hexo/context.h source file, line 37.

#define CONTEXT_IRQEN(n) void (n)(void)  

This macro is declared in hexo/context.h source file, line 104.

irq enable restore function prototype.

See also context_set_irqen.

#define CONTEXT_PREEMPT(n) struct context_s * (n)(void)  

This macro is declared in hexo/context.h source file, line 98.

context preempt function prototype.

A function pointer of this type is called on exception handler completion if valid. The function may return a pointer to a context to switch to or NULL. When this function returns a context pointer, the interrupted context will not be resumed.

The context_set_preempt function can be called from within an exception handler to setup such a one-shot handler for the executing processor.

The MutekH scheduler provides some useful preemption handlers for common context queuing operations: See sched_preempt_switch, sched_preempt_stop and sched_preempt_wait_unlock.

typedef void (context_entry_t)(void *param)   

This typedef is declared in hexo/context.h source file, line 81.

This typedef is context entry point function type.

This declaration involves expansion of the CONTEXT_ENTRY macro.

See also CONTEXT_ENTRY.

typedef void (context_irqen_t)(void )   

This typedef is declared in hexo/context.h source file, line 107.

context irq restore enable function prototype.

This declaration involves expansion of the CONTEXT_IRQEN macro.

See also CONTEXT_IRQEN.

typedef struct context_s *(context_preempt_t)(void )   

This typedef is declared in hexo/context.h source file, line 101.

context preempt function prototype.

This declaration involves expansion of the CONTEXT_PREEMPT macro.

See also CONTEXT_PREEMPT.

error_t context_set_preempt(context_preempt_t *func)  

This function sets a preemption handler function local to the executing processor. The preemtion handler pointer is reset to NULL on each exception entry and can be setup from an interrupt handler when context preemption is needed on interrupt return.

This function returns an error if a handler has already been set during the current interrupt or if it is not called from an interrupt handler. This function must be called with interrupts disabled.

This is available when CONFIG_HEXO_CONTEXT is defined.

See also CONTEXT_PREEMPT.

void cpu_context_set(uintptr_t stack, size_t stack_size, void *jumpto)  

This function sets new stack pointer and jump to a new function.

void cpu_context_set_user(uintptr_t stack_ptr, uintptr_t entry, reg_t param)  

This function sets user stack pointer and jump to a new function in user mode.

This is available when CONFIG_HEXO_CONTEXT and CONFIG_HEXO_USERMODE are both defined.

struct context_s  

This struct is declared in hexo/context.h source file, line 49.

context descriptor structure

This struct is for internal use only.

FieldDescription
void * tls;context local storage address
lock_t * unlock;lock to release on context restore
struct mmu_context_s * mmu;
size_t enter_cnt;
size_t preempt_cnt;

uintptr_t context_stack_end  

This variable is declared in hexo/context.h source file, line 76.

This is available when CONFIG_HEXO_CONTEXT is defined.

This variable is for internal use only.

uintptr_t context_stack_start  

This variable is declared in hexo/context.h source file, line 72.

This is available when CONFIG_HEXO_CONTEXT is defined.

This variable is for internal use only.

error_t cpu_context_bootstrap(struct context_s *context)  

This function intializes given context to match cpu current execution state. This function only performs processor specific part of the job.

This is available when CONFIG_HEXO_CONTEXT is defined.

This function is for internal use only.

See also context_bootstrap.

void cpu_context_destroy(struct context_s *context)  

This function cleanups given context resources. This function only performs processor specific part of the job.

This is available when CONFIG_HEXO_CONTEXT is defined.

This function is for internal use only.

See also context_init.

error_t cpu_context_init(struct context_s *context, context_entry_t *entry, void *param)  

This function initializes context and prepares first context execution. This function only performs processor specific part of the job.

This is available when CONFIG_HEXO_CONTEXT is defined.

This function is for internal use only.

See also context_init.

void cpu_context_jumpto(struct context_s *new)  

This function only performs processor specific part of the job.

This is available when CONFIG_HEXO_CONTEXT is defined.

This function is for internal use only.

See also context_jump_to.

void cpu_context_stack_use(struct context_s *context, context_entry_t *func, void *param)  

This function executes a function using given context stack. Current context stack content is preserved. This function only performs processor specific part of the job.

This is available when CONFIG_HEXO_CONTEXT is defined.

This function is for internal use only.

See also context_stack_use.

void cpu_context_switch(struct context_s *new)  

This function only performs processor specific part of the job.

This is available when CONFIG_HEXO_CONTEXT is defined.

This function is for internal use only.

See also context_switch_to.

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Oct 17 21:18:38 2018 using MkDoc