ptrace-abi.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #ifndef _ASM_X86_PTRACE_ABI_H
  2. #define _ASM_X86_PTRACE_ABI_H
  3. #ifdef __i386__
  4. #define EBX 0
  5. #define ECX 1
  6. #define EDX 2
  7. #define ESI 3
  8. #define EDI 4
  9. #define EBP 5
  10. #define EAX 6
  11. #define DS 7
  12. #define ES 8
  13. #define FS 9
  14. #define GS 10
  15. #define ORIG_EAX 11
  16. #define EIP 12
  17. #define CS 13
  18. #define EFL 14
  19. #define UESP 15
  20. #define SS 16
  21. #define FRAME_SIZE 17
  22. #else /* __i386__ */
  23. #if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
  24. /*
  25. * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
  26. * unless syscall needs a complete, fully filled "struct pt_regs".
  27. */
  28. #define R15 0
  29. #define R14 8
  30. #define R13 16
  31. #define R12 24
  32. #define RBP 32
  33. #define RBX 40
  34. /* These regs are callee-clobbered. Always saved on kernel entry. */
  35. #define R11 48
  36. #define R10 56
  37. #define R9 64
  38. #define R8 72
  39. #define RAX 80
  40. #define RCX 88
  41. #define RDX 96
  42. #define RSI 104
  43. #define RDI 112
  44. /*
  45. * On syscall entry, this is syscall#. On CPU exception, this is error code.
  46. * On hw interrupt, it's IRQ number:
  47. */
  48. #define ORIG_RAX 120
  49. /* Return frame for iretq */
  50. #define RIP 128
  51. #define CS 136
  52. #define EFLAGS 144
  53. #define RSP 152
  54. #define SS 160
  55. #endif /* __ASSEMBLY__ */
  56. /* top of stack page */
  57. #define FRAME_SIZE 168
  58. #endif /* !__i386__ */
  59. /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  60. #define PTRACE_GETREGS 12
  61. #define PTRACE_SETREGS 13
  62. #define PTRACE_GETFPREGS 14
  63. #define PTRACE_SETFPREGS 15
  64. #define PTRACE_GETFPXREGS 18
  65. #define PTRACE_SETFPXREGS 19
  66. #define PTRACE_OLDSETOPTIONS 21
  67. /* only useful for access 32bit programs / kernels */
  68. #define PTRACE_GET_THREAD_AREA 25
  69. #define PTRACE_SET_THREAD_AREA 26
  70. #ifdef __x86_64__
  71. # define PTRACE_ARCH_PRCTL 30
  72. #endif
  73. #define PTRACE_SYSEMU 31
  74. #define PTRACE_SYSEMU_SINGLESTEP 32
  75. #define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
  76. #ifndef __ASSEMBLY__
  77. #include <linux/types.h>
  78. #endif
  79. #endif /* _ASM_X86_PTRACE_ABI_H */