Changeset 165 for soft/giet_vm/sys/ctx_handler.c
- Timestamp:
- Jul 4, 2012, 2:51:18 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/ctx_handler.c
r164 r165 25 25 // ctx[3] <- $3 ctx[11]<- $11 ctx[19]<- $19 ctx[27]<- HI ctx[35]<- PTPR 26 26 // ctx[4] <- $4 ctx[12]<- $12 ctx[20]<- $20 ctx[28]<- $28 ctx[36]<- MODE 27 // ctx[5] <- $5 ctx[13]<- $13 ctx[21]<- $21 ctx[29]<- $29 ctx[37]<- reserved27 // ctx[5] <- $5 ctx[13]<- $13 ctx[21]<- $21 ctx[29]<- $29 ctx[37]<- FBDMA 28 28 // ctx[6] <- $6 ctx[14]<- $14 ctx[22]<- $22 ctx[30]<- $30 ctx[38]<- reserved 29 29 // ctx[7] <- $7 ctx[15]<- $15 ctx[23]<- $23 ctx[31]<- $31 ctx[39]<- reserved … … 64 64 unsigned int *next_context; 65 65 66 unsigned int tasks; 67 unsigned int proc_id; 68 69 proc_id = _procid(); 70 tasks = _scheduler[proc_id].tasks; 66 unsigned int pid = _procid(); 67 unsigned int time = _proctime(); 68 unsigned int tasks = _scheduler[pid].tasks; 71 69 72 70 // return if only one task */ … … 74 72 75 73 // compute the task context base address for the current task 76 curr_task_id = _scheduler[p roc_id].current;77 curr_context = &(_scheduler[p roc_id].context[curr_task_id][0]);74 curr_task_id = _scheduler[pid].current; 75 curr_context = &(_scheduler[pid].context[curr_task_id][0]); 78 76 79 77 // select the next task using a round-robin scheduling policy … … 81 79 82 80 // compute the task context base address for the next task 83 next_context = &(_scheduler[proc_id].context[next_task_id][0]); 84 85 // update the scheduler state, and makes the task switch 86 _scheduler[proc_id].current = next_task_id; 87 _task_switch( curr_context, next_context ); 81 next_context = &(_scheduler[pid].context[next_task_id][0]); 88 82 89 83 #if GIET_DEBUG_SWITCH 90 unsigned int time = _proctime();84 _get_lock( &_tty_put_lock ); 91 85 _puts( "\n[GIET] Context switch for processor "); 92 _putw( p roc_id );86 _putw( pid ); 93 87 _puts( " at cycle "); 94 88 _putw( time ); … … 103 97 _putw( next_task_id ); 104 98 _puts("\n"); 99 _release_lock( &_tty_put_lock ); 105 100 #endif 101 102 // update the scheduler state, and makes the task switch 103 _scheduler[pid].current = next_task_id; 104 _task_switch( curr_context, next_context ); 106 105 107 106 } // end _ctx_switch
Note: See TracChangeset
for help on using the changeset viewer.