x2sp用于栈指针(stack pointer)x3gp用于通用指针 (global pointer)x4tp用于线程指针 (thread pointer)x5t0用于存放临时数据或者备用链接寄存器x6~x7t1~t2用于存放临时数据寄存器x8s0/fp需要保存的寄存器或者帧指针寄存器x9s1需要保存的寄存器x10~x11a0~a1函数传递参数寄存器或者函数返回值寄存器x12~
RT-Thread 为什么在适配 RISC-V 架构在线程中实现上下文切换,而在 ARM Cortex-M 架构上使用在中断中实现上下文切换呢? ARM Cortex-M 实现了自动硬件自动压栈和出栈一些寄存器,而 RISC-V 标准中并没有要求,RISC-V 架构需要通过软件方式保存、恢复寄存器,通过中断实现上下文切换并没有带来性能提升。很多 IP 设计厂家...
x1 / ra (return address) x2 / sp (stack pointer) x3 / gp (global pointer) x4 / tp (thread pointer) x5 / t0 (temporary) x6 / t1 x7 / t2 x8 / s0 / fp (saved register, frame pointer) x9 / s1 x10 / a0 (function argument, return value) x11 / a1 (function argument, return ...
1.RISC-V 调用约束 / 寄存器 RegisterABI NameDescription / 中文描述Saver x0 zero Zero constant / 常数 0 — x1 ra Return address / 返回地址 Caller x2 sp Stack pointer / 栈指针 — x3 gp Global pointer / 全局指针 — x4 tp Thread pointer / 线程指针 Callee x5-x7 t0-t2 Temporaries / 临时...
* the kernel thread pointer. If we came from the kernel, the scratch * register will contain 0, and we should continue on the current TP.*/csrrw tp, CSR_SCRATCH, tp bnez tp, .Lsave_context .Lrestore_kernel_tpsp: csrr tp, CSR_SCRATCH ...
riscv指令 各个寄存器 寄存器ABI名字注释Saver x0 zero Hard-wired zero,常数0 x1 ra Return address caller,调用函数的指令pc x2 sp Stack pointer callee,被调用的函数指令pc x3 gp Global pointer x4 tp Thread pointer x5 t0 Temporary/alternate link register caller x6 t1 Temporaries caller x7 t2...
x2 sp Stack pointer Caller x3 gp Global pointer -- x4 tp Thread pointer -- x5-7 t0-2 Temporaries Caller x8 s0/fp Saved register/frame pointer Caller x9 s1 Save register Caller x10-11 a0-1 Function arguments/return values Caller
gp global pointer tp thread pointer zero a register that always returns a value of zero. How do I put a number in a register? The GD32VF103 uses an RV32IMAC core. This means it does Integer calculations only. Has a hardware Multiply, is capable of certain Atomic (non-interruptible) in...
下图是RISC-V 指令格式,从下图可以看到RSIC-V共六种指令格式。 opcode :指令操作码 imm:代码立即数 func3和funct7:代表指令对应的功能 rs1:源寄存器1 rs2:源寄存器2 rd:目标寄存器(RSIC-V 一个指令可以提供三个寄存器操作) 六种指令格式作用如下:
tp Thread pointer -- x5-7 t0-2 Temporaries