syscall.h 1020 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef __ASM_H8300_SYSCALLS_32_H
  2. #define __ASM_H8300_SYSCALLS_32_H
  3. #ifdef __KERNEL__
  4. #include <linux/compiler.h>
  5. #include <linux/linkage.h>
  6. #include <linux/types.h>
  7. #include <linux/ptrace.h>
  8. static inline int
  9. syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
  10. {
  11. return regs->orig_er0;
  12. }
  13. static inline void
  14. syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
  15. unsigned int i, unsigned int n, unsigned long *args)
  16. {
  17. BUG_ON(i + n > 6);
  18. while (n > 0) {
  19. switch (i) {
  20. case 0:
  21. *args++ = regs->er1;
  22. break;
  23. case 1:
  24. *args++ = regs->er2;
  25. break;
  26. case 2:
  27. *args++ = regs->er3;
  28. break;
  29. case 3:
  30. *args++ = regs->er4;
  31. break;
  32. case 4:
  33. *args++ = regs->er5;
  34. break;
  35. case 5:
  36. *args++ = regs->er6;
  37. break;
  38. }
  39. i++;
  40. n--;
  41. }
  42. }
  43. /* Misc syscall related bits */
  44. asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
  45. asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
  46. #endif /* __KERNEL__ */
  47. #endif /* __ASM_H8300_SYSCALLS_32_H */