blob: f83e0a27387f5198d46b1e3713decb253ce9471a [file] [log] [blame]
Andrew Geissler69721092021-07-23 12:57:00 -04001From ed8dbe1c793f2f770fef61adc4390277f903cceb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 9 Jul 2021 01:32:42 -0700
4Subject: [PATCH] mips: Use hardcodes values for ABI syscall bases
5
6mips kernels 5.13+ have stopped exposing the UAPIs which provided these
7defines, the values are more or less static so just use the hardcoded
8values for now. Use __NR_syscalls to get number of syscalls supported
9and include asm-generic/unistd.h to get this definition
10
11Upstream-Status: Pending
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 sysdeps/linux-gnu/mips/trace.c | 13 +++++++------
15 1 file changed, 7 insertions(+), 6 deletions(-)
16
17diff --git a/sysdeps/linux-gnu/mips/trace.c b/sysdeps/linux-gnu/mips/trace.c
18index d54818e..e72184d 100644
19--- a/sysdeps/linux-gnu/mips/trace.c
20+++ b/sysdeps/linux-gnu/mips/trace.c
21@@ -33,6 +33,7 @@
22 #include <asm/unistd.h>
23 #include <assert.h>
24 #include <asm/unistd.h>
25+#include <asm-generic/unistd.h>
26
27 #include "backend.h"
28 #include "common.h"
29@@ -135,12 +136,12 @@ syscall_p(struct process *proc, int status, int *sysnum)
30 int min_syscall, max_syscall, sigreturn, rt_sigreturn;
31 struct callstack_element *top = NULL;
32 int depth = proc->callstack_depth;
33- const int syscallbase[] = {__NR_O32_Linux, __NR_N32_Linux,
34- __NR_64_Linux, __NR_O32_Linux};
35- const int syscallnum[] = {__NR_O32_Linux_syscalls,
36- __NR_N32_Linux_syscalls,
37- __NR_64_Linux_syscalls,
38- __NR_O32_Linux_syscalls};
39+ const int syscallbase[] = {4000, 6000,
40+ 5000, 4000};
41+ const int syscallnum[] = {__NR_syscalls,
42+ __NR_syscalls,
43+ __NR_syscalls,
44+ __NR_syscalls};
45 const int rt_sigreturn_list[] = {193, 211, 211, 193};
46 const int sigreturn_list[] = {119, -1, -1, 119};
47
48--
492.32.0
50