Linux-libre 5.4.39-gnu
[librecmc/linux-libre.git] / arch / h8300 / include / asm / kgdb.h
1 /*
2  * Copyright (C) 2015 Yoshinori Sato <ysato@users.sourceforge.jp>
3  *
4  * This file is subject to the terms and conditions of the GNU General Public
5  * License.  See the file "COPYING" in the main directory of this archive
6  * for more details.
7  */
8
9 #ifndef _ASM_H8300_KGDB_H
10 #define _ASM_H8300_KGDB_H
11
12 #define CACHE_FLUSH_IS_SAFE     1
13 #define BUFMAX                  2048
14
15 enum regnames {
16         GDB_ER0, GDB_ER1, GDB_ER2, GDB_ER3,
17         GDB_ER4, GDB_ER5, GDB_ER6, GDB_SP,
18         GDB_CCR, GDB_PC,
19         GDB_CYCLLE,
20 #if defined(CONFIG_CPU_H8S)
21         GDB_EXR,
22 #endif
23         GDB_TICK, GDB_INST,
24 #if defined(CONFIG_CPU_H8S)
25         GDB_MACH, GDB_MACL,
26 #endif
27         /* do not change the last entry or anything below! */
28         GDB_NUMREGBYTES,                /* number of registers */
29 };
30
31 #define GDB_SIZEOF_REG          sizeof(u32)
32 #if defined(CONFIG_CPU_H8300H)
33 #define DBG_MAX_REG_NUM         (13)
34 #elif defined(CONFIG_CPU_H8S)
35 #define DBG_MAX_REG_NUM         (14)
36 #endif
37 #define NUMREGBYTES             (DBG_MAX_REG_NUM * GDB_SIZEOF_REG)
38
39 #define BREAK_INSTR_SIZE        2
40 static inline void arch_kgdb_breakpoint(void)
41 {
42         __asm__ __volatile__("trapa #2");
43 }
44
45 #endif /* _ASM_H8300_KGDB_H */