1 /*
2 * Copyright (c) 2016-2021 The strace developers.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7
8 static int
9 arch_set_error(struct tcb *tcp)
10 {
11 if (PPC_TRAP_IS_SCV(ppc_regs.trap)) {
12 ppc_regs.gpr[3] = -tcp->u_error;
13 } else {
14 ppc_regs.gpr[3] = tcp->u_error;
15 ppc_regs.ccr |= 0x10000000;
16 }
17 return set_regs(tcp->pid);
18 }
19
20 static int
21 arch_set_success(struct tcb *tcp)
22 {
23 ppc_regs.gpr[3] = tcp->u_rval;
24 if (!PPC_TRAP_IS_SCV(ppc_regs.trap))
25 ppc_regs.ccr &= ~0x10000000;
26 return set_regs(tcp->pid);
27 }