Skip to content

Commit

Permalink
fix: don't use #[naked] when inlining is paramount for correctness
Browse files Browse the repository at this point in the history
Functions with `#[naked]` are no longer eligible for inlining as of
<rust-lang/rust#79192>.

Fixes test failures in the RISC-V port.
  • Loading branch information
yvt committed Dec 6, 2020
1 parent 72bb293 commit 32d5fdc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/r3_port_arm/src/startup/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ impl VectorTable {
}
}

#[naked]
#[inline(always)]
pub fn start<System: EntryPoint + StartupOptions>() {
unsafe {
Expand Down
1 change: 0 additions & 1 deletion src/r3_port_riscv/src/threading/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ macro_rules! use_port {
unsafe { PORT_STATE.port_boot::<Self>() };
}

#[naked]
#[inline(always)]
unsafe fn exception_handler() -> ! {
unsafe { State::exception_handler::<Self>() };
Expand Down
1 change: 0 additions & 1 deletion src/r3_port_riscv/src/threading/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,6 @@ impl State {
}

/// Implements [`crate::EntryPoint::exception_handler`].
#[naked]
#[inline(always)]
pub unsafe fn exception_handler<System: PortInstance>() -> ! {
const FRAME_SIZE: usize = if cfg!(target_feature = "f") {
Expand Down

0 comments on commit 32d5fdc

Please sign in to comment.