syscall.h 702 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* syscall.h */
  2. #ifndef _ASM_PARISC_SYSCALL_H_
  3. #define _ASM_PARISC_SYSCALL_H_
  4. #include <linux/err.h>
  5. #include <asm/ptrace.h>
  6. static inline long syscall_get_nr(struct task_struct *tsk,
  7. struct pt_regs *regs)
  8. {
  9. return regs->gr[20];
  10. }
  11. static inline void syscall_get_arguments(struct task_struct *tsk,
  12. struct pt_regs *regs, unsigned int i,
  13. unsigned int n, unsigned long *args)
  14. {
  15. BUG_ON(i);
  16. switch (n) {
  17. case 6:
  18. args[5] = regs->gr[21];
  19. case 5:
  20. args[4] = regs->gr[22];
  21. case 4:
  22. args[3] = regs->gr[23];
  23. case 3:
  24. args[2] = regs->gr[24];
  25. case 2:
  26. args[1] = regs->gr[25];
  27. case 1:
  28. args[0] = regs->gr[26];
  29. break;
  30. default:
  31. BUG();
  32. }
  33. }
  34. #endif /*_ASM_PARISC_SYSCALL_H_*/