/* Check if a riscv PLIC-specific interrupt line is enabled. 
This routine checks if a RISCV PLIC-specific interrupt line is enabled.  */
int riscv_plic_irq_is_enabled(uint32_t irq)
/* Check if a riscv PLIC-specific interrupt line is enabled. 
This routine checks if a RISCV PLIC-specific interrupt line is enabled.  */
int riscv_plic_irq_is_enabled(uint32_t irq)
{
	const struct device *dev = get_plic_dev_from_irq(irq);
	const struct plic_config *config = dev->config;
	const uint32_t local_irq = irq_from_level_2(irq);
	mem_addr_t en_addr = config->irq_en + local_irq_to_reg_offset(local_irq);
	uint32_t en_value;
	en_value = sys_read32(en_addr);
	en_value &= BIT(local_irq & PLIC_REG_MASK);
	return !!en_value;
}