| Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| Ralf Baechle | 293c5bd | 2007-07-25 16:19:33 +0100 | [diff] [blame] | 2 | #ifndef __ASM_SECCOMP_H |
| 3 | |
| Ralf Baechle | 293c5bd | 2007-07-25 16:19:33 +0100 | [diff] [blame] | 4 | #include <linux/unistd.h> |
| 5 | |
| Matt Redfearn | b1b4fad | 2016-03-29 09:35:33 +0100 | [diff] [blame] | 6 | #ifdef CONFIG_COMPAT |
| 7 | static 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 Baechle | 293c5bd | 2007-07-25 16:19:33 +0100 | [diff] [blame] | 19 | |
| Masahiro Yamada | 97f2645 | 2016-08-03 13:45:50 -0700 | [diff] [blame] | 20 | if (IS_ENABLED(CONFIG_MIPS32_O32) && test_thread_flag(TIF_32BIT_REGS)) |
| Matt Redfearn | b1b4fad | 2016-03-29 09:35:33 +0100 | [diff] [blame] | 21 | return syscalls_O32; |
| Ralf Baechle | 293c5bd | 2007-07-25 16:19:33 +0100 | [diff] [blame] | 22 | |
| Masahiro Yamada | 97f2645 | 2016-08-03 13:45:50 -0700 | [diff] [blame] | 23 | if (IS_ENABLED(CONFIG_MIPS32_N32)) |
| Matt Redfearn | b1b4fad | 2016-03-29 09:35:33 +0100 | [diff] [blame] | 24 | return syscalls_N32; |
| Ralf Baechle | 293c5bd | 2007-07-25 16:19:33 +0100 | [diff] [blame] | 25 | |
| Matt Redfearn | b1b4fad | 2016-03-29 09:35:33 +0100 | [diff] [blame] | 26 | BUG(); |
| 27 | } |
| Ralf Baechle | 293c5bd | 2007-07-25 16:19:33 +0100 | [diff] [blame] | 28 | |
| Matt Redfearn | b1b4fad | 2016-03-29 09:35:33 +0100 | [diff] [blame] | 29 | #define get_compat_mode1_syscalls get_compat_mode1_syscalls |
| 30 | |
| 31 | #endif /* CONFIG_COMPAT */ |
| Ralf Baechle | 293c5bd | 2007-07-25 16:19:33 +0100 | [diff] [blame] | 32 | |
| Kees Cook | 97247fd | 2015-04-16 12:48:53 -0700 | [diff] [blame] | 33 | #include <asm-generic/seccomp.h> |
| 34 | |
| Ralf Baechle | 293c5bd | 2007-07-25 16:19:33 +0100 | [diff] [blame] | 35 | #endif /* __ASM_SECCOMP_H */ |