ptrace.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * Copyright 2004-2008 Analog Devices Inc.
  3. *
  4. * Licensed under the GPL-2 or later.
  5. */
  6. #ifndef _UAPI_BFIN_PTRACE_H
  7. #define _UAPI_BFIN_PTRACE_H
  8. /*
  9. * GCC defines register number like this:
  10. * -----------------------------
  11. * 0 - 7 are data registers R0-R7
  12. * 8 - 15 are address registers P0-P7
  13. * 16 - 31 dsp registers I/B/L0 -- I/B/L3 & M0--M3
  14. * 32 - 33 A registers A0 & A1
  15. * 34 - status register
  16. * -----------------------------
  17. *
  18. * We follows above, except:
  19. * 32-33 --- Low 32-bit of A0&1
  20. * 34-35 --- High 8-bit of A0&1
  21. */
  22. #ifndef __ASSEMBLY__
  23. struct task_struct;
  24. /* this struct defines the way the registers are stored on the
  25. stack during a system call. */
  26. struct pt_regs {
  27. long orig_pc;
  28. long ipend;
  29. long seqstat;
  30. long rete;
  31. long retn;
  32. long retx;
  33. long pc; /* PC == RETI */
  34. long rets;
  35. long reserved; /* Used as scratch during system calls */
  36. long astat;
  37. long lb1;
  38. long lb0;
  39. long lt1;
  40. long lt0;
  41. long lc1;
  42. long lc0;
  43. long a1w;
  44. long a1x;
  45. long a0w;
  46. long a0x;
  47. long b3;
  48. long b2;
  49. long b1;
  50. long b0;
  51. long l3;
  52. long l2;
  53. long l1;
  54. long l0;
  55. long m3;
  56. long m2;
  57. long m1;
  58. long m0;
  59. long i3;
  60. long i2;
  61. long i1;
  62. long i0;
  63. long usp;
  64. long fp;
  65. long p5;
  66. long p4;
  67. long p3;
  68. long p2;
  69. long p1;
  70. long p0;
  71. long r7;
  72. long r6;
  73. long r5;
  74. long r4;
  75. long r3;
  76. long r2;
  77. long r1;
  78. long r0;
  79. long orig_r0;
  80. long orig_p0;
  81. long syscfg;
  82. };
  83. /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  84. #define PTRACE_GETREGS 12
  85. #define PTRACE_SETREGS 13 /* ptrace signal */
  86. #define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */
  87. #define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */
  88. #define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */
  89. #define PS_S (0x0002)
  90. #endif /* __ASSEMBLY__ */
  91. /*
  92. * Offsets used by 'ptrace' system call interface.
  93. */
  94. #define PT_R0 204
  95. #define PT_R1 200
  96. #define PT_R2 196
  97. #define PT_R3 192
  98. #define PT_R4 188
  99. #define PT_R5 184
  100. #define PT_R6 180
  101. #define PT_R7 176
  102. #define PT_P0 172
  103. #define PT_P1 168
  104. #define PT_P2 164
  105. #define PT_P3 160
  106. #define PT_P4 156
  107. #define PT_P5 152
  108. #define PT_FP 148
  109. #define PT_USP 144
  110. #define PT_I0 140
  111. #define PT_I1 136
  112. #define PT_I2 132
  113. #define PT_I3 128
  114. #define PT_M0 124
  115. #define PT_M1 120
  116. #define PT_M2 116
  117. #define PT_M3 112
  118. #define PT_L0 108
  119. #define PT_L1 104
  120. #define PT_L2 100
  121. #define PT_L3 96
  122. #define PT_B0 92
  123. #define PT_B1 88
  124. #define PT_B2 84
  125. #define PT_B3 80
  126. #define PT_A0X 76
  127. #define PT_A0W 72
  128. #define PT_A1X 68
  129. #define PT_A1W 64
  130. #define PT_LC0 60
  131. #define PT_LC1 56
  132. #define PT_LT0 52
  133. #define PT_LT1 48
  134. #define PT_LB0 44
  135. #define PT_LB1 40
  136. #define PT_ASTAT 36
  137. #define PT_RESERVED 32
  138. #define PT_RETS 28
  139. #define PT_PC 24
  140. #define PT_RETX 20
  141. #define PT_RETN 16
  142. #define PT_RETE 12
  143. #define PT_SEQSTAT 8
  144. #define PT_IPEND 4
  145. #define PT_ORIG_R0 208
  146. #define PT_ORIG_P0 212
  147. #define PT_SYSCFG 216
  148. #define PT_TEXT_ADDR 220
  149. #define PT_TEXT_END_ADDR 224
  150. #define PT_DATA_ADDR 228
  151. #define PT_FDPIC_EXEC 232
  152. #define PT_FDPIC_INTERP 236
  153. #define PT_LAST_PSEUDO PT_FDPIC_INTERP
  154. #endif /* _UAPI_BFIN_PTRACE_H */