[sw/silicon_creator] Use asm to avoid SP usage in ROM exception handler
Signed-off-by: Alphan Ulusoy <alphan@google.com>
diff --git a/sw/device/silicon_creator/rom/rom.c b/sw/device/silicon_creator/rom/rom.c
index 2c9f0f9..92e1622 100644
--- a/sw/device/silicon_creator/rom/rom.c
+++ b/sw/device/silicon_creator/rom/rom.c
@@ -456,7 +456,11 @@
shutdown_finalize(rom_try_boot());
}
-void rom_interrupt_handler(void) { shutdown_finalize(rom_irq_error()); }
+void rom_interrupt_handler(void) {
+ register rom_error_t error asm("a0") = rom_irq_error();
+ asm volatile("tail shutdown_finalize;" ::"r"(error));
+ OT_UNREACHABLE();
+}
// We only need a single handler for all ROM interrupts, but we want to
// keep distinct symbols to make writing tests easier. In the ROM,