439
439
440
440
extern crate cortex_m_rt_macros as macros;
441
441
442
- use core:: arch:: global_asm;
443
442
use core:: fmt;
444
- use core:: sync:: atomic:: { self , Ordering } ;
443
+ #[ cfg( cortex_m) ]
444
+ use core:: arch:: global_asm;
445
445
446
446
// HardFault exceptions are bounced through this trampoline which grabs the stack pointer at
447
447
// the time of the exception and passes it to th euser's HardFault handler in r0.
448
448
// Depending on the stack mode in EXC_RETURN, fetches stack from either MSP or PSP.
449
+ #[ cfg( cortex_m) ]
449
450
global_asm ! (
450
451
".cfi_sections .debug_frame
451
452
.section .HardFaultTrampoline, \" ax\"
@@ -468,6 +469,7 @@ global_asm!(
468
469
) ;
469
470
470
471
/// Parse cfg attributes inside a global_asm call.
472
+ #[ cfg( cortex_m) ]
471
473
macro_rules! cfg_global_asm {
472
474
{ @inner, [ $( $x: tt) * ] , } => {
473
475
global_asm!{ $( $x) * }
@@ -490,6 +492,7 @@ macro_rules! cfg_global_asm {
490
492
// Calls an optional user-provided __pre_init and then initialises RAM.
491
493
// If the target has an FPU, it is enabled.
492
494
// Finally jumsp to the user main function.
495
+ #[ cfg( cortex_m) ]
493
496
cfg_global_asm ! {
494
497
".cfi_sections .debug_frame
495
498
.section .Reset, \" ax\"
@@ -1048,12 +1051,14 @@ pub static __RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
1048
1051
#[ cfg_attr( cortex_m, link_section = ".HardFault.default" ) ]
1049
1052
#[ no_mangle]
1050
1053
pub unsafe extern "C" fn HardFault_ ( ef : & ExceptionFrame ) -> ! {
1054
+ #[ allow( clippy:: empty_loop) ]
1051
1055
loop { }
1052
1056
}
1053
1057
1054
1058
#[ doc( hidden) ]
1055
1059
#[ no_mangle]
1056
1060
pub unsafe extern "C" fn DefaultHandler_ ( ) -> ! {
1061
+ #[ allow( clippy:: empty_loop) ]
1057
1062
loop { }
1058
1063
}
1059
1064
0 commit comments