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 sparc64_set_o0_tstate(struct tcb *tcp, const unsigned long o0,
10 const unsigned long tstate_set,
11 const unsigned long tstate_clear)
12 {
13 sparc_regs.u_regs[U_REG_O0] = o0;
14 sparc_regs.tstate |= tstate_set;
15 sparc_regs.tstate &= ~tstate_clear;
16 return set_regs(tcp->pid);
17 }
18
19 static int
20 arch_set_error(struct tcb *tcp)
21 {
22 return sparc64_set_o0_tstate(tcp, tcp->u_error, 0x1100000000UL, 0);
23 }
24
25 static int
26 arch_set_success(struct tcb *tcp)
27 {
28 return sparc64_set_o0_tstate(tcp, tcp->u_rval, 0, 0x1100000000UL);
29 }