#define OS_START_SEC_VAR_UNSPECIFIED #include "tpl_memmap.h" % # In monocore, the tpl_kern variable is the well known structure used # in monocore version of Trampoline if OS::NUMBER_OF_CORES == 1 then % /** * @internal * * tpl_kern gather informations on the current executing object and * the previous one */ VAR(tpl_kern_state, OS_VAR) tpl_kern = { NULL, /* no running task static descriptor */ &IDLE_TASK_task_stat_desc, /* elected task to run is idle task */ NULL, /* no running task dynamic descriptor */ &IDLE_TASK_task_desc, /* elected task to run is idle task */ INVALID_PROC_ID, /* no running task so no ID */ INVALID_PROC_ID, /* idle task has no ID */ NO_NEED_SWITCH, /* no context switch needed at start */ FALSE, /* no schedule needed at start */ #if WITH_MEMORY_PROTECTION == YES 1, /* at early system startup, we run in */ /* kernel mode, so in trusted mode */ #endif /* WITH_MEMORY_PROTECTION */ }; % # In multicore, the tpl_kern variable is an array of pointers # to tpl_kern_state structures indexed by core number else% /** * @internal * * a tpl_kern is used for each core. Each tpl_kern gather informations * on the current executing object and the previous one on the corresponding * core */ % loop core_id from 0 to OS::NUMBER_OF_CORES - 1 do% VAR(tpl_kern_state, OS_VAR) tpl_kern_% !core_id % = { NULL, /* no previous task static descriptor */ &IDLE_TASK_% !core_id %_task_stat_desc, /* current task tu run is idle task */ NULL, /* no previous task dynamic descriptor */ &IDLE_TASK_% !core_id %_task_desc, /* current task tu run is idle task */ INVALID_PROC_ID, /* no running task so no ID */ INVALID_PROC_ID, /* idle task has no ID */ NO_NEED_SWITCH, /* no context switch needed at start */ FALSE, /* no schedule needed at start */ #if WITH_MEMORY_PROTECTION == YES 1, /* at early system startup, we run in */ /* kernel mode, so in trusted mode */ #endif /* WITH_MEMORY_PROTECTION */ }; % end loop loop core_id from 0 to OS::NUMBER_OF_CORES - 1 before % CONSTP2VAR(tpl_kern_state, OS_CONST, OS_VAR) tpl_kern[% ! OS::NUMBER_OF_CORES %] = { % do % &tpl_kern_% !core_id between %, % after % }; % end loop end if % #define OS_STOP_SEC_VAR_UNSPECIFIED #include "tpl_memmap.h"