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 May 21, 2022
1 parent d18f752 commit 633a7d3
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/smp/ipi.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,24 +148,41 @@ 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

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

word_t target = getRegister(NODE_STATE(ksCurThread), capRegister);
word_t irq = getRegister(NODE_STATE(ksCurThread), msgInfoRegister);
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));
return EXCEPTION_NONE;

#else /* not CONFIG_ARCH_ARM */

ipi_send_target(ipi, BIT(target));

#endif /* [not] CONFIG_ARCH_ARM */

return EXCEPTION_NONE;

#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 633a7d3

Please sign in to comment.