From 32d5fdc624377ca4f256e30482a42c9d4cef739e Mon Sep 17 00:00:00 2001 From: yvt Date: Sun, 6 Dec 2020 16:38:33 +0900 Subject: [PATCH] fix: don't use `#[naked]` when inlining is paramount for correctness Functions with `#[naked]` are no longer eligible for inlining as of . Fixes test failures in the RISC-V port. --- src/r3_port_arm/src/startup/imp.rs | 1 - src/r3_port_riscv/src/threading/cfg.rs | 1 - src/r3_port_riscv/src/threading/imp.rs | 1 - 3 files changed, 3 deletions(-) diff --git a/src/r3_port_arm/src/startup/imp.rs b/src/r3_port_arm/src/startup/imp.rs index a961a1e71c..8c67c9b163 100644 --- a/src/r3_port_arm/src/startup/imp.rs +++ b/src/r3_port_arm/src/startup/imp.rs @@ -30,7 +30,6 @@ impl VectorTable { } } -#[naked] #[inline(always)] pub fn start() { unsafe { diff --git a/src/r3_port_riscv/src/threading/cfg.rs b/src/r3_port_riscv/src/threading/cfg.rs index 93a9cb3569..ca7b9f4af7 100644 --- a/src/r3_port_riscv/src/threading/cfg.rs +++ b/src/r3_port_riscv/src/threading/cfg.rs @@ -61,7 +61,6 @@ macro_rules! use_port { unsafe { PORT_STATE.port_boot::() }; } - #[naked] #[inline(always)] unsafe fn exception_handler() -> ! { unsafe { State::exception_handler::() }; diff --git a/src/r3_port_riscv/src/threading/imp.rs b/src/r3_port_riscv/src/threading/imp.rs index 0ce1e24926..b2b0d45b69 100644 --- a/src/r3_port_riscv/src/threading/imp.rs +++ b/src/r3_port_riscv/src/threading/imp.rs @@ -1113,7 +1113,6 @@ impl State { } /// Implements [`crate::EntryPoint::exception_handler`]. - #[naked] #[inline(always)] pub unsafe fn exception_handler() -> ! { const FRAME_SIZE: usize = if cfg!(target_feature = "f") {