Skip to content

Commit 0f27d58

Browse files
authored
Merge pull request #11 from rcore-os/update-toolchain
fix examples and publish as v0.9.0
2 parents 61599d3 + 8a0305b commit 0f27d58

File tree

14 files changed

+26
-33
lines changed

14 files changed

+26
-33
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions-rs/toolchain@v1
1212
with:
1313
profile: minimal
14-
toolchain: nightly
14+
toolchain: nightly-2022-01-20
1515
override: true
1616
components: rustfmt, clippy
1717
- name: Check code format
@@ -38,7 +38,7 @@ jobs:
3838
- uses: actions-rs/toolchain@v1
3939
with:
4040
profile: minimal
41-
toolchain: nightly
41+
toolchain: nightly-2022-01-20
4242
target: ${{ matrix.target }}
4343
components: clippy
4444
- name: Build
@@ -64,7 +64,7 @@ jobs:
6464
- uses: actions-rs/toolchain@v1
6565
with:
6666
profile: minimal
67-
toolchain: nightly
67+
toolchain: nightly-2022-01-20
6868
components: rust-src
6969
- name: Build
7070
uses: actions-rs/cargo@v1
@@ -88,7 +88,7 @@ jobs:
8888
- uses: actions-rs/toolchain@v1
8989
with:
9090
profile: minimal
91-
toolchain: nightly
91+
toolchain: nightly-2022-01-20
9292
override: true
9393
- name: Test
9494
uses: actions-rs/cargo@v1
@@ -104,7 +104,7 @@ jobs:
104104
- uses: actions-rs/toolchain@v1
105105
with:
106106
profile: minimal
107-
toolchain: nightly
107+
toolchain: nightly-2022-01-20
108108
target: aarch64-unknown-linux-gnu
109109
override: true
110110
- uses: actions-rs/cargo@v1

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.9.0] - 2022-02-26
9+
10+
- **[Breaking]** Fix dependencies and asm macros for new nightly.
11+
812
## [0.8.0] - 2021-07-26
913

1014
- **[Breaking]** Fix dependencies for new nightly.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
22
name = "trapframe"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
authors = [
55
"Runji Wang <[email protected]>",
66
"Jiajie Chen <[email protected]>",
77
"Hoblovski <[email protected]>",
88
"Ben Pig Chu <[email protected]>",
99
]
10-
edition = "2018"
10+
edition = "2021"
1111
description = "Handle Trap Frame across kernel and user space on multiple ISAs."
1212
homepage = "https://github.com/rcore-os/trapframe-rs"
1313
documentation = "https://docs.rs/trapframe"
@@ -23,8 +23,8 @@ exclude = ["docs", ".idea"]
2323
[dependencies]
2424

2525
[target.'cfg(target_arch = "x86_64")'.dependencies]
26-
x86_64 = "0.14"
27-
raw-cpuid = "9.0"
26+
x86_64 = "0.14.8"
27+
raw-cpuid = "10"
2828

2929
[features]
3030
default = []

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ Handle Trap Frame across kernel and user space on multiple ISAs.
88

99
Supported ISA: x86_64, aarch64, riscv32, riscv64, mipsel
1010

11-
## info
12-
- Ver 0.8.0 was tested for x86_64 ISA by rustc 1.55+ nightly
13-
1411
## Example
1512

1613
### Go to user space

build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ fn gen_vector_asm() -> Result<()> {
1414

1515
writeln!(f, "# generated by build.rs - do not edit")?;
1616
writeln!(f, ".section .text")?;
17-
writeln!(f, ".intel_syntax noprefix")?;
1817
for i in 0..256 {
1918
writeln!(f, "vector{}:", i)?;
20-
if !(i == 8 || (i >= 10 && i <= 14) || i == 17) {
19+
if !(i == 8 || (10..=14).contains(&i) || i == 17) {
2120
writeln!(f, "\tpush 0")?;
2221
}
2322
writeln!(f, "\tpush {}", i)?;

examples/riscv/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ edition = "2018"
88

99
[dependencies]
1010
log = "0.4"
11-
riscv = "0.5"
12-
opensbi-rt = { git = "https://github.com/rcore-os/opensbi-rt.git", rev = "52f0041" }
11+
riscv = "0.7"
12+
opensbi-rt = { git = "https://github.com/rcore-os/opensbi-rt.git", rev = "abdfeb7" }
1313
trapframe = { path = "../.." }

examples/riscv/src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#![no_std]
22
#![no_main]
3-
#![feature(asm)]
43

54
#[macro_use]
65
extern crate opensbi_rt;
76

8-
use riscv::register::scause::{Exception as E, Scause, Trap};
7+
use riscv::register::scause::{Exception as E, Trap};
98
use riscv::register::{scause, stval};
109
use trapframe::{GeneralRegs, TrapFrame, UserContext};
1110
use core::arch::asm;
@@ -92,5 +91,5 @@ extern "C" fn trap_handler(tf: &mut TrapFrame) {
9291
}
9392

9493
unsafe extern "C" fn user_entry() {
95-
opensbi_rt::sbi::console_putchar(1);
94+
opensbi_rt::sbi::legacy::console_putchar(1);
9695
}

examples/uefi/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2018"
88

99
[dependencies]
1010
log = "0.4"
11-
x86_64 = "0.13"
12-
uefi = "0.7"
13-
uefi-services = "0.4"
11+
x86_64 = "0.14"
12+
uefi = "0.14"
13+
uefi-services = "0.11"
1414
trapframe = { path = "../.." }

examples/uefi/rust-toolchain

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/uefi/src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
#![no_std]
22
#![no_main]
3-
#![feature(asm)]
43
#![feature(abi_efiapi)]
54
#![feature(core_intrinsics)]
65
#![feature(naked_functions)]
76
#![deny(warnings)]
87

98
extern crate alloc;
109

10+
use core::arch::asm;
1111
use core::intrinsics::breakpoint;
1212
use log::*;
1313
use trapframe::{GeneralRegs, TrapFrame, UserContext};
1414
use uefi::prelude::*;
1515
use x86_64::registers::control::*;
1616
use x86_64::structures::paging::{PageTable, PageTableFlags};
17-
use core::arch::asm;
1817

1918
#[entry]
20-
fn efi_main(_image: Handle, st: SystemTable<Boot>) -> uefi::Status {
21-
uefi_services::init(&st).expect_success("Failed to initialize utilities");
19+
fn efi_main(_image: Handle, mut st: SystemTable<Boot>) -> uefi::Status {
20+
uefi_services::init(&mut st).expect_success("Failed to initialize utilities");
2221
check_and_set_cpu_features();
2322
allow_user_access(user_entry as usize);
2423
unsafe {

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly
1+
nightly-2022-01-20

src/arch/x86_64/syscall.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.intel_syntax noprefix
2-
31
.text
42
# extern "sysv64" fn syscall_return(&mut GeneralRegs)
53
.global syscall_return

src/arch/x86_64/syscall.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn init() {
1111
unsafe {
1212
// enable `syscall` instruction
1313
assert!(cpuid
14-
.get_extended_function_info()
14+
.get_extended_processor_and_feature_identifiers()
1515
.unwrap()
1616
.has_syscall_sysret());
1717
Efer::update(|efer| {

src/arch/x86_64/trap.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.intel_syntax noprefix
2-
31
.text
42
.global __alltraps
53
__alltraps:

0 commit comments

Comments
 (0)