22
33#![ crate_name = "cortexm" ]
44#![ crate_type = "rlib" ]
5- #![ feature( asm , asm_sym) ]
5+ #![ feature( asm_sym) ]
66#![ feature( naked_functions) ]
77#![ no_std]
88
@@ -40,6 +40,7 @@ extern "C" {
4040) ) ]
4141#[ naked]
4242pub unsafe extern "C" fn systick_handler_arm_v7m ( ) {
43+ use core:: arch:: asm;
4344 asm ! (
4445 "
4546 // Set thread mode to privileged to switch back to kernel mode.
@@ -70,6 +71,7 @@ pub unsafe extern "C" fn systick_handler_arm_v7m() {
7071) ) ]
7172#[ naked]
7273pub unsafe extern "C" fn svc_handler_arm_v7m ( ) {
74+ use core:: arch:: asm;
7375 asm ! (
7476 "
7577 // First check to see which direction we are going in. If the link register
@@ -132,6 +134,7 @@ pub unsafe extern "C" fn svc_handler_arm_v7m() {
132134) ) ]
133135#[ naked]
134136pub unsafe extern "C" fn generic_isr_arm_v7m ( ) {
137+ use core:: arch:: asm;
135138 asm ! (
136139 "
137140 // Set thread mode to privileged to ensure we are executing as the kernel.
@@ -209,6 +212,7 @@ pub unsafe extern "C" fn generic_isr_arm_v7m() {
209212
210213#[ cfg( all( target_arch = "arm" , target_os = "none" ) ) ]
211214pub unsafe extern "C" fn unhandled_interrupt ( ) {
215+ use core:: arch:: asm;
212216 let mut interrupt_number: u32 ;
213217
214218 // IPSR[8:0] holds the currently active interrupt
@@ -232,6 +236,7 @@ pub unsafe extern "C" fn unhandled_interrupt() {
232236#[ cfg( all( target_arch = "arm" , target_os = "none" ) ) ]
233237#[ naked]
234238pub unsafe extern "C" fn initialize_ram_jump_to_main ( ) {
239+ use core:: arch:: asm;
235240 asm ! (
236241 "
237242 // Start by initializing .bss memory. The Tock linker script defines
@@ -298,6 +303,7 @@ pub unsafe extern "C" fn switch_to_user_arm_v7m(
298303 mut user_stack : * const usize ,
299304 process_regs : & mut [ usize ; 8 ] ,
300305) -> * const usize {
306+ use core:: arch:: asm;
301307 asm ! (
302308 "
303309 // Rust `asm!()` macro (as of May 2021) will not let us mark r6, r7 and r9
@@ -514,6 +520,7 @@ unsafe extern "C" fn hard_fault_handler_arm_v7m_continued(
514520 kernel_stack : u32 ,
515521 stack_overflow : u32 ,
516522) {
523+ use core:: arch:: asm;
517524 if kernel_stack != 0 {
518525 if stack_overflow != 0 {
519526 // Panic to show the correct error.
@@ -570,6 +577,7 @@ unsafe extern "C" fn hard_fault_handler_arm_v7m_continued(
570577) ) ]
571578#[ naked]
572579pub unsafe extern "C" fn hard_fault_handler_arm_v7m ( ) {
580+ use core:: arch:: asm;
573581 // First need to determine if this a kernel fault or a userspace fault, and store
574582 // the unmodified stack pointer. Place these values in registers, then call
575583 // a non-naked function, to allow for use of rust code alongside inline asm.
0 commit comments