kgdb.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_KGDB_H_
  3. #define __ASM_KGDB_H_
  4. #ifdef __KERNEL__
  5. #include <asm/sgidefs.h>
  6. #if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
  7. (_MIPS_ISA == _MIPS_ISA_MIPS32)
  8. #define KGDB_GDB_REG_SIZE 32
  9. #define GDB_SIZEOF_REG sizeof(u32)
  10. #elif (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
  11. (_MIPS_ISA == _MIPS_ISA_MIPS64)
  12. #ifdef CONFIG_32BIT
  13. #define KGDB_GDB_REG_SIZE 32
  14. #define GDB_SIZEOF_REG sizeof(u32)
  15. #else /* CONFIG_32BIT */
  16. #define KGDB_GDB_REG_SIZE 64
  17. #define GDB_SIZEOF_REG sizeof(u64)
  18. #endif
  19. #else
  20. #error "Need to set KGDB_GDB_REG_SIZE for MIPS ISA"
  21. #endif /* _MIPS_ISA */
  22. #define BUFMAX 2048
  23. #define DBG_MAX_REG_NUM 72
  24. #define NUMREGBYTES (DBG_MAX_REG_NUM * sizeof(GDB_SIZEOF_REG))
  25. #define NUMCRITREGBYTES (12 * sizeof(GDB_SIZEOF_REG))
  26. #define BREAK_INSTR_SIZE 4
  27. #define CACHE_FLUSH_IS_SAFE 0
  28. extern void arch_kgdb_breakpoint(void);
  29. extern void *saved_vectors[32];
  30. extern void handle_exception(struct pt_regs *regs);
  31. extern void breakinst(void);
  32. extern int kgdb_ll_trap(int cmd, const char *str,
  33. struct pt_regs *regs, long err, int trap, int sig);
  34. #endif /* __KERNEL__ */
  35. #endif /* __ASM_KGDB_H_ */