strace/linux/powerpc/set_error.c
Eugene Syromyatnikov 525f70debe linux: set error flags in arch_set_error on POWER and Alpha
* 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"
2018-06-11 14:02:06 +00:00

26 lines
599 B
C

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_CCR, ppc_regs.ccr) ||
upoke(tcp, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]);
#else
return set_regs(tcp->pid);
#endif
}
static int
arch_set_success(struct tcb *tcp)
{
ppc_regs.gpr[3] = tcp->u_rval;
ppc_regs.ccr &= ~0x10000000;
#ifdef HAVE_GETREGS_OLD
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
}