summaryrefslogtreecommitdiff
path: root/src/arch-mips64n32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch-mips64n32.c')
-rw-r--r--src/arch-mips64n32.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/arch-mips64n32.c b/src/arch-mips64n32.c
index f8088ae..098864b 100644
--- a/src/arch-mips64n32.c
+++ b/src/arch-mips64n32.c
@@ -43,8 +43,9 @@ int mips64n32_syscall_resolve_name_munge(const char *name)
{
int sys;
+ /* NOTE: we don't want to modify the pseudo-syscall numbers */
sys = mips64n32_syscall_resolve_name(name);
- if (sys == __NR_SCMP_ERROR)
+ if (sys == __NR_SCMP_ERROR || sys < 0)
return sys;
return sys + __SCMP_NR_BASE;
@@ -61,7 +62,10 @@ int mips64n32_syscall_resolve_name_munge(const char *name)
*/
const char *mips64n32_syscall_resolve_num_munge(int num)
{
- return mips64n32_syscall_resolve_num(num - __SCMP_NR_BASE);
+ /* NOTE: we don't want to modify the pseudo-syscall numbers */
+ if (num >= __SCMP_NR_BASE)
+ num -= __SCMP_NR_BASE;
+ return mips64n32_syscall_resolve_num(num);
}
const struct arch_def arch_def_mips64n32 = {