aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/unistd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh/unistd.h')
-rw-r--r--include/asm-sh/unistd.h121
1 files changed, 39 insertions, 82 deletions
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index 76b5430cb458..f1a0cbc966be 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -292,25 +292,51 @@
292#define __NR_mq_getsetattr (__NR_mq_open+5) 292#define __NR_mq_getsetattr (__NR_mq_open+5)
293#define __NR_kexec_load 283 293#define __NR_kexec_load 283
294#define __NR_waitid 284 294#define __NR_waitid 284
295#define __NR_add_key 285 295/* #define __NR_sys_setaltroot 285 */
296#define __NR_request_key 286 296#define __NR_add_key 286
297#define __NR_keyctl 287 297#define __NR_request_key 287
298#define __NR_ioprio_set 288 298#define __NR_keyctl 288
299#define __NR_ioprio_get 289 299#define __NR_ioprio_set 289
300#define __NR_inotify_init 290 300#define __NR_ioprio_get 290
301#define __NR_inotify_add_watch 291 301#define __NR_inotify_init 291
302#define __NR_inotify_rm_watch 292 302#define __NR_inotify_add_watch 292
303#define __NR_inotify_rm_watch 293
304#define __NR_migrate_pages 294
305#define __NR_openat 295
306#define __NR_mkdirat 296
307#define __NR_mknodat 297
308#define __NR_fchownat 298
309#define __NR_futimesat 299
310#define __NR_newfstatat 300
311#define __NR_unlinkat 301
312#define __NR_renameat 302
313#define __NR_linkat 303
314#define __NR_symlinkat 304
315#define __NR_readlinkat 305
316#define __NR_fchmodat 306
317#define __NR_faccessat 307
318#define __NR_pselect6 308
319#define __NR_ppoll 309
320#define __NR_unshare 310
321#define __NR_set_robust_list 311
322#define __NR_get_robust_list 312
323#define __NR_splice 313
324#define __NR_sync_file_range 314
325#define __NR_tee 315
326#define __NR_vmsplice 316
303 327
304 328#define NR_syscalls 317
305#define NR_syscalls 293
306 329
307#ifdef __KERNEL__ 330#ifdef __KERNEL__
308 331
309/* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */ 332#include <linux/err.h>
333
334/* user-visible error numbers are in the range -1 - -MAX_ERRNO:
335 * see <asm-sh/errno.h> */
310 336
311#define __syscall_return(type, res) \ 337#define __syscall_return(type, res) \
312do { \ 338do { \
313 if ((unsigned long)(res) >= (unsigned long)(-124)) { \ 339 if ((unsigned long)(res) >= (unsigned long)(-MAX_ERRNO)) { \
314 /* Avoid using "res" which is declared to be in register r0; \ 340 /* Avoid using "res" which is declared to be in register r0; \
315 errno might expand to a function call and clobber it. */ \ 341 errno might expand to a function call and clobber it. */ \
316 int __err = -(res); \ 342 int __err = -(res); \
@@ -444,76 +470,7 @@ __syscall_return(type,__sc0); \
444#define __ARCH_WANT_SYS_SIGPENDING 470#define __ARCH_WANT_SYS_SIGPENDING
445#define __ARCH_WANT_SYS_SIGPROCMASK 471#define __ARCH_WANT_SYS_SIGPROCMASK
446#define __ARCH_WANT_SYS_RT_SIGACTION 472#define __ARCH_WANT_SYS_RT_SIGACTION
447 473#define __ARCH_WANT_SYS_RT_SIGSUSPEND
448#ifdef __KERNEL_SYSCALLS__
449
450#include <linux/compiler.h>
451#include <linux/types.h>
452#include <linux/linkage.h>
453#include <asm/ptrace.h>
454
455/*
456 * we need this inline - forking from kernel space will result
457 * in NO COPY ON WRITE (!!!), until an execve is executed. This
458 * is no problem, but for the stack. This is handled by not letting
459 * main() use the stack at all after fork(). Thus, no function
460 * calls - which means inline code for fork too, as otherwise we
461 * would use the stack upon exit from 'fork()'.
462 *
463 * Actually only pause and fork are needed inline, so that there
464 * won't be any messing with the stack from main(), but we define
465 * some others too.
466 */
467#define __NR__exit __NR_exit
468static __inline__ _syscall0(int,pause)
469static __inline__ _syscall0(int,sync)
470static __inline__ _syscall0(pid_t,setsid)
471static __inline__ _syscall3(int,write,int,fd,const char *,buf,off_t,count)
472static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count)
473static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
474static __inline__ _syscall1(int,dup,int,fd)
475static __inline__ _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
476static __inline__ _syscall3(int,open,const char *,file,int,flag,int,mode)
477static __inline__ _syscall1(int,close,int,fd)
478static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
479static __inline__ _syscall1(int,delete_module,const char *,name)
480
481static __inline__ pid_t wait(int * wait_stat)
482{
483 return waitpid(-1,wait_stat,0);
484}
485
486asmlinkage long sys_mmap2(
487 unsigned long addr, unsigned long len,
488 unsigned long prot, unsigned long flags,
489 unsigned long fd, unsigned long pgoff);
490asmlinkage int sys_execve(char *ufilename, char **uargv,
491 char **uenvp, unsigned long r7,
492 struct pt_regs regs);
493asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
494 unsigned long parent_tidptr,
495 unsigned long child_tidptr,
496 struct pt_regs regs);
497asmlinkage int sys_fork(unsigned long r4, unsigned long r5,
498 unsigned long r6, unsigned long r7,
499 struct pt_regs regs);
500asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,
501 unsigned long r6, unsigned long r7,
502 struct pt_regs regs);
503asmlinkage int sys_pipe(unsigned long r4, unsigned long r5,
504 unsigned long r6, unsigned long r7,
505 struct pt_regs regs);
506asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char *buf,
507 size_t count, long dummy, loff_t pos);
508asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char *buf,
509 size_t count, long dummy, loff_t pos);
510struct sigaction;
511asmlinkage long sys_rt_sigaction(int sig,
512 const struct sigaction __user *act,
513 struct sigaction __user *oact,
514 size_t sigsetsize);
515
516#endif /* __KERNEL_SYSCALLS__ */
517 474
518/* 475/*
519 * "Conditional" syscalls 476 * "Conditional" syscalls