reg.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* Copyright (C) 2001, 2002 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, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _SYS_REG_H
  16. #define _SYS_REG_H 1
  17. #include <bits/wordsize.h>
  18. #if __WORDSIZE == 64
  19. /* Index into an array of 8 byte longs returned from ptrace for
  20. location of the users' stored general purpose registers. */
  21. # define R15 0
  22. # define R14 1
  23. # define R13 2
  24. # define R12 3
  25. # define RBP 4
  26. # define RBX 5
  27. # define R11 6
  28. # define R10 7
  29. # define R9 8
  30. # define R8 9
  31. # define RAX 10
  32. # define RCX 11
  33. # define RDX 12
  34. # define RSI 13
  35. # define RDI 14
  36. # define ORIG_RAX 15
  37. # define RIP 16
  38. # define CS 17
  39. # define EFLAGS 18
  40. # define RSP 19
  41. # define SS 20
  42. # define FS_BASE 21
  43. # define GS_BASE 22
  44. # define DS 23
  45. # define ES 24
  46. # define FS 25
  47. # define GS 26
  48. #else
  49. /* Index into an array of 4 byte integers returned from ptrace for
  50. * location of the users' stored general purpose registers. */
  51. # define EBX 0
  52. # define ECX 1
  53. # define EDX 2
  54. # define ESI 3
  55. # define EDI 4
  56. # define EBP 5
  57. # define EAX 6
  58. # define DS 7
  59. # define ES 8
  60. # define FS 9
  61. # define GS 10
  62. # define ORIG_EAX 11
  63. # define EIP 12
  64. # define CS 13
  65. # define EFL 14
  66. # define UESP 15
  67. # define SS 16
  68. #endif
  69. #endif