xref: /aosp_15_r20/external/strace/linux/powerpc/get_error.c (revision cf84ac9a129d8ea9952db616b4e9b904c4bdde56)
1*cf84ac9aSAndroid Build Coastguard Worker static void
get_error(struct tcb * tcp,const bool check_errno)2*cf84ac9aSAndroid Build Coastguard Worker get_error(struct tcb *tcp, const bool check_errno)
3*cf84ac9aSAndroid Build Coastguard Worker {
4*cf84ac9aSAndroid Build Coastguard Worker 	if (ppc_regs.ccr & 0x10000000) {
5*cf84ac9aSAndroid Build Coastguard Worker 		tcp->u_rval = -1;
6*cf84ac9aSAndroid Build Coastguard Worker 		tcp->u_error = ppc_regs.gpr[3];
7*cf84ac9aSAndroid Build Coastguard Worker 	} else {
8*cf84ac9aSAndroid Build Coastguard Worker 		tcp->u_rval = ppc_regs.gpr[3];
9*cf84ac9aSAndroid Build Coastguard Worker 	}
10*cf84ac9aSAndroid Build Coastguard Worker }
11