Skip to content

Commit ce6db9e

Browse files
ancientmodernfelicitiapicostove
authored andcommitted
images: add riscv64 core image
Co-authored-by: Yixue Zhao <[email protected]> Co-authored-by: stove <[email protected]> Signed-off-by: Haorong Lu <[email protected]>
1 parent c610531 commit ce6db9e

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

images/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ proto-obj-y += core-arm.o
77
proto-obj-y += core-aarch64.o
88
proto-obj-y += core-ppc64.o
99
proto-obj-y += core-s390.o
10+
proto-obj-y += core-riscv64.o
1011
proto-obj-y += cpuinfo.o
1112
proto-obj-y += inventory.o
1213
proto-obj-y += fdinfo.o

images/core-riscv64.proto

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// SPDX-License-Identifier: MIT
2+
3+
syntax = "proto2";
4+
5+
import "opts.proto";
6+
7+
// Refer to riscv-gnu-toolchain/linux-headers/include/asm/ptrace.h
8+
message user_riscv64_regs_entry {
9+
required uint64 pc = 1;
10+
required uint64 ra = 2;
11+
required uint64 sp = 3;
12+
required uint64 gp = 4;
13+
required uint64 tp = 5;
14+
required uint64 t0 = 6;
15+
required uint64 t1 = 7;
16+
required uint64 t2 = 8;
17+
required uint64 s0 = 9;
18+
required uint64 s1 = 10;
19+
required uint64 a0 = 11;
20+
required uint64 a1 = 12;
21+
required uint64 a2 = 13;
22+
required uint64 a3 = 14;
23+
required uint64 a4 = 15;
24+
required uint64 a5 = 16;
25+
required uint64 a6 = 17;
26+
required uint64 a7 = 18;
27+
required uint64 s2 = 19;
28+
required uint64 s3 = 20;
29+
required uint64 s4 = 21;
30+
required uint64 s5 = 22;
31+
required uint64 s6 = 23;
32+
required uint64 s7 = 24;
33+
required uint64 s8 = 25;
34+
required uint64 s9 = 26;
35+
required uint64 s10 = 27;
36+
required uint64 s11 = 28;
37+
required uint64 t3 = 29;
38+
required uint64 t4 = 30;
39+
required uint64 t5 = 31;
40+
required uint64 t6 = 32;
41+
}
42+
43+
message user_riscv64_d_ext_entry {
44+
repeated uint64 f = 1;
45+
required uint32 fcsr = 2;
46+
}
47+
48+
message thread_info_riscv64 {
49+
required uint64 clear_tid_addr = 1[(criu).hex = true];
50+
required uint64 tls = 2;
51+
required user_riscv64_regs_entry gpregs = 3[(criu).hex = true];
52+
required user_riscv64_d_ext_entry fpsimd = 4;
53+
}

images/core.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import "core-ppc64.proto";
99
import "core-s390.proto";
1010
import "core-mips.proto";
1111
import "core-loongarch64.proto";
12+
import "core-riscv64.proto";
1213

1314
import "rlimit.proto";
1415
import "timer.proto";
@@ -126,6 +127,7 @@ message core_entry {
126127
S390 = 5;
127128
MIPS = 6;
128129
LOONGARCH64 = 7;
130+
RISCV64 = 8;
129131
}
130132

131133
required march mtype = 1;
@@ -136,6 +138,7 @@ message core_entry {
136138
optional thread_info_s390 ti_s390 = 10;
137139
optional thread_info_mips ti_mips = 11;
138140
optional thread_info_loongarch64 ti_loongarch64 = 12;
141+
optional thread_info_riscv64 ti_riscv64 = 13;
139142

140143
optional task_core_entry tc = 3;
141144
optional task_kobj_ids_entry ids = 4;

0 commit comments

Comments
 (0)