xref: /OK3568_Linux_fs/kernel/arch/mips/include/asm/seccomp.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef __ASM_SECCOMP_H
3*4882a593Smuzhiyun 
4*4882a593Smuzhiyun #include <linux/unistd.h>
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun #ifdef CONFIG_COMPAT
get_compat_mode1_syscalls(void)7*4882a593Smuzhiyun static inline const int *get_compat_mode1_syscalls(void)
8*4882a593Smuzhiyun {
9*4882a593Smuzhiyun 	static const int syscalls_O32[] = {
10*4882a593Smuzhiyun 		__NR_O32_Linux + 3, __NR_O32_Linux + 4,
11*4882a593Smuzhiyun 		__NR_O32_Linux + 1, __NR_O32_Linux + 193,
12*4882a593Smuzhiyun 		-1, /* negative terminated */
13*4882a593Smuzhiyun 	};
14*4882a593Smuzhiyun 	static const int syscalls_N32[] = {
15*4882a593Smuzhiyun 		__NR_N32_Linux + 0, __NR_N32_Linux + 1,
16*4882a593Smuzhiyun 		__NR_N32_Linux + 58, __NR_N32_Linux + 211,
17*4882a593Smuzhiyun 		-1, /* negative terminated */
18*4882a593Smuzhiyun 	};
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun 	if (IS_ENABLED(CONFIG_MIPS32_O32) && test_thread_flag(TIF_32BIT_REGS))
21*4882a593Smuzhiyun 		return syscalls_O32;
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun 	if (IS_ENABLED(CONFIG_MIPS32_N32))
24*4882a593Smuzhiyun 		return syscalls_N32;
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun 	BUG();
27*4882a593Smuzhiyun }
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun #define get_compat_mode1_syscalls get_compat_mode1_syscalls
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun #endif /* CONFIG_COMPAT */
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun #include <asm-generic/seccomp.h>
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun #endif /* __ASM_SECCOMP_H */
36