xref: /openbmc/linux/arch/sparc/include/asm/kgdb.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2a439fe51SSam Ravnborg #ifndef _SPARC_KGDB_H
3a439fe51SSam Ravnborg #define _SPARC_KGDB_H
4a439fe51SSam Ravnborg 
5a439fe51SSam Ravnborg #ifdef CONFIG_SPARC32
6a439fe51SSam Ravnborg #define BUFMAX			2048
7a439fe51SSam Ravnborg #else
8a439fe51SSam Ravnborg #define BUFMAX			4096
9a439fe51SSam Ravnborg #endif
10a439fe51SSam Ravnborg 
11a439fe51SSam Ravnborg enum regnames {
12a439fe51SSam Ravnborg 	GDB_G0, GDB_G1, GDB_G2, GDB_G3, GDB_G4, GDB_G5, GDB_G6, GDB_G7,
13a439fe51SSam Ravnborg 	GDB_O0, GDB_O1, GDB_O2, GDB_O3, GDB_O4, GDB_O5, GDB_SP, GDB_O7,
14a439fe51SSam Ravnborg 	GDB_L0, GDB_L1, GDB_L2, GDB_L3, GDB_L4, GDB_L5, GDB_L6, GDB_L7,
15a439fe51SSam Ravnborg 	GDB_I0, GDB_I1, GDB_I2, GDB_I3, GDB_I4, GDB_I5, GDB_FP, GDB_I7,
16a439fe51SSam Ravnborg 	GDB_F0,
17a439fe51SSam Ravnborg 	GDB_F31 = GDB_F0 + 31,
18a439fe51SSam Ravnborg #ifdef CONFIG_SPARC32
19a439fe51SSam Ravnborg 	GDB_Y, GDB_PSR, GDB_WIM, GDB_TBR, GDB_PC, GDB_NPC,
20a439fe51SSam Ravnborg 	GDB_FSR, GDB_CSR,
21a439fe51SSam Ravnborg #else
22a439fe51SSam Ravnborg 	GDB_F32 = GDB_F0 + 32,
23a439fe51SSam Ravnborg 	GDB_F62 = GDB_F32 + 15,
24a439fe51SSam Ravnborg 	GDB_PC, GDB_NPC, GDB_STATE, GDB_FSR, GDB_FPRS, GDB_Y,
25a439fe51SSam Ravnborg #endif
26a439fe51SSam Ravnborg };
27a439fe51SSam Ravnborg 
28a439fe51SSam Ravnborg #ifdef CONFIG_SPARC32
29a439fe51SSam Ravnborg #define NUMREGBYTES		((GDB_CSR + 1) * 4)
30a439fe51SSam Ravnborg #else
31a439fe51SSam Ravnborg #define NUMREGBYTES		((GDB_Y + 1) * 8)
32d097efa9SSam Ravnborg #endif
3348c7eca5SSam Ravnborg 
3448c7eca5SSam Ravnborg struct pt_regs;
3548c7eca5SSam Ravnborg asmlinkage void kgdb_trap(unsigned long trap_level, struct pt_regs *regs);
36a439fe51SSam Ravnborg 
37f05a6865SSam Ravnborg void arch_kgdb_breakpoint(void);
38a439fe51SSam Ravnborg 
39a439fe51SSam Ravnborg #define BREAK_INSTR_SIZE	4
40a439fe51SSam Ravnborg #define CACHE_FLUSH_IS_SAFE	1
41a439fe51SSam Ravnborg 
42a439fe51SSam Ravnborg #endif /* _SPARC_KGDB_H */
43