diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cecdb01..b3d4021 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: nightly-2022-01-20 override: true components: rustfmt, clippy - name: Check code format @@ -38,7 +38,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: nightly-2022-01-20 target: ${{ matrix.target }} components: clippy - name: Build @@ -64,7 +64,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: nightly-2022-01-20 components: rust-src - name: Build uses: actions-rs/cargo@v1 @@ -88,7 +88,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: nightly-2022-01-20 override: true - name: Test uses: actions-rs/cargo@v1 @@ -104,7 +104,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: nightly-2022-01-20 target: aarch64-unknown-linux-gnu override: true - uses: actions-rs/cargo@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e34d8e..c94f60e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.9.0] - 2022-02-26 + +- **[Breaking]** Fix dependencies and asm macros for new nightly. + ## [0.8.0] - 2021-07-26 - **[Breaking]** Fix dependencies for new nightly. diff --git a/Cargo.toml b/Cargo.toml index e3f14f5..554edbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "trapframe" -version = "0.8.0" +version = "0.9.0" authors = [ "Runji Wang ", "Jiajie Chen ", "Hoblovski ", "Ben Pig Chu ", ] -edition = "2018" +edition = "2021" description = "Handle Trap Frame across kernel and user space on multiple ISAs." homepage = "https://github.com/rcore-os/trapframe-rs" documentation = "https://docs.rs/trapframe" @@ -23,8 +23,8 @@ exclude = ["docs", ".idea"] [dependencies] [target.'cfg(target_arch = "x86_64")'.dependencies] -x86_64 = "0.14" -raw-cpuid = "9.0" +x86_64 = "0.14.8" +raw-cpuid = "10" [features] default = [] diff --git a/README.md b/README.md index 114ca48..8428c7b 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,6 @@ Handle Trap Frame across kernel and user space on multiple ISAs. Supported ISA: x86_64, aarch64, riscv32, riscv64, mipsel -## info -- Ver 0.8.0 was tested for x86_64 ISA by rustc 1.55+ nightly - ## Example ### Go to user space diff --git a/build.rs b/build.rs index a722224..8569fd7 100644 --- a/build.rs +++ b/build.rs @@ -14,10 +14,9 @@ fn gen_vector_asm() -> Result<()> { writeln!(f, "# generated by build.rs - do not edit")?; writeln!(f, ".section .text")?; - writeln!(f, ".intel_syntax noprefix")?; for i in 0..256 { writeln!(f, "vector{}:", i)?; - if !(i == 8 || (i >= 10 && i <= 14) || i == 17) { + if !(i == 8 || (10..=14).contains(&i) || i == 17) { writeln!(f, "\tpush 0")?; } writeln!(f, "\tpush {}", i)?; diff --git a/examples/riscv/Cargo.toml b/examples/riscv/Cargo.toml index 2a5dec7..ad3a3fb 100644 --- a/examples/riscv/Cargo.toml +++ b/examples/riscv/Cargo.toml @@ -8,6 +8,6 @@ edition = "2018" [dependencies] log = "0.4" -riscv = "0.5" -opensbi-rt = { git = "https://github.com/rcore-os/opensbi-rt.git", rev = "52f0041" } +riscv = "0.7" +opensbi-rt = { git = "https://github.com/rcore-os/opensbi-rt.git", rev = "abdfeb7" } trapframe = { path = "../.." } diff --git a/examples/riscv/src/main.rs b/examples/riscv/src/main.rs index d7c9ddb..79b95e2 100644 --- a/examples/riscv/src/main.rs +++ b/examples/riscv/src/main.rs @@ -1,11 +1,10 @@ #![no_std] #![no_main] -#![feature(asm)] #[macro_use] extern crate opensbi_rt; -use riscv::register::scause::{Exception as E, Scause, Trap}; +use riscv::register::scause::{Exception as E, Trap}; use riscv::register::{scause, stval}; use trapframe::{GeneralRegs, TrapFrame, UserContext}; use core::arch::asm; @@ -92,5 +91,5 @@ extern "C" fn trap_handler(tf: &mut TrapFrame) { } unsafe extern "C" fn user_entry() { - opensbi_rt::sbi::console_putchar(1); + opensbi_rt::sbi::legacy::console_putchar(1); } diff --git a/examples/uefi/Cargo.toml b/examples/uefi/Cargo.toml index cddc83c..1d2f962 100644 --- a/examples/uefi/Cargo.toml +++ b/examples/uefi/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] log = "0.4" -x86_64 = "0.13" -uefi = "0.7" -uefi-services = "0.4" +x86_64 = "0.14" +uefi = "0.14" +uefi-services = "0.11" trapframe = { path = "../.." } diff --git a/examples/uefi/rust-toolchain b/examples/uefi/rust-toolchain deleted file mode 100644 index 194a199..0000000 --- a/examples/uefi/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly-2021-01-01 \ No newline at end of file diff --git a/examples/uefi/src/main.rs b/examples/uefi/src/main.rs index 76266e1..597b543 100644 --- a/examples/uefi/src/main.rs +++ b/examples/uefi/src/main.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(asm)] #![feature(abi_efiapi)] #![feature(core_intrinsics)] #![feature(naked_functions)] @@ -8,17 +7,17 @@ extern crate alloc; +use core::arch::asm; use core::intrinsics::breakpoint; use log::*; use trapframe::{GeneralRegs, TrapFrame, UserContext}; use uefi::prelude::*; use x86_64::registers::control::*; use x86_64::structures::paging::{PageTable, PageTableFlags}; -use core::arch::asm; #[entry] -fn efi_main(_image: Handle, st: SystemTable) -> uefi::Status { - uefi_services::init(&st).expect_success("Failed to initialize utilities"); +fn efi_main(_image: Handle, mut st: SystemTable) -> uefi::Status { + uefi_services::init(&mut st).expect_success("Failed to initialize utilities"); check_and_set_cpu_features(); allow_user_access(user_entry as usize); unsafe { diff --git a/rust-toolchain b/rust-toolchain index 07ade69..12ae469 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly \ No newline at end of file +nightly-2022-01-20 \ No newline at end of file diff --git a/src/arch/x86_64/syscall.S b/src/arch/x86_64/syscall.S index 6b32637..dc96e5b 100644 --- a/src/arch/x86_64/syscall.S +++ b/src/arch/x86_64/syscall.S @@ -1,5 +1,3 @@ -.intel_syntax noprefix - .text # extern "sysv64" fn syscall_return(&mut GeneralRegs) .global syscall_return diff --git a/src/arch/x86_64/syscall.rs b/src/arch/x86_64/syscall.rs index f4ef83d..b2fc6a6 100644 --- a/src/arch/x86_64/syscall.rs +++ b/src/arch/x86_64/syscall.rs @@ -11,7 +11,7 @@ pub fn init() { unsafe { // enable `syscall` instruction assert!(cpuid - .get_extended_function_info() + .get_extended_processor_and_feature_identifiers() .unwrap() .has_syscall_sysret()); Efer::update(|efer| { diff --git a/src/arch/x86_64/trap.S b/src/arch/x86_64/trap.S index d270f8f..91a8227 100644 --- a/src/arch/x86_64/trap.S +++ b/src/arch/x86_64/trap.S @@ -1,5 +1,3 @@ -.intel_syntax noprefix - .text .global __alltraps __alltraps: