svn commit: r303796 - head/sys/cddl/dev/dtrace/powerpc
Justin Hibbits
jhibbits at FreeBSD.org
Sat Aug 6 15:06:20 UTC 2016
Author: jhibbits
Date: Sat Aug 6 15:06:19 2016
New Revision: 303796
URL: https://svnweb.freebsd.org/changeset/base/303796
Log:
Two fixups for dtrace
* Use the right incantation to get the next stack pointer. Since powerpc uses
special frames for traps, dereferencing the stack pointer straight up won't
get us the next stack pointer in every case.
* Clear EE using the correct instruction sequence. The PowerISA states that
'andi.' ANDs the register with 0||<imm>, instead of sign extending or filling
out the unavailable bits with 1. Even if it did sign extend, PSL_EE is
0x8000, so ~PSL_EE is 0x7fff, and the upper bits would be cleared. Use rlwinm
in the 32-bit case, and a two-rotate sequence in the 64-bit case, the latter
chosen to follow the output generated by gcc.
MFC after: 1 week
Modified:
head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S
head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S
==============================================================================
--- head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Sat Aug 6 13:32:40 2016 (r303795)
+++ head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Sat Aug 6 15:06:19 2016 (r303796)
@@ -67,7 +67,13 @@ dtrace_icookie_t dtrace_interrupt_disabl
*/
ASENTRY_NOPROF(dtrace_interrupt_disable)
mfmsr %r3
- andi. %r0,%r3,~PSL_EE at l
+#ifdef __powerpc64__
+ /* Two-instruction sequence to clear EE flag */
+ rldicl %r0,%r3,48,1
+ rotldi %r0,%r0,16
+#else
+ rlwinm %r0,%r3,0,~PSL_EE /* Clear EE flag */
+#endif
mtmsr %r0
blr
END(dtrace_interrupt_disable)
Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
==============================================================================
--- head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Sat Aug 6 13:32:40 2016 (r303795)
+++ head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Sat Aug 6 15:06:19 2016 (r303796)
@@ -545,7 +545,7 @@ dtrace_getstackdepth(int aframes)
else
aframes--;
osp = sp;
- sp = *(uintptr_t *)sp;
+ sp = dtrace_next_sp(sp);
}
if (depth < aframes)
return (0);
More information about the svn-src-head
mailing list