riscv: Do not remove ESF when SOC_ISR_SW_UNSTACKING
When CONFIG_SOC_ISR_SW_UNSTACKING is defined, it's up to the custom soc
code to remove the ESF, because the software-managed part of the ESF is
depending on the hardware. Fix this in the ISR code.
@@ -659,7 +659,6 @@ fp_trap_exit:
#else
/* Restore caller-saved registers from thread stack */
DO_CALLER_SAVED(lr)
-#endif /* CONFIG_RISCV_SOC_HAS_ISR_STACKING */
#ifdef CONFIG_USERSPACE
/* retrieve saved stack pointer */
@@ -669,4 +668,6 @@ fp_trap_exit:
addi sp, sp, __z_arch_esf_t_SIZEOF
#endif
+#endif /* CONFIG_RISCV_SOC_HAS_ISR_STACKING */
+
mret
