base-hw: RISC-V save/restore 'x29' correctly

* register x29/t4 was not saved and therefore not restored correctly
* change 'warning' to 'error' before '_die' is called

issue #2423
This commit is contained in:
Sebastian Sumpf 2017-08-24 16:22:02 +02:00 committed by Christian Helmuth
parent 7113c17100
commit e17accb3ba
2 changed files with 5 additions and 4 deletions

View File

@ -61,7 +61,8 @@ _mt_kernel_entry_pic:
addi x31, x31, 8
# save x30 in master
sd x30, CPU_X1 + 8 * 28(x31)
sd x29, CPU_X1 + 8 * 28(x31)
sd x30, CPU_X1 + 8 * 29(x31)
# load kernel page table
ld x30, CPU_SPTBR(x31)
@ -149,7 +150,7 @@ _mt_user_entry_pic:
sfence.vm x0
# restore x29 - x31 from master context
# restore x29 - x31 from master context
.irp reg,31,30,29
ld x\reg, CPU_X1 + 8 * (\reg - 1)(x29)
.endr

View File

@ -35,8 +35,8 @@ void Thread::exception(unsigned const cpu)
_mmu_exception();
break;
default:
Genode::warning(*this, ": unhandled exception ", cpu_exception,
" at ip=", (void*)ip, " addr=", Cpu::sbadaddr());
Genode::error(*this, ": unhandled exception ", cpu_exception,
" at ip=", (void*)ip, " addr=", Genode::Hex(Cpu::sbadaddr()));
_die();
}
}