diff options
-rw-r--r-- | arch/xtensa/kernel/syscalls.c | 152 | ||||
-rw-r--r-- | arch/xtensa/kernel/syscalls.h | 57 | ||||
-rw-r--r-- | include/asm-xtensa/unistd.h | 98 |
3 files changed, 30 insertions, 277 deletions
diff --git a/arch/xtensa/kernel/syscalls.c b/arch/xtensa/kernel/syscalls.c index abc8ed6c7026..3540d8b119f3 100644 --- a/arch/xtensa/kernel/syscalls.c +++ b/arch/xtensa/kernel/syscalls.c | |||
@@ -46,8 +46,6 @@ | |||
46 | 46 | ||
47 | extern void do_syscall_trace(void); | 47 | extern void do_syscall_trace(void); |
48 | typedef int (*syscall_t)(void *a0,...); | 48 | typedef int (*syscall_t)(void *a0,...); |
49 | extern int (*do_syscalls)(struct pt_regs *regs, syscall_t fun, | ||
50 | int narg); | ||
51 | extern syscall_t sys_call_table[]; | 49 | extern syscall_t sys_call_table[]; |
52 | extern unsigned char sys_narg_table[]; | 50 | extern unsigned char sys_narg_table[]; |
53 | 51 | ||
@@ -72,10 +70,8 @@ int sys_pipe(int __user *userfds) | |||
72 | /* | 70 | /* |
73 | * Common code for old and new mmaps. | 71 | * Common code for old and new mmaps. |
74 | */ | 72 | */ |
75 | 73 | long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | |
76 | static inline long do_mmap2(unsigned long addr, unsigned long len, | 74 | unsigned long flags, unsigned long fd, unsigned long pgoff) |
77 | unsigned long prot, unsigned long flags, | ||
78 | unsigned long fd, unsigned long pgoff) | ||
79 | { | 75 | { |
80 | int error = -EBADF; | 76 | int error = -EBADF; |
81 | struct file * file = NULL; | 77 | struct file * file = NULL; |
@@ -97,29 +93,6 @@ out: | |||
97 | return error; | 93 | return error; |
98 | } | 94 | } |
99 | 95 | ||
100 | unsigned long old_mmap(unsigned long addr, size_t len, int prot, | ||
101 | int flags, int fd, off_t offset) | ||
102 | { | ||
103 | return do_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); | ||
104 | } | ||
105 | |||
106 | long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | ||
107 | unsigned long flags, unsigned long fd, unsigned long pgoff) | ||
108 | { | ||
109 | return do_mmap2(addr, len, prot, flags, fd, pgoff); | ||
110 | } | ||
111 | |||
112 | int sys_fork(struct pt_regs *regs) | ||
113 | { | ||
114 | return do_fork(SIGCHLD, regs->areg[1], regs, 0, NULL, NULL); | ||
115 | } | ||
116 | |||
117 | int sys_vfork(struct pt_regs *regs) | ||
118 | { | ||
119 | return do_fork(CLONE_VFORK|CLONE_VM|SIGCHLD, regs->areg[1], | ||
120 | regs, 0, NULL, NULL); | ||
121 | } | ||
122 | |||
123 | int sys_clone(struct pt_regs *regs) | 96 | int sys_clone(struct pt_regs *regs) |
124 | { | 97 | { |
125 | unsigned long clone_flags; | 98 | unsigned long clone_flags; |
@@ -162,30 +135,6 @@ int sys_uname(struct old_utsname * name) | |||
162 | return -EFAULT; | 135 | return -EFAULT; |
163 | } | 136 | } |
164 | 137 | ||
165 | int sys_olduname(struct oldold_utsname * name) | ||
166 | { | ||
167 | int error; | ||
168 | |||
169 | if (!name) | ||
170 | return -EFAULT; | ||
171 | if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) | ||
172 | return -EFAULT; | ||
173 | |||
174 | error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); | ||
175 | error -= __put_user(0,name->sysname+__OLD_UTS_LEN); | ||
176 | error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); | ||
177 | error -= __put_user(0,name->nodename+__OLD_UTS_LEN); | ||
178 | error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); | ||
179 | error -= __put_user(0,name->release+__OLD_UTS_LEN); | ||
180 | error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); | ||
181 | error -= __put_user(0,name->version+__OLD_UTS_LEN); | ||
182 | error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); | ||
183 | error -= __put_user(0,name->machine+__OLD_UTS_LEN); | ||
184 | |||
185 | return error ? -EFAULT : 0; | ||
186 | } | ||
187 | |||
188 | |||
189 | /* | 138 | /* |
190 | * Build the string table for the builtin "poor man's strace". | 139 | * Build the string table for the builtin "poor man's strace". |
191 | */ | 140 | */ |
@@ -319,100 +268,3 @@ void system_call (struct pt_regs *regs) | |||
319 | regs->areg[2] = res; | 268 | regs->areg[2] = res; |
320 | do_syscall_trace(); | 269 | do_syscall_trace(); |
321 | } | 270 | } |
322 | |||
323 | /* | ||
324 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | ||
325 | * | ||
326 | * This is really horribly ugly. | ||
327 | */ | ||
328 | |||
329 | int sys_ipc (uint call, int first, int second, | ||
330 | int third, void __user *ptr, long fifth) | ||
331 | { | ||
332 | int version, ret; | ||
333 | |||
334 | version = call >> 16; /* hack for backward compatibility */ | ||
335 | call &= 0xffff; | ||
336 | ret = -ENOSYS; | ||
337 | |||
338 | switch (call) { | ||
339 | case SEMOP: | ||
340 | ret = sys_semtimedop (first, (struct sembuf __user *)ptr, | ||
341 | second, NULL); | ||
342 | break; | ||
343 | |||
344 | case SEMTIMEDOP: | ||
345 | ret = sys_semtimedop (first, (struct sembuf __user *)ptr, | ||
346 | second, (const struct timespec *) fifth); | ||
347 | break; | ||
348 | |||
349 | case SEMGET: | ||
350 | ret = sys_semget (first, second, third); | ||
351 | break; | ||
352 | |||
353 | case SEMCTL: { | ||
354 | union semun fourth; | ||
355 | |||
356 | if (ptr && !get_user(fourth.__pad, (void *__user *) ptr)) | ||
357 | ret = sys_semctl (first, second, third, fourth); | ||
358 | break; | ||
359 | } | ||
360 | |||
361 | case MSGSND: | ||
362 | ret = sys_msgsnd (first, (struct msgbuf __user*) ptr, | ||
363 | second, third); | ||
364 | break; | ||
365 | |||
366 | case MSGRCV: | ||
367 | switch (version) { | ||
368 | case 0: { | ||
369 | struct ipc_kludge tmp; | ||
370 | |||
371 | if (ptr && !copy_from_user(&tmp, | ||
372 | (struct ipc_kludge *) ptr, | ||
373 | sizeof (tmp))) | ||
374 | ret = sys_msgrcv (first, tmp.msgp, second, | ||
375 | tmp.msgtyp, third); | ||
376 | break; | ||
377 | } | ||
378 | |||
379 | default: | ||
380 | ret = sys_msgrcv (first, (struct msgbuf __user *) ptr, | ||
381 | second, 0, third); | ||
382 | break; | ||
383 | } | ||
384 | break; | ||
385 | |||
386 | case MSGGET: | ||
387 | ret = sys_msgget ((key_t) first, second); | ||
388 | break; | ||
389 | |||
390 | case MSGCTL: | ||
391 | ret = sys_msgctl (first, second, (struct msqid_ds __user*) ptr); | ||
392 | break; | ||
393 | |||
394 | case SHMAT: { | ||
395 | ulong raddr; | ||
396 | ret = do_shmat (first, (char __user *) ptr, second, &raddr); | ||
397 | |||
398 | if (!ret) | ||
399 | ret = put_user (raddr, (ulong __user *) third); | ||
400 | |||
401 | break; | ||
402 | } | ||
403 | |||
404 | case SHMDT: | ||
405 | ret = sys_shmdt ((char __user *)ptr); | ||
406 | break; | ||
407 | |||
408 | case SHMGET: | ||
409 | ret = sys_shmget (first, second, third); | ||
410 | break; | ||
411 | |||
412 | case SHMCTL: | ||
413 | ret = sys_shmctl (first, second, (struct shmid_ds __user*) ptr); | ||
414 | break; | ||
415 | } | ||
416 | return ret; | ||
417 | } | ||
418 | |||
diff --git a/arch/xtensa/kernel/syscalls.h b/arch/xtensa/kernel/syscalls.h index 5b3f75f50feb..07580696b602 100644 --- a/arch/xtensa/kernel/syscalls.h +++ b/arch/xtensa/kernel/syscalls.h | |||
@@ -25,20 +25,19 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | SYSCALL(0, 0) /* 00 */ | 27 | SYSCALL(0, 0) /* 00 */ |
28 | |||
29 | SYSCALL(sys_exit, 1) | 28 | SYSCALL(sys_exit, 1) |
30 | SYSCALL(sys_fork, 0) | 29 | SYSCALL(sys_ni_syscall, 0) |
31 | SYSCALL(sys_read, 3) | 30 | SYSCALL(sys_read, 3) |
32 | SYSCALL(sys_write, 3) | 31 | SYSCALL(sys_write, 3) |
33 | SYSCALL(sys_open, 3) /* 05 */ | 32 | SYSCALL(sys_open, 3) /* 05 */ |
34 | SYSCALL(sys_close, 1) | 33 | SYSCALL(sys_close, 1) |
35 | SYSCALL(sys_waitpid, 3) | 34 | SYSCALL(sys_ni_syscall, 3) |
36 | SYSCALL(sys_creat, 2) | 35 | SYSCALL(sys_creat, 2) |
37 | SYSCALL(sys_link, 2) | 36 | SYSCALL(sys_link, 2) |
38 | SYSCALL(sys_unlink, 1) /* 10 */ | 37 | SYSCALL(sys_unlink, 1) /* 10 */ |
39 | SYSCALL(sys_execve, 0) | 38 | SYSCALL(sys_execve, 0) |
40 | SYSCALL(sys_chdir, 1) | 39 | SYSCALL(sys_chdir, 1) |
41 | SYSCALL(sys_time, 1) | 40 | SYSCALL(sys_ni_syscall, 1) |
42 | SYSCALL(sys_mknod, 3) | 41 | SYSCALL(sys_mknod, 3) |
43 | SYSCALL(sys_chmod, 2) /* 15 */ | 42 | SYSCALL(sys_chmod, 2) /* 15 */ |
44 | SYSCALL(sys_lchown, 3) | 43 | SYSCALL(sys_lchown, 3) |
@@ -47,19 +46,19 @@ SYSCALL(sys_stat, 2) | |||
47 | SYSCALL(sys_lseek, 3) | 46 | SYSCALL(sys_lseek, 3) |
48 | SYSCALL(sys_getpid, 0) /* 20 */ | 47 | SYSCALL(sys_getpid, 0) /* 20 */ |
49 | SYSCALL(sys_mount, 5) | 48 | SYSCALL(sys_mount, 5) |
50 | SYSCALL(sys_oldumount, 1) | 49 | SYSCALL(sys_ni_syscall, 1) |
51 | SYSCALL(sys_setuid, 1) | 50 | SYSCALL(sys_setuid, 1) |
52 | SYSCALL(sys_getuid, 0) | 51 | SYSCALL(sys_getuid, 0) |
53 | SYSCALL(sys_stime, 1) /* 25 */ | 52 | SYSCALL(sys_ni_syscall, 1) /* 25 */ |
54 | SYSCALL(sys_ptrace, 4) | 53 | SYSCALL(sys_ptrace, 4) |
55 | SYSCALL(sys_alarm, 1) | 54 | SYSCALL(sys_ni_syscall, 1) |
56 | SYSCALL(sys_fstat, 2) | 55 | SYSCALL(sys_fstat, 2) |
57 | SYSCALL(sys_pause, 0) | 56 | SYSCALL(sys_ni_syscall, 0) |
58 | SYSCALL(sys_utime, 2) /* 30 */ | 57 | SYSCALL(sys_utime, 2) /* 30 */ |
59 | SYSCALL(sys_ni_syscall, 0) | 58 | SYSCALL(sys_ni_syscall, 0) |
60 | SYSCALL(sys_ni_syscall, 0) | 59 | SYSCALL(sys_ni_syscall, 0) |
61 | SYSCALL(sys_access, 2) | 60 | SYSCALL(sys_access, 2) |
62 | SYSCALL(sys_nice, 1) | 61 | SYSCALL(sys_ni_syscall, 1) |
63 | SYSCALL(sys_ni_syscall, 0) /* 35 */ | 62 | SYSCALL(sys_ni_syscall, 0) /* 35 */ |
64 | SYSCALL(sys_sync, 0) | 63 | SYSCALL(sys_sync, 0) |
65 | SYSCALL(sys_kill, 2) | 64 | SYSCALL(sys_kill, 2) |
@@ -73,7 +72,7 @@ SYSCALL(sys_ni_syscall, 0) | |||
73 | SYSCALL(sys_brk, 1) /* 45 */ | 72 | SYSCALL(sys_brk, 1) /* 45 */ |
74 | SYSCALL(sys_setgid, 1) | 73 | SYSCALL(sys_setgid, 1) |
75 | SYSCALL(sys_getgid, 0) | 74 | SYSCALL(sys_getgid, 0) |
76 | SYSCALL(sys_ni_syscall, 0) /* was signal(2) */ | 75 | SYSCALL(sys_ni_syscall, 0) |
77 | SYSCALL(sys_geteuid, 0) | 76 | SYSCALL(sys_geteuid, 0) |
78 | SYSCALL(sys_getegid, 0) /* 50 */ | 77 | SYSCALL(sys_getegid, 0) /* 50 */ |
79 | SYSCALL(sys_acct, 1) | 78 | SYSCALL(sys_acct, 1) |
@@ -84,21 +83,21 @@ SYSCALL(sys_fcntl, 3) /* 55 */ | |||
84 | SYSCALL(sys_ni_syscall, 2) | 83 | SYSCALL(sys_ni_syscall, 2) |
85 | SYSCALL(sys_setpgid, 2) | 84 | SYSCALL(sys_setpgid, 2) |
86 | SYSCALL(sys_ni_syscall, 0) | 85 | SYSCALL(sys_ni_syscall, 0) |
87 | SYSCALL(sys_olduname, 1) | 86 | SYSCALL(sys_ni_syscall, 0) |
88 | SYSCALL(sys_umask, 1) /* 60 */ | 87 | SYSCALL(sys_umask, 1) /* 60 */ |
89 | SYSCALL(sys_chroot, 1) | 88 | SYSCALL(sys_chroot, 1) |
90 | SYSCALL(sys_ustat, 2) | 89 | SYSCALL(sys_ustat, 2) |
91 | SYSCALL(sys_dup2, 2) | 90 | SYSCALL(sys_dup2, 2) |
92 | SYSCALL(sys_getppid, 0) | 91 | SYSCALL(sys_getppid, 0) |
93 | SYSCALL(sys_getpgrp, 0) /* 65 */ | 92 | SYSCALL(sys_ni_syscall, 0) /* 65 */ |
94 | SYSCALL(sys_setsid, 0) | 93 | SYSCALL(sys_setsid, 0) |
95 | SYSCALL(sys_sigaction, 3) | 94 | SYSCALL(sys_sigaction, 3) |
96 | SYSCALL(sys_sgetmask, 0) | 95 | SYSCALL(sys_ni_syscall, 0) |
97 | SYSCALL(sys_ssetmask, 1) | 96 | SYSCALL(sys_ni_syscall, 1) |
98 | SYSCALL(sys_setreuid, 2) /* 70 */ | 97 | SYSCALL(sys_setreuid, 2) /* 70 */ |
99 | SYSCALL(sys_setregid, 2) | 98 | SYSCALL(sys_setregid, 2) |
100 | SYSCALL(sys_sigsuspend, 0) | 99 | SYSCALL(sys_sigsuspend, 0) |
101 | SYSCALL(sys_sigpending, 1) | 100 | SYSCALL(sys_ni_syscall, 1) |
102 | SYSCALL(sys_sethostname, 2) | 101 | SYSCALL(sys_sethostname, 2) |
103 | SYSCALL(sys_setrlimit, 2) /* 75 */ | 102 | SYSCALL(sys_setrlimit, 2) /* 75 */ |
104 | SYSCALL(sys_getrlimit, 2) | 103 | SYSCALL(sys_getrlimit, 2) |
@@ -107,15 +106,15 @@ SYSCALL(sys_gettimeofday, 2) | |||
107 | SYSCALL(sys_settimeofday, 2) | 106 | SYSCALL(sys_settimeofday, 2) |
108 | SYSCALL(sys_getgroups, 2) /* 80 */ | 107 | SYSCALL(sys_getgroups, 2) /* 80 */ |
109 | SYSCALL(sys_setgroups, 2) | 108 | SYSCALL(sys_setgroups, 2) |
110 | SYSCALL(sys_ni_syscall, 0) /* old_select */ | 109 | SYSCALL(sys_ni_syscall, 0) |
111 | SYSCALL(sys_symlink, 2) | 110 | SYSCALL(sys_symlink, 2) |
112 | SYSCALL(sys_lstat, 2) | 111 | SYSCALL(sys_lstat, 2) |
113 | SYSCALL(sys_readlink, 3) /* 85 */ | 112 | SYSCALL(sys_readlink, 3) /* 85 */ |
114 | SYSCALL(sys_uselib, 1) | 113 | SYSCALL(sys_uselib, 1) |
115 | SYSCALL(sys_swapon, 2) | 114 | SYSCALL(sys_swapon, 2) |
116 | SYSCALL(sys_reboot, 3) | 115 | SYSCALL(sys_reboot, 3) |
117 | SYSCALL(old_readdir, 3) | 116 | SYSCALL(sys_ni_syscall, 3) |
118 | SYSCALL(old_mmap, 6) /* 90 */ | 117 | SYSCALL(sys_ni_syscall, 6) /* 90 */ |
119 | SYSCALL(sys_munmap, 2) | 118 | SYSCALL(sys_munmap, 2) |
120 | SYSCALL(sys_truncate, 2) | 119 | SYSCALL(sys_truncate, 2) |
121 | SYSCALL(sys_ftruncate, 2) | 120 | SYSCALL(sys_ftruncate, 2) |
@@ -127,7 +126,7 @@ SYSCALL(sys_ni_syscall, 0) | |||
127 | SYSCALL(sys_statfs, 2) | 126 | SYSCALL(sys_statfs, 2) |
128 | SYSCALL(sys_fstatfs, 2) /* 100 */ | 127 | SYSCALL(sys_fstatfs, 2) /* 100 */ |
129 | SYSCALL(sys_ni_syscall, 3) | 128 | SYSCALL(sys_ni_syscall, 3) |
130 | SYSCALL(sys_socketcall, 2) | 129 | SYSCALL(sys_ni_syscall, 2) |
131 | SYSCALL(sys_syslog, 3) | 130 | SYSCALL(sys_syslog, 3) |
132 | SYSCALL(sys_setitimer, 3) | 131 | SYSCALL(sys_setitimer, 3) |
133 | SYSCALL(sys_getitimer, 2) /* 105 */ | 132 | SYSCALL(sys_getitimer, 2) /* 105 */ |
@@ -137,32 +136,32 @@ SYSCALL(sys_newfstat, 2) | |||
137 | SYSCALL(sys_uname, 1) | 136 | SYSCALL(sys_uname, 1) |
138 | SYSCALL(sys_ni_syscall, 0) /* 110 */ | 137 | SYSCALL(sys_ni_syscall, 0) /* 110 */ |
139 | SYSCALL(sys_vhangup, 0) | 138 | SYSCALL(sys_vhangup, 0) |
140 | SYSCALL(sys_ni_syscall, 0) /* was sys_idle() */ | 139 | SYSCALL(sys_ni_syscall, 0) |
141 | SYSCALL(sys_ni_syscall, 0) | 140 | SYSCALL(sys_ni_syscall, 0) |
142 | SYSCALL(sys_wait4, 4) | 141 | SYSCALL(sys_wait4, 4) |
143 | SYSCALL(sys_swapoff, 1) /* 115 */ | 142 | SYSCALL(sys_swapoff, 1) /* 115 */ |
144 | SYSCALL(sys_sysinfo, 1) | 143 | SYSCALL(sys_sysinfo, 1) |
145 | SYSCALL(sys_ipc, 5) /* 6 really, but glibc uses only 5) */ | 144 | SYSCALL(sys_ni_syscall, 0) |
146 | SYSCALL(sys_fsync, 1) | 145 | SYSCALL(sys_fsync, 1) |
147 | SYSCALL(sys_sigreturn, 0) | 146 | SYSCALL(sys_sigreturn, 0) |
148 | SYSCALL(sys_clone, 0) /* 120 */ | 147 | SYSCALL(sys_clone, 0) /* 120 */ |
149 | SYSCALL(sys_setdomainname, 2) | 148 | SYSCALL(sys_setdomainname, 2) |
150 | SYSCALL(sys_newuname, 1) | 149 | SYSCALL(sys_newuname, 1) |
151 | SYSCALL(sys_ni_syscall, 0) /* sys_modify_ldt */ | 150 | SYSCALL(sys_ni_syscall, 0) |
152 | SYSCALL(sys_adjtimex, 1) | 151 | SYSCALL(sys_adjtimex, 1) |
153 | SYSCALL(sys_mprotect, 3) /* 125 */ | 152 | SYSCALL(sys_mprotect, 3) /* 125 */ |
154 | SYSCALL(sys_sigprocmask, 3) | 153 | SYSCALL(sys_ni_syscall, 3) |
155 | SYSCALL(sys_ni_syscall, 2) /* old sys_create_module */ | 154 | SYSCALL(sys_ni_syscall, 2) |
156 | SYSCALL(sys_init_module, 2) | 155 | SYSCALL(sys_init_module, 2) |
157 | SYSCALL(sys_delete_module, 1) | 156 | SYSCALL(sys_delete_module, 1) |
158 | SYSCALL(sys_ni_syscall, 1) /* old sys_get_kernel_sysm */ /* 130 */ | 157 | SYSCALL(sys_ni_syscall, 1) /* 130 */ |
159 | SYSCALL(sys_quotactl, 0) | 158 | SYSCALL(sys_quotactl, 0) |
160 | SYSCALL(sys_getpgid, 1) | 159 | SYSCALL(sys_getpgid, 1) |
161 | SYSCALL(sys_fchdir, 1) | 160 | SYSCALL(sys_fchdir, 1) |
162 | SYSCALL(sys_bdflush, 2) | 161 | SYSCALL(sys_bdflush, 2) |
163 | SYSCALL(sys_sysfs, 3) /* 135 */ | 162 | SYSCALL(sys_sysfs, 3) /* 135 */ |
164 | SYSCALL(sys_personality, 1) | 163 | SYSCALL(sys_personality, 1) |
165 | SYSCALL(sys_ni_syscall, 0) /* for afs_syscall */ | 164 | SYSCALL(sys_ni_syscall, 0) |
166 | SYSCALL(sys_setfsuid, 1) | 165 | SYSCALL(sys_setfsuid, 1) |
167 | SYSCALL(sys_setfsgid, 1) | 166 | SYSCALL(sys_setfsgid, 1) |
168 | SYSCALL(sys_llseek, 5) /* 140 */ | 167 | SYSCALL(sys_llseek, 5) /* 140 */ |
@@ -212,7 +211,7 @@ SYSCALL(sys_socket, 3) | |||
212 | SYSCALL(sys_socketpair, 4) | 211 | SYSCALL(sys_socketpair, 4) |
213 | SYSCALL(sys_setresuid, 3) /* 185 */ | 212 | SYSCALL(sys_setresuid, 3) /* 185 */ |
214 | SYSCALL(sys_getresuid, 3) | 213 | SYSCALL(sys_getresuid, 3) |
215 | SYSCALL(sys_ni_syscall, 5) /* old sys_query_module */ | 214 | SYSCALL(sys_ni_syscall, 5) |
216 | SYSCALL(sys_poll, 3) | 215 | SYSCALL(sys_poll, 3) |
217 | SYSCALL(sys_nfsservctl, 3) | 216 | SYSCALL(sys_nfsservctl, 3) |
218 | SYSCALL(sys_setresgid, 3) /* 190 */ | 217 | SYSCALL(sys_setresgid, 3) /* 190 */ |
@@ -235,7 +234,7 @@ SYSCALL(sys_sigaltstack, 0) | |||
235 | SYSCALL(sys_sendfile, 4) | 234 | SYSCALL(sys_sendfile, 4) |
236 | SYSCALL(sys_ni_syscall, 0) | 235 | SYSCALL(sys_ni_syscall, 0) |
237 | SYSCALL(sys_ni_syscall, 0) | 236 | SYSCALL(sys_ni_syscall, 0) |
238 | SYSCALL(sys_mmap2, 6) /* 210 */ | 237 | SYSCALL(sys_mmap, 6) /* 210 */ |
239 | SYSCALL(sys_truncate64, 2) | 238 | SYSCALL(sys_truncate64, 2) |
240 | SYSCALL(sys_ftruncate64, 2) | 239 | SYSCALL(sys_ftruncate64, 2) |
241 | SYSCALL(sys_stat64, 2) | 240 | SYSCALL(sys_stat64, 2) |
@@ -245,4 +244,4 @@ SYSCALL(sys_pivot_root, 2) | |||
245 | SYSCALL(sys_mincore, 3) | 244 | SYSCALL(sys_mincore, 3) |
246 | SYSCALL(sys_madvise, 3) | 245 | SYSCALL(sys_madvise, 3) |
247 | SYSCALL(sys_getdents64, 3) | 246 | SYSCALL(sys_getdents64, 3) |
248 | SYSCALL(sys_vfork, 0) /* 220 */ | 247 | SYSCALL(sys_ni_syscall, 0) /* 220 */ |
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h index 64c64dd83ba4..6b39d6609d9c 100644 --- a/include/asm-xtensa/unistd.h +++ b/include/asm-xtensa/unistd.h | |||
@@ -13,42 +13,31 @@ | |||
13 | 13 | ||
14 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
15 | 15 | ||
16 | //#define __NR_setup 0 /* used only by init, to get system going */ | ||
17 | #define __NR_spill 0 | 16 | #define __NR_spill 0 |
18 | #define __NR_exit 1 | 17 | #define __NR_exit 1 |
19 | #define __NR_fork 2 | ||
20 | #define __NR_read 3 | 18 | #define __NR_read 3 |
21 | #define __NR_write 4 | 19 | #define __NR_write 4 |
22 | #define __NR_open 5 | 20 | #define __NR_open 5 |
23 | #define __NR_close 6 | 21 | #define __NR_close 6 |
24 | #define __NR_waitpid 7 | ||
25 | #define __NR_creat 8 | 22 | #define __NR_creat 8 |
26 | #define __NR_link 9 | 23 | #define __NR_link 9 |
27 | #define __NR_unlink 10 | 24 | #define __NR_unlink 10 |
28 | #define __NR_execve 11 | 25 | #define __NR_execve 11 |
29 | #define __NR_chdir 12 | 26 | #define __NR_chdir 12 |
30 | #define __NR_time 13 | ||
31 | #define __NR_mknod 14 | 27 | #define __NR_mknod 14 |
32 | #define __NR_chmod 15 | 28 | #define __NR_chmod 15 |
33 | #define __NR_lchown 16 | 29 | #define __NR_lchown 16 |
34 | #define __NR_break 17 | 30 | #define __NR_break 17 |
35 | #define __NR_oldstat 18 | ||
36 | #define __NR_lseek 19 | 31 | #define __NR_lseek 19 |
37 | #define __NR_getpid 20 | 32 | #define __NR_getpid 20 |
38 | #define __NR_mount 21 | 33 | #define __NR_mount 21 |
39 | #define __NR_oldumount 22 | ||
40 | #define __NR_setuid 23 | 34 | #define __NR_setuid 23 |
41 | #define __NR_getuid 24 | 35 | #define __NR_getuid 24 |
42 | #define __NR_stime 25 | ||
43 | #define __NR_ptrace 26 | 36 | #define __NR_ptrace 26 |
44 | #define __NR_alarm 27 | ||
45 | #define __NR_oldfstat 28 | ||
46 | #define __NR_pause 29 | ||
47 | #define __NR_utime 30 | 37 | #define __NR_utime 30 |
48 | #define __NR_stty 31 | 38 | #define __NR_stty 31 |
49 | #define __NR_gtty 32 | 39 | #define __NR_gtty 32 |
50 | #define __NR_access 33 | 40 | #define __NR_access 33 |
51 | #define __NR_nice 34 | ||
52 | #define __NR_ftime 35 | 41 | #define __NR_ftime 35 |
53 | #define __NR_sync 36 | 42 | #define __NR_sync 36 |
54 | #define __NR_kill 37 | 43 | #define __NR_kill 37 |
@@ -66,24 +55,18 @@ | |||
66 | #define __NR_geteuid 49 | 55 | #define __NR_geteuid 49 |
67 | #define __NR_getegid 50 | 56 | #define __NR_getegid 50 |
68 | #define __NR_acct 51 | 57 | #define __NR_acct 51 |
69 | #define __NR_umount 52 | ||
70 | #define __NR_lock 53 | 58 | #define __NR_lock 53 |
71 | #define __NR_ioctl 54 | 59 | #define __NR_ioctl 54 |
72 | #define __NR_fcntl 55 | 60 | #define __NR_fcntl 55 |
73 | #define __NR_mpx 56 | ||
74 | #define __NR_setpgid 57 | 61 | #define __NR_setpgid 57 |
75 | #define __NR_ulimit 58 | 62 | #define __NR_ulimit 58 |
76 | #define __NR_oldolduname 59 | ||
77 | #define __NR_umask 60 | 63 | #define __NR_umask 60 |
78 | #define __NR_chroot 61 | 64 | #define __NR_chroot 61 |
79 | #define __NR_ustat 62 | 65 | #define __NR_ustat 62 |
80 | #define __NR_dup2 63 | 66 | #define __NR_dup2 63 |
81 | #define __NR_getppid 64 | 67 | #define __NR_getppid 64 |
82 | #define __NR_getpgrp 65 | ||
83 | #define __NR_setsid 66 | 68 | #define __NR_setsid 66 |
84 | #define __NR_sigaction 67 | 69 | #define __NR_sigaction 67 |
85 | #define __NR_sgetmask 68 | ||
86 | #define __NR_ssetmask 69 | ||
87 | #define __NR_setreuid 70 | 70 | #define __NR_setreuid 70 |
88 | #define __NR_setregid 71 | 71 | #define __NR_setregid 71 |
89 | #define __NR_sigsuspend 72 | 72 | #define __NR_sigsuspend 72 |
@@ -98,13 +81,10 @@ | |||
98 | #define __NR_setgroups 81 | 81 | #define __NR_setgroups 81 |
99 | #define __NR_select 82 | 82 | #define __NR_select 82 |
100 | #define __NR_symlink 83 | 83 | #define __NR_symlink 83 |
101 | #define __NR_oldlstat 84 | ||
102 | #define __NR_readlink 85 | 84 | #define __NR_readlink 85 |
103 | #define __NR_uselib 86 | 85 | #define __NR_uselib 86 |
104 | #define __NR_swapon 87 | 86 | #define __NR_swapon 87 |
105 | #define __NR_reboot 88 | 87 | #define __NR_reboot 88 |
106 | #define __NR_readdir 89 | ||
107 | #define __NR_mmap 90 | ||
108 | #define __NR_munmap 91 | 88 | #define __NR_munmap 91 |
109 | #define __NR_truncate 92 | 89 | #define __NR_truncate 92 |
110 | #define __NR_ftruncate 93 | 90 | #define __NR_ftruncate 93 |
@@ -116,22 +96,18 @@ | |||
116 | #define __NR_statfs 99 | 96 | #define __NR_statfs 99 |
117 | #define __NR_fstatfs 100 | 97 | #define __NR_fstatfs 100 |
118 | #define __NR_ioperm 101 | 98 | #define __NR_ioperm 101 |
119 | #define __NR_socketcall 102 | ||
120 | #define __NR_syslog 103 | 99 | #define __NR_syslog 103 |
121 | #define __NR_setitimer 104 | 100 | #define __NR_setitimer 104 |
122 | #define __NR_getitimer 105 | 101 | #define __NR_getitimer 105 |
123 | #define __NR_stat 106 | 102 | #define __NR_stat 106 |
124 | #define __NR_lstat 107 | 103 | #define __NR_lstat 107 |
125 | #define __NR_fstat 108 | 104 | #define __NR_fstat 108 |
126 | #define __NR_olduname 109 | ||
127 | #define __NR_iopl 110 | 105 | #define __NR_iopl 110 |
128 | #define __NR_vhangup 111 | 106 | #define __NR_vhangup 111 |
129 | #define __NR_idle 112 | 107 | #define __NR_idle 112 |
130 | #define __NR_vm86 113 | ||
131 | #define __NR_wait4 114 | 108 | #define __NR_wait4 114 |
132 | #define __NR_swapoff 115 | 109 | #define __NR_swapoff 115 |
133 | #define __NR_sysinfo 116 | 110 | #define __NR_sysinfo 116 |
134 | #define __NR_ipc 117 | ||
135 | #define __NR_fsync 118 | 111 | #define __NR_fsync 118 |
136 | #define __NR_sigreturn 119 | 112 | #define __NR_sigreturn 119 |
137 | #define __NR_clone 120 | 113 | #define __NR_clone 120 |
@@ -140,18 +116,15 @@ | |||
140 | #define __NR_modify_ldt 123 | 116 | #define __NR_modify_ldt 123 |
141 | #define __NR_adjtimex 124 | 117 | #define __NR_adjtimex 124 |
142 | #define __NR_mprotect 125 | 118 | #define __NR_mprotect 125 |
143 | #define __NR_sigprocmask 126 | ||
144 | #define __NR_create_module 127 | 119 | #define __NR_create_module 127 |
145 | #define __NR_init_module 128 | 120 | #define __NR_init_module 128 |
146 | #define __NR_delete_module 129 | 121 | #define __NR_delete_module 129 |
147 | #define __NR_get_kernel_syms 130 | ||
148 | #define __NR_quotactl 131 | 122 | #define __NR_quotactl 131 |
149 | #define __NR_getpgid 132 | 123 | #define __NR_getpgid 132 |
150 | #define __NR_fchdir 133 | 124 | #define __NR_fchdir 133 |
151 | #define __NR_bdflush 134 | 125 | #define __NR_bdflush 134 |
152 | #define __NR_sysfs 135 | 126 | #define __NR_sysfs 135 |
153 | #define __NR_personality 136 | 127 | #define __NR_personality 136 |
154 | #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ | ||
155 | #define __NR_setfsuid 138 | 128 | #define __NR_setfsuid 138 |
156 | #define __NR_setfsgid 139 | 129 | #define __NR_setfsgid 139 |
157 | #define __NR__llseek 140 | 130 | #define __NR__llseek 140 |
@@ -222,8 +195,6 @@ | |||
222 | #define __NR_capset 205 | 195 | #define __NR_capset 205 |
223 | #define __NR_sigaltstack 206 | 196 | #define __NR_sigaltstack 206 |
224 | #define __NR_sendfile 207 | 197 | #define __NR_sendfile 207 |
225 | #define __NR_streams1 208 /* some people actually want it */ | ||
226 | #define __NR_streams2 209 /* some people actually want it */ | ||
227 | #define __NR_mmap2 210 | 198 | #define __NR_mmap2 210 |
228 | #define __NR_truncate64 211 | 199 | #define __NR_truncate64 211 |
229 | #define __NR_ftruncate64 212 | 200 | #define __NR_ftruncate64 212 |
@@ -234,7 +205,6 @@ | |||
234 | #define __NR_mincore 217 | 205 | #define __NR_mincore 217 |
235 | #define __NR_madvise 218 | 206 | #define __NR_madvise 218 |
236 | #define __NR_getdents64 219 | 207 | #define __NR_getdents64 219 |
237 | #define __NR_vfork 220 | ||
238 | 208 | ||
239 | /* Keep this last; should always equal the last valid call number. */ | 209 | /* Keep this last; should always equal the last valid call number. */ |
240 | #define __NR_Linux_syscalls 220 | 210 | #define __NR_Linux_syscalls 220 |
@@ -448,55 +418,7 @@ __syscall_return(type,__res); \ | |||
448 | 418 | ||
449 | 419 | ||
450 | #ifdef __KERNEL_SYSCALLS__ | 420 | #ifdef __KERNEL_SYSCALLS__ |
451 | |||
452 | #include <linux/compiler.h> | ||
453 | #include <linux/types.h> | ||
454 | #include <linux/syscalls.h> | ||
455 | |||
456 | /* | ||
457 | * we need this inline - forking from kernel space will result | ||
458 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
459 | * is no problem, but for the stack. This is handled by not letting | ||
460 | * main() use the stack at all after fork(). Thus, no function | ||
461 | * calls - which means inline code for fork too, as otherwise we | ||
462 | * would use the stack upon exit from 'fork()'. | ||
463 | * | ||
464 | * Actually only pause and fork are needed inline, so that there | ||
465 | * won't be any messing with the stack from main(), but we define | ||
466 | * some others too. | ||
467 | */ | ||
468 | |||
469 | #define __NR__exit __NR_exit | ||
470 | |||
471 | static __inline__ _syscall0(int,pause) | ||
472 | //static __inline__ _syscall1(int,setup,int,magic) FIXME | ||
473 | static __inline__ _syscall0(int,sync) | ||
474 | static __inline__ _syscall0(pid_t,setsid) | ||
475 | static __inline__ _syscall3(int,write,int,fd,const char *,buf,off_t,count) | ||
476 | static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
477 | static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
478 | static __inline__ _syscall1(int,dup,int,fd) | ||
479 | static __inline__ _syscall3(int,execve,const char*,file,char**,argv,char**,envp) | 421 | static __inline__ _syscall3(int,execve,const char*,file,char**,argv,char**,envp) |
480 | static __inline__ _syscall3(int,open,const char *,file,int,flag,int,mode) | ||
481 | static __inline__ _syscall1(int,close,int,fd) | ||
482 | static __inline__ _syscall1(int,_exit,int,exitcode) | ||
483 | static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | ||
484 | static __inline__ _syscall1(int,delete_module,const char *,name) | ||
485 | |||
486 | struct stat; | ||
487 | static __inline__ _syscall2(int,fstat,int,fd,struct stat *,buf) | ||
488 | static __inline__ _syscall0(pid_t,getpid) | ||
489 | static __inline__ _syscall2(int,kill,int,pid,int,sig) | ||
490 | static __inline__ _syscall2(int,stat,const char *, path,struct stat *,buf) | ||
491 | static __inline__ _syscall1(int,unlink,char *,pathname) | ||
492 | |||
493 | |||
494 | |||
495 | extern pid_t waitpid(int, int*, int ); | ||
496 | static __inline__ pid_t wait(int * wait_stat) | ||
497 | { | ||
498 | return waitpid(-1,wait_stat,0); | ||
499 | } | ||
500 | #endif | 422 | #endif |
501 | 423 | ||
502 | /* | 424 | /* |
@@ -508,30 +430,10 @@ static __inline__ pid_t wait(int * wait_stat) | |||
508 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); | 430 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); |
509 | 431 | ||
510 | #ifdef __KERNEL__ | 432 | #ifdef __KERNEL__ |
511 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
512 | #define __ARCH_WANT_OLD_READDIR | ||
513 | #define __ARCH_WANT_OLD_STAT | ||
514 | #define __ARCH_WANT_STAT64 | 433 | #define __ARCH_WANT_STAT64 |
515 | #define __ARCH_WANT_SYS_ALARM | ||
516 | #define __ARCH_WANT_SYS_GETHOSTNAME | ||
517 | #define __ARCH_WANT_SYS_PAUSE | ||
518 | #define __ARCH_WANT_SYS_SGETMASK | ||
519 | #define __ARCH_WANT_SYS_SIGNAL | ||
520 | #define __ARCH_WANT_SYS_TIME | ||
521 | #define __ARCH_WANT_SYS_UTIME | 434 | #define __ARCH_WANT_SYS_UTIME |
522 | #define __ARCH_WANT_SYS_WAITPID | ||
523 | #define __ARCH_WANT_SYS_SOCKETCALL | ||
524 | #define __ARCH_WANT_SYS_FADVISE64 | ||
525 | #define __ARCH_WANT_SYS_GETPGRP | ||
526 | #define __ARCH_WANT_SYS_LLSEEK | 435 | #define __ARCH_WANT_SYS_LLSEEK |
527 | #define __ARCH_WANT_SYS_NICE | ||
528 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
529 | #define __ARCH_WANT_SYS_OLDUMOUNT | ||
530 | #define __ARCH_WANT_SYS_SIGPENDING | ||
531 | #define __ARCH_WANT_SYS_SIGPROCMASK | ||
532 | #define __ARCH_WANT_SYS_RT_SIGACTION | 436 | #define __ARCH_WANT_SYS_RT_SIGACTION |
533 | #endif | 437 | #endif |
534 | 438 | ||
535 | |||
536 | |||
537 | #endif /* _XTENSA_UNISTD_H */ | 439 | #endif /* _XTENSA_UNISTD_H */ |