Loading...
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Copyright (C) 2015 Altera Corporation
4 * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch>
5 *
6 * Based on the code posted by Kazuyasu on the Altera Forum at:
7 * http://www.alteraforum.com/forum/showpost.php?p=77003&postcount=20
8 */
9
10#ifndef _ASM_NIOS2_KGDB_H
11#define _ASM_NIOS2_KGDB_H
12
13#define CACHE_FLUSH_IS_SAFE 1
14#define BUFMAX 2048
15
16enum regnames {
17 GDB_R0 = 0,
18 GDB_AT,
19 GDB_R2,
20 GDB_R3,
21 GDB_R4,
22 GDB_R5,
23 GDB_R6,
24 GDB_R7,
25 GDB_R8,
26 GDB_R9,
27 GDB_R10,
28 GDB_R11,
29 GDB_R12,
30 GDB_R13,
31 GDB_R14,
32 GDB_R15,
33 GDB_R16,
34 GDB_R17,
35 GDB_R18,
36 GDB_R19,
37 GDB_R20,
38 GDB_R21,
39 GDB_R22,
40 GDB_R23,
41 GDB_ET,
42 GDB_BT,
43 GDB_GP,
44 GDB_SP,
45 GDB_FP,
46 GDB_EA,
47 GDB_BA,
48 GDB_RA,
49 GDB_PC,
50 GDB_STATUS,
51 GDB_ESTATUS,
52 GDB_BSTATUS,
53 GDB_IENABLE,
54 GDB_IPENDING,
55 GDB_CPUID,
56 GDB_CTL6,
57 GDB_EXCEPTION,
58 GDB_PTEADDR,
59 GDB_TLBACC,
60 GDB_TLBMISC,
61 GDB_ECCINJ,
62 GDB_BADADDR,
63 GDB_CONFIG,
64 GDB_MPUBASE,
65 GDB_MPUACC,
66 /* do not change the last entry or anything below! */
67 GDB_NUMREGBYTES /* number of registers */
68};
69
70#define GDB_SIZEOF_REG sizeof(u32)
71#define DBG_MAX_REG_NUM (49)
72#define NUMREGBYTES (DBG_MAX_REG_NUM * sizeof(GDB_SIZEOF_REG))
73
74#define BREAK_INSTR_SIZE 4
75static inline void arch_kgdb_breakpoint(void)
76{
77 __asm__ __volatile__("trap 30\n");
78}
79
80#endif /* _ASM_NIOS2_KGDB_H */
1/*
2 * Copyright (C) 2015 Altera Corporation
3 * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch>
4 *
5 * Based on the code posted by Kazuyasu on the Altera Forum at:
6 * http://www.alteraforum.com/forum/showpost.php?p=77003&postcount=20
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
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.
17 *
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/>.
20 *
21 */
22
23#ifndef _ASM_NIOS2_KGDB_H
24#define _ASM_NIOS2_KGDB_H
25
26#define CACHE_FLUSH_IS_SAFE 1
27#define BUFMAX 2048
28
29enum regnames {
30 GDB_R0 = 0,
31 GDB_AT,
32 GDB_R2,
33 GDB_R3,
34 GDB_R4,
35 GDB_R5,
36 GDB_R6,
37 GDB_R7,
38 GDB_R8,
39 GDB_R9,
40 GDB_R10,
41 GDB_R11,
42 GDB_R12,
43 GDB_R13,
44 GDB_R14,
45 GDB_R15,
46 GDB_R16,
47 GDB_R17,
48 GDB_R18,
49 GDB_R19,
50 GDB_R20,
51 GDB_R21,
52 GDB_R22,
53 GDB_R23,
54 GDB_ET,
55 GDB_BT,
56 GDB_GP,
57 GDB_SP,
58 GDB_FP,
59 GDB_EA,
60 GDB_BA,
61 GDB_RA,
62 GDB_PC,
63 GDB_STATUS,
64 GDB_ESTATUS,
65 GDB_BSTATUS,
66 GDB_IENABLE,
67 GDB_IPENDING,
68 GDB_CPUID,
69 GDB_CTL6,
70 GDB_EXCEPTION,
71 GDB_PTEADDR,
72 GDB_TLBACC,
73 GDB_TLBMISC,
74 GDB_ECCINJ,
75 GDB_BADADDR,
76 GDB_CONFIG,
77 GDB_MPUBASE,
78 GDB_MPUACC,
79 /* do not change the last entry or anything below! */
80 GDB_NUMREGBYTES /* number of registers */
81};
82
83#define GDB_SIZEOF_REG sizeof(u32)
84#define DBG_MAX_REG_NUM (49)
85#define NUMREGBYTES (DBG_MAX_REG_NUM * sizeof(GDB_SIZEOF_REG))
86
87#define BREAK_INSTR_SIZE 4
88static inline void arch_kgdb_breakpoint(void)
89{
90 __asm__ __volatile__("trap 30\n");
91}
92
93#endif /* _ASM_NIOS2_KGDB_H */