kunlun1和kunlun3 适配 riscv gcc 15版本

This commit is contained in:
2024-11-03 11:22:45 +08:00
parent ff1d8f698a
commit 31698d0808
8 changed files with 42 additions and 3 deletions

View File

@@ -178,7 +178,12 @@ void exception_handler_3(uintptr_t mcause, uintptr_t epc, saved_registers *reg)
//disble global interrupt;
__asm volatile ( "csrc mstatus,8" );
// 在mbadaddr寄存器写入值 gcc 15 中这个寄存器名称改了
#if __GNUC__ <= 10
__asm volatile ( "csrr %0, mbadaddr" : "=r"(mbadaddr));
#else
__asm volatile ( "csrr %0, mtval" : "=r"(mbadaddr));
#endif
switch(mcause) {
case 0x0: