syscall.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Syscall support for the Hexagon architecture
  4. *
  5. * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  6. */
  7. #ifndef _ASM_HEXAGON_SYSCALL_H
  8. #define _ASM_HEXAGON_SYSCALL_H
  9. #include <uapi/linux/audit.h>
  10. #include <linux/err.h>
  11. #include <asm/ptrace.h>
  12. typedef long (*syscall_fn)(unsigned long, unsigned long,
  13. unsigned long, unsigned long,
  14. unsigned long, unsigned long);
  15. #include <asm-generic/syscalls.h>
  16. extern void *sys_call_table[];
  17. static inline long syscall_get_nr(struct task_struct *task,
  18. struct pt_regs *regs)
  19. {
  20. return regs->r06;
  21. }
  22. static inline void syscall_get_arguments(struct task_struct *task,
  23. struct pt_regs *regs,
  24. unsigned long *args)
  25. {
  26. memcpy(args, &(&regs->r00)[0], 6 * sizeof(args[0]));
  27. }
  28. static inline long syscall_get_error(struct task_struct *task,
  29. struct pt_regs *regs)
  30. {
  31. return IS_ERR_VALUE(regs->r00) ? regs->r00 : 0;
  32. }
  33. static inline long syscall_get_return_value(struct task_struct *task,
  34. struct pt_regs *regs)
  35. {
  36. return regs->r00;
  37. }
  38. static inline int syscall_get_arch(struct task_struct *task)
  39. {
  40. return AUDIT_ARCH_HEXAGON;
  41. }
  42. #endif