xref: /linux/arch/riscv/include/asm/gdb_xml.h (revision 8440d4a75d90556cfb8fb3e244443f67381aafd6)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef __ASM_GDB_XML_H_
4 #define __ASM_GDB_XML_H_
5 
6 #define kgdb_arch_gdb_stub_feature riscv_gdb_stub_feature
7 static const char riscv_gdb_stub_feature[64] =
8 			"PacketSize=800;qXfer:features:read+;";
9 
10 static const char gdb_xfer_read_target[31] = "qXfer:features:read:target.xml:";
11 
12 #ifdef CONFIG_64BIT
13 static const char gdb_xfer_read_cpuxml[39] =
14 			"qXfer:features:read:riscv-64bit-cpu.xml";
15 
16 static const char riscv_gdb_stub_target_desc[256] =
17 "l<?xml version=\"1.0\"?>"
18 "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">"
19 "<target>"
20 "<xi:include href=\"riscv-64bit-cpu.xml\"/>"
21 "</target>";
22 
23 static const char riscv_gdb_stub_cpuxml[2048] =
24 "l<?xml version=\"1.0\"?>"
25 "<!DOCTYPE feature SYSTEM \"gdb-target.dtd\">"
26 "<feature name=\"org.gnu.gdb.riscv.cpu\">"
27 "<reg name=\""DBG_REG_ZERO"\" bitsize=\"64\" type=\"int\" regnum=\"0\"/>"
28 "<reg name=\""DBG_REG_RA"\" bitsize=\"64\" type=\"code_ptr\"/>"
29 "<reg name=\""DBG_REG_SP"\" bitsize=\"64\" type=\"data_ptr\"/>"
30 "<reg name=\""DBG_REG_GP"\" bitsize=\"64\" type=\"data_ptr\"/>"
31 "<reg name=\""DBG_REG_TP"\" bitsize=\"64\" type=\"data_ptr\"/>"
32 "<reg name=\""DBG_REG_T0"\" bitsize=\"64\" type=\"int\"/>"
33 "<reg name=\""DBG_REG_T1"\" bitsize=\"64\" type=\"int\"/>"
34 "<reg name=\""DBG_REG_T2"\" bitsize=\"64\" type=\"int\"/>"
35 "<reg name=\""DBG_REG_FP"\" bitsize=\"64\" type=\"data_ptr\"/>"
36 "<reg name=\""DBG_REG_S1"\" bitsize=\"64\" type=\"int\"/>"
37 "<reg name=\""DBG_REG_A0"\" bitsize=\"64\" type=\"int\"/>"
38 "<reg name=\""DBG_REG_A1"\" bitsize=\"64\" type=\"int\"/>"
39 "<reg name=\""DBG_REG_A2"\" bitsize=\"64\" type=\"int\"/>"
40 "<reg name=\""DBG_REG_A3"\" bitsize=\"64\" type=\"int\"/>"
41 "<reg name=\""DBG_REG_A4"\" bitsize=\"64\" type=\"int\"/>"
42 "<reg name=\""DBG_REG_A5"\" bitsize=\"64\" type=\"int\"/>"
43 "<reg name=\""DBG_REG_A6"\" bitsize=\"64\" type=\"int\"/>"
44 "<reg name=\""DBG_REG_A7"\" bitsize=\"64\" type=\"int\"/>"
45 "<reg name=\""DBG_REG_S2"\" bitsize=\"64\" type=\"int\"/>"
46 "<reg name=\""DBG_REG_S3"\" bitsize=\"64\" type=\"int\"/>"
47 "<reg name=\""DBG_REG_S4"\" bitsize=\"64\" type=\"int\"/>"
48 "<reg name=\""DBG_REG_S5"\" bitsize=\"64\" type=\"int\"/>"
49 "<reg name=\""DBG_REG_S6"\" bitsize=\"64\" type=\"int\"/>"
50 "<reg name=\""DBG_REG_S7"\" bitsize=\"64\" type=\"int\"/>"
51 "<reg name=\""DBG_REG_S8"\" bitsize=\"64\" type=\"int\"/>"
52 "<reg name=\""DBG_REG_S9"\" bitsize=\"64\" type=\"int\"/>"
53 "<reg name=\""DBG_REG_S10"\" bitsize=\"64\" type=\"int\"/>"
54 "<reg name=\""DBG_REG_S11"\" bitsize=\"64\" type=\"int\"/>"
55 "<reg name=\""DBG_REG_T3"\" bitsize=\"64\" type=\"int\"/>"
56 "<reg name=\""DBG_REG_T4"\" bitsize=\"64\" type=\"int\"/>"
57 "<reg name=\""DBG_REG_T5"\" bitsize=\"64\" type=\"int\"/>"
58 "<reg name=\""DBG_REG_T6"\" bitsize=\"64\" type=\"int\"/>"
59 "<reg name=\""DBG_REG_EPC"\" bitsize=\"64\" type=\"code_ptr\"/>"
60 "<reg name=\""DBG_REG_STATUS"\" bitsize=\"64\" type=\"int\"/>"
61 "<reg name=\""DBG_REG_BADADDR"\" bitsize=\"64\" type=\"int\"/>"
62 "<reg name=\""DBG_REG_CAUSE"\" bitsize=\"64\" type=\"int\"/>"
63 "</feature>";
64 #else
65 static const char gdb_xfer_read_cpuxml[39] =
66 			"qXfer:features:read:riscv-32bit-cpu.xml";
67 
68 static const char riscv_gdb_stub_target_desc[256] =
69 "l<?xml version=\"1.0\"?>"
70 "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">"
71 "<target>"
72 "<xi:include href=\"riscv-32bit-cpu.xml\"/>"
73 "</target>";
74 
75 static const char riscv_gdb_stub_cpuxml[2048] =
76 "l<?xml version=\"1.0\"?>"
77 "<!DOCTYPE feature SYSTEM \"gdb-target.dtd\">"
78 "<feature name=\"org.gnu.gdb.riscv.cpu\">"
79 "<reg name=\""DBG_REG_ZERO"\" bitsize=\"32\" type=\"int\" regnum=\"0\"/>"
80 "<reg name=\""DBG_REG_RA"\" bitsize=\"32\" type=\"code_ptr\"/>"
81 "<reg name=\""DBG_REG_SP"\" bitsize=\"32\" type=\"data_ptr\"/>"
82 "<reg name=\""DBG_REG_GP"\" bitsize=\"32\" type=\"data_ptr\"/>"
83 "<reg name=\""DBG_REG_TP"\" bitsize=\"32\" type=\"data_ptr\"/>"
84 "<reg name=\""DBG_REG_T0"\" bitsize=\"32\" type=\"int\"/>"
85 "<reg name=\""DBG_REG_T1"\" bitsize=\"32\" type=\"int\"/>"
86 "<reg name=\""DBG_REG_T2"\" bitsize=\"32\" type=\"int\"/>"
87 "<reg name=\""DBG_REG_FP"\" bitsize=\"32\" type=\"data_ptr\"/>"
88 "<reg name=\""DBG_REG_S1"\" bitsize=\"32\" type=\"int\"/>"
89 "<reg name=\""DBG_REG_A0"\" bitsize=\"32\" type=\"int\"/>"
90 "<reg name=\""DBG_REG_A1"\" bitsize=\"32\" type=\"int\"/>"
91 "<reg name=\""DBG_REG_A2"\" bitsize=\"32\" type=\"int\"/>"
92 "<reg name=\""DBG_REG_A3"\" bitsize=\"32\" type=\"int\"/>"
93 "<reg name=\""DBG_REG_A4"\" bitsize=\"32\" type=\"int\"/>"
94 "<reg name=\""DBG_REG_A5"\" bitsize=\"32\" type=\"int\"/>"
95 "<reg name=\""DBG_REG_A6"\" bitsize=\"32\" type=\"int\"/>"
96 "<reg name=\""DBG_REG_A7"\" bitsize=\"32\" type=\"int\"/>"
97 "<reg name=\""DBG_REG_S2"\" bitsize=\"32\" type=\"int\"/>"
98 "<reg name=\""DBG_REG_S3"\" bitsize=\"32\" type=\"int\"/>"
99 "<reg name=\""DBG_REG_S4"\" bitsize=\"32\" type=\"int\"/>"
100 "<reg name=\""DBG_REG_S5"\" bitsize=\"32\" type=\"int\"/>"
101 "<reg name=\""DBG_REG_S6"\" bitsize=\"32\" type=\"int\"/>"
102 "<reg name=\""DBG_REG_S7"\" bitsize=\"32\" type=\"int\"/>"
103 "<reg name=\""DBG_REG_S8"\" bitsize=\"32\" type=\"int\"/>"
104 "<reg name=\""DBG_REG_S9"\" bitsize=\"32\" type=\"int\"/>"
105 "<reg name=\""DBG_REG_S10"\" bitsize=\"32\" type=\"int\"/>"
106 "<reg name=\""DBG_REG_S11"\" bitsize=\"32\" type=\"int\"/>"
107 "<reg name=\""DBG_REG_T3"\" bitsize=\"32\" type=\"int\"/>"
108 "<reg name=\""DBG_REG_T4"\" bitsize=\"32\" type=\"int\"/>"
109 "<reg name=\""DBG_REG_T5"\" bitsize=\"32\" type=\"int\"/>"
110 "<reg name=\""DBG_REG_T6"\" bitsize=\"32\" type=\"int\"/>"
111 "<reg name=\""DBG_REG_EPC"\" bitsize=\"32\" type=\"code_ptr\"/>"
112 "<reg name=\""DBG_REG_STATUS"\" bitsize=\"32\" type=\"int\"/>"
113 "<reg name=\""DBG_REG_BADADDR"\" bitsize=\"32\" type=\"int\"/>"
114 "<reg name=\""DBG_REG_CAUSE"\" bitsize=\"32\" type=\"int\"/>"
115 "</feature>";
116 #endif
117 #endif
118