reg.h 1.8 KB

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