- Timestamp:
- Apr 28, 2016, 1:12:23 PM (9 years ago)
- Location:
- soft/giet_vm/giet_kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/ctx_handler.c
r725 r818 180 180 // makes context switch 181 181 _thread_switch( curr_ctx_vaddr , next_ctx_vaddr ); 182 183 // only modify the PTPR when necessary, in order to avoid unnecessary 184 // TLBs flush. 185 if (curr_ctx_vaddr->slot[CTX_PTPR_ID] != 186 next_ctx_vaddr->slot[CTX_PTPR_ID]) 187 { 188 _set_mmu_ptpr(next_ctx_vaddr->slot[CTX_PTPR_ID]); 189 } 182 190 } 183 191 } //end _ctx_switch() … … 195 203 while(1) 196 204 { 197 // initialize counter 198 unsigned int count = GIET_IDLE_THREAD_PERIOD; 199 200 // decounting loop 201 asm volatile( 202 "move $3, %0 \n" 203 "_idle_thread_loop: \n" 204 "addi $3, $3, -1 \n" 205 "bnez $3, _idle_thread_loop \n" 206 "nop \n" 207 : 208 : "r"(count) 209 : "$3" ); 205 _sleep( GIET_IDLE_THREAD_PERIOD ); 210 206 211 207 // warning message 212 _printf("\n[GIET WARNING] Processor[%d,%d,%d] still idle at cycle % d",208 _printf("\n[GIET WARNING] Processor[%d,%d,%d] still idle at cycle %u", 213 209 x , y , p , _get_proctime() ); 214 210 } -
soft/giet_vm/giet_kernel/switch.s
r709 r818 116 116 lw $26, 35*4($27) 117 117 mtc0 $26, $8 /* restore BVAR */ 118 lw $26, 39*4($27)119 mtc2 $26, $0 /* restore PTPR */120 118 121 119 /* returns to caller */
Note: See TracChangeset
for help on using the changeset viewer.