]> granicus.if.org Git - strace/commitdiff
linux: set error flags in arch_set_error on POWER and Alpha
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 10 Jun 2018 12:25:37 +0000 (14:25 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 11 Jun 2018 14:02:06 +0000 (14:02 +0000)
* alpha/set_error.c (arch_set_error): Set alpha_r3 to 1, update tracee's
REG_A3.
* powerpc/set_error.c (arch_set_error): Set bit 28 in CCR register,
update tracee's PT_CCR.

Fixes: v4.15~126 "Implement arch specific methods of changing syscall number and error code"
linux/alpha/set_error.c
linux/powerpc/set_error.c

index 169277bc3886114dd7e7fb9ba0df17de6083ddf5..78a247e5ed835b68189151c423b32575a3cfa6bf 100644 (file)
@@ -1,8 +1,8 @@
 static int
 arch_set_error(struct tcb *tcp)
 {
-       alpha_r0 = tcp->u_error;
-       return upoke(tcp, REG_R0, alpha_r0);
+       return upoke(tcp, REG_A3, (alpha_a3 = 1))
+              || upoke(tcp, REG_R0, (alpha_r0 = tcp->u_error));
 }
 
 static int
index 38ae32bb76d7362d85b6ea644deff739d7a5db4e..602ca15e1a1bf73342e1f91ce6b29df2a8e86f28 100644 (file)
@@ -2,8 +2,10 @@ static int
 arch_set_error(struct tcb *tcp)
 {
        ppc_regs.gpr[3] = tcp->u_error;
+       ppc_regs.ccr |= 0x10000000;
 #ifdef HAVE_GETREGS_OLD
-       return upoke(tcp, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]);
+       return upoke(tcp, sizeof(long) * PT_CCR, ppc_regs.ccr) ||
+              upoke(tcp, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]);
 #else
        return set_regs(tcp->pid);
 #endif