mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-08 04:56:43 +00:00
kernel: riscv: print processes from tid #0
Start numbering threads from index 0. This matches up with what the rest of the system uses. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
8c82736524
commit
7f7142d948
2 changed files with 5 additions and 2 deletions
|
|
@ -132,7 +132,10 @@ pub extern "C" fn trap_handler(
|
|||
&& sstatus::read().spp() == sstatus::SPP::Supervisor
|
||||
&& sc.bits() == 0xf
|
||||
{
|
||||
panic!("Ran out of kernel stack");
|
||||
let pid = current_pid();
|
||||
let ex = RiscvException::from_regs(sc.bits(), sepc::read(), stval::read());
|
||||
print!("KERNEL({}): RISC-V fault: {} - ", pid, ex);
|
||||
panic!("Maybe ran out of kernel stack?");
|
||||
}
|
||||
|
||||
let pid = current_pid();
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ impl Process {
|
|||
pub fn print_all_threads(&self) {
|
||||
let process = unsafe { &mut *PROCESS };
|
||||
for (tid_idx, &thread) in process.threads.iter().enumerate() {
|
||||
let tid = tid_idx + 1;
|
||||
let tid = tid_idx;
|
||||
if thread.registers[1] != 0 {
|
||||
Self::print_thread(tid, &thread);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue