diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2005-05-01 11:58:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 11:58:55 -0400 |
commit | 80f9507886076de0cadfdf2b87701e68156829c2 (patch) | |
tree | d9830aeda24b0a004938bae36db3e8efba84b7db /arch/um/sys-x86_64 | |
parent | ddcd6b175793839e51fdd55debb670a9f512c448 (diff) |
[PATCH] uml: fix syscall table by including $(SUBARCH)'s one, for x86-64
Reuse asm-x86-64/unistd.h to build our syscall table, like x86-64 already
does.
Like for i386, we must add some #defines for all the (right!) changes UML does
to x86-64 syscall table.
Note: I noted a bogus:
[ __NR_sched_yield ] = (syscall_handler_t *) yield,
while doing this patch (which could only be a workaround for some strange bug,
but I would ignore this possibility). I'm changing this without notice.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/sys-x86_64')
-rw-r--r-- | arch/um/sys-x86_64/Makefile | 2 | ||||
-rw-r--r-- | arch/um/sys-x86_64/sys_call_table.c | 271 | ||||
-rw-r--r-- | arch/um/sys-x86_64/syscall_table.c | 59 | ||||
-rw-r--r-- | arch/um/sys-x86_64/syscalls.c | 12 |
4 files changed, 72 insertions, 272 deletions
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile index 274158e7da3f..d7ed2f7908df 100644 --- a/arch/um/sys-x86_64/Makefile +++ b/arch/um/sys-x86_64/Makefile | |||
@@ -6,7 +6,7 @@ | |||
6 | 6 | ||
7 | lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o mem.o memcpy.o \ | 7 | lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o mem.o memcpy.o \ |
8 | ptrace.o ptrace_user.o semaphore.o sigcontext.o signal.o \ | 8 | ptrace.o ptrace_user.o semaphore.o sigcontext.o signal.o \ |
9 | syscalls.o sysrq.o thunk.o sys_call_table.o | 9 | syscalls.o sysrq.o thunk.o syscall_table.o |
10 | 10 | ||
11 | USER_OBJS := ptrace_user.o sigcontext.o | 11 | USER_OBJS := ptrace_user.o sigcontext.o |
12 | 12 | ||
diff --git a/arch/um/sys-x86_64/sys_call_table.c b/arch/um/sys-x86_64/sys_call_table.c deleted file mode 100644 index a31e0dffb270..000000000000 --- a/arch/um/sys-x86_64/sys_call_table.c +++ /dev/null | |||
@@ -1,271 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) | ||
3 | * Copyright 2003 PathScale, Inc. | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #include "linux/config.h" | ||
8 | #include "linux/unistd.h" | ||
9 | #include "linux/sys.h" | ||
10 | #include "linux/swap.h" | ||
11 | #include "linux/syscalls.h" | ||
12 | #include "linux/sysctl.h" | ||
13 | #include "asm/signal.h" | ||
14 | #include "sysdep/syscalls.h" | ||
15 | #include "kern_util.h" | ||
16 | |||
17 | #define LAST_GENERIC_SYSCALL __NR_keyctl | ||
18 | |||
19 | #if LAST_GENERIC_SYSCALL > LAST_ARCH_SYSCALL | ||
20 | #define LAST_SYSCALL LAST_GENERIC_SYSCALL | ||
21 | #else | ||
22 | #define LAST_SYSCALL LAST_ARCH_SYSCALL | ||
23 | #endif | ||
24 | |||
25 | extern syscall_handler_t sys_fork; | ||
26 | extern syscall_handler_t sys_execve; | ||
27 | extern syscall_handler_t um_time; | ||
28 | extern syscall_handler_t um_stime; | ||
29 | extern syscall_handler_t sys_pipe; | ||
30 | extern syscall_handler_t sys_olduname; | ||
31 | extern syscall_handler_t sys_sigaction; | ||
32 | extern syscall_handler_t sys_sigsuspend; | ||
33 | extern syscall_handler_t old_readdir; | ||
34 | extern syscall_handler_t sys_uname; | ||
35 | extern syscall_handler_t sys_ipc; | ||
36 | extern syscall_handler_t sys_sigreturn; | ||
37 | extern syscall_handler_t sys_clone; | ||
38 | extern syscall_handler_t sys_rt_sigreturn; | ||
39 | extern syscall_handler_t sys_sigaltstack; | ||
40 | extern syscall_handler_t sys_vfork; | ||
41 | extern syscall_handler_t old_select; | ||
42 | extern syscall_handler_t sys_modify_ldt; | ||
43 | extern syscall_handler_t sys_rt_sigsuspend; | ||
44 | extern syscall_handler_t sys_mbind; | ||
45 | extern syscall_handler_t sys_get_mempolicy; | ||
46 | extern syscall_handler_t sys_set_mempolicy; | ||
47 | extern syscall_handler_t sys_sys_setaltroot; | ||
48 | |||
49 | /* On X86-64 all syscalls are aware of 32-bit [ug]ids, so I had to fix this!*/ | ||
50 | syscall_handler_t *sys_call_table[] = { | ||
51 | [ __NR_restart_syscall ] = (syscall_handler_t *) sys_restart_syscall, | ||
52 | [ __NR_exit ] = (syscall_handler_t *) sys_exit, | ||
53 | [ __NR_fork ] = (syscall_handler_t *) sys_fork, | ||
54 | [ __NR_read ] = (syscall_handler_t *) sys_read, | ||
55 | [ __NR_write ] = (syscall_handler_t *) sys_write, | ||
56 | |||
57 | /* These three are declared differently in asm/unistd.h */ | ||
58 | [ __NR_open ] = (syscall_handler_t *) sys_open, | ||
59 | [ __NR_close ] = (syscall_handler_t *) sys_close, | ||
60 | [ __NR_creat ] = (syscall_handler_t *) sys_creat, | ||
61 | [ __NR_link ] = (syscall_handler_t *) sys_link, | ||
62 | [ __NR_unlink ] = (syscall_handler_t *) sys_unlink, | ||
63 | [ __NR_execve ] = (syscall_handler_t *) sys_execve, | ||
64 | |||
65 | /* declared differently in kern_util.h */ | ||
66 | [ __NR_chdir ] = (syscall_handler_t *) sys_chdir, | ||
67 | [ __NR_time ] = um_time, | ||
68 | [ __NR_mknod ] = (syscall_handler_t *) sys_mknod, | ||
69 | [ __NR_chmod ] = (syscall_handler_t *) sys_chmod, | ||
70 | [ __NR_lchown ] = (syscall_handler_t *) sys_lchown, | ||
71 | [ __NR_lseek ] = (syscall_handler_t *) sys_lseek, | ||
72 | [ __NR_getpid ] = (syscall_handler_t *) sys_getpid, | ||
73 | [ __NR_mount ] = (syscall_handler_t *) sys_mount, | ||
74 | [ __NR_setuid ] = (syscall_handler_t *) sys_setuid, | ||
75 | [ __NR_getuid ] = (syscall_handler_t *) sys_getuid, | ||
76 | [ __NR_ptrace ] = (syscall_handler_t *) sys_ptrace, | ||
77 | [ __NR_alarm ] = (syscall_handler_t *) sys_alarm, | ||
78 | [ __NR_pause ] = (syscall_handler_t *) sys_pause, | ||
79 | [ __NR_utime ] = (syscall_handler_t *) sys_utime, | ||
80 | [ __NR_access ] = (syscall_handler_t *) sys_access, | ||
81 | [ __NR_sync ] = (syscall_handler_t *) sys_sync, | ||
82 | [ __NR_kill ] = (syscall_handler_t *) sys_kill, | ||
83 | [ __NR_rename ] = (syscall_handler_t *) sys_rename, | ||
84 | [ __NR_mkdir ] = (syscall_handler_t *) sys_mkdir, | ||
85 | [ __NR_rmdir ] = (syscall_handler_t *) sys_rmdir, | ||
86 | |||
87 | /* Declared differently in asm/unistd.h */ | ||
88 | [ __NR_dup ] = (syscall_handler_t *) sys_dup, | ||
89 | [ __NR_pipe ] = (syscall_handler_t *) sys_pipe, | ||
90 | [ __NR_times ] = (syscall_handler_t *) sys_times, | ||
91 | [ __NR_brk ] = (syscall_handler_t *) sys_brk, | ||
92 | [ __NR_setgid ] = (syscall_handler_t *) sys_setgid, | ||
93 | [ __NR_getgid ] = (syscall_handler_t *) sys_getgid, | ||
94 | [ __NR_geteuid ] = (syscall_handler_t *) sys_geteuid, | ||
95 | [ __NR_getegid ] = (syscall_handler_t *) sys_getegid, | ||
96 | [ __NR_acct ] = (syscall_handler_t *) sys_acct, | ||
97 | [ __NR_umount2 ] = (syscall_handler_t *) sys_umount, | ||
98 | [ __NR_ioctl ] = (syscall_handler_t *) sys_ioctl, | ||
99 | [ __NR_fcntl ] = (syscall_handler_t *) sys_fcntl, | ||
100 | [ __NR_setpgid ] = (syscall_handler_t *) sys_setpgid, | ||
101 | [ __NR_umask ] = (syscall_handler_t *) sys_umask, | ||
102 | [ __NR_chroot ] = (syscall_handler_t *) sys_chroot, | ||
103 | [ __NR_ustat ] = (syscall_handler_t *) sys_ustat, | ||
104 | [ __NR_dup2 ] = (syscall_handler_t *) sys_dup2, | ||
105 | [ __NR_getppid ] = (syscall_handler_t *) sys_getppid, | ||
106 | [ __NR_getpgrp ] = (syscall_handler_t *) sys_getpgrp, | ||
107 | [ __NR_setsid ] = (syscall_handler_t *) sys_setsid, | ||
108 | [ __NR_setreuid ] = (syscall_handler_t *) sys_setreuid, | ||
109 | [ __NR_setregid ] = (syscall_handler_t *) sys_setregid, | ||
110 | [ __NR_sethostname ] = (syscall_handler_t *) sys_sethostname, | ||
111 | [ __NR_setrlimit ] = (syscall_handler_t *) sys_setrlimit, | ||
112 | [ __NR_getrlimit ] = (syscall_handler_t *) sys_getrlimit, | ||
113 | [ __NR_getrusage ] = (syscall_handler_t *) sys_getrusage, | ||
114 | [ __NR_gettimeofday ] = (syscall_handler_t *) sys_gettimeofday, | ||
115 | [ __NR_settimeofday ] = (syscall_handler_t *) sys_settimeofday, | ||
116 | [ __NR_getgroups ] = (syscall_handler_t *) sys_getgroups, | ||
117 | [ __NR_setgroups ] = (syscall_handler_t *) sys_setgroups, | ||
118 | [ __NR_symlink ] = (syscall_handler_t *) sys_symlink, | ||
119 | [ __NR_readlink ] = (syscall_handler_t *) sys_readlink, | ||
120 | [ __NR_uselib ] = (syscall_handler_t *) sys_ni_syscall, | ||
121 | [ __NR_swapon ] = (syscall_handler_t *) sys_swapon, | ||
122 | [ __NR_reboot ] = (syscall_handler_t *) sys_reboot, | ||
123 | [ __NR_munmap ] = (syscall_handler_t *) sys_munmap, | ||
124 | [ __NR_truncate ] = (syscall_handler_t *) sys_truncate, | ||
125 | [ __NR_ftruncate ] = (syscall_handler_t *) sys_ftruncate, | ||
126 | [ __NR_fchmod ] = (syscall_handler_t *) sys_fchmod, | ||
127 | [ __NR_fchown ] = (syscall_handler_t *) sys_fchown, | ||
128 | [ __NR_getpriority ] = (syscall_handler_t *) sys_getpriority, | ||
129 | [ __NR_setpriority ] = (syscall_handler_t *) sys_setpriority, | ||
130 | [ __NR_statfs ] = (syscall_handler_t *) sys_statfs, | ||
131 | [ __NR_fstatfs ] = (syscall_handler_t *) sys_fstatfs, | ||
132 | [ __NR_ioperm ] = (syscall_handler_t *) sys_ni_syscall, | ||
133 | [ __NR_syslog ] = (syscall_handler_t *) sys_syslog, | ||
134 | [ __NR_setitimer ] = (syscall_handler_t *) sys_setitimer, | ||
135 | [ __NR_getitimer ] = (syscall_handler_t *) sys_getitimer, | ||
136 | [ __NR_stat ] = (syscall_handler_t *) sys_newstat, | ||
137 | [ __NR_lstat ] = (syscall_handler_t *) sys_newlstat, | ||
138 | [ __NR_fstat ] = (syscall_handler_t *) sys_newfstat, | ||
139 | [ __NR_vhangup ] = (syscall_handler_t *) sys_vhangup, | ||
140 | [ __NR_wait4 ] = (syscall_handler_t *) sys_wait4, | ||
141 | [ __NR_swapoff ] = (syscall_handler_t *) sys_swapoff, | ||
142 | [ __NR_sysinfo ] = (syscall_handler_t *) sys_sysinfo, | ||
143 | [ __NR_fsync ] = (syscall_handler_t *) sys_fsync, | ||
144 | [ __NR_clone ] = (syscall_handler_t *) sys_clone, | ||
145 | [ __NR_setdomainname ] = (syscall_handler_t *) sys_setdomainname, | ||
146 | [ __NR_uname ] = (syscall_handler_t *) sys_newuname, | ||
147 | [ __NR_adjtimex ] = (syscall_handler_t *) sys_adjtimex, | ||
148 | [ __NR_mprotect ] = (syscall_handler_t *) sys_mprotect, | ||
149 | [ __NR_create_module ] = (syscall_handler_t *) sys_ni_syscall, | ||
150 | [ __NR_init_module ] = (syscall_handler_t *) sys_init_module, | ||
151 | [ __NR_delete_module ] = (syscall_handler_t *) sys_delete_module, | ||
152 | [ __NR_get_kernel_syms ] = (syscall_handler_t *) sys_ni_syscall, | ||
153 | [ __NR_quotactl ] = (syscall_handler_t *) sys_quotactl, | ||
154 | [ __NR_getpgid ] = (syscall_handler_t *) sys_getpgid, | ||
155 | [ __NR_fchdir ] = (syscall_handler_t *) sys_fchdir, | ||
156 | [ __NR_sysfs ] = (syscall_handler_t *) sys_sysfs, | ||
157 | [ __NR_personality ] = (syscall_handler_t *) sys_personality, | ||
158 | [ __NR_afs_syscall ] = (syscall_handler_t *) sys_ni_syscall, | ||
159 | [ __NR_setfsuid ] = (syscall_handler_t *) sys_setfsuid, | ||
160 | [ __NR_setfsgid ] = (syscall_handler_t *) sys_setfsgid, | ||
161 | [ __NR_getdents ] = (syscall_handler_t *) sys_getdents, | ||
162 | [ __NR_flock ] = (syscall_handler_t *) sys_flock, | ||
163 | [ __NR_msync ] = (syscall_handler_t *) sys_msync, | ||
164 | [ __NR_readv ] = (syscall_handler_t *) sys_readv, | ||
165 | [ __NR_writev ] = (syscall_handler_t *) sys_writev, | ||
166 | [ __NR_getsid ] = (syscall_handler_t *) sys_getsid, | ||
167 | [ __NR_fdatasync ] = (syscall_handler_t *) sys_fdatasync, | ||
168 | [ __NR__sysctl ] = (syscall_handler_t *) sys_sysctl, | ||
169 | [ __NR_mlock ] = (syscall_handler_t *) sys_mlock, | ||
170 | [ __NR_munlock ] = (syscall_handler_t *) sys_munlock, | ||
171 | [ __NR_mlockall ] = (syscall_handler_t *) sys_mlockall, | ||
172 | [ __NR_munlockall ] = (syscall_handler_t *) sys_munlockall, | ||
173 | [ __NR_sched_setparam ] = (syscall_handler_t *) sys_sched_setparam, | ||
174 | [ __NR_sched_getparam ] = (syscall_handler_t *) sys_sched_getparam, | ||
175 | [ __NR_sched_setscheduler ] = (syscall_handler_t *) sys_sched_setscheduler, | ||
176 | [ __NR_sched_getscheduler ] = (syscall_handler_t *) sys_sched_getscheduler, | ||
177 | [ __NR_sched_yield ] = (syscall_handler_t *) yield, | ||
178 | [ __NR_sched_get_priority_max ] = (syscall_handler_t *) sys_sched_get_priority_max, | ||
179 | [ __NR_sched_get_priority_min ] = (syscall_handler_t *) sys_sched_get_priority_min, | ||
180 | [ __NR_sched_rr_get_interval ] = (syscall_handler_t *) sys_sched_rr_get_interval, | ||
181 | [ __NR_nanosleep ] = (syscall_handler_t *) sys_nanosleep, | ||
182 | [ __NR_mremap ] = (syscall_handler_t *) sys_mremap, | ||
183 | [ __NR_setresuid ] = (syscall_handler_t *) sys_setresuid, | ||
184 | [ __NR_getresuid ] = (syscall_handler_t *) sys_getresuid, | ||
185 | [ __NR_query_module ] = (syscall_handler_t *) sys_ni_syscall, | ||
186 | [ __NR_poll ] = (syscall_handler_t *) sys_poll, | ||
187 | [ __NR_nfsservctl ] = (syscall_handler_t *) sys_nfsservctl, | ||
188 | [ __NR_setresgid ] = (syscall_handler_t *) sys_setresgid, | ||
189 | [ __NR_getresgid ] = (syscall_handler_t *) sys_getresgid, | ||
190 | [ __NR_prctl ] = (syscall_handler_t *) sys_prctl, | ||
191 | [ __NR_rt_sigreturn ] = (syscall_handler_t *) sys_rt_sigreturn, | ||
192 | [ __NR_rt_sigaction ] = (syscall_handler_t *) sys_rt_sigaction, | ||
193 | [ __NR_rt_sigprocmask ] = (syscall_handler_t *) sys_rt_sigprocmask, | ||
194 | [ __NR_rt_sigpending ] = (syscall_handler_t *) sys_rt_sigpending, | ||
195 | [ __NR_rt_sigtimedwait ] = (syscall_handler_t *) sys_rt_sigtimedwait, | ||
196 | [ __NR_rt_sigqueueinfo ] = (syscall_handler_t *) sys_rt_sigqueueinfo, | ||
197 | [ __NR_rt_sigsuspend ] = (syscall_handler_t *) sys_rt_sigsuspend, | ||
198 | [ __NR_pread64 ] = (syscall_handler_t *) sys_pread64, | ||
199 | [ __NR_pwrite64 ] = (syscall_handler_t *) sys_pwrite64, | ||
200 | [ __NR_chown ] = (syscall_handler_t *) sys_chown, | ||
201 | [ __NR_getcwd ] = (syscall_handler_t *) sys_getcwd, | ||
202 | [ __NR_capget ] = (syscall_handler_t *) sys_capget, | ||
203 | [ __NR_capset ] = (syscall_handler_t *) sys_capset, | ||
204 | [ __NR_sigaltstack ] = (syscall_handler_t *) sys_sigaltstack, | ||
205 | [ __NR_sendfile ] = (syscall_handler_t *) sys_sendfile64, | ||
206 | [ __NR_getpmsg ] = (syscall_handler_t *) sys_ni_syscall, | ||
207 | [ __NR_putpmsg ] = (syscall_handler_t *) sys_ni_syscall, | ||
208 | [ __NR_vfork ] = (syscall_handler_t *) sys_vfork, | ||
209 | [ __NR_getdents64 ] = (syscall_handler_t *) sys_getdents64, | ||
210 | [ __NR_gettid ] = (syscall_handler_t *) sys_gettid, | ||
211 | [ __NR_readahead ] = (syscall_handler_t *) sys_readahead, | ||
212 | [ __NR_setxattr ] = (syscall_handler_t *) sys_setxattr, | ||
213 | [ __NR_lsetxattr ] = (syscall_handler_t *) sys_lsetxattr, | ||
214 | [ __NR_fsetxattr ] = (syscall_handler_t *) sys_fsetxattr, | ||
215 | [ __NR_getxattr ] = (syscall_handler_t *) sys_getxattr, | ||
216 | [ __NR_lgetxattr ] = (syscall_handler_t *) sys_lgetxattr, | ||
217 | [ __NR_fgetxattr ] = (syscall_handler_t *) sys_fgetxattr, | ||
218 | [ __NR_listxattr ] = (syscall_handler_t *) sys_listxattr, | ||
219 | [ __NR_llistxattr ] = (syscall_handler_t *) sys_llistxattr, | ||
220 | [ __NR_flistxattr ] = (syscall_handler_t *) sys_flistxattr, | ||
221 | [ __NR_removexattr ] = (syscall_handler_t *) sys_removexattr, | ||
222 | [ __NR_lremovexattr ] = (syscall_handler_t *) sys_lremovexattr, | ||
223 | [ __NR_fremovexattr ] = (syscall_handler_t *) sys_fremovexattr, | ||
224 | [ __NR_tkill ] = (syscall_handler_t *) sys_tkill, | ||
225 | [ __NR_futex ] = (syscall_handler_t *) sys_futex, | ||
226 | [ __NR_sched_setaffinity ] = (syscall_handler_t *) sys_sched_setaffinity, | ||
227 | [ __NR_sched_getaffinity ] = (syscall_handler_t *) sys_sched_getaffinity, | ||
228 | [ __NR_io_setup ] = (syscall_handler_t *) sys_io_setup, | ||
229 | [ __NR_io_destroy ] = (syscall_handler_t *) sys_io_destroy, | ||
230 | [ __NR_io_getevents ] = (syscall_handler_t *) sys_io_getevents, | ||
231 | [ __NR_io_submit ] = (syscall_handler_t *) sys_io_submit, | ||
232 | [ __NR_io_cancel ] = (syscall_handler_t *) sys_io_cancel, | ||
233 | [ __NR_exit_group ] = (syscall_handler_t *) sys_exit_group, | ||
234 | [ __NR_lookup_dcookie ] = (syscall_handler_t *) sys_lookup_dcookie, | ||
235 | [ __NR_epoll_create ] = (syscall_handler_t *) sys_epoll_create, | ||
236 | [ __NR_epoll_ctl ] = (syscall_handler_t *) sys_epoll_ctl, | ||
237 | [ __NR_epoll_wait ] = (syscall_handler_t *) sys_epoll_wait, | ||
238 | [ __NR_remap_file_pages ] = (syscall_handler_t *) sys_remap_file_pages, | ||
239 | [ __NR_set_tid_address ] = (syscall_handler_t *) sys_set_tid_address, | ||
240 | [ __NR_timer_create ] = (syscall_handler_t *) sys_timer_create, | ||
241 | [ __NR_timer_settime ] = (syscall_handler_t *) sys_timer_settime, | ||
242 | [ __NR_timer_gettime ] = (syscall_handler_t *) sys_timer_gettime, | ||
243 | [ __NR_timer_getoverrun ] = (syscall_handler_t *) sys_timer_getoverrun, | ||
244 | [ __NR_timer_delete ] = (syscall_handler_t *) sys_timer_delete, | ||
245 | [ __NR_clock_settime ] = (syscall_handler_t *) sys_clock_settime, | ||
246 | [ __NR_clock_gettime ] = (syscall_handler_t *) sys_clock_gettime, | ||
247 | [ __NR_clock_getres ] = (syscall_handler_t *) sys_clock_getres, | ||
248 | [ __NR_clock_nanosleep ] = (syscall_handler_t *) sys_clock_nanosleep, | ||
249 | [ __NR_tgkill ] = (syscall_handler_t *) sys_tgkill, | ||
250 | [ __NR_utimes ] = (syscall_handler_t *) sys_utimes, | ||
251 | [ __NR_fadvise64 ] = (syscall_handler_t *) sys_fadvise64, | ||
252 | [ __NR_vserver ] = (syscall_handler_t *) sys_ni_syscall, | ||
253 | [ __NR_mbind ] = (syscall_handler_t *) sys_mbind, | ||
254 | [ __NR_get_mempolicy ] = (syscall_handler_t *) sys_get_mempolicy, | ||
255 | [ __NR_set_mempolicy ] = (syscall_handler_t *) sys_set_mempolicy, | ||
256 | [ __NR_mq_open ] = (syscall_handler_t *) sys_mq_open, | ||
257 | [ __NR_mq_unlink ] = (syscall_handler_t *) sys_mq_unlink, | ||
258 | [ __NR_mq_timedsend ] = (syscall_handler_t *) sys_mq_timedsend, | ||
259 | [ __NR_mq_timedreceive ] = (syscall_handler_t *) sys_mq_timedreceive, | ||
260 | [ __NR_mq_notify ] = (syscall_handler_t *) sys_mq_notify, | ||
261 | [ __NR_mq_getsetattr ] = (syscall_handler_t *) sys_mq_getsetattr, | ||
262 | [ __NR_kexec_load ] = (syscall_handler_t *) sys_ni_syscall, | ||
263 | [ __NR_waitid ] = (syscall_handler_t *) sys_waitid, | ||
264 | [ __NR_add_key ] = (syscall_handler_t *) sys_add_key, | ||
265 | [ __NR_request_key ] = (syscall_handler_t *) sys_request_key, | ||
266 | [ __NR_keyctl ] = (syscall_handler_t *) sys_keyctl, | ||
267 | |||
268 | ARCH_SYSCALLS | ||
269 | [ LAST_SYSCALL + 1 ... NR_syscalls ] = | ||
270 | (syscall_handler_t *) sys_ni_syscall | ||
271 | }; | ||
diff --git a/arch/um/sys-x86_64/syscall_table.c b/arch/um/sys-x86_64/syscall_table.c new file mode 100644 index 000000000000..34b2e842864f --- /dev/null +++ b/arch/um/sys-x86_64/syscall_table.c | |||
@@ -0,0 +1,59 @@ | |||
1 | /* System call table for UML/x86-64, copied from arch/x86_64/kernel/syscall.c | ||
2 | * with some changes for UML. */ | ||
3 | |||
4 | #include <linux/linkage.h> | ||
5 | #include <linux/sys.h> | ||
6 | #include <linux/cache.h> | ||
7 | #include <linux/config.h> | ||
8 | |||
9 | #define __NO_STUBS | ||
10 | |||
11 | /* Below you can see, in terms of #define's, the differences between the x86-64 | ||
12 | * and the UML syscall table. */ | ||
13 | |||
14 | /* Not going to be implemented by UML, since we have no hardware. */ | ||
15 | #define stub_iopl sys_ni_syscall | ||
16 | #define sys_ioperm sys_ni_syscall | ||
17 | |||
18 | /* The UML TLS problem. Note that x86_64 does not implement this, so the below | ||
19 | * is needed only for the ia32 compatibility. */ | ||
20 | /*#define sys_set_thread_area sys_ni_syscall | ||
21 | #define sys_get_thread_area sys_ni_syscall*/ | ||
22 | |||
23 | /* For __NR_time. The x86-64 name hopefully will change from sys_time64 to | ||
24 | * sys_time (since the current situation is bogus). I've sent a patch to cleanup | ||
25 | * this. Remove below the obsoleted line. */ | ||
26 | #define sys_time64 um_time | ||
27 | #define sys_time um_time | ||
28 | |||
29 | /* On UML we call it this way ("old" means it's not mmap2) */ | ||
30 | #define sys_mmap old_mmap | ||
31 | /* On x86-64 sys_uname is actually sys_newuname plus a compatibility trick. | ||
32 | * See arch/x86_64/kernel/sys_x86_64.c */ | ||
33 | #define sys_uname sys_uname64 | ||
34 | |||
35 | #define stub_clone sys_clone | ||
36 | #define stub_fork sys_fork | ||
37 | #define stub_vfork sys_vfork | ||
38 | #define stub_execve sys_execve | ||
39 | #define stub_rt_sigsuspend sys_rt_sigsuspend | ||
40 | #define stub_sigaltstack sys_sigaltstack | ||
41 | #define stub_rt_sigreturn sys_rt_sigreturn | ||
42 | |||
43 | #define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; | ||
44 | #undef _ASM_X86_64_UNISTD_H_ | ||
45 | #include <asm-x86_64/unistd.h> | ||
46 | |||
47 | #undef __SYSCALL | ||
48 | #define __SYSCALL(nr, sym) [ nr ] = sym, | ||
49 | #undef _ASM_X86_64_UNISTD_H_ | ||
50 | |||
51 | typedef void (*sys_call_ptr_t)(void); | ||
52 | |||
53 | extern void sys_ni_syscall(void); | ||
54 | |||
55 | sys_call_ptr_t sys_call_table[__NR_syscall_max+1] __cacheline_aligned = { | ||
56 | /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ | ||
57 | [0 ... __NR_syscall_max] = &sys_ni_syscall, | ||
58 | #include <asm-x86_64/unistd.h> | ||
59 | }; | ||
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index 68205a03364c..15768c96ceb4 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include "asm/prctl.h" /* XXX This should get the constants from libc */ | 14 | #include "asm/prctl.h" /* XXX This should get the constants from libc */ |
15 | #include "choose-mode.h" | 15 | #include "choose-mode.h" |
16 | 16 | ||
17 | /* XXX: copied from x86-64: arch/x86_64/kernel/sys_x86_64.c */ | ||
17 | asmlinkage long wrap_sys_shmat(int shmid, char __user *shmaddr, int shmflg) | 18 | asmlinkage long wrap_sys_shmat(int shmid, char __user *shmaddr, int shmflg) |
18 | { | 19 | { |
19 | unsigned long raddr; | 20 | unsigned long raddr; |
@@ -21,6 +22,17 @@ asmlinkage long wrap_sys_shmat(int shmid, char __user *shmaddr, int shmflg) | |||
21 | return do_shmat(shmid, shmaddr, shmflg, &raddr) ?: (long) raddr; | 22 | return do_shmat(shmid, shmaddr, shmflg, &raddr) ?: (long) raddr; |
22 | } | 23 | } |
23 | 24 | ||
25 | asmlinkage long sys_uname64(struct new_utsname __user * name) | ||
26 | { | ||
27 | int err; | ||
28 | down_read(&uts_sem); | ||
29 | err = copy_to_user(name, &system_utsname, sizeof (*name)); | ||
30 | up_read(&uts_sem); | ||
31 | if (personality(current->personality) == PER_LINUX32) | ||
32 | err |= copy_to_user(&name->machine, "i686", 5); | ||
33 | return err ? -EFAULT : 0; | ||
34 | } | ||
35 | |||
24 | #ifdef CONFIG_MODE_TT | 36 | #ifdef CONFIG_MODE_TT |
25 | extern int modify_ldt(int func, void *ptr, unsigned long bytecount); | 37 | extern int modify_ldt(int func, void *ptr, unsigned long bytecount); |
26 | 38 | ||