From 6d22fcb1641d2ad81fc4a26c52ae06d5c6132e8b Mon Sep 17 00:00:00 2001 From: ruiqurm Date: Mon, 5 Sep 2022 17:52:17 +0800 Subject: [PATCH] udpate rust-toolchain: nightly-2022-07-20 --- os/src/batch.rs | 1 + os/src/main.rs | 4 ++-- os/src/sbi.rs | 2 ++ os/src/trap/mod.rs | 1 + rust-toolchain | 1 - rust-toolchain.toml | 4 ++++ user/src/bin/bad_address.rs | 1 - user/src/bin/bad_instruction.rs | 3 ++- user/src/bin/bad_register.rs | 3 ++- user/src/bin/hello_world.rs | 1 - user/src/bin/test1_write0.rs | 3 ++- user/src/lib.rs | 1 - user/src/syscall.rs | 2 +- 13 files changed, 17 insertions(+), 10 deletions(-) delete mode 100644 rust-toolchain create mode 100644 rust-toolchain.toml diff --git a/os/src/batch.rs b/os/src/batch.rs index 816e8b78..7f29b21b 100644 --- a/os/src/batch.rs +++ b/os/src/batch.rs @@ -1,6 +1,7 @@ use lazy_static::*; use crate::trap::TrapContext; use crate::sync::UPSafeCell; +use core::arch::asm; const USER_STACK_SIZE: usize = 4096 * 2; const KERNEL_STACK_SIZE: usize = 4096 * 2; diff --git a/os/src/main.rs b/os/src/main.rs index a01c22f0..2914b924 100644 --- a/os/src/main.rs +++ b/os/src/main.rs @@ -1,7 +1,5 @@ #![no_std] #![no_main] -#![feature(global_asm)] -#![feature(asm)] #![feature(panic_info_message)] #[macro_use] @@ -13,6 +11,8 @@ mod trap; mod batch; mod sync; +use core::arch::global_asm; + global_asm!(include_str!("entry.asm")); global_asm!(include_str!("link_app.S")); diff --git a/os/src/sbi.rs b/os/src/sbi.rs index 935fe24e..52eda4e9 100644 --- a/os/src/sbi.rs +++ b/os/src/sbi.rs @@ -10,6 +10,8 @@ const SBI_REMOTE_SFENCE_VMA: usize = 6; const SBI_REMOTE_SFENCE_VMA_ASID: usize = 7; const SBI_SHUTDOWN: usize = 8; +use core::arch::asm; + #[inline(always)] fn sbi_call(which: usize, arg0: usize, arg1: usize, arg2: usize) -> usize { let mut ret; diff --git a/os/src/trap/mod.rs b/os/src/trap/mod.rs index e42b05fb..4dcab091 100644 --- a/os/src/trap/mod.rs +++ b/os/src/trap/mod.rs @@ -12,6 +12,7 @@ use riscv::register::{ }; use crate::syscall::syscall; use crate::batch::run_next_app; +use core::arch::global_asm; global_asm!(include_str!("trap.S")); diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index fd472758..00000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly-2021-10-15 diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..ee7007df --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +profile = "minimal" +channel = "nightly-2022-07-20" +components = ["rust-src", "llvm-tools-preview", "rustfmt", "clippy"] \ No newline at end of file diff --git a/user/src/bin/bad_address.rs b/user/src/bin/bad_address.rs index 64222bf6..8c25a567 100644 --- a/user/src/bin/bad_address.rs +++ b/user/src/bin/bad_address.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(asm)] extern crate user_lib; diff --git a/user/src/bin/bad_instruction.rs b/user/src/bin/bad_instruction.rs index cdaa171b..275ba2cb 100644 --- a/user/src/bin/bad_instruction.rs +++ b/user/src/bin/bad_instruction.rs @@ -1,6 +1,7 @@ #![no_std] #![no_main] -#![feature(asm)] + +use core::arch::asm; extern crate user_lib; diff --git a/user/src/bin/bad_register.rs b/user/src/bin/bad_register.rs index af1f25af..dd22fc05 100644 --- a/user/src/bin/bad_register.rs +++ b/user/src/bin/bad_register.rs @@ -1,6 +1,7 @@ #![no_std] #![no_main] -#![feature(asm)] + +use core::arch::asm; extern crate user_lib; diff --git a/user/src/bin/hello_world.rs b/user/src/bin/hello_world.rs index a8a3f308..1ebfd5f0 100644 --- a/user/src/bin/hello_world.rs +++ b/user/src/bin/hello_world.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(asm)] #[macro_use] extern crate user_lib; diff --git a/user/src/bin/test1_write0.rs b/user/src/bin/test1_write0.rs index c4a77cca..d58d2cd2 100644 --- a/user/src/bin/test1_write0.rs +++ b/user/src/bin/test1_write0.rs @@ -1,6 +1,7 @@ #![no_std] #![no_main] -#![feature(asm)] + +use core::arch::asm; #[macro_use] extern crate user_lib; diff --git a/user/src/lib.rs b/user/src/lib.rs index a1eda04f..b756b45b 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)] #![feature(alloc_error_handler)] diff --git a/user/src/syscall.rs b/user/src/syscall.rs index 7aaa584e..c1721519 100644 --- a/user/src/syscall.rs +++ b/user/src/syscall.rs @@ -1,5 +1,5 @@ use super::{Stat, TimeVal}; - +use core::arch::asm; pub const SYSCALL_OPENAT: usize = 56; pub const SYSCALL_CLOSE: usize = 57; pub const SYSCALL_READ: usize = 63;