Skip to content

Commit f4e85f6

Browse files
committed
feat: update rust edition to 2024 and change asm! to naked_asm!
1 parent 65bf5df commit f4e85f6

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[workspace]
2+
resolver = "3"
23
members = ["xtask", "fast-trap", "test-app"]
34
default-members = ["xtask"]

fast-trap/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "fast-trap"
33
description = "Provide a framework for bare-metal trap handling, aiming at ensuring performance while reusing code."
44
version = "0.0.1"
5-
edition = "2021"
5+
edition = "2024"
66
authors = ["YdrMaster <ydrml@hotmail.com>"]
77
repository = "https://github.com/YdrMaster/fast-trap.git"
88
documentation = "https://docs.rs/fast-trap"

fast-trap/src/hal/riscv/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,13 @@ impl FlowContext {
111111
#[naked]
112112
pub unsafe extern "C" fn reuse_stack_for_trap() {
113113
const LAYOUT: Layout = Layout::new::<TrapHandler>();
114-
core::arch::asm!(
114+
core::arch::naked_asm!(
115115
" addi sp, sp, {size}
116116
andi sp, sp, {mask}
117117
ret
118118
",
119119
size = const -(LAYOUT.size() as isize),
120120
mask = const !(LAYOUT.align() as isize - 1) ,
121-
options(noreturn)
122121
)
123122
}
124123

@@ -127,7 +126,7 @@ pub unsafe extern "C" fn reuse_stack_for_trap() {
127126
/// See [proto](crate::hal::doc::trap_entry).
128127
#[naked]
129128
pub unsafe extern "C" fn trap_entry() {
130-
core::arch::asm!(
129+
core::arch::naked_asm!(
131130
".align 2",
132131
// 换栈
133132
exchange!(),
@@ -242,6 +241,5 @@ pub unsafe extern "C" fn trap_entry() {
242241
load!(a1[ 9] => a1),
243242
exchange!(),
244243
r#return!(),
245-
options(noreturn),
246244
)
247245
}

test-app/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "test-app"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55
authors = ["YdrMaster <ydrml@hotmail.com>"]
66
publish = false
77

xtask/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "xtask"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
authors = ["YdrMaster <ydrml@hotmail.com>"]
66
publish = false
77

0 commit comments

Comments
 (0)