ptrace.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _UAPI_ASM_X86_PTRACE_H
  3. #define _UAPI_ASM_X86_PTRACE_H
  4. #include <linux/compiler.h> /* For __user */
  5. #include <asm/ptrace-abi.h>
  6. #include <asm/processor-flags.h>
  7. #ifndef __ASSEMBLY__
  8. #ifdef __i386__
  9. /* this struct defines the way the registers are stored on the
  10. stack during a system call. */
  11. #ifndef __KERNEL__
  12. struct pt_regs {
  13. long ebx;
  14. long ecx;
  15. long edx;
  16. long esi;
  17. long edi;
  18. long ebp;
  19. long eax;
  20. int xds;
  21. int xes;
  22. int xfs;
  23. int xgs;
  24. long orig_eax;
  25. long eip;
  26. int xcs;
  27. long eflags;
  28. long esp;
  29. int xss;
  30. };
  31. #endif /* __KERNEL__ */
  32. #else /* __i386__ */
  33. #ifndef __KERNEL__
  34. struct pt_regs {
  35. /*
  36. * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
  37. * unless syscall needs a complete, fully filled "struct pt_regs".
  38. */
  39. unsigned long r15;
  40. unsigned long r14;
  41. unsigned long r13;
  42. unsigned long r12;
  43. unsigned long rbp;
  44. unsigned long rbx;
  45. /* These regs are callee-clobbered. Always saved on kernel entry. */
  46. unsigned long r11;
  47. unsigned long r10;
  48. unsigned long r9;
  49. unsigned long r8;
  50. unsigned long rax;
  51. unsigned long rcx;
  52. unsigned long rdx;
  53. unsigned long rsi;
  54. unsigned long rdi;
  55. /*
  56. * On syscall entry, this is syscall#. On CPU exception, this is error code.
  57. * On hw interrupt, it's IRQ number:
  58. */
  59. unsigned long orig_rax;
  60. /* Return frame for iretq */
  61. unsigned long rip;
  62. unsigned long cs;
  63. unsigned long eflags;
  64. unsigned long rsp;
  65. unsigned long ss;
  66. /* top of stack page */
  67. };
  68. #endif /* __KERNEL__ */
  69. #endif /* !__i386__ */
  70. #endif /* !__ASSEMBLY__ */
  71. #endif /* _UAPI_ASM_X86_PTRACE_H */