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