Skip to content

Commit

Permalink
Merge pull request #11 from rcore-os/update-toolchain
Browse files Browse the repository at this point in the history
fix examples and publish as v0.9.0
  • Loading branch information
jiegec authored Feb 26, 2022
2 parents 61599d3 + 8a0305b commit 0f27d58
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 33 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "trapframe"
version = "0.8.0"
version = "0.9.0"
authors = [
"Runji Wang <wangrunji0408@163.com>",
"Jiajie Chen <c@jia.je>",
"Hoblovski <daizy19@mails.tsinghua.edu.cn>",
"Ben Pig Chu <benpichu@gmail.com>",
]
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"
Expand All @@ -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 = []
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
4 changes: 2 additions & 2 deletions examples/riscv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../.." }
5 changes: 2 additions & 3 deletions examples/riscv/src/main.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
}
6 changes: 3 additions & 3 deletions examples/uefi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../.." }
1 change: 0 additions & 1 deletion examples/uefi/rust-toolchain

This file was deleted.

7 changes: 3 additions & 4 deletions examples/uefi/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
#![no_std]
#![no_main]
#![feature(asm)]
#![feature(abi_efiapi)]
#![feature(core_intrinsics)]
#![feature(naked_functions)]
#![deny(warnings)]

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<Boot>) -> uefi::Status {
uefi_services::init(&st).expect_success("Failed to initialize utilities");
fn efi_main(_image: Handle, mut st: SystemTable<Boot>) -> 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 {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly
nightly-2022-01-20
2 changes: 0 additions & 2 deletions src/arch/x86_64/syscall.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.intel_syntax noprefix

.text
# extern "sysv64" fn syscall_return(&mut GeneralRegs)
.global syscall_return
Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86_64/syscall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
2 changes: 0 additions & 2 deletions src/arch/x86_64/trap.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.intel_syntax noprefix

.text
.global __alltraps
__alltraps:
Expand Down

0 comments on commit 0f27d58

Please sign in to comment.