blob: e383d7e27b9359dc8a6867bc826c3958a6ea3acd [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Ralf Baechle293c5bd2007-07-25 16:19:33 +01002#ifndef __ASM_SECCOMP_H
3
Ralf Baechle293c5bd2007-07-25 16:19:33 +01004#include <linux/unistd.h>
5
Matt Redfearnb1b4fad2016-03-29 09:35:33 +01006#ifdef CONFIG_COMPAT
7static inline const int *get_compat_mode1_syscalls(void)
8{
9 static const int syscalls_O32[] = {
10 __NR_O32_Linux + 3, __NR_O32_Linux + 4,
11 __NR_O32_Linux + 1, __NR_O32_Linux + 193,
12 0, /* null terminated */
13 };
14 static const int syscalls_N32[] = {
15 __NR_N32_Linux + 0, __NR_N32_Linux + 1,
16 __NR_N32_Linux + 58, __NR_N32_Linux + 211,
17 0, /* null terminated */
18 };
Ralf Baechle293c5bd2007-07-25 16:19:33 +010019
Masahiro Yamada97f26452016-08-03 13:45:50 -070020 if (IS_ENABLED(CONFIG_MIPS32_O32) && test_thread_flag(TIF_32BIT_REGS))
Matt Redfearnb1b4fad2016-03-29 09:35:33 +010021 return syscalls_O32;
Ralf Baechle293c5bd2007-07-25 16:19:33 +010022
Masahiro Yamada97f26452016-08-03 13:45:50 -070023 if (IS_ENABLED(CONFIG_MIPS32_N32))
Matt Redfearnb1b4fad2016-03-29 09:35:33 +010024 return syscalls_N32;
Ralf Baechle293c5bd2007-07-25 16:19:33 +010025
Matt Redfearnb1b4fad2016-03-29 09:35:33 +010026 BUG();
27}
Ralf Baechle293c5bd2007-07-25 16:19:33 +010028
Matt Redfearnb1b4fad2016-03-29 09:35:33 +010029#define get_compat_mode1_syscalls get_compat_mode1_syscalls
30
31#endif /* CONFIG_COMPAT */
Ralf Baechle293c5bd2007-07-25 16:19:33 +010032
Kees Cook97247fd2015-04-16 12:48:53 -070033#include <asm-generic/seccomp.h>
34
Ralf Baechle293c5bd2007-07-25 16:19:33 +010035#endif /* __ASM_SECCOMP_H */