Changeset 189 for soft/giet_vm/sys/switch.s
- Timestamp:
- Aug 7, 2012, 6:37:49 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/switch.s
r158 r189 1 1 /****************************************************************************** 2 * This function receives two arguments representing addresses of task 3 * contexts, respectively for the current running task to be descheduled and 4 * for the next task to be scheduled. 2 * This function receives two arguments that are the current task context 3 * physical addresses and the next task context physical address. 5 4 ******************************************************************************/ 6 5 … … 11 10 _task_switch: 12 11 12 /* desactivate DTLB */ 13 ori $27, $0, 0xB 14 mtc2 $27, $1 /* DTLB desactivated */ 15 13 16 /* save _current task context */ 14 15 17 add $27, $4, $0 /* $27 <= &context[curr_task_id] */ 16 18 … … 58 60 mfc2 $26, $0 59 61 sw $26, 35*4($27) /* ctx[35] <= PTPR */ 60 mfc2 $26, $161 sw $26, 36*4($27) /* ctx[36] <= MODE */62 62 63 63 /* restore next task context */ 64 65 64 add $27, $5, $0 /* $27<= &context[next_task_id] */ 66 65 67 66 lw $26, 35*4($27) 68 67 mtc2 $26, $0 /* restore PTPR */ 69 lw $26, 36*4($27)70 mtc2 $26, $1 /* restore MODE */71 68 lw $26, 0*4($27) 72 69 mtc0 $26, $12 /* restore SR */ … … 111 108 mtc0 $26, $13 /* restore CR */ 112 109 113 jr $31 /* returns to caller */ 110 /* activate DTLB */ 111 ori $27, $0, 0xF 112 mtc2 $27, $1 113 114 /* returns to caller */ 115 jr $31 114 116 115 117 .endfunc
Note: See TracChangeset
for help on using the changeset viewer.