aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dion Dokter <diondokter@gmail.com> 2023-07-21 13:23:49 +0200
committerGravatar Dion Dokter <diondokter@gmail.com> 2023-07-21 13:23:49 +0200
commit3bd46e56e4e4c138cb51900f47280cc991f51702 (patch)
tree92047930a5e269a233dc2f10d9feb5d71974cfb7
parent540d1de34aa69b3ec262b7461c51394ac140418d (diff)
downloadcortex-m-3bd46e56e4e4c138cb51900f47280cc991f51702.tar.gz
cortex-m-3bd46e56e4e4c138cb51900f47280cc991f51702.tar.zst
cortex-m-3bd46e56e4e4c138cb51900f47280cc991f51702.zip
Changed some names around so everything should be called correctly
-rw-r--r--cortex-m-rt/macros/src/lib.rs32
1 files changed, 14 insertions, 18 deletions
diff --git a/cortex-m-rt/macros/src/lib.rs b/cortex-m-rt/macros/src/lib.rs
index cd92b85..80ac665 100644
--- a/cortex-m-rt/macros/src/lib.rs
+++ b/cortex-m-rt/macros/src/lib.rs
@@ -368,11 +368,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
#(#cfgs)*
#(#attrs)*
#[doc(hidden)]
- #[export_name = "HardFault"]
- // Only emit link_section when building for embedded targets,
- // because some hosted platforms (used to check the build)
- // cannot handle the long link section names.
- #[cfg_attr(target_os = "none", link_section = ".HardFault.user")]
+ #[export_name = "HardFaultUser"]
pub unsafe extern "C" fn #tramp_ident(frame: &::cortex_m_rt::ExceptionFrame) {
#ident(frame)
}
@@ -384,23 +380,23 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
// Depending on the stack mode in EXC_RETURN, fetches stack from either MSP or PSP.
core::arch::global_asm!(
".cfi_sections .debug_frame
- .section .HardFaultTrampoline, \"ax\"
- .global HardFaultTrampline
- .type HardFaultTrampline,%function
+ .section .HardFault.user, \"ax\"
+ .global HardFault
+ .type HardFault,%function
.thumb_func
.cfi_startproc
- HardFaultTrampoline:",
- "mov r0, lr
- movs r1, #4
- tst r0, r1
- bne 0f
- mrs r0, MSP
- b HardFault
+ HardFault:",
+ "mov r0, lr
+ movs r1, #4
+ tst r0, r1
+ bne 0f
+ mrs r0, MSP
+ b HardFaultUser
0:
- mrs r0, PSP
- b HardFault",
+ mrs r0, PSP
+ b HardFaultUser",
".cfi_endproc
- .size HardFaultTrampoline, . - HardFaultTrampoline",
+ .size HardFault, . - HardFault",
);
)
} else {