sys_sh32.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #include <linux/errno.h>
  2. #include <linux/sched.h>
  3. #include <linux/sched/task_stack.h>
  4. #include <linux/mm.h>
  5. #include <linux/smp.h>
  6. #include <linux/sem.h>
  7. #include <linux/msg.h>
  8. #include <linux/shm.h>
  9. #include <linux/stat.h>
  10. #include <linux/syscalls.h>
  11. #include <linux/mman.h>
  12. #include <linux/file.h>
  13. #include <linux/module.h>
  14. #include <linux/fs.h>
  15. #include <linux/ipc.h>
  16. #include <asm/cacheflush.h>
  17. #include <linux/uaccess.h>
  18. #include <asm/unistd.h>
  19. #include <asm/syscalls.h>
  20. /*
  21. * sys_pipe() is the normal C calling standard for creating
  22. * a pipe. It's not the way Unix traditionally does this, though.
  23. */
  24. asmlinkage int sys_sh_pipe(void)
  25. {
  26. int fd[2];
  27. int error;
  28. error = do_pipe_flags(fd, 0);
  29. if (!error) {
  30. current_pt_regs()->regs[1] = fd[1];
  31. return fd[0];
  32. }
  33. return error;
  34. }
  35. asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf,
  36. size_t count, long dummy, loff_t pos)
  37. {
  38. return sys_pread64(fd, buf, count, pos);
  39. }
  40. asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf,
  41. size_t count, long dummy, loff_t pos)
  42. {
  43. return sys_pwrite64(fd, buf, count, pos);
  44. }
  45. asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1,
  46. u32 len0, u32 len1, int advice)
  47. {
  48. #ifdef __LITTLE_ENDIAN__
  49. return sys_fadvise64_64(fd, (u64)offset1 << 32 | offset0,
  50. (u64)len1 << 32 | len0, advice);
  51. #else
  52. return sys_fadvise64_64(fd, (u64)offset0 << 32 | offset1,
  53. (u64)len0 << 32 | len1, advice);
  54. #endif
  55. }