From 45d62be444cbf86df8f15dee1e5ed4e63bcd2046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Mon, 18 Aug 2025 12:14:14 +0200 Subject: [PATCH] fix(riscv): don't split stateful assembly directives across global_asm instances Relying on stateful directives to persist across inline assembly instances is forbidden: https://doc.rust-lang.org/reference/inline-assembly.html#r-asm.directives.stateful --- src/arch/riscv/trap.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arch/riscv/trap.rs b/src/arch/riscv/trap.rs index 54f58c8..5a5fc68 100644 --- a/src/arch/riscv/trap.rs +++ b/src/arch/riscv/trap.rs @@ -10,7 +10,8 @@ global_asm!( .macro STORE_SP a1, a2 sw \a1, \a2*XLENB(sp) .endm -" +", + include_str!("trap.S") ); #[cfg(target_arch = "riscv64")] global_asm!( @@ -22,11 +23,10 @@ global_asm!( .macro STORE_SP a1, a2 sd \a1, \a2*XLENB(sp) .endm -" +", + include_str!("trap.S") ); -global_asm!(include_str!("trap.S")); - /// Initialize interrupt handling for the current HART. /// /// # Safety