blob: c5c0f69cc2c9cdc0b3d4d6ec039a30bc94c4e8b7 [file] [log] [blame]
Dmitry V. Levin0c8c5c92015-11-29 00:06:45 +00001#define get_error arm_get_error
2#include "arm/get_error.c"
3#undef get_error
4
5static void
6get_error(struct tcb *tcp, const bool check_errno)
7{
8 if (tcp->currpers == 0) {
9 arm_get_error(tcp, check_errno);
10 return;
11 }
12
Dmitry V. Levind70d1c42015-03-22 22:13:55 +000013 if (check_errno && is_negated_errno(aarch64_regs.regs[0])) {
14 tcp->u_rval = -1;
15 tcp->u_error = -aarch64_regs.regs[0];
16 } else {
17 tcp->u_rval = aarch64_regs.regs[0];
18 }
Dmitry V. Levind70d1c42015-03-22 22:13:55 +000019}