ptrace_v32.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef _CRIS_ARCH_PTRACE_H
  2. #define _CRIS_ARCH_PTRACE_H
  3. /* Register numbers in the ptrace system call interface */
  4. #define PT_ORIG_R10 0
  5. #define PT_R0 1
  6. #define PT_R1 2
  7. #define PT_R2 3
  8. #define PT_R3 4
  9. #define PT_R4 5
  10. #define PT_R5 6
  11. #define PT_R6 7
  12. #define PT_R7 8
  13. #define PT_R8 9
  14. #define PT_R9 10
  15. #define PT_R10 11
  16. #define PT_R11 12
  17. #define PT_R12 13
  18. #define PT_R13 14
  19. #define PT_ACR 15
  20. #define PT_SRS 16
  21. #define PT_MOF 17
  22. #define PT_SPC 18
  23. #define PT_CCS 19
  24. #define PT_SRP 20
  25. #define PT_ERP 21 /* This is actually the debugged process' PC */
  26. #define PT_EXS 22
  27. #define PT_EDA 23
  28. #define PT_USP 24 /* special case - USP is not in the pt_regs */
  29. #define PT_PPC 25 /* special case - pseudo PC */
  30. #define PT_BP 26 /* Base number for BP registers. */
  31. #define PT_BP_CTRL 26 /* BP control register. */
  32. #define PT_MAX 40
  33. /* Condition code bit numbers. */
  34. #define C_CCS_BITNR 0
  35. #define V_CCS_BITNR 1
  36. #define Z_CCS_BITNR 2
  37. #define N_CCS_BITNR 3
  38. #define X_CCS_BITNR 4
  39. #define I_CCS_BITNR 5
  40. #define U_CCS_BITNR 6
  41. #define P_CCS_BITNR 7
  42. #define R_CCS_BITNR 8
  43. #define S_CCS_BITNR 9
  44. #define M_CCS_BITNR 30
  45. #define Q_CCS_BITNR 31
  46. #define CCS_SHIFT 10 /* Shift count for each level in CCS */
  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 orig_r10;
  53. /* pushed by movem r13, [sp] in SAVE_ALL. */
  54. unsigned long r0;
  55. unsigned long r1;
  56. unsigned long r2;
  57. unsigned long r3;
  58. unsigned long r4;
  59. unsigned long r5;
  60. unsigned long r6;
  61. unsigned long r7;
  62. unsigned long r8;
  63. unsigned long r9;
  64. unsigned long r10;
  65. unsigned long r11;
  66. unsigned long r12;
  67. unsigned long r13;
  68. unsigned long acr;
  69. unsigned long srs;
  70. unsigned long mof;
  71. unsigned long spc;
  72. unsigned long ccs;
  73. unsigned long srp;
  74. unsigned long erp; /* This is actually the debugged process' PC */
  75. /* For debugging purposes; saved only when needed. */
  76. unsigned long exs;
  77. unsigned long eda;
  78. };
  79. /* switch_stack is the extra stuff pushed onto the stack in _resume (entry.S)
  80. * when doing a context-switch. it is used (apart from in resume) when a new
  81. * thread is made and we need to make _resume (which is starting it for the
  82. * first time) realise what is going on.
  83. *
  84. * Actually, the use is very close to the thread struct (TSS) in that both the
  85. * switch_stack and the TSS are used to keep thread stuff when switching in
  86. * _resume.
  87. */
  88. struct switch_stack {
  89. unsigned long r0;
  90. unsigned long r1;
  91. unsigned long r2;
  92. unsigned long r3;
  93. unsigned long r4;
  94. unsigned long r5;
  95. unsigned long r6;
  96. unsigned long r7;
  97. unsigned long r8;
  98. unsigned long r9;
  99. unsigned long return_ip; /* ip that _resume will return to */
  100. };
  101. #ifdef __KERNEL__
  102. #define arch_has_single_step() (1)
  103. #define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0)
  104. #define instruction_pointer(regs) ((regs)->erp)
  105. #define profile_pc(regs) instruction_pointer(regs)
  106. #endif /* __KERNEL__ */
  107. #endif