diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2012-07-13 17:38:17 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-10-29 16:25:01 -0400 |
commit | 19e2e172f0ed2552793ecef506b00c3fa3421845 (patch) | |
tree | ca324a14964fd13fd7957c2e30baa196cee1e998 /arch/mips/kernel/ftrace.c | |
parent | 403342a82d7959ad76210778cfcd7e26f7dd98cd (diff) |
MIPS: Provide arch_syscall_addr.
The generic version is wrong for MIPS.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/ftrace.c')
-rw-r--r-- | arch/mips/kernel/ftrace.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c index dba90ec0dc38..6e022c44f447 100644 --- a/arch/mips/kernel/ftrace.c +++ b/arch/mips/kernel/ftrace.c | |||
@@ -11,11 +11,14 @@ | |||
11 | #include <linux/uaccess.h> | 11 | #include <linux/uaccess.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/ftrace.h> | 13 | #include <linux/ftrace.h> |
14 | #include <linux/syscalls.h> | ||
14 | 15 | ||
15 | #include <asm/asm.h> | 16 | #include <asm/asm.h> |
16 | #include <asm/asm-offsets.h> | 17 | #include <asm/asm-offsets.h> |
17 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
19 | #include <asm/syscall.h> | ||
18 | #include <asm/uasm.h> | 20 | #include <asm/uasm.h> |
21 | #include <asm/unistd.h> | ||
19 | 22 | ||
20 | #include <asm-generic/sections.h> | 23 | #include <asm-generic/sections.h> |
21 | 24 | ||
@@ -364,3 +367,33 @@ out: | |||
364 | WARN_ON(1); | 367 | WARN_ON(1); |
365 | } | 368 | } |
366 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 369 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
370 | |||
371 | #ifdef CONFIG_FTRACE_SYSCALLS | ||
372 | |||
373 | #ifdef CONFIG_32BIT | ||
374 | unsigned long __init arch_syscall_addr(int nr) | ||
375 | { | ||
376 | return (unsigned long)sys_call_table[nr - __NR_O32_Linux]; | ||
377 | } | ||
378 | #endif | ||
379 | |||
380 | #ifdef CONFIG_64BIT | ||
381 | |||
382 | unsigned long __init arch_syscall_addr(int nr) | ||
383 | { | ||
384 | #ifdef CONFIG_MIPS32_N32 | ||
385 | if (nr >= __NR_N32_Linux && nr <= __NR_N32_Linux + __NR_N32_Linux_syscalls) | ||
386 | return (unsigned long)sysn32_call_table[(nr - __NR_N32_Linux) * 2]; | ||
387 | #endif | ||
388 | if (nr >= __NR_64_Linux && nr <= __NR_64_Linux + __NR_64_Linux_syscalls) | ||
389 | return (unsigned long)sys_call_table[nr - __NR_64_Linux]; | ||
390 | #ifdef CONFIG_MIPS32_O32 | ||
391 | if (nr >= __NR_O32_Linux && nr <= __NR_O32_Linux + __NR_O32_Linux_syscalls) | ||
392 | return (unsigned long)sys32_call_table[nr - __NR_O32_Linux]; | ||
393 | #endif | ||
394 | |||
395 | return (unsigned long) &sys_ni_syscall; | ||
396 | } | ||
397 | #endif | ||
398 | |||
399 | #endif /* CONFIG_FTRACE_SYSCALLS */ | ||