ptrace-abi.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #define R15 0
  25. #define R14 8
  26. #define R13 16
  27. #define R12 24
  28. #define RBP 32
  29. #define RBX 40
  30. /* arguments: interrupts/non tracing syscalls only save upto here*/
  31. #define R11 48
  32. #define R10 56
  33. #define R9 64
  34. #define R8 72
  35. #define RAX 80
  36. #define RCX 88
  37. #define RDX 96
  38. #define RSI 104
  39. #define RDI 112
  40. #define ORIG_RAX 120 /* = ERROR */
  41. /* end of arguments */
  42. /* cpu exception frame or undefined in case of fast syscall. */
  43. #define RIP 128
  44. #define CS 136
  45. #define EFLAGS 144
  46. #define RSP 152
  47. #define SS 160
  48. #define ARGOFFSET R11
  49. #endif /* __ASSEMBLY__ */
  50. /* top of stack page */
  51. #define FRAME_SIZE 168
  52. #endif /* !__i386__ */
  53. /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  54. #define PTRACE_GETREGS 12
  55. #define PTRACE_SETREGS 13
  56. #define PTRACE_GETFPREGS 14
  57. #define PTRACE_SETFPREGS 15
  58. #define PTRACE_GETFPXREGS 18
  59. #define PTRACE_SETFPXREGS 19
  60. #define PTRACE_OLDSETOPTIONS 21
  61. /* only useful for access 32bit programs / kernels */
  62. #define PTRACE_GET_THREAD_AREA 25
  63. #define PTRACE_SET_THREAD_AREA 26
  64. #ifdef __x86_64__
  65. # define PTRACE_ARCH_PRCTL 30
  66. #else
  67. # define PTRACE_SYSEMU 31
  68. # define PTRACE_SYSEMU_SINGLESTEP 32
  69. #endif
  70. #endif