浏览代码

fix single-hart

Román Cárdenas 1 年之前
父节点
当前提交
d597a71548
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      riscv-rt/src/asm.rs

+ 3 - 2
riscv-rt/src/asm.rs

@@ -110,10 +110,11 @@ cfg_global_asm!(
     addi t1, t1, -1
     bnez t1, 1b
 2:  ",
-    "la t1, _stack_start",
-    "sub t1, t1, t0",
 );
 cfg_global_asm!(
+    "la t1, _stack_start",
+    #[cfg(not(feature = "single-hart"))]
+    "sub t1, t1, t0",
     "andi sp, t1, -16 // align stack to 16-bytes
     add s0, sp, zero",
 );