Changeset 696 for soft/giet_vm/giet_kernel/ctx_handler.c
- Timestamp:
- Aug 7, 2015, 5:42:06 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/ctx_handler.c
r695 r696 60 60 // set NORUN_MASK_TASK bit 61 61 _atomic_or( &psched->context[ltid][CTX_NORUN_ID], NORUN_MASK_TASK ); 62 } 63 64 65 ////////////////// 66 static void _ctx_exec_task( unsigned int ltid ) 67 { 68 // get scheduler address 69 static_scheduler_t* psched = (static_scheduler_t*)_get_sched(); 70 71 // TODO: reload .data segment 72 73 // find initial stack pointer 74 mapping_header_t * header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE; 75 mapping_task_t * task = _get_task_base(header); 76 mapping_vseg_t * vseg = _get_vseg_base(header); 77 unsigned int task_id = psched->context[ltid][CTX_GTID_ID]; 78 unsigned int vseg_id = task[task_id].stack_vseg_id; 79 unsigned int sp_value = vseg[vseg_id].vbase + vseg[vseg_id].length; 80 81 // reset task context: RA / SR / SP / EPC / NORUN 82 psched->context[ltid][CTX_RA_ID] = (unsigned int)&_ctx_eret; 83 psched->context[ltid][CTX_SR_ID] = GIET_SR_INIT_VALUE; 84 psched->context[ltid][CTX_SP_ID] = sp_value; 85 psched->context[ltid][CTX_EPC_ID] = psched->context[ltid][CTX_ENTRY_ID]; 86 psched->context[ltid][CTX_NORUN_ID] = 0; 62 87 } 63 88 … … 128 153 // acknowledge signal 129 154 _atomic_and( &psched->context[next_task_id][CTX_SIG_ID], ~SIG_MASK_KILL ); 130 131 // skip 132 continue; 155 } 156 157 // this task needs to be executed 158 if ( psched->context[next_task_id][CTX_SIG_ID] & SIG_MASK_EXEC ) 159 { 160 _ctx_exec_task( next_task_id ); 161 162 // acknowledge signal 163 _atomic_and( &psched->context[next_task_id][CTX_SIG_ID], ~SIG_MASK_EXEC ); 133 164 } 134 165
Note: See TracChangeset
for help on using the changeset viewer.