diff options
author | 2023-06-16 11:46:56 +0200 | |
---|---|---|
committer | 2023-06-16 11:46:56 +0200 | |
commit | 54877baa685c63f085cc50adc251bb3af5bdfb2b (patch) | |
tree | 366a9bffc89330b23f69c439d372ed6d6bba0ca8 /cortex-m-rt/src | |
parent | 36419ff47e31c4d2bfce23569e070f1bd123c678 (diff) | |
download | cortex-m-54877baa685c63f085cc50adc251bb3af5bdfb2b.tar.gz cortex-m-54877baa685c63f085cc50adc251bb3af5bdfb2b.tar.zst cortex-m-54877baa685c63f085cc50adc251bb3af5bdfb2b.zip |
Removed the feature flag and moved the trampoline into the macro
Diffstat (limited to 'cortex-m-rt/src')
-rw-r--r-- | cortex-m-rt/src/lib.rs | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs index a39d32a..6456a5e 100644 --- a/cortex-m-rt/src/lib.rs +++ b/cortex-m-rt/src/lib.rs @@ -455,31 +455,6 @@ extern crate cortex_m_rt_macros as macros; use core::arch::global_asm; use core::fmt; -// HardFault exceptions are bounced through this trampoline which grabs the stack pointer at -// the time of the exception and passes it to the user's HardFault handler in r0. -// Depending on the stack mode in EXC_RETURN, fetches stack from either MSP or PSP. -#[cfg(all(cortex_m, feature = "hardfault-trampoline"))] -global_asm!( - ".cfi_sections .debug_frame - .section .HardFaultTrampoline, \"ax\" - .global HardFaultTrampline - .type HardFaultTrampline,%function - .thumb_func - .cfi_startproc - HardFaultTrampoline:", - "mov r0, lr - movs r1, #4 - tst r0, r1 - bne 0f - mrs r0, MSP - b HardFault - 0: - mrs r0, PSP - b HardFault", - ".cfi_endproc - .size HardFaultTrampoline, . - HardFaultTrampoline", -); - /// Parse cfg attributes inside a global_asm call. #[cfg(cortex_m)] macro_rules! cfg_global_asm { @@ -1058,19 +1033,8 @@ pub fn heap_start() -> *mut u32 { #[no_mangle] pub static __RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset; -#[allow(unused_variables)] #[doc(hidden)] #[cfg_attr(cortex_m, link_section = ".HardFault.default")] -#[cfg(feature = "hardfault-trampoline")] -#[no_mangle] -pub unsafe extern "C" fn HardFault_(ef: &ExceptionFrame) -> ! { - #[allow(clippy::empty_loop)] - loop {} -} - -#[doc(hidden)] -#[cfg_attr(cortex_m, link_section = ".HardFault.default")] -#[cfg(not(feature = "hardfault-trampoline"))] #[no_mangle] pub unsafe extern "C" fn HardFault_() -> ! { #[allow(clippy::empty_loop)] @@ -1125,9 +1089,6 @@ extern "C" { fn NonMaskableInt(); - #[cfg(feature = "hardfault-trampoline")] - fn HardFaultTrampoline(); - #[cfg(not(feature = "hardfault-trampoline"))] fn HardFault(); #[cfg(not(armv6m))] @@ -1167,11 +1128,6 @@ pub static __EXCEPTIONS: [Vector; 14] = [ handler: NonMaskableInt, }, // Exception 3: Hard Fault Interrupt. - #[cfg(feature = "hardfault-trampoline")] - Vector { - handler: HardFaultTrampoline, - }, - #[cfg(not(feature = "hardfault-trampoline"))] Vector { handler: HardFault }, // Exception 4: Memory Management Interrupt [not on Cortex-M0 variants]. #[cfg(not(armv6m))] |