4 * Based on arch/arm/include/kgdb.h
6 * Copyright (C) 2013 Cavium Inc.
7 * Author: Vijaya Kumar K <vijaya.kumar@caviumnetworks.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include <linux/ptrace.h>
26 #include <asm/debug-monitors.h>
30 static inline void arch_kgdb_breakpoint(void)
32 asm ("brk %0" : : "I" (KDBG_COMPILED_DBG_BRK_IMM
));
35 extern void kgdb_handle_bus_error(void);
36 extern int kgdb_fault_expected
;
38 #endif /* !__ASSEMBLY__ */
41 * gdb is expecting the following registers layout.
43 * General purpose regs:
61 * general purpose registers size in bytes.
62 * pstate is only 4 bytes. subtract 4 bytes
64 #define GP_REG_BYTES (_GP_REGS * 8)
65 #define DBG_MAX_REG_NUM (_GP_REGS + _FP_REGS + _EXTRA_REGS)
68 * Size of I/O buffer for gdb packet.
69 * considering to hold all register contents, size is set
75 * Number of bytes required for gdb_regs buffer.
76 * _GP_REGS: 8 bytes, _FP_REGS: 16 bytes and _EXTRA_REGS: 4 bytes each
77 * GDB fails to connect for size beyond this with error
78 * "'g' packet reply is too long"
81 #define NUMREGBYTES ((_GP_REGS * 8) + (_FP_REGS * 16) + \
84 #endif /* __ASM_KGDB_H */