syscall.h 929 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* syscall.h */
  2. #ifndef _ASM_PARISC_SYSCALL_H_
  3. #define _ASM_PARISC_SYSCALL_H_
  4. #include <uapi/linux/audit.h>
  5. #include <linux/compat.h>
  6. #include <linux/err.h>
  7. #include <asm/ptrace.h>
  8. static inline long syscall_get_nr(struct task_struct *tsk,
  9. struct pt_regs *regs)
  10. {
  11. return regs->gr[20];
  12. }
  13. static inline void syscall_get_arguments(struct task_struct *tsk,
  14. struct pt_regs *regs, unsigned int i,
  15. unsigned int n, unsigned long *args)
  16. {
  17. BUG_ON(i);
  18. switch (n) {
  19. case 6:
  20. args[5] = regs->gr[21];
  21. case 5:
  22. args[4] = regs->gr[22];
  23. case 4:
  24. args[3] = regs->gr[23];
  25. case 3:
  26. args[2] = regs->gr[24];
  27. case 2:
  28. args[1] = regs->gr[25];
  29. case 1:
  30. args[0] = regs->gr[26];
  31. break;
  32. default:
  33. BUG();
  34. }
  35. }
  36. static inline int syscall_get_arch(void)
  37. {
  38. int arch = AUDIT_ARCH_PARISC;
  39. #ifdef CONFIG_64BIT
  40. if (!is_compat_task())
  41. arch = AUDIT_ARCH_PARISC64;
  42. #endif
  43. return arch;
  44. }
  45. #endif /*_ASM_PARISC_SYSCALL_H_*/