Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 2013 04:12:19 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r259245 - head/sys/powerpc/aim
Message-ID:  <201312120412.rBC4CJNZ007847@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Thu Dec 12 04:12:19 2013
New Revision: 259245
URL: http://svnweb.freebsd.org/changeset/base/259245

Log:
  FBT now does work fully on PowerPC.
  
  MFC after:	2 weeks

Modified:
  head/sys/powerpc/aim/trap.c
  head/sys/powerpc/aim/trap_subr32.S
  head/sys/powerpc/aim/trap_subr64.S

Modified: head/sys/powerpc/aim/trap.c
==============================================================================
--- head/sys/powerpc/aim/trap.c	Thu Dec 12 03:04:00 2013	(r259244)
+++ head/sys/powerpc/aim/trap.c	Thu Dec 12 04:12:19 2013	(r259245)
@@ -297,7 +297,7 @@ trap(struct trapframe *frame)
 #ifdef KDTRACE_HOOKS
 		case EXC_PGM:
 			if (frame->srr1 & EXC_PGM_TRAP) {
-				if (*(uintptr_t *)frame->srr0 == 0x7c810808) {
+				if (*(uint32_t *)frame->srr0 == 0x7c810808) {
 					if (dtrace_invop_jump_addr != NULL) {
 						dtrace_invop_jump_addr(frame);
 						return;

Modified: head/sys/powerpc/aim/trap_subr32.S
==============================================================================
--- head/sys/powerpc/aim/trap_subr32.S	Thu Dec 12 03:04:00 2013	(r259244)
+++ head/sys/powerpc/aim/trap_subr32.S	Thu Dec 12 04:12:19 2013	(r259245)
@@ -883,8 +883,8 @@ CNAME(dblow):
 	mfcr	%r29			/* save CR in r29 */
 	mfsrr1	%r1
 	mtcr	%r1
-	bf	17,1f			/* branch if privileged */
-
+	bf	17,2f			/* branch if privileged */
+1:
 	/* Unprivileged case */
 	mtcr	%r29			/* put the condition register back */
         mfsprg2	%r29			/* ... and r29 */
@@ -893,7 +893,17 @@ CNAME(dblow):
 	li	%r1, 0	 		/* How to get the vector from LR */
 
         bla     generictrap		/* and we look like a generic trap */
-1:
+2:
+#ifdef KDTRACE_HOOKS
+	/* Privileged, so drop to KDB */
+	mfsrr0	%r1
+	lwz	%r4,0(%r1)
+	/* Check if it's a DTrace trap. */
+	li	%r3,0x0808
+	addis	%r3,%r3,0x7c81
+	cmplw	%cr0,%r3,%r4
+	beq	%cr0,1b
+#endif
 	/* Privileged, so drop to KDB */
 	GET_CPUINFO(%r1)
 	stw	%r28,(PC_DBSAVE+CPUSAVE_R28)(%r1)	/* free r28 */

Modified: head/sys/powerpc/aim/trap_subr64.S
==============================================================================
--- head/sys/powerpc/aim/trap_subr64.S	Thu Dec 12 03:04:00 2013	(r259244)
+++ head/sys/powerpc/aim/trap_subr64.S	Thu Dec 12 04:12:19 2013	(r259245)
@@ -789,8 +789,9 @@ CNAME(dblow):
 	mfcr	%r29			/* save CR in r29 */
 	mfsrr1	%r1
 	mtcr	%r1
-	bf	17,1f			/* branch if privileged */
+	bf	17,2f			/* branch if privileged */
 
+1:
 	/* Unprivileged case */
 	mtcr	%r29			/* put the condition register back */
         mfsprg2	%r29			/* ... and r29 */
@@ -799,8 +800,17 @@ CNAME(dblow):
 	li	%r1, 0	 		/* How to get the vector from LR */
 
         bla     generictrap		/* and we look like a generic trap */
-1:
+2:
+#ifdef KDTRACE_HOOKS
 	/* Privileged, so drop to KDB */
+	mfsrr0	%r1
+	lwz	%r4,0(%r1)
+	/* Check if it's a DTrace trap. */
+	li	%r3,0x0808
+	addis	%r3,%r3,0x7c81
+	cmplw	%cr0,%r3,%r4
+	beq	%cr0,1b
+#endif
 	GET_CPUINFO(%r1)
 	std	%r27,(PC_DBSAVE+CPUSAVE_R27)(%r1)	/* free r27 */
 	std	%r28,(PC_DBSAVE+CPUSAVE_R28)(%r1)	/* free r28 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312120412.rBC4CJNZ007847>