* syscall.c: Fix 64-bit process detection on embedded powerpc

Signed-off-by: James Yang <[email protected]>
---
 syscall.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/syscall.c b/syscall.c
index 3477dcd..8d47e7e 100644
--- a/syscall.c
+++ b/syscall.c
@@ -1222,8 +1222,9 @@ get_scno(struct tcb *tcp)
        int currpers;
 
        /* Check for 64/32 bit mode. */
-       /* SF is bit 0 of MSR */
-       if ((ppc_regs.msr >> 63) & 1)
+       /* SF is bit 0 of MSR (a 64-bit register in Server) */
+       /* CM is bit 0 of MSR (a 32-bit register in Embedded) */
+       if (((ppc_regs.msr >> 63) & 1) || ((ppc_regs.msr >> 31) & 1))
                currpers = 0;
        else
                currpers = 1;
-- 
1.7.2.5



------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to