@@ -426,9 +426,9 @@ fn weak_start_trap(arch: RiscvArch) -> TokenStream {
426
426
let ret = "mret" ;
427
427
428
428
format ! (
429
- "
429
+ r# "
430
430
core::arch::global_asm!(
431
- \ " .section .trap, \\ \ " ax\ \\"
431
+ ".section .trap, \\"ax\\"
432
432
.align {width}
433
433
.weak _start_trap
434
434
_start_trap:
@@ -439,7 +439,7 @@ _start_trap:
439
439
{load}
440
440
addi sp, sp, {TRAP_SIZE} * {width}
441
441
{ret}
442
- \ " );"
442
+ ");"#
443
443
)
444
444
. parse ( )
445
445
. unwrap ( )
@@ -479,9 +479,9 @@ fn vectored_interrupt_trap(arch: RiscvArch) -> TokenStream {
479
479
let ret = "mret" ;
480
480
481
481
let instructions = format ! (
482
- "
482
+ r# "
483
483
core::arch::global_asm!(
484
- \ " .section .trap, \\ \ " ax\ \\"
484
+ ".section .trap, \\"ax\\"
485
485
486
486
.global _start_DefaultHandler_trap
487
487
_start_DefaultHandler_trap:
@@ -496,7 +496,7 @@ _continue_interrupt_trap:
496
496
{load} // restore trap frame
497
497
addi sp, sp, {TRAP_SIZE} * {width} // deallocate space for trap frame
498
498
{ret} // return from interrupt
499
- \ " );"
499
+ ");"#
500
500
) ;
501
501
502
502
instructions. parse ( ) . unwrap ( )
@@ -584,17 +584,17 @@ fn start_interrupt_trap(ident: &syn::Ident, arch: RiscvArch) -> proc_macro2::Tok
584
584
let store = store_trap ( arch, |r| r == "a0" ) ;
585
585
586
586
let instructions = format ! (
587
- "
587
+ r# "
588
588
core::arch::global_asm!(
589
- \ " .section .trap, \\ \ " ax\ \\"
589
+ ".section .trap, \\"ax\\"
590
590
.align 2
591
591
.global _start_{interrupt}_trap
592
592
_start_{interrupt}_trap:
593
593
addi sp, sp, -{TRAP_SIZE} * {width} // allocate space for trap frame
594
594
{store} // store trap partially (only register a0)
595
595
la a0, {interrupt} // load interrupt handler address into a0
596
596
j _continue_interrupt_trap // jump to common part of interrupt trap
597
- \ " );"
597
+ ");"#
598
598
) ;
599
599
600
600
instructions. parse ( ) . unwrap ( )
0 commit comments