ptrace.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. * Copyright (C) 2004, 2006, 2009, 2010 Texas Instruments Incorporated
  3. * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
  4. *
  5. * Updated for 2.6.34: Mark Salter <msalter@redhat.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef _UAPI_ASM_C6X_PTRACE_H
  12. #define _UAPI_ASM_C6X_PTRACE_H
  13. #define BKPT_OPCODE 0x56454314 /* illegal opcode */
  14. #ifdef _BIG_ENDIAN
  15. #define PT_LO(odd, even) odd
  16. #define PT_HI(odd, even) even
  17. #else
  18. #define PT_LO(odd, even) even
  19. #define PT_HI(odd, even) odd
  20. #endif
  21. #define PT_A4_ORG PT_LO(1, 0)
  22. #define PT_TSR PT_HI(1, 0)
  23. #define PT_ILC PT_LO(3, 2)
  24. #define PT_RILC PT_HI(3, 2)
  25. #define PT_CSR PT_LO(5, 4)
  26. #define PT_PC PT_HI(5, 4)
  27. #define PT_B16 PT_LO(7, 6)
  28. #define PT_B17 PT_HI(7, 6)
  29. #define PT_B18 PT_LO(9, 8)
  30. #define PT_B19 PT_HI(9, 8)
  31. #define PT_B20 PT_LO(11, 10)
  32. #define PT_B21 PT_HI(11, 10)
  33. #define PT_B22 PT_LO(13, 12)
  34. #define PT_B23 PT_HI(13, 12)
  35. #define PT_B24 PT_LO(15, 14)
  36. #define PT_B25 PT_HI(15, 14)
  37. #define PT_B26 PT_LO(17, 16)
  38. #define PT_B27 PT_HI(17, 16)
  39. #define PT_B28 PT_LO(19, 18)
  40. #define PT_B29 PT_HI(19, 18)
  41. #define PT_B30 PT_LO(21, 20)
  42. #define PT_B31 PT_HI(21, 20)
  43. #define PT_B0 PT_LO(23, 22)
  44. #define PT_B1 PT_HI(23, 22)
  45. #define PT_B2 PT_LO(25, 24)
  46. #define PT_B3 PT_HI(25, 24)
  47. #define PT_B4 PT_LO(27, 26)
  48. #define PT_B5 PT_HI(27, 26)
  49. #define PT_B6 PT_LO(29, 28)
  50. #define PT_B7 PT_HI(29, 28)
  51. #define PT_B8 PT_LO(31, 30)
  52. #define PT_B9 PT_HI(31, 30)
  53. #define PT_B10 PT_LO(33, 32)
  54. #define PT_B11 PT_HI(33, 32)
  55. #define PT_B12 PT_LO(35, 34)
  56. #define PT_B13 PT_HI(35, 34)
  57. #define PT_A16 PT_LO(37, 36)
  58. #define PT_A17 PT_HI(37, 36)
  59. #define PT_A18 PT_LO(39, 38)
  60. #define PT_A19 PT_HI(39, 38)
  61. #define PT_A20 PT_LO(41, 40)
  62. #define PT_A21 PT_HI(41, 40)
  63. #define PT_A22 PT_LO(43, 42)
  64. #define PT_A23 PT_HI(43, 42)
  65. #define PT_A24 PT_LO(45, 44)
  66. #define PT_A25 PT_HI(45, 44)
  67. #define PT_A26 PT_LO(47, 46)
  68. #define PT_A27 PT_HI(47, 46)
  69. #define PT_A28 PT_LO(49, 48)
  70. #define PT_A29 PT_HI(49, 48)
  71. #define PT_A30 PT_LO(51, 50)
  72. #define PT_A31 PT_HI(51, 50)
  73. #define PT_A0 PT_LO(53, 52)
  74. #define PT_A1 PT_HI(53, 52)
  75. #define PT_A2 PT_LO(55, 54)
  76. #define PT_A3 PT_HI(55, 54)
  77. #define PT_A4 PT_LO(57, 56)
  78. #define PT_A5 PT_HI(57, 56)
  79. #define PT_A6 PT_LO(59, 58)
  80. #define PT_A7 PT_HI(59, 58)
  81. #define PT_A8 PT_LO(61, 60)
  82. #define PT_A9 PT_HI(61, 60)
  83. #define PT_A10 PT_LO(63, 62)
  84. #define PT_A11 PT_HI(63, 62)
  85. #define PT_A12 PT_LO(65, 64)
  86. #define PT_A13 PT_HI(65, 64)
  87. #define PT_A14 PT_LO(67, 66)
  88. #define PT_A15 PT_HI(67, 66)
  89. #define PT_B14 PT_LO(69, 68)
  90. #define PT_B15 PT_HI(69, 68)
  91. #define NR_PTREGS 70
  92. #define PT_DP PT_B14 /* Data Segment Pointer (B14) */
  93. #define PT_SP PT_B15 /* Stack Pointer (B15) */
  94. #define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */
  95. #define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */
  96. #define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */
  97. #ifndef __ASSEMBLY__
  98. #ifdef _BIG_ENDIAN
  99. #define REG_PAIR(odd, even) unsigned long odd; unsigned long even
  100. #else
  101. #define REG_PAIR(odd, even) unsigned long even; unsigned long odd
  102. #endif
  103. /*
  104. * this struct defines the way the registers are stored on the
  105. * stack during a system call. fields defined with REG_PAIR
  106. * are saved and restored using double-word memory operations
  107. * which means the word ordering of the pair depends on endianess.
  108. */
  109. struct pt_regs {
  110. REG_PAIR(tsr, orig_a4);
  111. REG_PAIR(rilc, ilc);
  112. REG_PAIR(pc, csr);
  113. REG_PAIR(b17, b16);
  114. REG_PAIR(b19, b18);
  115. REG_PAIR(b21, b20);
  116. REG_PAIR(b23, b22);
  117. REG_PAIR(b25, b24);
  118. REG_PAIR(b27, b26);
  119. REG_PAIR(b29, b28);
  120. REG_PAIR(b31, b30);
  121. REG_PAIR(b1, b0);
  122. REG_PAIR(b3, b2);
  123. REG_PAIR(b5, b4);
  124. REG_PAIR(b7, b6);
  125. REG_PAIR(b9, b8);
  126. REG_PAIR(b11, b10);
  127. REG_PAIR(b13, b12);
  128. REG_PAIR(a17, a16);
  129. REG_PAIR(a19, a18);
  130. REG_PAIR(a21, a20);
  131. REG_PAIR(a23, a22);
  132. REG_PAIR(a25, a24);
  133. REG_PAIR(a27, a26);
  134. REG_PAIR(a29, a28);
  135. REG_PAIR(a31, a30);
  136. REG_PAIR(a1, a0);
  137. REG_PAIR(a3, a2);
  138. REG_PAIR(a5, a4);
  139. REG_PAIR(a7, a6);
  140. REG_PAIR(a9, a8);
  141. REG_PAIR(a11, a10);
  142. REG_PAIR(a13, a12);
  143. REG_PAIR(a15, a14);
  144. REG_PAIR(sp, dp);
  145. };
  146. #endif /* __ASSEMBLY__ */
  147. #endif /* _UAPI_ASM_C6X_PTRACE_H */