1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_KGDB_H_
3 #define __ASM_KGDB_H_
4 
5 #ifdef __KERNEL__
6 
7 #ifdef CONFIG_32BIT
8 #define KGDB_GDB_REG_SIZE	32
9 #define GDB_SIZEOF_REG		sizeof(u32)
10 #else /* CONFIG_CPU_32BIT */
11 #define KGDB_GDB_REG_SIZE	64
12 #define GDB_SIZEOF_REG		sizeof(u64)
13 #endif
14 
15 #define BUFMAX			2048
16 #define DBG_ALL_REG_NUM		76
17 #define DBG_MAX_REG_NUM		35
18 #define NUMREGBYTES		(DBG_MAX_REG_NUM * sizeof(GDB_SIZEOF_REG))
19 #define NUMCRITREGBYTES		(12 * sizeof(GDB_SIZEOF_REG))
20 #define BREAK_INSTR_SIZE	4
21 #define CACHE_FLUSH_IS_SAFE	0
22 
23 extern void arch_kgdb_breakpoint(void);
24 extern void *saved_vectors[32];
25 extern void handle_exception(struct pt_regs *regs);
26 extern void breakinst(void);
27 extern int kgdb_ll_trap(int cmd, const char *str,
28 			struct pt_regs *regs, long err, int trap, int sig);
29 
30 #endif				/* __KERNEL__ */
31 
32 #endif /* __ASM_KGDB_H_ */
33