Index: trunk/hal/tsar_mips32/core/hal_exception.c
===================================================================
--- trunk/hal/tsar_mips32/core/hal_exception.c	(revision 101)
+++ trunk/hal/tsar_mips32/core/hal_exception.c	(revision 296)
@@ -49,11 +49,11 @@
 typedef enum
 {
-    XCODE_ADEL = 4,        // Illegal address for data load 
-    XCODE_ADES = 5,        // Illegal address for data store
-    XCODE_IBE  = 6,        // Instruction MMU exception       (can be NON-FATAL)
-    XCODE_DBE  = 7,        // Data MMU exception              (can be NON-FATAL)
-    XCODE_RI   = 10,       // Reserved instruction exception
-    XCODE_CPU  = 11,       // Coprocessor unusable exception  (can be NON-FATAl)
-    XCODE_OVR  = 12        // Arithmetic Overflow exception
+    XCODE_ADEL = 0x4,        // Illegal address for data load 
+    XCODE_ADES = 0x5,        // Illegal address for data store
+    XCODE_IBE  = 0x6,        // Instruction MMU exception       (can be NON-FATAL)
+    XCODE_DBE  = 0x7,        // Data MMU exception              (can be NON-FATAL)
+    XCODE_RI   = 0xA,        // Reserved instruction exception
+    XCODE_CPU  = 0xB,        // Coprocessor unusable exception  (can be NON-FATAl)
+    XCODE_OVR  = 0xC,        // Arithmetic Overflow exception
 }
 xcode_values_t;
@@ -105,5 +105,5 @@
         case XCODE_RI:   // user fatal error
         {
-            printk("\n[ERROR] in thread %x / arithmetic overflow\n",
+            printk("\n[ERROR] in thread %x / Illegal Codop\n",
 		           this->trdid );
 		    error = EXCP_USER_ERROR;
@@ -123,6 +123,6 @@
         default:
         {
-            printk("\n[PANIC] in %s for thread %x / illegal XCODE value\n",
-		           __FUNCTION__ , this->trdid );
+            printk("\n[PANIC] in %s for thread %x / illegal XCODE value = %x\n",
+		           __FUNCTION__ , this->trdid , excCode );
 		    error = EXCP_USER_ERROR;
         }
@@ -149,37 +149,34 @@
     remote_spinlock_lock( XPTR( LOCAL_CLUSTER->io_cxy , &exception_lock ) );
 
-    // dump core registers values
+    if( this->type == THREAD_USER )
+    printk("\n================= USER ERROR =======================================\n");
+    else
+    printk("\n================= KERNEL PANIC =====================================\n");
 
-    printk("\n====================================================================\n");
-	printk("  thread %x / process %x / core %x / cycle %d\n",
-           this->trdid , this->process->pid , this->core->gid , hal_get_cycles() );
+	printk("  thread type = %s / trdid = %x / pid %x / core[%x,%d]\n"
+           "  local locks = %d / remote locks = %d / blocked_vector = %X\n\n",
+           thread_type_str(this->type), this->trdid, this->process->pid, local_cxy,
+           this->core->lid, this->local_locks, this->remote_locks, this->blocked );
 
-	printk("  - Processor State:\n");
-  
-	printk("    CR:   %x\tEPC:  %x\tSR:   %x\tSP:    %x\n",
+	printk("CR    %X  EPC   %X  SR    %X  SP     %X\n",
 		   regs_tbl[UZ_CR], regs_tbl[UZ_EPC], regs_tbl[UZ_SR], regs_tbl[UZ_SP]);
 
-    printk("    at_1  %x\tv0_2  %x\t\tv1_3  %x\ta0_4   %x\ta1_5   %x\n",
+    printk("at_1  %X  v0_2  %X  v1_3  %X  a0_4   %X  a1_5   %X\n",
    	       regs_tbl[UZ_AT], regs_tbl[UZ_V0], regs_tbl[UZ_V1], regs_tbl[UZ_A0], regs_tbl[UZ_A1]);
 
-    printk("    a2_6  %x\t\ta3_7  %x\tt0_8  %x\tt1_9   %x\tt2_10  %x\n",
+    printk("a2_6  %X  a3_7  %X  t0_8  %X  t1_9   %X  t2_10  %X\n",
 		   regs_tbl[UZ_A2],regs_tbl[UZ_A3],regs_tbl[UZ_T0],regs_tbl[UZ_T1],regs_tbl[UZ_T2]);
   
-    printk("    t3_11 %x\tt4_12 %x\t\tt5_13 %x\tt6_14  %x\tt7_15  %x\n",
+    printk("t3_11 %X  t4_12 %X  t5_13 %X  t6_14  %X  t7_15  %X\n",
 		   regs_tbl[UZ_T3],regs_tbl[UZ_T4],regs_tbl[UZ_T5],regs_tbl[UZ_T6],regs_tbl[UZ_T7]);
 
-    printk("    t8_24 %x\t\tt9_25 %x\tgp_28 %x\tc0_hi  %x\tc0_lo  %x\n",
+    printk("t8_24 %X  t9_25 %X  gp_28 %X  c0_hi  %X  c0_lo  %X\n",
 		   regs_tbl[UZ_T8],regs_tbl[UZ_T9],regs_tbl[UZ_GP],regs_tbl[UZ_HI],regs_tbl[UZ_LO]);
 
-    printk("    s0_16 %x\ts1_17 %x\ts2_18 %x\ts3_19  %x\ts4_20  %x\n",
+    printk("s0_16 %X  s1_17 %X  s2_18 %X  s3_19  %X  s4_20  %X\n",
 		   regs_tbl[UZ_S0],regs_tbl[UZ_S1],regs_tbl[UZ_S2],regs_tbl[UZ_S3],regs_tbl[UZ_S4]);
   
-    printk("    s5_21 %x\ts6_22 %x\t\ts7_23 %x\ts8_30  %x\tra_31  %x\n\n",
+    printk("s5_21 %X  s6_22 %X  s7_23 %X  s8_30  %X  ra_31  %X\n",
 	       regs_tbl[UZ_S5],regs_tbl[UZ_S6],regs_tbl[UZ_S7],regs_tbl[UZ_S8],regs_tbl[UZ_RA]);
-
-    printk("  - Thread State: %x\n"
-           "    type = %s / local_locks = %d / remote_locks = %d / blocked = %x\n",
-           thread_type_str( this->type ), this->local_locks, this->remote_locks,
-           this->blocked );
 
     // release the exception_lock
