kgdb.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright (C) 2015 Altera Corporation
  3. * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch>
  4. *
  5. * Based on the code posted by Kazuyasu on the Altera Forum at:
  6. * http://www.alteraforum.com/forum/showpost.php?p=77003&postcount=20
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #ifndef _ASM_NIOS2_KGDB_H
  23. #define _ASM_NIOS2_KGDB_H
  24. #define CACHE_FLUSH_IS_SAFE 1
  25. #define BUFMAX 2048
  26. enum regnames {
  27. GDB_R0 = 0,
  28. GDB_AT,
  29. GDB_R2,
  30. GDB_R3,
  31. GDB_R4,
  32. GDB_R5,
  33. GDB_R6,
  34. GDB_R7,
  35. GDB_R8,
  36. GDB_R9,
  37. GDB_R10,
  38. GDB_R11,
  39. GDB_R12,
  40. GDB_R13,
  41. GDB_R14,
  42. GDB_R15,
  43. GDB_R16,
  44. GDB_R17,
  45. GDB_R18,
  46. GDB_R19,
  47. GDB_R20,
  48. GDB_R21,
  49. GDB_R22,
  50. GDB_R23,
  51. GDB_ET,
  52. GDB_BT,
  53. GDB_GP,
  54. GDB_SP,
  55. GDB_FP,
  56. GDB_EA,
  57. GDB_BA,
  58. GDB_RA,
  59. GDB_PC,
  60. GDB_STATUS,
  61. GDB_ESTATUS,
  62. GDB_BSTATUS,
  63. GDB_IENABLE,
  64. GDB_IPENDING,
  65. GDB_CPUID,
  66. GDB_CTL6,
  67. GDB_EXCEPTION,
  68. GDB_PTEADDR,
  69. GDB_TLBACC,
  70. GDB_TLBMISC,
  71. GDB_ECCINJ,
  72. GDB_BADADDR,
  73. GDB_CONFIG,
  74. GDB_MPUBASE,
  75. GDB_MPUACC,
  76. /* do not change the last entry or anything below! */
  77. GDB_NUMREGBYTES /* number of registers */
  78. };
  79. #define GDB_SIZEOF_REG sizeof(u32)
  80. #define DBG_MAX_REG_NUM (49)
  81. #define NUMREGBYTES (DBG_MAX_REG_NUM * sizeof(GDB_SIZEOF_REG))
  82. #define BREAK_INSTR_SIZE 4
  83. static inline void arch_kgdb_breakpoint(void)
  84. {
  85. __asm__ __volatile__("trap 30\n");
  86. }
  87. #endif /* _ASM_NIOS2_KGDB_H */