Changeset 469 for trunk/hal/tsar_mips32
- Timestamp:
- Aug 20, 2018, 1:04:16 PM (6 years ago)
- Location:
- trunk/hal/tsar_mips32/core
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/core/hal_exception.c
r459 r469 146 146 147 147 // restore FPU registers from requesting thread context 148 hal_fpu_context_restore( this ->fpu_context);148 hal_fpu_context_restore( this ); 149 149 150 150 // attach the FPU to the requesting thread … … 155 155 { 156 156 // restore FPU registers from requesting thread context 157 hal_fpu_context_restore( this ->fpu_context);157 hal_fpu_context_restore( this ); 158 158 159 159 // attach the FPU to the requesting thread … … 218 218 if( DEBUG_HAL_EXCEPTIONS < cycle ) 219 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); 220 __FUNCTION__, this->trdid, process->pid, 221 is_ins, hal_mmu_exception_str(excp_code), bad_vaddr, cycle); 221 222 #endif 222 223 … … 235 236 if( error ) 236 237 { 237 printk("\n[ERROR] in %s for thread %x : cannot map vaddr = %x\n", 238 __FUNCTION__ , this->trdid , bad_vaddr ); 238 printk("\n[USER ERROR] in %s for thread %x in process %x\n" 239 " cannot map vaddr = %x / is_ins %d / epc %x\n", 240 __FUNCTION__, this->trdid, this->process->pid, bad_vaddr, is_ins, excPC ); 239 241 240 242 return EXCP_USER_ERROR; … … 256 258 case MMU_READ_PRIVILEGE_VIOLATION: 257 259 { 258 printk("\n[ERROR] in %s for thread %x : illegal user access to vaddr = %x\n", 259 __FUNCTION__ , this->trdid , bad_vaddr ); 260 printk("\n[USER ERROR] in %s for thread %x in process %x\n" 261 " illegal user access to vaddr = %x / is_ins %d / epc %x\n", 262 __FUNCTION__, this->trdid, this->process->pid, bad_vaddr, is_ins, excPC ); 260 263 261 264 return EXCP_USER_ERROR; … … 275 278 if( error ) 276 279 { 277 printk("\n[ERROR] in %s for thread %x : cannot cow vaddr = %x\n", 278 __FUNCTION__ , this->trdid , bad_vaddr ); 280 printk("\n[USER ERROR] in %s for thread %x in process %x\n" 281 " cannot cow vaddr = %x / is_ins %d / epc %x\n", 282 __FUNCTION__, this->trdid, this->process->pid, bad_vaddr, is_ins, excPC ); 279 283 280 284 return EXCP_USER_ERROR; … … 295 299 else // non writable user error 296 300 { 297 printk("\n[ERROR] in %s for thread %x : non-writable vaddr = %x\n", 298 __FUNCTION__ , this->trdid , bad_vaddr ); 301 printk("\n[USER ERROR] in %s for thread %x in process %x\n" 302 " non-writable vaddr = %x / is_ins %d / epc %x\n", 303 __FUNCTION__, this->trdid, this->process->pid, bad_vaddr, is_ins, excPC ); 299 304 300 305 return EXCP_USER_ERROR; … … 303 308 case MMU_READ_EXEC_VIOLATION: // user error 304 309 { 305 printk("\n[ERROR] in %s for thread %x : read to non-executable vaddr = %x\n", 306 __FUNCTION__ , this->trdid , bad_vaddr ); 310 printk("\n[USER_ERROR] in %s for thread %x in process %x\n" 311 " non-executable vaddr = %x / is_ins %d / epc %x\n", 312 __FUNCTION__, this->trdid, this->process->pid, bad_vaddr, is_ins, excPC ); 307 313 308 314 return EXCP_USER_ERROR; 309 315 } 310 default: // this is a kernel error => panic311 { 312 assert( false , __FUNCTION__ ,313 " thread %x in process %x / epc %x / badvaddr %x / cycle%d\n",314 this->trdid, this->process->pid, excPC, bad_vaddr, (uint32_t)hal_get_cycles());316 default: // this is a kernel error 317 { 318 printk("\n[KERNEL ERROR] in %s for thread %x in process %x\n" 319 " epc %x / badvaddr %x / is_ins %d\n", 320 __FUNCTION__, this->trdid, this->process->pid, excPC, bad_vaddr, is_ins ); 315 321 316 322 return EXCP_KERNEL_PANIC; … … 353 359 else 354 360 { 355 nolock_printk("\n=== KERNEL PANIC/ trdid %x / pid %x / core[%x,%d] / cycle %d ===\n",361 nolock_printk("\n=== KERNEL ERROR / trdid %x / pid %x / core[%x,%d] / cycle %d ===\n", 356 362 this->trdid, process->pid, local_cxy, core->lid , (uint32_t)hal_get_cycles() ); 357 363 } … … 415 421 switch(excCode) 416 422 { 417 case XCODE_DBE: // can be non fatal423 case XCODE_DBE: // Data Bus Error : can be non fatal if page fault 418 424 { 419 425 error = hal_mmu_exception( this , excPC , false ); // data MMU exception 420 426 break; 421 427 } 422 case XCODE_IBE: // can be non fatal428 case XCODE_IBE: // Instruction Bus Error : can be non fatal if page fault 423 429 { 424 430 error = hal_mmu_exception( this , excPC , true ); // ins MMU exception 425 431 break; 426 432 } 427 case XCODE_CPU: // can be non fatal428 { 429 if( ((uzone[UZ_CR] >> 28) & 0x3) == 1 ) // FPU433 case XCODE_CPU: // Coprocessor unavailable : can be non fatal if FPU 434 { 435 if( ((uzone[UZ_CR] >> 28) & 0x3) == 1 ) // FPU 430 436 { 431 error = hal_fpu_exception( this ); // FPU exception437 error = hal_fpu_exception( this ); 432 438 } 433 else 439 else // undefined coprocessor 434 440 { 441 printk("\n[USER_ERROR] in %s for thread %x in process %x\n" 442 " undefined coprocessor / epc %x\n", 443 __FUNCTION__, this->trdid, this->process->pid, excPC ); 444 435 445 error = EXCP_USER_ERROR; 436 446 } 437 447 break; 438 448 } 439 case XCODE_OVR: // user fatal error 440 case XCODE_RI: // user fatal error 449 case XCODE_OVR: // Arithmetic Overflow : user fatal error 450 { 451 printk("\n[USER_ERROR] in %s for thread %x in process %x\n" 452 " arithmetic overflow / epc %x\n", 453 __FUNCTION__, this->trdid, this->process->pid, excPC ); 454 455 error = EXCP_USER_ERROR; 456 break; 457 } 458 case XCODE_RI: // Reserved Instruction : user fatal error 459 { 460 printk("\n[USER_ERROR] in %s for thread %x in process %x\n" 461 " reserved instruction / epc %x\n", 462 __FUNCTION__, this->trdid, this->process->pid, excPC ); 463 464 error = EXCP_USER_ERROR; 465 break; 466 } 441 467 case XCODE_ADEL: // user fatal error 442 case XCODE_ADES: // user fatal error 443 { 468 { 469 printk("\n[USER_ERROR] in %s for thread %x in process %x\n" 470 " illegal data load address / epc %x\n", 471 __FUNCTION__, this->trdid, this->process->pid, excPC ); 472 473 error = EXCP_USER_ERROR; 474 break; 475 } 476 case XCODE_ADES: // user fatal error 477 { 478 printk("\n[USER_ERROR] in %s for thread %x in process %x\n" 479 " illegal data store address / epc %x\n", 480 __FUNCTION__, this->trdid, this->process->pid, excPC ); 481 444 482 error = EXCP_USER_ERROR; 445 483 break; … … 462 500 hal_exception_dump( this , uzone , error ); 463 501 464 assert( false , __FUNCTION__ , "thread %x in process %x on core [%x,%d]", 465 this , this->process->pid , local_cxy , this->core->lid ); 502 assert( false , __FUNCTION__ , "core[%x,%d] blocked\n", local_cxy, this->core->lid ); 466 503 } 467 504
Note: See TracChangeset
for help on using the changeset viewer.