syscalls.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * syscalls.h - Linux syscall interfaces (arch-specific)
  3. *
  4. * Copyright (c) 2008 Jaswinder Singh Rajput
  5. * Copyright 2010 Tilera Corporation. All Rights Reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation, version 2.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  14. * NON INFRINGEMENT. See the GNU General Public License for
  15. * more details.
  16. */
  17. #ifndef _ASM_TILE_SYSCALLS_H
  18. #define _ASM_TILE_SYSCALLS_H
  19. #include <linux/compiler.h>
  20. #include <linux/linkage.h>
  21. #include <linux/signal.h>
  22. #include <linux/types.h>
  23. #include <linux/compat.h>
  24. /* The array of function pointers for syscalls. */
  25. extern void *sys_call_table[];
  26. #ifdef CONFIG_COMPAT
  27. extern void *compat_sys_call_table[];
  28. #endif
  29. /*
  30. * Note that by convention, any syscall which requires the current
  31. * register set takes an additional "struct pt_regs *" pointer; the
  32. * sys_xxx() function just adds the pointer and tail-calls to _sys_xxx().
  33. */
  34. /* kernel/sys.c */
  35. ssize_t sys32_readahead(int fd, u32 offset_lo, u32 offset_hi, u32 count);
  36. long sys32_fadvise64(int fd, u32 offset_lo, u32 offset_hi,
  37. u32 len, int advice);
  38. int sys32_fadvise64_64(int fd, u32 offset_lo, u32 offset_hi,
  39. u32 len_lo, u32 len_hi, int advice);
  40. long sys_flush_cache(void);
  41. long sys_mmap2(unsigned long addr, unsigned long len,
  42. unsigned long prot, unsigned long flags,
  43. unsigned long fd, unsigned long pgoff);
  44. #ifdef __tilegx__
  45. long sys_mmap(unsigned long addr, unsigned long len,
  46. unsigned long prot, unsigned long flags,
  47. unsigned long fd, off_t pgoff);
  48. #endif
  49. /* kernel/process.c */
  50. long sys_clone(unsigned long clone_flags, unsigned long newsp,
  51. void __user *parent_tid, void __user *child_tid);
  52. long _sys_clone(unsigned long clone_flags, unsigned long newsp,
  53. void __user *parent_tid, void __user *child_tid,
  54. struct pt_regs *regs);
  55. long sys_fork(void);
  56. long _sys_fork(struct pt_regs *regs);
  57. long sys_vfork(void);
  58. long _sys_vfork(struct pt_regs *regs);
  59. long sys_execve(const char __user *filename,
  60. const char __user *const __user *argv,
  61. const char __user *const __user *envp);
  62. long _sys_execve(const char __user *filename,
  63. const char __user *const __user *argv,
  64. const char __user *const __user *envp, struct pt_regs *regs);
  65. /* kernel/signal.c */
  66. long sys_sigaltstack(const stack_t __user *, stack_t __user *);
  67. long _sys_sigaltstack(const stack_t __user *, stack_t __user *,
  68. struct pt_regs *);
  69. long sys_rt_sigreturn(void);
  70. long _sys_rt_sigreturn(struct pt_regs *regs);
  71. /* platform-independent functions */
  72. long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize);
  73. long sys_rt_sigaction(int sig, const struct sigaction __user *act,
  74. struct sigaction __user *oact, size_t sigsetsize);
  75. #ifndef __tilegx__
  76. /* mm/fault.c */
  77. int sys_cmpxchg_badaddr(unsigned long address);
  78. int _sys_cmpxchg_badaddr(unsigned long address, struct pt_regs *);
  79. #endif
  80. #ifdef CONFIG_COMPAT
  81. long compat_sys_execve(const char __user *path,
  82. const compat_uptr_t __user *argv,
  83. const compat_uptr_t __user *envp);
  84. long _compat_sys_execve(const char __user *path,
  85. const compat_uptr_t __user *argv,
  86. const compat_uptr_t __user *envp,
  87. struct pt_regs *regs);
  88. long compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr,
  89. struct compat_sigaltstack __user *uoss_ptr);
  90. long _compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr,
  91. struct compat_sigaltstack __user *uoss_ptr,
  92. struct pt_regs *regs);
  93. long compat_sys_rt_sigreturn(void);
  94. long _compat_sys_rt_sigreturn(struct pt_regs *regs);
  95. /* These four are not defined for 64-bit, but serve as "compat" syscalls. */
  96. long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg);
  97. long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf);
  98. long sys_truncate64(const char __user *path, loff_t length);
  99. long sys_ftruncate64(unsigned int fd, loff_t length);
  100. #endif
  101. #endif /* _ASM_TILE_SYSCALLS_H */