PERFORCE change 94528 for review

Kip Macy kmacy at FreeBSD.org
Mon Apr 3 07:55:40 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=94528

Change 94528 by kmacy at kmacy_storage:sun4v_work on 2006/04/03 07:54:52

	convert string mapping for trap numbers
	remove call to pmap_set_tsbs

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/trap.c#8 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/trap.c#8 (text+ko) ====

@@ -115,6 +115,8 @@
 
 extern char *syscallnames[];
 
+static int trap_conversion[256];
+
 const char *trap_msg[] = {
 	"reserved",
 	"instruction access exception",
@@ -237,12 +239,21 @@
 trap_init(void)
 {
 	vm_paddr_t mmfsa;
+	int i;
+
 	mmfsa = mmu_fault_status_area + (MMFSA_SIZE*PCPU_GET(cpuid));
 	set_wstate(WSTATE_KERN);
 	set_mmfsa_scratchpad(mmfsa);
 
 	OF_set_mmfsa_traptable(&tl0_base, mmfsa);
-	pmap_set_tsbs();
+	for (i = 0; i < 128; i++)
+		trap_conversion[i] = i;
+	for (i = 128; i < 256; i++)
+		trap_conversion[i] = 0;
+	trap_conversion[0x31] = 35;
+	trap_conversion[0x9] = 34;
+	trap_conversion[0x6c] = 14;
+
 }
 
 void
@@ -257,7 +268,7 @@
 	td = PCPU_GET(curthread);
 
 	CTR4(KTR_TRAP, "trap: %p type=%s (%s) pil=%#lx", td,
-	    trap_msg[type & ~T_KERNEL],
+	    trap_msg[trap_conversion[type & ~T_KERNEL]],
 	    (TRAPF_USERMODE(tf) ? "user" : "kernel"), rdpr(pil));
 
 	PCPU_LAZY_INC(cnt.v_trap);
@@ -365,13 +376,19 @@
 			UNIMPLEMENTED;
 			error = 1;
 			break;
+               case T_ILLEGAL_INSTRUCTION:
+                       if (tf->tf_tpc > KERNBASE) {
+                               printf("illinstr: 0x%lx\n", tf->tf_tpc);
+                               printf("illinstr: 0x%x\n", *((uint32_t *)tf->tf_tpc));
+                       }
+
 		default:
 			error = 1;
 			break;
 		}
 
 		if (error != 0)
-			panic("trap: %s", trap_msg[type & ~T_KERNEL]);
+			panic("trap: %s at 0x%lx", trap_msg[trap_conversion[type & ~T_KERNEL]], tf->tf_tpc);
 	}
 	CTR1(KTR_TRAP, "trap: td=%p return", td);
 }
@@ -402,6 +419,11 @@
 	type = type & ~T_KERNEL;
 	va = TLB_TAR_VA(data);
 
+#if 1
+	printf("trap_pfault(type=%ld, data=0x%lx, tpc=0x%lx, ctx=0x%lx)\n", 
+	       type, data, tf->tf_tpc, ctx);
+#endif
+
 	CTR4(KTR_TRAP, "trap_pfault: td=%p pm_ctx=%#lx va=%#lx ctx=%#lx",
 	    td, p->p_vmspace->vm_pmap.pm_context[PCPU_GET(cpuid)], va, ctx);
 


More information about the p4-projects mailing list