ptrace_v10.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef _CRIS_ARCH_PTRACE_H
  2. #define _CRIS_ARCH_PTRACE_H
  3. /* Frame types */
  4. #define CRIS_FRAME_NORMAL 0 /* normal frame without SBFS stacking */
  5. #define CRIS_FRAME_BUSFAULT 1 /* frame stacked using SBFS, need RBF return
  6. path */
  7. /* Register numbers in the ptrace system call interface */
  8. #define PT_FRAMETYPE 0
  9. #define PT_ORIG_R10 1
  10. #define PT_R13 2
  11. #define PT_R12 3
  12. #define PT_R11 4
  13. #define PT_R10 5
  14. #define PT_R9 6
  15. #define PT_R8 7
  16. #define PT_R7 8
  17. #define PT_R6 9
  18. #define PT_R5 10
  19. #define PT_R4 11
  20. #define PT_R3 12
  21. #define PT_R2 13
  22. #define PT_R1 14
  23. #define PT_R0 15
  24. #define PT_MOF 16
  25. #define PT_DCCR 17
  26. #define PT_SRP 18
  27. #define PT_IRP 19 /* This is actually the debugged process' PC */
  28. #define PT_CSRINSTR 20 /* CPU Status record remnants -
  29. valid if frametype == busfault */
  30. #define PT_CSRADDR 21
  31. #define PT_CSRDATA 22
  32. #define PT_USP 23 /* special case - USP is not in the pt_regs */
  33. #define PT_MAX 23
  34. /* Condition code bit numbers. The same numbers apply to CCR of course,
  35. but we use DCCR everywhere else, so let's try and be consistent. */
  36. #define C_DCCR_BITNR 0
  37. #define V_DCCR_BITNR 1
  38. #define Z_DCCR_BITNR 2
  39. #define N_DCCR_BITNR 3
  40. #define X_DCCR_BITNR 4
  41. #define I_DCCR_BITNR 5
  42. #define B_DCCR_BITNR 6
  43. #define M_DCCR_BITNR 7
  44. #define U_DCCR_BITNR 8
  45. #define P_DCCR_BITNR 9
  46. #define F_DCCR_BITNR 10
  47. /* pt_regs not only specifices the format in the user-struct during
  48. * ptrace but is also the frame format used in the kernel prologue/epilogues
  49. * themselves
  50. */
  51. struct pt_regs {
  52. unsigned long frametype; /* type of stackframe */
  53. unsigned long orig_r10;
  54. /* pushed by movem r13, [sp] in SAVE_ALL, movem pushes backwards */
  55. unsigned long r13;
  56. unsigned long r12;
  57. unsigned long r11;
  58. unsigned long r10;
  59. unsigned long r9;
  60. unsigned long r8;
  61. unsigned long r7;
  62. unsigned long r6;
  63. unsigned long r5;
  64. unsigned long r4;
  65. unsigned long r3;
  66. unsigned long r2;
  67. unsigned long r1;
  68. unsigned long r0;
  69. unsigned long mof;
  70. unsigned long dccr;
  71. unsigned long srp;
  72. unsigned long irp; /* This is actually the debugged process' PC */
  73. unsigned long csrinstr;
  74. unsigned long csraddr;
  75. unsigned long csrdata;
  76. };
  77. /* switch_stack is the extra stuff pushed onto the stack in _resume (entry.S)
  78. * when doing a context-switch. it is used (apart from in resume) when a new
  79. * thread is made and we need to make _resume (which is starting it for the
  80. * first time) realise what is going on.
  81. *
  82. * Actually, the use is very close to the thread struct (TSS) in that both the
  83. * switch_stack and the TSS are used to keep thread stuff when switching in
  84. * _resume.
  85. */
  86. struct switch_stack {
  87. unsigned long r9;
  88. unsigned long r8;
  89. unsigned long r7;
  90. unsigned long r6;
  91. unsigned long r5;
  92. unsigned long r4;
  93. unsigned long r3;
  94. unsigned long r2;
  95. unsigned long r1;
  96. unsigned long r0;
  97. unsigned long return_ip; /* ip that _resume will return to */
  98. };
  99. #ifdef __KERNEL__
  100. /* bit 8 is user-mode flag */
  101. #define user_mode(regs) (((regs)->dccr & 0x100) != 0)
  102. #define instruction_pointer(regs) ((regs)->irp)
  103. #define profile_pc(regs) instruction_pointer(regs)
  104. #endif /* __KERNEL__ */
  105. #endif