aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-12 22:20:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-12 22:20:04 -0400
commitb4fe19f78e84813e720d0f0482da22194a7728e3 (patch)
tree3b38d2b50bfc44e284ed8cc361a7d6b1398bd4fc /arch/arm64/kernel
parentff69497ad754b0fa9d5935df644890f208f31558 (diff)
parent48b3b3215f6bc33986f275a0cff508bd9b23fd86 (diff)
Merge tag 'arm64-uapi' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64
Pull arm64 uapi disintegration from Catalin Marinas: "UAPI headers for arm64 together with some clean-up to make it possible: - Do not export the COMPAT_* definitions to user - Simplify the compat unistd32.h definitions and remove the __SYSCALL_COMPAT guard - Disintegrate the arch/arm64/include/asm/* headers" * tag 'arm64-uapi' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64: UAPI: (Scripted) Disintegrate arch/arm64/include/asm arm64: Do not export the compat-specific definitions to the user arm64: Do not include asm/unistd32.h in asm/unistd.h arm64: Remove unused definitions from asm/unistd32.h
Diffstat (limited to 'arch/arm64/kernel')
-rw-r--r--arch/arm64/kernel/entry.S1
-rw-r--r--arch/arm64/kernel/ptrace.c6
-rw-r--r--arch/arm64/kernel/signal32.c22
-rw-r--r--arch/arm64/kernel/sys32.S126
-rw-r--r--arch/arm64/kernel/sys_compat.c4
5 files changed, 16 insertions, 143 deletions
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 6538928ff1ab..a6f3f7da6880 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -26,6 +26,7 @@
26#include <asm/errno.h> 26#include <asm/errno.h>
27#include <asm/thread_info.h> 27#include <asm/thread_info.h>
28#include <asm/unistd.h> 28#include <asm/unistd.h>
29#include <asm/unistd32.h>
29 30
30/* 31/*
31 * Bad Abort numbers 32 * Bad Abort numbers
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index ac3550ecc7b5..2ea3968367c2 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -823,11 +823,11 @@ static int compat_ptrace_read_user(struct task_struct *tsk, compat_ulong_t off,
823 if (off & 3) 823 if (off & 3)
824 return -EIO; 824 return -EIO;
825 825
826 if (off == PT_TEXT_ADDR) 826 if (off == COMPAT_PT_TEXT_ADDR)
827 tmp = tsk->mm->start_code; 827 tmp = tsk->mm->start_code;
828 else if (off == PT_DATA_ADDR) 828 else if (off == COMPAT_PT_DATA_ADDR)
829 tmp = tsk->mm->start_data; 829 tmp = tsk->mm->start_data;
830 else if (off == PT_TEXT_END_ADDR) 830 else if (off == COMPAT_PT_TEXT_END_ADDR)
831 tmp = tsk->mm->end_code; 831 tmp = tsk->mm->end_code;
832 else if (off < sizeof(compat_elf_gregset_t)) 832 else if (off < sizeof(compat_elf_gregset_t))
833 return copy_regset_to_user(tsk, &user_aarch32_view, 833 return copy_regset_to_user(tsk, &user_aarch32_view,
diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c
index 0790a87a4346..4654824747a4 100644
--- a/arch/arm64/kernel/signal32.c
+++ b/arch/arm64/kernel/signal32.c
@@ -18,8 +18,6 @@
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */ 19 */
20 20
21#define __SYSCALL_COMPAT
22
23#include <linux/compat.h> 21#include <linux/compat.h>
24#include <linux/signal.h> 22#include <linux/signal.h>
25#include <linux/syscalls.h> 23#include <linux/syscalls.h>
@@ -28,7 +26,7 @@
28#include <asm/fpsimd.h> 26#include <asm/fpsimd.h>
29#include <asm/signal32.h> 27#include <asm/signal32.h>
30#include <asm/uaccess.h> 28#include <asm/uaccess.h>
31#include <asm/unistd.h> 29#include <asm/unistd32.h>
32 30
33struct compat_sigaction { 31struct compat_sigaction {
34 compat_uptr_t sa_handler; 32 compat_uptr_t sa_handler;
@@ -126,19 +124,19 @@ struct compat_rt_sigframe {
126 * For ARM syscalls, the syscall number has to be loaded into r7. 124 * For ARM syscalls, the syscall number has to be loaded into r7.
127 * We do not support an OABI userspace. 125 * We do not support an OABI userspace.
128 */ 126 */
129#define MOV_R7_NR_SIGRETURN (0xe3a07000 | __NR_sigreturn) 127#define MOV_R7_NR_SIGRETURN (0xe3a07000 | __NR_compat_sigreturn)
130#define SVC_SYS_SIGRETURN (0xef000000 | __NR_sigreturn) 128#define SVC_SYS_SIGRETURN (0xef000000 | __NR_compat_sigreturn)
131#define MOV_R7_NR_RT_SIGRETURN (0xe3a07000 | __NR_rt_sigreturn) 129#define MOV_R7_NR_RT_SIGRETURN (0xe3a07000 | __NR_compat_rt_sigreturn)
132#define SVC_SYS_RT_SIGRETURN (0xef000000 | __NR_rt_sigreturn) 130#define SVC_SYS_RT_SIGRETURN (0xef000000 | __NR_compat_rt_sigreturn)
133 131
134/* 132/*
135 * For Thumb syscalls, we also pass the syscall number via r7. We therefore 133 * For Thumb syscalls, we also pass the syscall number via r7. We therefore
136 * need two 16-bit instructions. 134 * need two 16-bit instructions.
137 */ 135 */
138#define SVC_THUMB_SIGRETURN (((0xdf00 | __NR_sigreturn) << 16) | \ 136#define SVC_THUMB_SIGRETURN (((0xdf00 | __NR_compat_sigreturn) << 16) | \
139 0x2700 | __NR_sigreturn) 137 0x2700 | __NR_compat_sigreturn)
140#define SVC_THUMB_RT_SIGRETURN (((0xdf00 | __NR_rt_sigreturn) << 16) | \ 138#define SVC_THUMB_RT_SIGRETURN (((0xdf00 | __NR_compat_rt_sigreturn) << 16) | \
141 0x2700 | __NR_rt_sigreturn) 139 0x2700 | __NR_compat_rt_sigreturn)
142 140
143const compat_ulong_t aarch32_sigret_code[6] = { 141const compat_ulong_t aarch32_sigret_code[6] = {
144 /* 142 /*
@@ -819,5 +817,5 @@ asmlinkage int compat_sys_rt_sigqueueinfo(int pid, int sig,
819 817
820void compat_setup_restart_syscall(struct pt_regs *regs) 818void compat_setup_restart_syscall(struct pt_regs *regs)
821{ 819{
822 regs->regs[7] = __NR_restart_syscall; 820 regs->regs[7] = __NR_compat_restart_syscall;
823} 821}
diff --git a/arch/arm64/kernel/sys32.S b/arch/arm64/kernel/sys32.S
index 5e4dc93cc31f..54c4aec47a08 100644
--- a/arch/arm64/kernel/sys32.S
+++ b/arch/arm64/kernel/sys32.S
@@ -147,136 +147,12 @@ compat_sys_fanotify_mark_wrapper:
147 b sys_fanotify_mark 147 b sys_fanotify_mark
148ENDPROC(compat_sys_fanotify_mark_wrapper) 148ENDPROC(compat_sys_fanotify_mark_wrapper)
149 149
150/*
151 * Use the compat system call wrappers.
152 */
153#define sys_fork compat_sys_fork_wrapper
154#define sys_open compat_sys_open
155#define sys_execve compat_sys_execve_wrapper
156#define sys_lseek compat_sys_lseek_wrapper
157#define sys_mount compat_sys_mount
158#define sys_ptrace compat_sys_ptrace
159#define sys_times compat_sys_times
160#define sys_ioctl compat_sys_ioctl
161#define sys_fcntl compat_sys_fcntl
162#define sys_ustat compat_sys_ustat
163#define sys_sigaction compat_sys_sigaction
164#define sys_sigsuspend compat_sys_sigsuspend
165#define sys_sigpending compat_sys_sigpending
166#define sys_setrlimit compat_sys_setrlimit
167#define sys_getrusage compat_sys_getrusage
168#define sys_gettimeofday compat_sys_gettimeofday
169#define sys_settimeofday compat_sys_settimeofday
170#define sys_statfs compat_sys_statfs
171#define sys_fstatfs compat_sys_fstatfs
172#define sys_setitimer compat_sys_setitimer
173#define sys_getitimer compat_sys_getitimer
174#define sys_newstat compat_sys_newstat
175#define sys_newlstat compat_sys_newlstat
176#define sys_newfstat compat_sys_newfstat
177#define sys_wait4 compat_sys_wait4
178#define sys_sysinfo compat_sys_sysinfo
179#define sys_sigreturn compat_sys_sigreturn_wrapper
180#define sys_clone compat_sys_clone_wrapper
181#define sys_adjtimex compat_sys_adjtimex
182#define sys_sigprocmask compat_sys_sigprocmask
183#define sys_getdents compat_sys_getdents
184#define sys_select compat_sys_select
185#define sys_readv compat_sys_readv
186#define sys_writev compat_sys_writev
187#define sys_sysctl compat_sys_sysctl
188#define sys_sched_rr_get_interval compat_sys_sched_rr_get_interval
189#define sys_nanosleep compat_sys_nanosleep
190#define sys_rt_sigreturn compat_sys_rt_sigreturn_wrapper
191#define sys_rt_sigaction compat_sys_rt_sigaction
192#define sys_rt_sigprocmask compat_sys_rt_sigprocmask
193#define sys_rt_sigpending compat_sys_rt_sigpending
194#define sys_rt_sigtimedwait compat_sys_rt_sigtimedwait
195#define sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo
196#define sys_rt_sigsuspend compat_sys_rt_sigsuspend
197#define sys_pread64 compat_sys_pread64_wrapper
198#define sys_pwrite64 compat_sys_pwrite64_wrapper
199#define sys_sigaltstack compat_sys_sigaltstack_wrapper
200#define sys_sendfile compat_sys_sendfile
201#define sys_vfork compat_sys_vfork_wrapper
202#define sys_getrlimit compat_sys_getrlimit
203#define sys_mmap2 sys_mmap_pgoff
204#define sys_truncate64 compat_sys_truncate64_wrapper
205#define sys_ftruncate64 compat_sys_ftruncate64_wrapper
206#define sys_getdents64 compat_sys_getdents64
207#define sys_fcntl64 compat_sys_fcntl64
208#define sys_readahead compat_sys_readahead_wrapper
209#define sys_futex compat_sys_futex
210#define sys_sched_setaffinity compat_sys_sched_setaffinity
211#define sys_sched_getaffinity compat_sys_sched_getaffinity
212#define sys_io_setup compat_sys_io_setup
213#define sys_io_getevents compat_sys_io_getevents
214#define sys_io_submit compat_sys_io_submit
215#define sys_lookup_dcookie compat_sys_lookup_dcookie
216#define sys_timer_create compat_sys_timer_create
217#define sys_timer_settime compat_sys_timer_settime
218#define sys_timer_gettime compat_sys_timer_gettime
219#define sys_clock_settime compat_sys_clock_settime
220#define sys_clock_gettime compat_sys_clock_gettime
221#define sys_clock_getres compat_sys_clock_getres
222#define sys_clock_nanosleep compat_sys_clock_nanosleep
223#define sys_statfs64 compat_sys_statfs64_wrapper
224#define sys_fstatfs64 compat_sys_fstatfs64_wrapper
225#define sys_utimes compat_sys_utimes
226#define sys_fadvise64_64 compat_sys_fadvise64_64_wrapper
227#define sys_mq_open compat_sys_mq_open
228#define sys_mq_timedsend compat_sys_mq_timedsend
229#define sys_mq_timedreceive compat_sys_mq_timedreceive
230#define sys_mq_notify compat_sys_mq_notify
231#define sys_mq_getsetattr compat_sys_mq_getsetattr
232#define sys_waitid compat_sys_waitid
233#define sys_recv compat_sys_recv
234#define sys_recvfrom compat_sys_recvfrom
235#define sys_setsockopt compat_sys_setsockopt
236#define sys_getsockopt compat_sys_getsockopt
237#define sys_sendmsg compat_sys_sendmsg
238#define sys_recvmsg compat_sys_recvmsg
239#define sys_semctl compat_sys_semctl
240#define sys_msgsnd compat_sys_msgsnd
241#define sys_msgrcv compat_sys_msgrcv
242#define sys_msgctl compat_sys_msgctl
243#define sys_shmat compat_sys_shmat
244#define sys_shmctl compat_sys_shmctl
245#define sys_keyctl compat_sys_keyctl
246#define sys_semtimedop compat_sys_semtimedop
247#define sys_mbind compat_sys_mbind
248#define sys_get_mempolicy compat_sys_get_mempolicy
249#define sys_set_mempolicy compat_sys_set_mempolicy
250#define sys_openat compat_sys_openat
251#define sys_futimesat compat_sys_futimesat
252#define sys_pselect6 compat_sys_pselect6
253#define sys_ppoll compat_sys_ppoll
254#define sys_set_robust_list compat_sys_set_robust_list
255#define sys_get_robust_list compat_sys_get_robust_list
256#define sys_sync_file_range2 compat_sys_sync_file_range2_wrapper
257#define sys_vmsplice compat_sys_vmsplice
258#define sys_move_pages compat_sys_move_pages
259#define sys_epoll_pwait compat_sys_epoll_pwait
260#define sys_kexec_load compat_sys_kexec_load
261#define sys_utimensat compat_sys_utimensat
262#define sys_signalfd compat_sys_signalfd
263#define sys_fallocate compat_sys_fallocate_wrapper
264#define sys_timerfd_settime compat_sys_timerfd_settime
265#define sys_timerfd_gettime compat_sys_timerfd_gettime
266#define sys_signalfd4 compat_sys_signalfd4
267#define sys_preadv compat_sys_preadv
268#define sys_pwritev compat_sys_pwritev
269#define sys_rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo
270#define sys_recvmmsg compat_sys_recvmmsg
271#define sys_fanotify_mark compat_sys_fanotify_mark_wrapper
272
273#undef __SYSCALL 150#undef __SYSCALL
274#define __SYSCALL(x, y) .quad y // x 151#define __SYSCALL(x, y) .quad y // x
275#define __SYSCALL_COMPAT
276 152
277/* 153/*
278 * The system calls table must be 4KB aligned. 154 * The system calls table must be 4KB aligned.
279 */ 155 */
280 .align 12 156 .align 12
281ENTRY(compat_sys_call_table) 157ENTRY(compat_sys_call_table)
282#include <asm/unistd.h> 158#include <asm/unistd32.h>
diff --git a/arch/arm64/kernel/sys_compat.c b/arch/arm64/kernel/sys_compat.c
index e521087cb0c4..906e3bd270b0 100644
--- a/arch/arm64/kernel/sys_compat.c
+++ b/arch/arm64/kernel/sys_compat.c
@@ -18,8 +18,6 @@
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */ 19 */
20 20
21#define __SYSCALL_COMPAT
22
23#include <linux/compat.h> 21#include <linux/compat.h>
24#include <linux/personality.h> 22#include <linux/personality.h>
25#include <linux/sched.h> 23#include <linux/sched.h>
@@ -28,7 +26,7 @@
28#include <linux/uaccess.h> 26#include <linux/uaccess.h>
29 27
30#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
31#include <asm/unistd.h> 29#include <asm/unistd32.h>
32 30
33asmlinkage int compat_sys_fork(struct pt_regs *regs) 31asmlinkage int compat_sys_fork(struct pt_regs *regs)
34{ 32{