1*cf84ac9aSAndroid Build Coastguard Worker #include "negated_errno.h" 2*cf84ac9aSAndroid Build Coastguard Worker 3*cf84ac9aSAndroid Build Coastguard Worker #define get_error arm_get_error 4*cf84ac9aSAndroid Build Coastguard Worker #include "arm/get_error.c" 5*cf84ac9aSAndroid Build Coastguard Worker #undef get_error 6*cf84ac9aSAndroid Build Coastguard Worker 7*cf84ac9aSAndroid Build Coastguard Worker static void get_error(struct tcb * tcp,const bool check_errno)8*cf84ac9aSAndroid Build Coastguard Workerget_error(struct tcb *tcp, const bool check_errno) 9*cf84ac9aSAndroid Build Coastguard Worker { 10*cf84ac9aSAndroid Build Coastguard Worker if (tcp->currpers == 1) { 11*cf84ac9aSAndroid Build Coastguard Worker arm_get_error(tcp, check_errno); 12*cf84ac9aSAndroid Build Coastguard Worker return; 13*cf84ac9aSAndroid Build Coastguard Worker } 14*cf84ac9aSAndroid Build Coastguard Worker 15*cf84ac9aSAndroid Build Coastguard Worker if (check_errno && is_negated_errno(aarch64_regs.regs[0])) { 16*cf84ac9aSAndroid Build Coastguard Worker tcp->u_rval = -1; 17*cf84ac9aSAndroid Build Coastguard Worker tcp->u_error = -aarch64_regs.regs[0]; 18*cf84ac9aSAndroid Build Coastguard Worker } else { 19*cf84ac9aSAndroid Build Coastguard Worker tcp->u_rval = aarch64_regs.regs[0]; 20*cf84ac9aSAndroid Build Coastguard Worker } 21*cf84ac9aSAndroid Build Coastguard Worker } 22