mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
kernel: riscv: print out allocated address
This will aid in debugging. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
05464b945b
commit
b16ad82e56
1 changed files with 4 additions and 2 deletions
|
|
@ -122,8 +122,8 @@ pub extern "C" fn trap_handler(
|
||||||
match ex {
|
match ex {
|
||||||
RiscvException::StorePageFault(pc, addr) | RiscvException::LoadPageFault(pc, addr) => {
|
RiscvException::StorePageFault(pc, addr) | RiscvException::LoadPageFault(pc, addr) => {
|
||||||
#[cfg(any(feature = "debug-print", feature = "print-panics"))]
|
#[cfg(any(feature = "debug-print", feature = "print-panics"))]
|
||||||
println!(
|
print!(
|
||||||
"KERNEL({}): RISC-V fault: {} @ {:08x}, addr {:08x}",
|
"KERNEL({}): RISC-V fault: {} @ {:08x}, addr {:08x} - ",
|
||||||
pid, ex, pc, addr
|
pid, ex, pc, addr
|
||||||
);
|
);
|
||||||
let virt = addr & !0xfff;
|
let virt = addr & !0xfff;
|
||||||
|
|
@ -164,6 +164,7 @@ pub extern "C" fn trap_handler(
|
||||||
flush_mmu();
|
flush_mmu();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
println!("Handing page {:08x} to process", new_page);
|
||||||
ArchProcess::with_current_mut(|process| {
|
ArchProcess::with_current_mut(|process| {
|
||||||
crate::arch::syscall::resume(
|
crate::arch::syscall::resume(
|
||||||
current_pid().get() == 1,
|
current_pid().get() == 1,
|
||||||
|
|
@ -171,6 +172,7 @@ pub extern "C" fn trap_handler(
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
println!("Page was not allocated");
|
||||||
}
|
}
|
||||||
RiscvException::InstructionPageFault(RETURN_FROM_ISR, _offset) => {
|
RiscvException::InstructionPageFault(RETURN_FROM_ISR, _offset) => {
|
||||||
// If we hit this address, then an ISR has just returned. Since
|
// If we hit this address, then an ISR has just returned. Since
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue