ptrace.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * Author: Hanlu Li <[email protected]>
  4. * Huacai Chen <[email protected]>
  5. *
  6. * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  7. */
  8. #ifndef _UAPI_ASM_PTRACE_H
  9. #define _UAPI_ASM_PTRACE_H
  10. #include <linux/types.h>
  11. #ifndef __KERNEL__
  12. #include <stdint.h>
  13. #endif
  14. /*
  15. * For PTRACE_{POKE,PEEK}USR. 0 - 31 are GPRs,
  16. * 32 is syscall's original ARG0, 33 is PC, 34 is BADVADDR.
  17. */
  18. #define GPR_BASE 0
  19. #define GPR_NUM 32
  20. #define GPR_END (GPR_BASE + GPR_NUM - 1)
  21. #define ARG0 (GPR_END + 1)
  22. #define PC (GPR_END + 2)
  23. #define BADVADDR (GPR_END + 3)
  24. #define NUM_FPU_REGS 32
  25. struct user_pt_regs {
  26. /* Main processor registers. */
  27. unsigned long regs[32];
  28. /* Original syscall arg0. */
  29. unsigned long orig_a0;
  30. /* Special CSR registers. */
  31. unsigned long csr_era;
  32. unsigned long csr_badv;
  33. unsigned long reserved[10];
  34. } __attribute__((aligned(8)));
  35. struct user_fp_state {
  36. uint64_t fpr[32];
  37. uint64_t fcc;
  38. uint32_t fcsr;
  39. };
  40. #define PTRACE_SYSEMU 0x1f
  41. #define PTRACE_SYSEMU_SINGLESTEP 0x20
  42. #endif /* _UAPI_ASM_PTRACE_H */