Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Aug 2013 05:10:46 +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: r254509 - in head/sys: cddl/dev/dtrace/powerpc modules/dtrace
Message-ID:  <201308190510.r7J5AkQQ014626@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Mon Aug 19 05:10:46 2013
New Revision: 254509
URL: http://svnweb.freebsd.org/changeset/base/254509

Log:
  Fix some ppc64 dtrace bugs, and enable systrace_freebsd32 for ppc64.

Modified:
  head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S
  head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
  head/sys/modules/dtrace/Makefile

Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S
==============================================================================
--- head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S	Mon Aug 19 04:56:03 2013	(r254508)
+++ head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S	Mon Aug 19 05:10:46 2013	(r254509)
@@ -50,6 +50,7 @@
 void dtrace_membar_producer(void)
 */
 ASENTRY_NOPROF(dtrace_membar_producer)
+	sync
 	blr
 END(dtrace_membar_producer)
 
@@ -57,6 +58,7 @@ END(dtrace_membar_producer)
 void dtrace_membar_consumer(void)
 */
 ASENTRY_NOPROF(dtrace_membar_consumer)
+	isync
 	blr
 END(dtrace_membar_consumer)
 
@@ -97,12 +99,21 @@ void *
 dtrace_casptr(void *target, void *cmp, void *new)
 */
 ASENTRY_NOPROF(dtrace_casptr)
+#ifdef __powerpc64__
+1:
+	ldarx	%r0,0,%r3
+	cmpd	%r4,%r0
+	bne	2f
+	stdcx.	%r5,0,%r3
+	bne	1b
+#else
 1:
 	lwarx	%r0,0,%r3
 	cmpw	%r4,%r0
 	bne	2f
 	stwcx.	%r5,0,%r3
 	bne	1b
+#endif
 2:	mr	%r3,%r0
 	blr
 END(dtrace_casptr)

Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
==============================================================================
--- head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c	Mon Aug 19 04:56:03 2013	(r254508)
+++ head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c	Mon Aug 19 05:10:46 2013	(r254509)
@@ -80,7 +80,11 @@ dtrace_getpcstack(pc_t *pcstack, int pcs
 		if (!INKERNEL((long) sp))
 			break;
 
+#ifdef __powerpc64__
+		callpc = *(uintptr_t *)(sp + RETURN_OFFSET64);
+#else
 		callpc = *(uintptr_t *)(sp + RETURN_OFFSET);
+#endif
 
 		if (!INKERNEL(callpc))
 			break;

Modified: head/sys/modules/dtrace/Makefile
==============================================================================
--- head/sys/modules/dtrace/Makefile	Mon Aug 19 04:56:03 2013	(r254508)
+++ head/sys/modules/dtrace/Makefile	Mon Aug 19 05:10:46 2013	(r254509)
@@ -22,7 +22,7 @@ SUBDIR+=	fasttrap fbt systrace_linux32
 .if ${MACHINE_CPUARCH} == "powerpc"
 SUBDIR+=	fbt
 .endif
-.if ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
 SUBDIR+=	systrace_freebsd32
 .endif
 



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