kgdb.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2015 Altera Corporation
  4. * Copyright (C) 2011 Tobias Klauser <[email protected]>
  5. *
  6. * Based on the code posted by Kazuyasu on the Altera Forum at:
  7. * http://www.alteraforum.com/forum/showpost.php?p=77003&postcount=20
  8. */
  9. #ifndef _ASM_NIOS2_KGDB_H
  10. #define _ASM_NIOS2_KGDB_H
  11. #define CACHE_FLUSH_IS_SAFE 1
  12. #define BUFMAX 2048
  13. enum regnames {
  14. GDB_R0 = 0,
  15. GDB_AT,
  16. GDB_R2,
  17. GDB_R3,
  18. GDB_R4,
  19. GDB_R5,
  20. GDB_R6,
  21. GDB_R7,
  22. GDB_R8,
  23. GDB_R9,
  24. GDB_R10,
  25. GDB_R11,
  26. GDB_R12,
  27. GDB_R13,
  28. GDB_R14,
  29. GDB_R15,
  30. GDB_R16,
  31. GDB_R17,
  32. GDB_R18,
  33. GDB_R19,
  34. GDB_R20,
  35. GDB_R21,
  36. GDB_R22,
  37. GDB_R23,
  38. GDB_ET,
  39. GDB_BT,
  40. GDB_GP,
  41. GDB_SP,
  42. GDB_FP,
  43. GDB_EA,
  44. GDB_BA,
  45. GDB_RA,
  46. GDB_PC,
  47. GDB_STATUS,
  48. GDB_ESTATUS,
  49. GDB_BSTATUS,
  50. GDB_IENABLE,
  51. GDB_IPENDING,
  52. GDB_CPUID,
  53. GDB_CTL6,
  54. GDB_EXCEPTION,
  55. GDB_PTEADDR,
  56. GDB_TLBACC,
  57. GDB_TLBMISC,
  58. GDB_ECCINJ,
  59. GDB_BADADDR,
  60. GDB_CONFIG,
  61. GDB_MPUBASE,
  62. GDB_MPUACC,
  63. /* do not change the last entry or anything below! */
  64. GDB_NUMREGBYTES /* number of registers */
  65. };
  66. #define GDB_SIZEOF_REG sizeof(u32)
  67. #define DBG_MAX_REG_NUM (49)
  68. #define NUMREGBYTES (DBG_MAX_REG_NUM * sizeof(GDB_SIZEOF_REG))
  69. #define BREAK_INSTR_SIZE 4
  70. static inline void arch_kgdb_breakpoint(void)
  71. {
  72. __asm__ __volatile__("trap 30\n");
  73. }
  74. #endif /* _ASM_NIOS2_KGDB_H */