sys_sh32.c 1.4 KB

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