ptrace.h 1.4 KB

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