Skip to content

Commit

Permalink
risc-v: support handle_SysDebugSendIPI()
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Heider <[email protected]>
  • Loading branch information
axel-h committed Jun 7, 2023
1 parent 2c5c3b1 commit 37927f3
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/smp/ipi.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,24 +149,36 @@ void generic_ipi_send_mask(irq_t ipi, word_t mask, bool_t isBlocking)
#ifdef CONFIG_DEBUG_BUILD
exception_t handle_SysDebugSendIPI(void)
{
#ifdef CONFIG_ARCH_ARM
word_t target = getRegister(NODE_STATE(ksCurThread), capRegister);

#if defined(CONFIG_ARCH_ARM) || defined(CONFIG_ARCH_RISCV)

word_t irq = getRegister(NODE_STATE(ksCurThread), msgInfoRegister);
word_t target = getRegister(NODE_STATE(ksCurThread), capRegister);
if (target > CONFIG_MAX_NUM_NODES) {
userError("SysDebugSendIPI: Invalid target, halting");
halt();
}

#if defined(CONFIG_ARCH_ARM)
if (irq > 15) {
userError("SysDebugSendIPI: Invalid IRQ, not a SGI, halting");
halt();
}
ipi_send_target(CORE_IRQ_TO_IRQT(0, irq), BIT(target));
irq = CORE_IRQ_TO_IRQT(0, irq);
#endif

ipi_send_target(irq, BIT(target));
return EXCEPTION_NONE;
#else /* not CONFIG_ARCH_ARM */

#else /* CONFIG_ARCH_??? */

userError("SysDebugSendIPI: not supported on this architecture");
halt();
#endif /* [not] CONFIG_ARCH_ARM */

#endif /* CONFIG_ARCH_xxx */

}

#endif /* CONFIG_DEBUG_BUILD */

#endif /* ENABLE_SMP_SUPPORT */

0 comments on commit 37927f3

Please sign in to comment.