xref: /openbmc/linux/arch/arm64/kernel/sys32.c (revision 3085e164)
10156411bSCatalin Marinas /*
20156411bSCatalin Marinas  * arch/arm64/kernel/sys32.c
30156411bSCatalin Marinas  *
40156411bSCatalin Marinas  * Copyright (C) 2015 ARM Ltd.
50156411bSCatalin Marinas  *
60156411bSCatalin Marinas  * This program is free software(void); you can redistribute it and/or modify
70156411bSCatalin Marinas  * it under the terms of the GNU General Public License version 2 as
80156411bSCatalin Marinas  * published by the Free Software Foundation.
90156411bSCatalin Marinas  *
100156411bSCatalin Marinas  * This program is distributed in the hope that it will be useful,
110156411bSCatalin Marinas  * but WITHOUT ANY WARRANTY; without even the implied warranty of
120156411bSCatalin Marinas  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
130156411bSCatalin Marinas  * GNU General Public License for more details.
140156411bSCatalin Marinas  *
150156411bSCatalin Marinas  * You should have received a copy of the GNU General Public License
160156411bSCatalin Marinas  * along with this program.  If not, see <http(void);//www.gnu.org/licenses/>.
170156411bSCatalin Marinas  */
180156411bSCatalin Marinas 
190156411bSCatalin Marinas /*
200156411bSCatalin Marinas  * Needed to avoid conflicting __NR_* macros between uapi/asm/unistd.h and
210156411bSCatalin Marinas  * asm/unistd32.h.
220156411bSCatalin Marinas  */
230156411bSCatalin Marinas #define __COMPAT_SYSCALL_NR
240156411bSCatalin Marinas 
250156411bSCatalin Marinas #include <linux/compiler.h>
260156411bSCatalin Marinas #include <linux/syscalls.h>
270156411bSCatalin Marinas 
283085e164SMark Rutland asmlinkage long compat_sys_sigreturn(void);
293085e164SMark Rutland asmlinkage long compat_sys_rt_sigreturn(void);
300156411bSCatalin Marinas asmlinkage long compat_sys_statfs64_wrapper(void);
310156411bSCatalin Marinas asmlinkage long compat_sys_fstatfs64_wrapper(void);
320156411bSCatalin Marinas asmlinkage long compat_sys_pread64_wrapper(void);
330156411bSCatalin Marinas asmlinkage long compat_sys_pwrite64_wrapper(void);
340156411bSCatalin Marinas asmlinkage long compat_sys_truncate64_wrapper(void);
350156411bSCatalin Marinas asmlinkage long compat_sys_ftruncate64_wrapper(void);
360156411bSCatalin Marinas asmlinkage long compat_sys_readahead_wrapper(void);
370156411bSCatalin Marinas asmlinkage long compat_sys_fadvise64_64_wrapper(void);
380156411bSCatalin Marinas asmlinkage long compat_sys_sync_file_range2_wrapper(void);
390156411bSCatalin Marinas asmlinkage long compat_sys_fallocate_wrapper(void);
4018ccb0caSAndreas Schwab asmlinkage long compat_sys_mmap2_wrapper(void);
410156411bSCatalin Marinas 
420156411bSCatalin Marinas #undef __SYSCALL
430156411bSCatalin Marinas #define __SYSCALL(nr, sym)	[nr] = sym,
440156411bSCatalin Marinas 
450156411bSCatalin Marinas /*
460156411bSCatalin Marinas  * The sys_call_table array must be 4K aligned to be accessible from
470156411bSCatalin Marinas  * kernel/entry.S.
480156411bSCatalin Marinas  */
490156411bSCatalin Marinas void * const compat_sys_call_table[__NR_compat_syscalls] __aligned(4096) = {
500156411bSCatalin Marinas 	[0 ... __NR_compat_syscalls - 1] = sys_ni_syscall,
510156411bSCatalin Marinas #include <asm/unistd32.h>
520156411bSCatalin Marinas };
53