powerpc: Merge syscalls.c and sys_ppc32.c.
[linux-2.6.git] / arch / powerpc / kernel / systbl.S
1 /*
2  * This file contains the table of syscall-handling functions.
3  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4  *
5  * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
6  * and Paul Mackerras.
7  *
8  * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
9  * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com) 
10  * 
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version
14  * 2 of the License, or (at your option) any later version.
15  */
16
17 #include <linux/config.h>
18 #include <asm/ppc_asm.h>
19
20 #ifdef CONFIG_PPC64
21 #define SYSCALL(func)           .llong  .sys_##func,.sys_##func
22 #define SYSCALL32(func)         .llong  .sys_##func,.sys32_##func
23 #define COMPAT_SYS(func)        .llong  .sys_##func,.compat_sys_##func
24 #define PPC_SYS(func)           .llong  .ppc_##func,.ppc_##func
25 #define OLDSYS(func)            .llong  .sys_ni_syscall,.sys_ni_syscall
26 #define SYS32ONLY(func)         .llong  .sys_ni_syscall,.sys32_##func
27 #define SYSX(f, f3264, f32)     .llong  .f,.f3264
28 #else
29 #define SYSCALL(func)           .long   sys_##func
30 #define SYSCALL32(func)         .long   sys_##func
31 #define COMPAT_SYS(func)        .long   sys_##func
32 #define PPC_SYS(func)           .long   ppc_##func
33 #define OLDSYS(func)            .long   sys_##func
34 #define SYS32ONLY(func)         .long   sys_##func
35 #define SYSX(f, f3264, f32)     .long   f32
36 #endif
37
38 #ifdef CONFIG_PPC64
39 #define sys_sigpending  sys_ni_syscall
40 #define sys_old_getrlimit sys_ni_syscall
41 #else
42 #define ppc_rtas        sys_ni_syscall
43 #endif
44
45 _GLOBAL(sys_call_table)
46 SYSCALL(restart_syscall)
47 SYSCALL(exit)
48 PPC_SYS(fork)
49 SYSCALL(read)
50 SYSCALL(write)
51 COMPAT_SYS(open)
52 SYSCALL(close)
53 SYSCALL32(waitpid)
54 SYSCALL32(creat)
55 SYSCALL(link)
56 SYSCALL(unlink)
57 SYSCALL32(execve)
58 SYSCALL(chdir)
59 SYSX(sys64_time,compat_sys_time,sys_time)
60 SYSCALL(mknod)
61 SYSCALL(chmod)
62 SYSCALL(lchown)
63 SYSCALL(ni_syscall)
64 OLDSYS(stat)
65 SYSX(sys_lseek,ppc32_lseek,sys_lseek)
66 SYSCALL(getpid)
67 COMPAT_SYS(mount)
68 SYSX(sys_ni_syscall,sys_oldumount,sys_oldumount)
69 SYSCALL(setuid)
70 SYSCALL(getuid)
71 COMPAT_SYS(stime)
72 SYSCALL32(ptrace)
73 SYSCALL(alarm)
74 OLDSYS(fstat)
75 SYSCALL32(pause)
76 COMPAT_SYS(utime)
77 SYSCALL(ni_syscall)
78 SYSCALL(ni_syscall)
79 SYSCALL32(access)
80 SYSCALL32(nice)
81 SYSCALL(ni_syscall)
82 SYSCALL(sync)
83 SYSCALL32(kill)
84 SYSCALL(rename)
85 SYSCALL32(mkdir)
86 SYSCALL(rmdir)
87 SYSCALL(dup)
88 SYSCALL(pipe)
89 COMPAT_SYS(times)
90 SYSCALL(ni_syscall)
91 SYSCALL(brk)
92 SYSCALL(setgid)
93 SYSCALL(getgid)
94 SYSCALL(signal)
95 SYSCALL(geteuid)
96 SYSCALL(getegid)
97 SYSCALL(acct)
98 SYSCALL(umount)
99 SYSCALL(ni_syscall)
100 COMPAT_SYS(ioctl)
101 COMPAT_SYS(fcntl)
102 SYSCALL(ni_syscall)
103 SYSCALL32(setpgid)
104 SYSCALL(ni_syscall)
105 SYSX(sys_ni_syscall,sys_olduname, sys_olduname)
106 SYSCALL32(umask)
107 SYSCALL(chroot)
108 SYSCALL(ustat)
109 SYSCALL(dup2)
110 SYSCALL(getppid)
111 SYSCALL(getpgrp)
112 SYSCALL(setsid)
113 SYS32ONLY(sigaction)
114 SYSCALL(sgetmask)
115 SYSCALL32(ssetmask)
116 SYSCALL(setreuid)
117 SYSCALL(setregid)
118 SYSX(sys_ni_syscall,ppc32_sigsuspend,ppc_sigsuspend)
119 COMPAT_SYS(sigpending)
120 SYSCALL32(sethostname)
121 COMPAT_SYS(setrlimit)
122 COMPAT_SYS(old_getrlimit)
123 COMPAT_SYS(getrusage)
124 SYSCALL32(gettimeofday)
125 SYSCALL32(settimeofday)
126 SYSCALL32(getgroups)
127 SYSCALL32(setgroups)
128 SYSX(sys_ni_syscall,sys_ni_syscall,ppc_select)
129 SYSCALL(symlink)
130 OLDSYS(lstat)
131 SYSCALL32(readlink)
132 SYSCALL(uselib)
133 SYSCALL(swapon)
134 SYSCALL(reboot)
135 SYSX(sys_ni_syscall,old32_readdir,old_readdir)
136 SYSCALL(mmap)
137 SYSCALL(munmap)
138 SYSCALL(truncate)
139 SYSCALL(ftruncate)
140 SYSCALL(fchmod)
141 SYSCALL(fchown)
142 SYSCALL32(getpriority)
143 SYSCALL32(setpriority)
144 SYSCALL(ni_syscall)
145 COMPAT_SYS(statfs)
146 COMPAT_SYS(fstatfs)
147 SYSCALL(ni_syscall)
148 COMPAT_SYS(socketcall)
149 SYSCALL32(syslog)
150 COMPAT_SYS(setitimer)
151 COMPAT_SYS(getitimer)
152 COMPAT_SYS(newstat)
153 COMPAT_SYS(newlstat)
154 COMPAT_SYS(newfstat)
155 SYSX(sys_ni_syscall,sys_uname,sys_uname)
156 SYSCALL(ni_syscall)
157 SYSCALL(vhangup)
158 SYSCALL(ni_syscall)
159 SYSCALL(ni_syscall)
160 COMPAT_SYS(wait4)
161 SYSCALL(swapoff)
162 SYSCALL32(sysinfo)
163 SYSCALL32(ipc)
164 SYSCALL(fsync)
165 SYSX(sys_ni_syscall,ppc32_sigreturn,sys_sigreturn)
166 PPC_SYS(clone)
167 SYSCALL32(setdomainname)
168 PPC_SYS(newuname)
169 SYSCALL(ni_syscall)
170 SYSCALL32(adjtimex)
171 SYSCALL(mprotect)
172 SYSX(sys_ni_syscall,compat_sys_sigprocmask,sys_sigprocmask)
173 SYSCALL(ni_syscall)
174 SYSCALL(init_module)
175 SYSCALL(delete_module)
176 SYSCALL(ni_syscall)
177 SYSCALL(quotactl)
178 SYSCALL32(getpgid)
179 SYSCALL(fchdir)
180 SYSCALL(bdflush)
181 SYSCALL32(sysfs)
182 SYSX(ppc64_personality,ppc64_personality,sys_personality)
183 SYSCALL(ni_syscall)
184 SYSCALL(setfsuid)
185 SYSCALL(setfsgid)
186 SYSCALL(llseek)
187 SYSCALL32(getdents)
188 SYSX(sys_select,ppc32_select,ppc_select)
189 SYSCALL(flock)
190 SYSCALL(msync)
191 COMPAT_SYS(readv)
192 COMPAT_SYS(writev)
193 SYSCALL32(getsid)
194 SYSCALL(fdatasync)
195 SYSCALL32(sysctl)
196 SYSCALL(mlock)
197 SYSCALL(munlock)
198 SYSCALL(mlockall)
199 SYSCALL(munlockall)
200 SYSCALL32(sched_setparam)
201 SYSCALL32(sched_getparam)
202 SYSCALL32(sched_setscheduler)
203 SYSCALL32(sched_getscheduler)
204 SYSCALL(sched_yield)
205 SYSCALL32(sched_get_priority_max)
206 SYSCALL32(sched_get_priority_min)
207 SYSCALL32(sched_rr_get_interval)
208 COMPAT_SYS(nanosleep)
209 SYSCALL(mremap)
210 SYSCALL(setresuid)
211 SYSCALL(getresuid)
212 SYSCALL(ni_syscall)
213 SYSCALL(poll)
214 COMPAT_SYS(nfsservctl)
215 SYSCALL(setresgid)
216 SYSCALL(getresgid)
217 SYSCALL32(prctl)
218 SYSX(ppc64_rt_sigreturn,ppc32_rt_sigreturn,sys_rt_sigreturn)
219 SYSCALL32(rt_sigaction)
220 SYSCALL32(rt_sigprocmask)
221 SYSCALL32(rt_sigpending)
222 COMPAT_SYS(rt_sigtimedwait)
223 SYSCALL32(rt_sigqueueinfo)
224 SYSX(ppc64_rt_sigsuspend,ppc32_rt_sigsuspend,ppc_rt_sigsuspend)
225 SYSCALL32(pread64)
226 SYSCALL32(pwrite64)
227 SYSCALL(chown)
228 SYSCALL(getcwd)
229 SYSCALL(capget)
230 SYSCALL(capset)
231 SYSCALL32(sigaltstack)
232 SYSX(sys_sendfile64,sys32_sendfile,sys_sendfile)
233 SYSCALL(ni_syscall)
234 SYSCALL(ni_syscall)
235 PPC_SYS(vfork)
236 COMPAT_SYS(getrlimit)
237 SYSCALL32(readahead)
238 SYS32ONLY(mmap2)
239 SYS32ONLY(truncate64)
240 SYS32ONLY(ftruncate64)
241 SYSX(sys_ni_syscall,sys_stat64,sys_stat64)
242 SYSX(sys_ni_syscall,sys_lstat64,sys_lstat64)
243 SYSX(sys_ni_syscall,sys_fstat64,sys_fstat64)
244 SYSCALL32(pciconfig_read)
245 SYSCALL32(pciconfig_write)
246 SYSCALL32(pciconfig_iobase)
247 SYSCALL(ni_syscall)
248 SYSCALL(getdents64)
249 SYSCALL(pivot_root)
250 SYSX(sys_ni_syscall,compat_sys_fcntl64,sys_fcntl64)
251 SYSCALL(madvise)
252 SYSCALL(mincore)
253 SYSCALL(gettid)
254 SYSCALL(tkill)
255 SYSCALL(setxattr)
256 SYSCALL(lsetxattr)
257 SYSCALL(fsetxattr)
258 SYSCALL(getxattr)
259 SYSCALL(lgetxattr)
260 SYSCALL(fgetxattr)
261 SYSCALL(listxattr)
262 SYSCALL(llistxattr)
263 SYSCALL(flistxattr)
264 SYSCALL(removexattr)
265 SYSCALL(lremovexattr)
266 SYSCALL(fremovexattr)
267 COMPAT_SYS(futex)
268 COMPAT_SYS(sched_setaffinity)
269 COMPAT_SYS(sched_getaffinity)
270 SYSCALL(ni_syscall)
271 SYSCALL(ni_syscall)
272 SYS32ONLY(sendfile64)
273 COMPAT_SYS(io_setup)
274 SYSCALL(io_destroy)
275 COMPAT_SYS(io_getevents)
276 COMPAT_SYS(io_submit)
277 SYSCALL(io_cancel)
278 SYSCALL(set_tid_address)
279 SYSX(sys_fadvise64,ppc32_fadvise64,sys_fadvise64)
280 SYSCALL(exit_group)
281 SYSX(sys_lookup_dcookie,ppc32_lookup_dcookie,sys_lookup_dcookie)
282 SYSCALL(epoll_create)
283 SYSCALL(epoll_ctl)
284 SYSCALL(epoll_wait)
285 SYSCALL(remap_file_pages)
286 SYSX(sys_timer_create,ppc32_timer_create,sys_timer_create)
287 COMPAT_SYS(timer_settime)
288 COMPAT_SYS(timer_gettime)
289 SYSCALL(timer_getoverrun)
290 SYSCALL(timer_delete)
291 COMPAT_SYS(clock_settime)
292 COMPAT_SYS(clock_gettime)
293 COMPAT_SYS(clock_getres)
294 COMPAT_SYS(clock_nanosleep)
295 SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext)
296 SYSCALL32(tgkill)
297 SYSCALL32(utimes)
298 COMPAT_SYS(statfs64)
299 COMPAT_SYS(fstatfs64)
300 SYSX(sys_ni_syscall, ppc32_fadvise64_64, sys_fadvise64_64)
301 PPC_SYS(rtas)
302 OLDSYS(debug_setcontext)
303 SYSCALL(ni_syscall)
304 SYSCALL(ni_syscall)
305 COMPAT_SYS(mbind)
306 COMPAT_SYS(get_mempolicy)
307 COMPAT_SYS(set_mempolicy)
308 COMPAT_SYS(mq_open)
309 SYSCALL(mq_unlink)
310 COMPAT_SYS(mq_timedsend)
311 COMPAT_SYS(mq_timedreceive)
312 COMPAT_SYS(mq_notify)
313 COMPAT_SYS(mq_getsetattr)
314 COMPAT_SYS(kexec_load)
315 SYSCALL32(add_key)
316 SYSCALL32(request_key)
317 COMPAT_SYS(keyctl)
318 COMPAT_SYS(waitid)
319 SYSCALL32(ioprio_set)
320 SYSCALL32(ioprio_get)
321 SYSCALL(inotify_init)
322 SYSCALL(inotify_add_watch)
323 SYSCALL(inotify_rm_watch)