We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a632c52 commit be0a197Copy full SHA for be0a197
arch/riscv/core/fatal.c
@@ -103,15 +103,21 @@ void _Fault(z_arch_esf_t *esf)
103
}
104
105
#endif /* CONFIG_USERSPACE */
106
- ulong_t mcause, mtval;
+ ulong_t mcause;
107
108
__asm__ volatile("csrr %0, mcause" : "=r" (mcause));
109
+
110
+#ifndef CONFIG_SOC_OPENISA_RV32M1_RISCV32
111
+ ulong_t mtval;
112
__asm__ volatile("csrr %0, mtval" : "=r" (mtval));
113
+#endif
114
115
mcause &= SOC_MCAUSE_EXP_MASK;
116
LOG_ERR("");
117
LOG_ERR(" mcause: %ld, %s", mcause, cause_str(mcause));
118
119
LOG_ERR(" mtval: %lx", mtval);
120
121
122
z_riscv_fatal_error(K_ERR_CPU_EXCEPTION, esf);
123
0 commit comments