/* DESCRIPTION: Writing the interrupt ID it received from the claim (irq) to the complete register would signal the PLIC we've served this IRQ. The PLIC does not check whether the completion ID is the same as the last claim ID for that target. If the completion ID does not match an interrupt source that is currently enabled for the target, the completion is silently ignored. RETURN VALUE: none  */
void plic_complete(int irq)
/* DESCRIPTION: Writing the interrupt ID it received from the claim (irq) to the complete register would signal the PLIC we've served this IRQ. The PLIC does not check whether the completion ID is the same as the last claim ID for that target. If the completion ID does not match an interrupt source that is currently enabled for the target, the completion is silently ignored. RETURN VALUE: none  */
void plic_complete(int irq)
{
    int hart = __raw_hartid();
    *(uint32_t *)PLIC_COMPLETE(hart) = irq;
}