ptrace.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef _UAPI_ASM_X86_PTRACE_H
  2. #define _UAPI_ASM_X86_PTRACE_H
  3. #include <linux/compiler.h> /* For __user */
  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. #ifndef __KERNEL__
  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. #endif /* __KERNEL__ */
  31. #else /* __i386__ */
  32. #ifndef __KERNEL__
  33. struct pt_regs {
  34. /*
  35. * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
  36. * unless syscall needs a complete, fully filled "struct pt_regs".
  37. */
  38. unsigned long r15;
  39. unsigned long r14;
  40. unsigned long r13;
  41. unsigned long r12;
  42. unsigned long rbp;
  43. unsigned long rbx;
  44. /* These regs are callee-clobbered. Always saved on kernel entry. */
  45. unsigned long r11;
  46. unsigned long r10;
  47. unsigned long r9;
  48. unsigned long r8;
  49. unsigned long rax;
  50. unsigned long rcx;
  51. unsigned long rdx;
  52. unsigned long rsi;
  53. unsigned long rdi;
  54. /*
  55. * On syscall entry, this is syscall#. On CPU exception, this is error code.
  56. * On hw interrupt, it's IRQ number:
  57. */
  58. unsigned long orig_rax;
  59. /* Return frame for iretq */
  60. unsigned long rip;
  61. unsigned long cs;
  62. unsigned long eflags;
  63. unsigned long rsp;
  64. unsigned long ss;
  65. /* top of stack page */
  66. };
  67. #endif /* __KERNEL__ */
  68. #endif /* !__i386__ */
  69. #endif /* !__ASSEMBLY__ */
  70. #endif /* _UAPI_ASM_X86_PTRACE_H */