aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/xtensa/kernel/syscalls.c152
-rw-r--r--arch/xtensa/kernel/syscalls.h57
-rw-r--r--include/asm-xtensa/unistd.h98
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
47extern void do_syscall_trace(void); 47extern void do_syscall_trace(void);
48typedef int (*syscall_t)(void *a0,...); 48typedef int (*syscall_t)(void *a0,...);
49extern int (*do_syscalls)(struct pt_regs *regs, syscall_t fun,
50 int narg);
51extern syscall_t sys_call_table[]; 49extern syscall_t sys_call_table[];
52extern unsigned char sys_narg_table[]; 50extern 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 73long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
76static 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
100unsigned 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
106long 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
112int sys_fork(struct pt_regs *regs)
113{
114 return do_fork(SIGCHLD, regs->areg[1], regs, 0, NULL, NULL);
115}
116
117int 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
123int sys_clone(struct pt_regs *regs) 96int 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
165int 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
329int 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
27SYSCALL(0, 0) /* 00 */ 27SYSCALL(0, 0) /* 00 */
28
29SYSCALL(sys_exit, 1) 28SYSCALL(sys_exit, 1)
30SYSCALL(sys_fork, 0) 29SYSCALL(sys_ni_syscall, 0)
31SYSCALL(sys_read, 3) 30SYSCALL(sys_read, 3)
32SYSCALL(sys_write, 3) 31SYSCALL(sys_write, 3)
33SYSCALL(sys_open, 3) /* 05 */ 32SYSCALL(sys_open, 3) /* 05 */
34SYSCALL(sys_close, 1) 33SYSCALL(sys_close, 1)
35SYSCALL(sys_waitpid, 3) 34SYSCALL(sys_ni_syscall, 3)
36SYSCALL(sys_creat, 2) 35SYSCALL(sys_creat, 2)
37SYSCALL(sys_link, 2) 36SYSCALL(sys_link, 2)
38SYSCALL(sys_unlink, 1) /* 10 */ 37SYSCALL(sys_unlink, 1) /* 10 */
39SYSCALL(sys_execve, 0) 38SYSCALL(sys_execve, 0)
40SYSCALL(sys_chdir, 1) 39SYSCALL(sys_chdir, 1)
41SYSCALL(sys_time, 1) 40SYSCALL(sys_ni_syscall, 1)
42SYSCALL(sys_mknod, 3) 41SYSCALL(sys_mknod, 3)
43SYSCALL(sys_chmod, 2) /* 15 */ 42SYSCALL(sys_chmod, 2) /* 15 */
44SYSCALL(sys_lchown, 3) 43SYSCALL(sys_lchown, 3)
@@ -47,19 +46,19 @@ SYSCALL(sys_stat, 2)
47SYSCALL(sys_lseek, 3) 46SYSCALL(sys_lseek, 3)
48SYSCALL(sys_getpid, 0) /* 20 */ 47SYSCALL(sys_getpid, 0) /* 20 */
49SYSCALL(sys_mount, 5) 48SYSCALL(sys_mount, 5)
50SYSCALL(sys_oldumount, 1) 49SYSCALL(sys_ni_syscall, 1)
51SYSCALL(sys_setuid, 1) 50SYSCALL(sys_setuid, 1)
52SYSCALL(sys_getuid, 0) 51SYSCALL(sys_getuid, 0)
53SYSCALL(sys_stime, 1) /* 25 */ 52SYSCALL(sys_ni_syscall, 1) /* 25 */
54SYSCALL(sys_ptrace, 4) 53SYSCALL(sys_ptrace, 4)
55SYSCALL(sys_alarm, 1) 54SYSCALL(sys_ni_syscall, 1)
56SYSCALL(sys_fstat, 2) 55SYSCALL(sys_fstat, 2)
57SYSCALL(sys_pause, 0) 56SYSCALL(sys_ni_syscall, 0)
58SYSCALL(sys_utime, 2) /* 30 */ 57SYSCALL(sys_utime, 2) /* 30 */
59SYSCALL(sys_ni_syscall, 0) 58SYSCALL(sys_ni_syscall, 0)
60SYSCALL(sys_ni_syscall, 0) 59SYSCALL(sys_ni_syscall, 0)
61SYSCALL(sys_access, 2) 60SYSCALL(sys_access, 2)
62SYSCALL(sys_nice, 1) 61SYSCALL(sys_ni_syscall, 1)
63SYSCALL(sys_ni_syscall, 0) /* 35 */ 62SYSCALL(sys_ni_syscall, 0) /* 35 */
64SYSCALL(sys_sync, 0) 63SYSCALL(sys_sync, 0)
65SYSCALL(sys_kill, 2) 64SYSCALL(sys_kill, 2)
@@ -73,7 +72,7 @@ SYSCALL(sys_ni_syscall, 0)
73SYSCALL(sys_brk, 1) /* 45 */ 72SYSCALL(sys_brk, 1) /* 45 */
74SYSCALL(sys_setgid, 1) 73SYSCALL(sys_setgid, 1)
75SYSCALL(sys_getgid, 0) 74SYSCALL(sys_getgid, 0)
76SYSCALL(sys_ni_syscall, 0) /* was signal(2) */ 75SYSCALL(sys_ni_syscall, 0)
77SYSCALL(sys_geteuid, 0) 76SYSCALL(sys_geteuid, 0)
78SYSCALL(sys_getegid, 0) /* 50 */ 77SYSCALL(sys_getegid, 0) /* 50 */
79SYSCALL(sys_acct, 1) 78SYSCALL(sys_acct, 1)
@@ -84,21 +83,21 @@ SYSCALL(sys_fcntl, 3) /* 55 */
84SYSCALL(sys_ni_syscall, 2) 83SYSCALL(sys_ni_syscall, 2)
85SYSCALL(sys_setpgid, 2) 84SYSCALL(sys_setpgid, 2)
86SYSCALL(sys_ni_syscall, 0) 85SYSCALL(sys_ni_syscall, 0)
87SYSCALL(sys_olduname, 1) 86SYSCALL(sys_ni_syscall, 0)
88SYSCALL(sys_umask, 1) /* 60 */ 87SYSCALL(sys_umask, 1) /* 60 */
89SYSCALL(sys_chroot, 1) 88SYSCALL(sys_chroot, 1)
90SYSCALL(sys_ustat, 2) 89SYSCALL(sys_ustat, 2)
91SYSCALL(sys_dup2, 2) 90SYSCALL(sys_dup2, 2)
92SYSCALL(sys_getppid, 0) 91SYSCALL(sys_getppid, 0)
93SYSCALL(sys_getpgrp, 0) /* 65 */ 92SYSCALL(sys_ni_syscall, 0) /* 65 */
94SYSCALL(sys_setsid, 0) 93SYSCALL(sys_setsid, 0)
95SYSCALL(sys_sigaction, 3) 94SYSCALL(sys_sigaction, 3)
96SYSCALL(sys_sgetmask, 0) 95SYSCALL(sys_ni_syscall, 0)
97SYSCALL(sys_ssetmask, 1) 96SYSCALL(sys_ni_syscall, 1)
98SYSCALL(sys_setreuid, 2) /* 70 */ 97SYSCALL(sys_setreuid, 2) /* 70 */
99SYSCALL(sys_setregid, 2) 98SYSCALL(sys_setregid, 2)
100SYSCALL(sys_sigsuspend, 0) 99SYSCALL(sys_sigsuspend, 0)
101SYSCALL(sys_sigpending, 1) 100SYSCALL(sys_ni_syscall, 1)
102SYSCALL(sys_sethostname, 2) 101SYSCALL(sys_sethostname, 2)
103SYSCALL(sys_setrlimit, 2) /* 75 */ 102SYSCALL(sys_setrlimit, 2) /* 75 */
104SYSCALL(sys_getrlimit, 2) 103SYSCALL(sys_getrlimit, 2)
@@ -107,15 +106,15 @@ SYSCALL(sys_gettimeofday, 2)
107SYSCALL(sys_settimeofday, 2) 106SYSCALL(sys_settimeofday, 2)
108SYSCALL(sys_getgroups, 2) /* 80 */ 107SYSCALL(sys_getgroups, 2) /* 80 */
109SYSCALL(sys_setgroups, 2) 108SYSCALL(sys_setgroups, 2)
110SYSCALL(sys_ni_syscall, 0) /* old_select */ 109SYSCALL(sys_ni_syscall, 0)
111SYSCALL(sys_symlink, 2) 110SYSCALL(sys_symlink, 2)
112SYSCALL(sys_lstat, 2) 111SYSCALL(sys_lstat, 2)
113SYSCALL(sys_readlink, 3) /* 85 */ 112SYSCALL(sys_readlink, 3) /* 85 */
114SYSCALL(sys_uselib, 1) 113SYSCALL(sys_uselib, 1)
115SYSCALL(sys_swapon, 2) 114SYSCALL(sys_swapon, 2)
116SYSCALL(sys_reboot, 3) 115SYSCALL(sys_reboot, 3)
117SYSCALL(old_readdir, 3) 116SYSCALL(sys_ni_syscall, 3)
118SYSCALL(old_mmap, 6) /* 90 */ 117SYSCALL(sys_ni_syscall, 6) /* 90 */
119SYSCALL(sys_munmap, 2) 118SYSCALL(sys_munmap, 2)
120SYSCALL(sys_truncate, 2) 119SYSCALL(sys_truncate, 2)
121SYSCALL(sys_ftruncate, 2) 120SYSCALL(sys_ftruncate, 2)
@@ -127,7 +126,7 @@ SYSCALL(sys_ni_syscall, 0)
127SYSCALL(sys_statfs, 2) 126SYSCALL(sys_statfs, 2)
128SYSCALL(sys_fstatfs, 2) /* 100 */ 127SYSCALL(sys_fstatfs, 2) /* 100 */
129SYSCALL(sys_ni_syscall, 3) 128SYSCALL(sys_ni_syscall, 3)
130SYSCALL(sys_socketcall, 2) 129SYSCALL(sys_ni_syscall, 2)
131SYSCALL(sys_syslog, 3) 130SYSCALL(sys_syslog, 3)
132SYSCALL(sys_setitimer, 3) 131SYSCALL(sys_setitimer, 3)
133SYSCALL(sys_getitimer, 2) /* 105 */ 132SYSCALL(sys_getitimer, 2) /* 105 */
@@ -137,32 +136,32 @@ SYSCALL(sys_newfstat, 2)
137SYSCALL(sys_uname, 1) 136SYSCALL(sys_uname, 1)
138SYSCALL(sys_ni_syscall, 0) /* 110 */ 137SYSCALL(sys_ni_syscall, 0) /* 110 */
139SYSCALL(sys_vhangup, 0) 138SYSCALL(sys_vhangup, 0)
140SYSCALL(sys_ni_syscall, 0) /* was sys_idle() */ 139SYSCALL(sys_ni_syscall, 0)
141SYSCALL(sys_ni_syscall, 0) 140SYSCALL(sys_ni_syscall, 0)
142SYSCALL(sys_wait4, 4) 141SYSCALL(sys_wait4, 4)
143SYSCALL(sys_swapoff, 1) /* 115 */ 142SYSCALL(sys_swapoff, 1) /* 115 */
144SYSCALL(sys_sysinfo, 1) 143SYSCALL(sys_sysinfo, 1)
145SYSCALL(sys_ipc, 5) /* 6 really, but glibc uses only 5) */ 144SYSCALL(sys_ni_syscall, 0)
146SYSCALL(sys_fsync, 1) 145SYSCALL(sys_fsync, 1)
147SYSCALL(sys_sigreturn, 0) 146SYSCALL(sys_sigreturn, 0)
148SYSCALL(sys_clone, 0) /* 120 */ 147SYSCALL(sys_clone, 0) /* 120 */
149SYSCALL(sys_setdomainname, 2) 148SYSCALL(sys_setdomainname, 2)
150SYSCALL(sys_newuname, 1) 149SYSCALL(sys_newuname, 1)
151SYSCALL(sys_ni_syscall, 0) /* sys_modify_ldt */ 150SYSCALL(sys_ni_syscall, 0)
152SYSCALL(sys_adjtimex, 1) 151SYSCALL(sys_adjtimex, 1)
153SYSCALL(sys_mprotect, 3) /* 125 */ 152SYSCALL(sys_mprotect, 3) /* 125 */
154SYSCALL(sys_sigprocmask, 3) 153SYSCALL(sys_ni_syscall, 3)
155SYSCALL(sys_ni_syscall, 2) /* old sys_create_module */ 154SYSCALL(sys_ni_syscall, 2)
156SYSCALL(sys_init_module, 2) 155SYSCALL(sys_init_module, 2)
157SYSCALL(sys_delete_module, 1) 156SYSCALL(sys_delete_module, 1)
158SYSCALL(sys_ni_syscall, 1) /* old sys_get_kernel_sysm */ /* 130 */ 157SYSCALL(sys_ni_syscall, 1) /* 130 */
159SYSCALL(sys_quotactl, 0) 158SYSCALL(sys_quotactl, 0)
160SYSCALL(sys_getpgid, 1) 159SYSCALL(sys_getpgid, 1)
161SYSCALL(sys_fchdir, 1) 160SYSCALL(sys_fchdir, 1)
162SYSCALL(sys_bdflush, 2) 161SYSCALL(sys_bdflush, 2)
163SYSCALL(sys_sysfs, 3) /* 135 */ 162SYSCALL(sys_sysfs, 3) /* 135 */
164SYSCALL(sys_personality, 1) 163SYSCALL(sys_personality, 1)
165SYSCALL(sys_ni_syscall, 0) /* for afs_syscall */ 164SYSCALL(sys_ni_syscall, 0)
166SYSCALL(sys_setfsuid, 1) 165SYSCALL(sys_setfsuid, 1)
167SYSCALL(sys_setfsgid, 1) 166SYSCALL(sys_setfsgid, 1)
168SYSCALL(sys_llseek, 5) /* 140 */ 167SYSCALL(sys_llseek, 5) /* 140 */
@@ -212,7 +211,7 @@ SYSCALL(sys_socket, 3)
212SYSCALL(sys_socketpair, 4) 211SYSCALL(sys_socketpair, 4)
213SYSCALL(sys_setresuid, 3) /* 185 */ 212SYSCALL(sys_setresuid, 3) /* 185 */
214SYSCALL(sys_getresuid, 3) 213SYSCALL(sys_getresuid, 3)
215SYSCALL(sys_ni_syscall, 5) /* old sys_query_module */ 214SYSCALL(sys_ni_syscall, 5)
216SYSCALL(sys_poll, 3) 215SYSCALL(sys_poll, 3)
217SYSCALL(sys_nfsservctl, 3) 216SYSCALL(sys_nfsservctl, 3)
218SYSCALL(sys_setresgid, 3) /* 190 */ 217SYSCALL(sys_setresgid, 3) /* 190 */
@@ -235,7 +234,7 @@ SYSCALL(sys_sigaltstack, 0)
235SYSCALL(sys_sendfile, 4) 234SYSCALL(sys_sendfile, 4)
236SYSCALL(sys_ni_syscall, 0) 235SYSCALL(sys_ni_syscall, 0)
237SYSCALL(sys_ni_syscall, 0) 236SYSCALL(sys_ni_syscall, 0)
238SYSCALL(sys_mmap2, 6) /* 210 */ 237SYSCALL(sys_mmap, 6) /* 210 */
239SYSCALL(sys_truncate64, 2) 238SYSCALL(sys_truncate64, 2)
240SYSCALL(sys_ftruncate64, 2) 239SYSCALL(sys_ftruncate64, 2)
241SYSCALL(sys_stat64, 2) 240SYSCALL(sys_stat64, 2)
@@ -245,4 +244,4 @@ SYSCALL(sys_pivot_root, 2)
245SYSCALL(sys_mincore, 3) 244SYSCALL(sys_mincore, 3)
246SYSCALL(sys_madvise, 3) 245SYSCALL(sys_madvise, 3)
247SYSCALL(sys_getdents64, 3) 246SYSCALL(sys_getdents64, 3)
248SYSCALL(sys_vfork, 0) /* 220 */ 247SYSCALL(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
471static __inline__ _syscall0(int,pause)
472//static __inline__ _syscall1(int,setup,int,magic) FIXME
473static __inline__ _syscall0(int,sync)
474static __inline__ _syscall0(pid_t,setsid)
475static __inline__ _syscall3(int,write,int,fd,const char *,buf,off_t,count)
476static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count)
477static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
478static __inline__ _syscall1(int,dup,int,fd)
479static __inline__ _syscall3(int,execve,const char*,file,char**,argv,char**,envp) 421static __inline__ _syscall3(int,execve,const char*,file,char**,argv,char**,envp)
480static __inline__ _syscall3(int,open,const char *,file,int,flag,int,mode)
481static __inline__ _syscall1(int,close,int,fd)
482static __inline__ _syscall1(int,_exit,int,exitcode)
483static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
484static __inline__ _syscall1(int,delete_module,const char *,name)
485
486struct stat;
487static __inline__ _syscall2(int,fstat,int,fd,struct stat *,buf)
488static __inline__ _syscall0(pid_t,getpid)
489static __inline__ _syscall2(int,kill,int,pid,int,sig)
490static __inline__ _syscall2(int,stat,const char *, path,struct stat *,buf)
491static __inline__ _syscall1(int,unlink,char *,pathname)
492
493
494
495extern pid_t waitpid(int, int*, int );
496static __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 */