@@ -426,9 +426,9 @@ fn weak_start_trap(arch: RiscvArch) -> TokenStream {
426426 let ret = "mret" ;
427427
428428 format ! (
429- "
429+ r# "
430430core::arch::global_asm!(
431- \ " .section .trap, \\ \ " ax\ \\"
431+ ".section .trap, \\"ax\\"
432432.align {width}
433433.weak _start_trap
434434_start_trap:
@@ -439,7 +439,7 @@ _start_trap:
439439 {load}
440440 addi sp, sp, {TRAP_SIZE} * {width}
441441 {ret}
442- \ " );"
442+ ");"#
443443 )
444444 . parse ( )
445445 . unwrap ( )
@@ -479,9 +479,9 @@ fn vectored_interrupt_trap(arch: RiscvArch) -> TokenStream {
479479 let ret = "mret" ;
480480
481481 let instructions = format ! (
482- "
482+ r# "
483483core::arch::global_asm!(
484- \ " .section .trap, \\ \ " ax\ \\"
484+ ".section .trap, \\"ax\\"
485485
486486.global _start_DefaultHandler_trap
487487_start_DefaultHandler_trap:
@@ -496,7 +496,7 @@ _continue_interrupt_trap:
496496 {load} // restore trap frame
497497 addi sp, sp, {TRAP_SIZE} * {width} // deallocate space for trap frame
498498 {ret} // return from interrupt
499- \ " );"
499+ ");"#
500500 ) ;
501501
502502 instructions. parse ( ) . unwrap ( )
@@ -584,17 +584,17 @@ fn start_interrupt_trap(ident: &syn::Ident, arch: RiscvArch) -> proc_macro2::Tok
584584 let store = store_trap ( arch, |r| r == "a0" ) ;
585585
586586 let instructions = format ! (
587- "
587+ r# "
588588core::arch::global_asm!(
589- \ " .section .trap, \\ \ " ax\ \\"
589+ ".section .trap, \\"ax\\"
590590 .align 2
591591 .global _start_{interrupt}_trap
592592 _start_{interrupt}_trap:
593593 addi sp, sp, -{TRAP_SIZE} * {width} // allocate space for trap frame
594594 {store} // store trap partially (only register a0)
595595 la a0, {interrupt} // load interrupt handler address into a0
596596 j _continue_interrupt_trap // jump to common part of interrupt trap
597- \ " );"
597+ ");"#
598598 ) ;
599599
600600 instructions. parse ( ) . unwrap ( )
0 commit comments