xref: /linux/arch/arm64/kernel/sys32.c (revision e58e871becec2d3b04ed91c0c16fe8deac9c9dfa)
1 /*
2  * arch/arm64/kernel/sys32.c
3  *
4  * Copyright (C) 2015 ARM Ltd.
5  *
6  * This program is free software(void); you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http(void);//www.gnu.org/licenses/>.
17  */
18 
19 /*
20  * Needed to avoid conflicting __NR_* macros between uapi/asm/unistd.h and
21  * asm/unistd32.h.
22  */
23 #define __COMPAT_SYSCALL_NR
24 
25 #include <linux/compiler.h>
26 #include <linux/syscalls.h>
27 
28 asmlinkage long compat_sys_sigreturn_wrapper(void);
29 asmlinkage long compat_sys_rt_sigreturn_wrapper(void);
30 asmlinkage long compat_sys_statfs64_wrapper(void);
31 asmlinkage long compat_sys_fstatfs64_wrapper(void);
32 asmlinkage long compat_sys_pread64_wrapper(void);
33 asmlinkage long compat_sys_pwrite64_wrapper(void);
34 asmlinkage long compat_sys_truncate64_wrapper(void);
35 asmlinkage long compat_sys_ftruncate64_wrapper(void);
36 asmlinkage long compat_sys_readahead_wrapper(void);
37 asmlinkage long compat_sys_fadvise64_64_wrapper(void);
38 asmlinkage long compat_sys_sync_file_range2_wrapper(void);
39 asmlinkage long compat_sys_fallocate_wrapper(void);
40 asmlinkage long compat_sys_mmap2_wrapper(void);
41 
42 #undef __SYSCALL
43 #define __SYSCALL(nr, sym)	[nr] = sym,
44 
45 /*
46  * The sys_call_table array must be 4K aligned to be accessible from
47  * kernel/entry.S.
48  */
49 void * const compat_sys_call_table[__NR_compat_syscalls] __aligned(4096) = {
50 	[0 ... __NR_compat_syscalls - 1] = sys_ni_syscall,
51 #include <asm/unistd32.h>
52 };
53