kgdb.h 3.0 KB

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