diff --git a/os/src/loader.rs b/os/src/loader.rs index d4ae5731..0d0a5774 100644 --- a/os/src/loader.rs +++ b/os/src/loader.rs @@ -1,5 +1,6 @@ use crate::trap::TrapContext; use crate::config::*; +use core::arch::asm; #[repr(align(4096))] #[derive(Copy, Clone)] diff --git a/os/src/main.rs b/os/src/main.rs index 608f1b09..c64cece5 100644 --- a/os/src/main.rs +++ b/os/src/main.rs @@ -1,9 +1,9 @@ #![no_std] #![no_main] -#![feature(global_asm)] -#![feature(asm)] #![feature(panic_info_message)] +use core::arch::global_asm; + #[macro_use] mod console; mod lang_items; diff --git a/os/src/sbi.rs b/os/src/sbi.rs index 935fe24e..aa12b7f3 100644 --- a/os/src/sbi.rs +++ b/os/src/sbi.rs @@ -1,5 +1,7 @@ #![allow(unused)] +use core::arch::asm; + const SBI_SET_TIMER: usize = 0; const SBI_CONSOLE_PUTCHAR: usize = 1; const SBI_CONSOLE_GETCHAR: usize = 2; diff --git a/os/src/task/switch.rs b/os/src/task/switch.rs index fa75be1a..dd3a2d3e 100644 --- a/os/src/task/switch.rs +++ b/os/src/task/switch.rs @@ -1,6 +1,7 @@ -global_asm!(include_str!("switch.S")); - use super::TaskContext; +use core::arch::global_asm; + +global_asm!(include_str!("switch.S")); extern "C" { pub fn __switch( diff --git a/os/src/trap/mod.rs b/os/src/trap/mod.rs index a6288997..d105bb9d 100644 --- a/os/src/trap/mod.rs +++ b/os/src/trap/mod.rs @@ -11,6 +11,7 @@ use riscv::register::{ stval, }; use crate::syscall::syscall; +use core::arch::global_asm; global_asm!(include_str!("trap.S")); @@ -48,4 +49,4 @@ pub fn trap_handler(cx: &mut TrapContext) -> &mut TrapContext { cx } -pub use context::TrapContext; \ No newline at end of file +pub use context::TrapContext; diff --git a/rust-toolchain b/rust-toolchain index c9f86822..a8a61591 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2021-12-15 +nightly-2022-01-01 diff --git a/user/src/lib.rs b/user/src/lib.rs index 94cce773..c8fabfee 100644 --- a/user/src/lib.rs +++ b/user/src/lib.rs @@ -1,5 +1,4 @@ #![no_std] -#![feature(asm)] #![feature(linkage)] #![feature(panic_info_message)] diff --git a/user/src/syscall.rs b/user/src/syscall.rs index 4a1f781b..30baeba8 100644 --- a/user/src/syscall.rs +++ b/user/src/syscall.rs @@ -1,3 +1,5 @@ +use core::arch::asm; + const SYSCALL_WRITE: usize = 64; const SYSCALL_EXIT: usize = 93; const SYSCALL_YIELD: usize = 124;