Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __ASM_KGDB_H_
0003 #define __ASM_KGDB_H_
0004 
0005 #ifdef __KERNEL__
0006 
0007 #include <asm/sgidefs.h>
0008 
0009 #if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
0010     (_MIPS_ISA == _MIPS_ISA_MIPS32)
0011 
0012 #define KGDB_GDB_REG_SIZE   32
0013 #define GDB_SIZEOF_REG      sizeof(u32)
0014 
0015 #elif (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
0016     (_MIPS_ISA == _MIPS_ISA_MIPS64)
0017 
0018 #ifdef CONFIG_32BIT
0019 #define KGDB_GDB_REG_SIZE   32
0020 #define GDB_SIZEOF_REG      sizeof(u32)
0021 #else /* CONFIG_32BIT */
0022 #define KGDB_GDB_REG_SIZE   64
0023 #define GDB_SIZEOF_REG      sizeof(u64)
0024 #endif
0025 #else
0026 #error "Need to set KGDB_GDB_REG_SIZE for MIPS ISA"
0027 #endif /* _MIPS_ISA */
0028 
0029 #define BUFMAX          2048
0030 #define DBG_MAX_REG_NUM     72
0031 #define NUMREGBYTES     (DBG_MAX_REG_NUM * sizeof(GDB_SIZEOF_REG))
0032 #define NUMCRITREGBYTES     (12 * sizeof(GDB_SIZEOF_REG))
0033 #define BREAK_INSTR_SIZE    4
0034 #define CACHE_FLUSH_IS_SAFE 0
0035 
0036 extern void arch_kgdb_breakpoint(void);
0037 extern void *saved_vectors[32];
0038 extern void handle_exception(struct pt_regs *regs);
0039 extern void breakinst(void);
0040 extern int kgdb_ll_trap(int cmd, const char *str,
0041             struct pt_regs *regs, long err, int trap, int sig);
0042 
0043 #endif              /* __KERNEL__ */
0044 
0045 #endif /* __ASM_KGDB_H_ */