1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Rust 内联汇编: https://doc.rust-lang.org/stable/rust-by-example/unsafe/asm.html?highlight=assem#inline-assembly
/// 系统调用入口函数
/// id: 系统调用号
/// args: 系统调用参数, [usize; 3]的数组
///
/// RISCV 函数调用 寄存器 规约:
/// x10, x11 (a0-1) 函数参数/返回值
/// x12 ~ x17 (a2-7) 函数参数
/// inlateout: rust 内敛汇编 为了节省寄存器的关键字, 让其先作为输入寄存器 然后再作为输入寄存器
/// riscv linux 系统调用表/号
/// refs: https://jborza.com/post/2021-05-11-riscv-linux-syscalls