kgdb.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /* Blackfin KGDB header
  2. *
  3. * Copyright 2005-2009 Analog Devices Inc.
  4. *
  5. * Licensed under the GPL-2 or later.
  6. */
  7. #ifndef __ASM_BLACKFIN_KGDB_H__
  8. #define __ASM_BLACKFIN_KGDB_H__
  9. #include <linux/ptrace.h>
  10. /*
  11. * BUFMAX defines the maximum number of characters in inbound/outbound buffers.
  12. * At least NUMREGBYTES*2 are needed for register packets.
  13. * Longer buffer is needed to list all threads.
  14. */
  15. #define BUFMAX 2048
  16. /*
  17. * Note that this register image is different from
  18. * the register image that Linux produces at interrupt time.
  19. *
  20. * Linux's register image is defined by struct pt_regs in ptrace.h.
  21. */
  22. enum regnames {
  23. /* Core Registers */
  24. BFIN_R0 = 0,
  25. BFIN_R1,
  26. BFIN_R2,
  27. BFIN_R3,
  28. BFIN_R4,
  29. BFIN_R5,
  30. BFIN_R6,
  31. BFIN_R7,
  32. BFIN_P0,
  33. BFIN_P1,
  34. BFIN_P2,
  35. BFIN_P3,
  36. BFIN_P4,
  37. BFIN_P5,
  38. BFIN_SP,
  39. BFIN_FP,
  40. BFIN_I0,
  41. BFIN_I1,
  42. BFIN_I2,
  43. BFIN_I3,
  44. BFIN_M0,
  45. BFIN_M1,
  46. BFIN_M2,
  47. BFIN_M3,
  48. BFIN_B0,
  49. BFIN_B1,
  50. BFIN_B2,
  51. BFIN_B3,
  52. BFIN_L0,
  53. BFIN_L1,
  54. BFIN_L2,
  55. BFIN_L3,
  56. BFIN_A0_DOT_X,
  57. BFIN_A0_DOT_W,
  58. BFIN_A1_DOT_X,
  59. BFIN_A1_DOT_W,
  60. BFIN_ASTAT,
  61. BFIN_RETS,
  62. BFIN_LC0,
  63. BFIN_LT0,
  64. BFIN_LB0,
  65. BFIN_LC1,
  66. BFIN_LT1,
  67. BFIN_LB1,
  68. BFIN_CYCLES,
  69. BFIN_CYCLES2,
  70. BFIN_USP,
  71. BFIN_SEQSTAT,
  72. BFIN_SYSCFG,
  73. BFIN_RETI,
  74. BFIN_RETX,
  75. BFIN_RETN,
  76. BFIN_RETE,
  77. /* Pseudo Registers */
  78. BFIN_PC,
  79. BFIN_CC,
  80. BFIN_EXTRA1, /* Address of .text section. */
  81. BFIN_EXTRA2, /* Address of .data section. */
  82. BFIN_EXTRA3, /* Address of .bss section. */
  83. BFIN_FDPIC_EXEC,
  84. BFIN_FDPIC_INTERP,
  85. /* MMRs */
  86. BFIN_IPEND,
  87. /* LAST ENTRY SHOULD NOT BE CHANGED. */
  88. BFIN_NUM_REGS /* The number of all registers. */
  89. };
  90. /* Number of bytes of registers. */
  91. #define NUMREGBYTES BFIN_NUM_REGS*4
  92. static inline void arch_kgdb_breakpoint(void)
  93. {
  94. asm("EXCPT 2;");
  95. }
  96. #define BREAK_INSTR_SIZE 2
  97. #ifdef CONFIG_SMP
  98. # define CACHE_FLUSH_IS_SAFE 0
  99. #else
  100. # define CACHE_FLUSH_IS_SAFE 1
  101. #endif
  102. #define GDB_ADJUSTS_BREAK_OFFSET
  103. #define GDB_SKIP_HW_WATCH_TEST
  104. #define HW_INST_WATCHPOINT_NUM 6
  105. #define HW_WATCHPOINT_NUM 8
  106. #define TYPE_INST_WATCHPOINT 0
  107. #define TYPE_DATA_WATCHPOINT 1
  108. /* Instruction watchpoint address control register bits mask */
  109. #define WPPWR 0x1
  110. #define WPIREN01 0x2
  111. #define WPIRINV01 0x4
  112. #define WPIAEN0 0x8
  113. #define WPIAEN1 0x10
  114. #define WPICNTEN0 0x20
  115. #define WPICNTEN1 0x40
  116. #define EMUSW0 0x80
  117. #define EMUSW1 0x100
  118. #define WPIREN23 0x200
  119. #define WPIRINV23 0x400
  120. #define WPIAEN2 0x800
  121. #define WPIAEN3 0x1000
  122. #define WPICNTEN2 0x2000
  123. #define WPICNTEN3 0x4000
  124. #define EMUSW2 0x8000
  125. #define EMUSW3 0x10000
  126. #define WPIREN45 0x20000
  127. #define WPIRINV45 0x40000
  128. #define WPIAEN4 0x80000
  129. #define WPIAEN5 0x100000
  130. #define WPICNTEN4 0x200000
  131. #define WPICNTEN5 0x400000
  132. #define EMUSW4 0x800000
  133. #define EMUSW5 0x1000000
  134. #define WPAND 0x2000000
  135. /* Data watchpoint address control register bits mask */
  136. #define WPDREN01 0x1
  137. #define WPDRINV01 0x2
  138. #define WPDAEN0 0x4
  139. #define WPDAEN1 0x8
  140. #define WPDCNTEN0 0x10
  141. #define WPDCNTEN1 0x20
  142. #define WPDSRC0 0xc0
  143. #define WPDACC0_OFFSET 8
  144. #define WPDSRC1 0xc00
  145. #define WPDACC1_OFFSET 12
  146. /* Watchpoint status register bits mask */
  147. #define STATIA0 0x1
  148. #define STATIA1 0x2
  149. #define STATIA2 0x4
  150. #define STATIA3 0x8
  151. #define STATIA4 0x10
  152. #define STATIA5 0x20
  153. #define STATDA0 0x40
  154. #define STATDA1 0x80
  155. #endif