Skip to content

Commit

Permalink
Debug Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Jul 28, 2023
1 parent a3f4121 commit 2979e5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/risc-v/src/qemu-rv/qemu_rv_irq_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@

void *riscv_dispatch_irq(uintptr_t vector, uintptr_t *regs)
{
*(volatile uint8_t *)0x10000000 = '%';////
int irq = (vector >> RV_IRQ_MASK) | (vector & 0xf);

/* Firstly, check if the irq is machine external interrupt */

if (RISCV_IRQ_EXT == irq)
{
*(volatile uint8_t *)0x10000000 = '^';////
uintptr_t val = getreg32(QEMU_RV_PLIC_CLAIM);

/* Add the value to nuttx irq which is offset to the mext */
Expand All @@ -72,13 +74,15 @@ void *riscv_dispatch_irq(uintptr_t vector, uintptr_t *regs)

if (RISCV_IRQ_EXT != irq)
{
*(volatile uint8_t *)0x10000000 = '&';////
/* Deliver the IRQ */

regs = riscv_doirq(irq, regs);
}

if (RISCV_IRQ_EXT <= irq)
{
*(volatile uint8_t *)0x10000000 = '*';////
/* Then write PLIC_CLAIM to clear pending in PLIC */

putreg32(irq - RISCV_IRQ_EXT, QEMU_RV_PLIC_CLAIM);
Expand Down

0 comments on commit 2979e5f

Please sign in to comment.