diff options
author | James Yang <james.yang@freescale.com> | 2014-02-18 15:32:43 -0600 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2014-02-25 23:33:30 +0000 |
commit | a78d777c869829a3f0320e1793adb44fb57ac950 (patch) | |
tree | e4b359fd808c86d5a3cbce3674364f7080256bcc /syscall.c | |
parent | fdb896e577d4154b4dbd4350c9828e7df3b7da84 (diff) | |
download | strace-a78d777c869829a3f0320e1793adb44fb57ac950.tar.gz strace-a78d777c869829a3f0320e1793adb44fb57ac950.tar.bz2 strace-a78d777c869829a3f0320e1793adb44fb57ac950.tar.xz |
powerpc64: fix 64-bit process detection on embedded
* syscall.c (get_scno) [POWERPC64]: Fix 64-bit process detection
on embedded powerpc.
Signed-off-by: James Yang <james.yang@freescale.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Diffstat (limited to 'syscall.c')
-rw-r--r-- | syscall.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1218,12 +1218,13 @@ get_scno(struct tcb *tcp) # ifdef POWERPC64 int currpers; - /* Check for 64/32 bit mode. */ - /* SF is bit 0 of MSR */ - if ((ppc_regs.msr >> 63) & 1) - currpers = 0; - else - currpers = 1; + /* + * Check for 64/32 bit mode. + * Embedded implementations covered by Book E extension of PPC use + * bit 0 (CM) of 32-bit Machine state register (MSR). + * Other implementations use bit 0 (SF) of 64-bit MSR. + */ + currpers = (ppc_regs.msr & 0x8000000080000000) ? 0 : 1; update_personality(tcp, currpers); # endif #elif defined(AVR32) |