ptrace-abi_x86.h 2.0 KB

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