2 * Compat system call wrappers
4 * Copyright (C) 2012 ARM Ltd.
5 * Authors: Will Deacon <will.deacon@arm.com>
6 * Catalin Marinas <catalin.marinas@arm.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include <linux/linkage.h>
22 #include <linux/const.h>
24 #include <asm/assembler.h>
25 #include <asm/asm-offsets.h>
26 #include <asm/errno.h>
30 * System call wrappers for the AArch32 compatibility layer.
33 ENTRY(compat_sys_sigreturn_wrapper)
35 b compat_sys_sigreturn
36 ENDPROC(compat_sys_sigreturn_wrapper)
38 ENTRY(compat_sys_rt_sigreturn_wrapper)
40 b compat_sys_rt_sigreturn
41 ENDPROC(compat_sys_rt_sigreturn_wrapper)
43 ENTRY(compat_sys_statfs64_wrapper)
48 ENDPROC(compat_sys_statfs64_wrapper)
50 ENTRY(compat_sys_fstatfs64_wrapper)
54 b compat_sys_fstatfs64
55 ENDPROC(compat_sys_fstatfs64_wrapper)
58 * Note: off_4k (w5) is always in units of 4K. If we can't do the
59 * requested offset because it is not page-aligned, we return -EINVAL.
61 ENTRY(compat_sys_mmap2_wrapper)
63 tst w5, #~PAGE_MASK >> 12
65 lsr w5, w5, #PAGE_SHIFT - 12
70 ENDPROC(compat_sys_mmap2_wrapper)
73 * Wrappers for AArch32 syscalls that either take 64-bit parameters
74 * in registers or that take 32-bit parameters which require sign
77 ENTRY(compat_sys_pread64_wrapper)
80 ENDPROC(compat_sys_pread64_wrapper)
82 ENTRY(compat_sys_pwrite64_wrapper)
85 ENDPROC(compat_sys_pwrite64_wrapper)
87 ENTRY(compat_sys_truncate64_wrapper)
90 ENDPROC(compat_sys_truncate64_wrapper)
92 ENTRY(compat_sys_ftruncate64_wrapper)
95 ENDPROC(compat_sys_ftruncate64_wrapper)
97 ENTRY(compat_sys_readahead_wrapper)
101 ENDPROC(compat_sys_readahead_wrapper)
103 ENTRY(compat_sys_fadvise64_64_wrapper)
105 regs_to_64 x1, x2, x3
106 regs_to_64 x2, x4, x5
109 ENDPROC(compat_sys_fadvise64_64_wrapper)
111 ENTRY(compat_sys_sync_file_range2_wrapper)
112 regs_to_64 x2, x2, x3
113 regs_to_64 x3, x4, x5
114 b sys_sync_file_range2
115 ENDPROC(compat_sys_sync_file_range2_wrapper)
117 ENTRY(compat_sys_fallocate_wrapper)
118 regs_to_64 x2, x2, x3
119 regs_to_64 x3, x4, x5
121 ENDPROC(compat_sys_fallocate_wrapper)