Skip to content

Commit

Permalink
feat: add display csr when turn on RV_SMRNMI.
Browse files Browse the repository at this point in the history
Display mnstatus, mncause, mnepc when turn on RISC-V
Resumable NonMaskable Interrupts Extension.
  • Loading branch information
NewPaulWalker authored and huxuan0307 committed Nov 4, 2024
1 parent 220a5aa commit fce68dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/isa/riscv64/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ void isa_reg_display() {
#endif // CONFIG_FPU_NONE
printf("pc: " FMT_WORD " mstatus: " FMT_WORD " mcause: " FMT_WORD " mepc: " FMT_WORD "\n",
cpu.pc, cpu.mstatus, mcause->val, mepc->val);
#ifdef CONFIG_RV_SMRNMI
printf("%22s mnstatus: " FMT_WORD " mncause: " FMT_WORD " mnepc: " FMT_WORD "\n",
"", mnstatus->val, mncause->val, mnepc->val);
#endif // CONFIG_RV_SMRNMI
printf("%22s sstatus: " FMT_WORD " scause: " FMT_WORD " sepc: " FMT_WORD "\n",
"", cpu.sstatus, scause->val, sepc->val);
printf("satp: " FMT_WORD "\n", satp->val);
Expand Down

0 comments on commit fce68dc

Please sign in to comment.