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>
23 #include <asm/assembler.h>
24 #include <asm/asm-offsets.h>
27 * System call wrappers for the AArch32 compatibility layer.
30 compat_sys_sigreturn_wrapper:
32 mov x27, #0 // prevent syscall restart handling (why)
33 b compat_sys_sigreturn
34 ENDPROC(compat_sys_sigreturn_wrapper)
36 compat_sys_rt_sigreturn_wrapper:
38 mov x27, #0 // prevent syscall restart handling (why)
39 b compat_sys_rt_sigreturn
40 ENDPROC(compat_sys_rt_sigreturn_wrapper)
42 compat_sys_sigaltstack_wrapper:
43 ldr x2, [sp, #S_COMPAT_SP]
44 b compat_do_sigaltstack
45 ENDPROC(compat_sys_sigaltstack_wrapper)
47 compat_sys_statfs64_wrapper:
52 ENDPROC(compat_sys_statfs64_wrapper)
54 compat_sys_fstatfs64_wrapper:
58 b compat_sys_fstatfs64
59 ENDPROC(compat_sys_fstatfs64_wrapper)
62 * Wrappers for AArch32 syscalls that either take 64-bit parameters
63 * in registers or that take 32-bit parameters which require sign
66 compat_sys_lseek_wrapper:
69 ENDPROC(compat_sys_lseek_wrapper)
71 compat_sys_pread64_wrapper:
72 orr x3, x4, x5, lsl #32
74 ENDPROC(compat_sys_pread64_wrapper)
76 compat_sys_pwrite64_wrapper:
77 orr x3, x4, x5, lsl #32
79 ENDPROC(compat_sys_pwrite64_wrapper)
81 compat_sys_truncate64_wrapper:
82 orr x1, x2, x3, lsl #32
84 ENDPROC(compat_sys_truncate64_wrapper)
86 compat_sys_ftruncate64_wrapper:
87 orr x1, x2, x3, lsl #32
89 ENDPROC(compat_sys_ftruncate64_wrapper)
91 compat_sys_readahead_wrapper:
92 orr x1, x2, x3, lsl #32
95 ENDPROC(compat_sys_readahead_wrapper)
97 compat_sys_lookup_dcookie:
98 orr x0, x0, x1, lsl #32
102 ENDPROC(compat_sys_lookup_dcookie)
104 compat_sys_fadvise64_64_wrapper:
106 orr x1, x2, x3, lsl #32
107 orr x2, x4, x5, lsl #32
110 ENDPROC(compat_sys_fadvise64_64_wrapper)
112 compat_sys_sync_file_range2_wrapper:
113 orr x2, x2, x3, lsl #32
114 orr x3, x4, x5, lsl #32
115 b sys_sync_file_range2
116 ENDPROC(compat_sys_sync_file_range2_wrapper)
118 compat_sys_fallocate_wrapper:
119 orr x2, x2, x3, lsl #32
120 orr x3, x4, x5, lsl #32
122 ENDPROC(compat_sys_fallocate_wrapper)
124 compat_sys_fanotify_mark_wrapper:
125 orr x2, x2, x3, lsl #32
129 ENDPROC(compat_sys_fanotify_mark_wrapper)
132 #define __SYSCALL(x, y) .quad y // x
135 * The system calls table must be 4KB aligned.
138 ENTRY(compat_sys_call_table)
139 #include <asm/unistd32.h>