reg.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* Copyright (C) 2001-2016 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <http://www.gnu.org/licenses/>. */
  14. #ifndef _SYS_REG_H
  15. #define _SYS_REG_H 1
  16. #ifdef __x86_64__
  17. /* Index into an array of 8 byte longs returned from ptrace for
  18. location of the users' stored general purpose registers. */
  19. # define R15 0
  20. # define R14 1
  21. # define R13 2
  22. # define R12 3
  23. # define RBP 4
  24. # define RBX 5
  25. # define R11 6
  26. # define R10 7
  27. # define R9 8
  28. # define R8 9
  29. # define RAX 10
  30. # define RCX 11
  31. # define RDX 12
  32. # define RSI 13
  33. # define RDI 14
  34. # define ORIG_RAX 15
  35. # define RIP 16
  36. # define CS 17
  37. # define EFLAGS 18
  38. # define RSP 19
  39. # define SS 20
  40. # define FS_BASE 21
  41. # define GS_BASE 22
  42. # define DS 23
  43. # define ES 24
  44. # define FS 25
  45. # define GS 26
  46. #else
  47. /* Index into an array of 4 byte integers returned from ptrace for
  48. * location of the users' stored general purpose registers. */
  49. # define EBX 0
  50. # define ECX 1
  51. # define EDX 2
  52. # define ESI 3
  53. # define EDI 4
  54. # define EBP 5
  55. # define EAX 6
  56. # define DS 7
  57. # define ES 8
  58. # define FS 9
  59. # define GS 10
  60. # define ORIG_EAX 11
  61. # define EIP 12
  62. # define CS 13
  63. # define EFL 14
  64. # define UESP 15
  65. # define SS 16
  66. #endif
  67. #endif