Skip to content

Commit 135403e

Browse files
committed
Change RISC-V register names in clobbers.
As of right now, asm clobbers of specific registers in Rust only work with the registers' x-style names, not the a/t/ra names. See rust-lang/rust#60392.
1 parent b4b1266 commit 135403e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/entry_point/start_item_riscv32.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ pub unsafe extern "C" fn _start() -> ! {
9393
jal rust_start"
9494
: // No output operands
9595
:
96-
: "memory", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7",
97-
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "ra" // Clobbers
96+
: "memory", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17",
97+
"x5", "x6", "x7", "x28", "x29", "x30", "x31", "x1" // Clobbers
9898
: "volatile" // Options
9999
);
100100
hint::unreachable_unchecked();

src/syscalls/platform_riscv32.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ pub unsafe fn yieldk() {
88
ecall"
99
:
1010
:
11-
: "memory", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7",
12-
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "ra"
11+
: "memory", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17",
12+
"x5", "x6", "x7", "x28", "x29", "x30", "x31", "x1"
1313
: "volatile");
1414
}
1515

0 commit comments

Comments
 (0)