瀏覽代碼

fix(context): new version rustc says we should use naked_asm

greatbridf 3 周之前
父節點
當前提交
b8a282ecb6
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      arch/src/x86_64/context.rs

+ 3 - 3
arch/src/x86_64/context.rs

@@ -1,4 +1,4 @@
-use core::arch::asm;
+use core::arch::naked_asm;
 
 #[repr(C)]
 #[derive(Debug, Default)]
@@ -48,7 +48,7 @@ impl TaskContext {
 
 #[naked]
 unsafe extern "C" fn _switch_to(current_context_sp: &mut u64, next_context_sp: &mut u64) {
-    asm!(
+    naked_asm!(
         "pushf",
         "push %rbp",
         "push %rbx",
@@ -66,6 +66,6 @@ unsafe extern "C" fn _switch_to(current_context_sp: &mut u64, next_context_sp: &
         "pop %rbp",
         "popf",
         "ret",
-        options(att_syntax, noreturn),
+        options(att_syntax),
     );
 }