Changeset 457 for trunk/hal/tsar_mips32/core/hal_exception.c
- Timestamp:
- Aug 2, 2018, 11:47:13 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/core/hal_exception.c
r440 r457 22 22 */ 23 23 24 #include <hal_ types.h>24 #include <hal_kernel_types.h> 25 25 #include <hal_irqmask.h> 26 26 #include <hal_special.h> … … 134 134 core_t * core = this->core; 135 135 136 // enable FPU 136 // enable FPU (in core SR) 137 137 hal_fpu_enable(); 138 138 139 // save FPU contextin current owner thread if required139 // save FPU register values in current owner thread if required 140 140 if( core->fpu_owner != NULL ) 141 141 { 142 142 if( core->fpu_owner != this ) 143 143 { 144 // save the FPU registers to current owner thread context 144 145 hal_fpu_context_save( XPTR( local_cxy , core->fpu_owner ) ); 146 147 // restore FPU registers from requesting thread context 148 hal_fpu_context_restore( this->fpu_context ); 149 150 // attach the FPU to the requesting thread 151 core->fpu_owner = this; 145 152 } 146 153 } 147 148 // attach the FPU to the requesting thread 149 hal_fpu_context_restore( this->fpu_context ); 150 core->fpu_owner = this; 154 else 155 { 156 // restore FPU registers from requesting thread context 157 hal_fpu_context_restore( this->fpu_context ); 158 159 // attach the FPU to the requesting thread 160 core->fpu_owner = this; 161 } 151 162 152 163 return EXCP_NON_FATAL; … … 206 217 uint32_t cycle = (uint32_t)hal_get_cycles(); 207 218 if( DEBUG_HAL_EXCEPTIONS < cycle ) 208 printk("\n[DBG] %s : thread %x enter / is_ins %d / %s / vaddr %x / cycle %d\n",209 __FUNCTION__, this , is_ins, hal_mmu_exception_str(excp_code), bad_vaddr, cycle);219 printk("\n[DBG] %s : thread %x in process %x enter / is_ins %d / %s / vaddr %x / cycle %d\n", 220 __FUNCTION__, this->trdid, process->pid, is_ins, hal_mmu_exception_str(excp_code), bad_vaddr, cycle); 210 221 #endif 211 222 … … 235 246 cycle = (uint32_t)hal_get_cycles(); 236 247 if( DEBUG_HAL_EXCEPTIONS < cycle ) 237 printk("\n[DBG] %s : thread %x exit / page-fault handled for vaddr = %x\n",238 __FUNCTION__ , this, bad_vaddr );248 printk("\n[DBG] %s : thread %x in process %x exit / page-fault handled for vaddr = %x\n", 249 __FUNCTION__, this->trdid, process->pid, bad_vaddr ); 239 250 #endif 240 251 … … 275 286 cycle = (uint32_t)hal_get_cycles(); 276 287 if( DEBUG_HAL_EXCEPTIONS < cycle ) 277 printk("\n[DBG] %s : thread %x exit / copy-on-write handled for vaddr = %x\n",278 __FUNCTION__ , this, bad_vaddr );288 printk("\n[DBG] %s : thread %x in process %x exit / copy-on-write handled for vaddr = %x\n", 289 __FUNCTION__, this->trdid, process->pid, bad_vaddr ); 279 290 #endif 280 291 … … 300 311 { 301 312 assert( false , __FUNCTION__ , 302 "thread %x / core[%x,%d] / epc %x / vaddr %x / cycle %d\n", 303 this, local_cxy, this->core->lid, excPC, bad_vaddr, (uint32_t)hal_get_cycles() ); 313 "thread %x in process %x / core[%x,%d] / epc %x / vaddr %x / cycle %d\n", 314 this->trdid, this->process->pid, local_cxy, this->core->lid, 315 excPC, bad_vaddr, (uint32_t)hal_get_cycles() ); 304 316 305 317 return EXCP_KERNEL_PANIC; … … 398 410 uint32_t cycle = (uint32_t)hal_get_cycles(); 399 411 if( DEBUG_HAL_EXCEPTIONS < cycle ) 400 printk("\n[DBG] %s : thread %x enter / core[%x,%d] / pid %x/ epc %x / xcode %x / cycle %d\n",401 __FUNCTION__, this , local_cxy, this->core->lid, this->process->pid, excPC, excCode, cycle );412 printk("\n[DBG] %s : thread %x in process %x enter / core[%x,%d] / epc %x / xcode %x / cycle %d\n", 413 __FUNCTION__, this->trdid, this->process->pid, local_cxy, this->core->lid, excPC, excCode, cycle ); 402 414 #endif 403 415 … … 458 470 cycle = (uint32_t)hal_get_cycles(); 459 471 if( DEBUG_HAL_EXCEPTIONS < cycle ) 460 printk("\n[DBG] %s : thread %x exit / core[%x,%d] / pid %x/ epc %x / xcode %x / cycle %d\n",461 __FUNCTION__, this , local_cxy, this->core->lid, this->process->pid, excPC, excCode, cycle );472 printk("\n[DBG] %s : thread %x in process %x exit / core[%x,%d] / epc %x / xcode %x / cycle %d\n", 473 __FUNCTION__, this->trdid, this->process->pid, local_cxy, this->core->lid, excPC, excCode, cycle ); 462 474 #endif 463 475
Note: See TracChangeset
for help on using the changeset viewer.