#ifndef _CTX_HANDLER_H #define _CTX_HANDLER_H #include ///////////////////////////////////////////////////////////////////////////////// // Definition of the scheduler structure ///////////////////////////////////////////////////////////////////////////////// typedef struct static_scheduler_s { unsigned int context[15][64]; // at most 15 task contexts unsigned int tasks; // actual number of tasks unsigned int current; // current task index unsigned int interrupt_vector[32]; // interrupt vector } static_scheduler_t; ///////////////////////////////////////////////////////////////////////////////// // Definition of the task context slots indexes ///////////////////////////////////////////////////////////////////////////////// #define CTX_SR_ID 0 #define CTX_SP_ID 29 #define CTX_RA_ID 31 #define CTX_EPC_ID 32 #define CTX_CR_ID 33 #define CTX_PTPR_ID 35 #define CTX_MODE_ID 36 #define CTX_TTY_ID 40 #define CTX_FBDMA_ID 41 #define CTX_PTAB_ID 42 #define CTX_TASK_ID 43 #define CTX_SCHED_ID 44 #define CTX_TIMER_ID 45 ////////////////////////////////////////////////////////////////////////////////// // Prototype of the context switch function ////////////////////////////////////////////////////////////////////////////////// extern void _ctx_switch(); extern static_scheduler_t _scheduler[]; #endif