ptrace_x86.h 1.5 KB

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