drivers/interrupt_controller/system_apic.c
/**
 *
 * @brief Program interrupt controller
 *
 * This routine programs the interrupt controller with the given vector
 * based on the given IRQ parameter.
 *
 * Drivers call this routine instead of IRQ_CONNECT() when interrupts are
 * configured statically.
 *
 * The Galileo board virtualizes IRQs as follows:
 *
 * - The first CONFIG_IOAPIC_NUM_RTES IRQs are provided by the IOAPIC so the
 *     IOAPIC is programmed for these IRQs
 * - The remaining IRQs are provided by the LOAPIC and hence the LOAPIC is
 *     programmed.
 *
 * @param vector the vector number
 * @param irq the virtualized IRQ
 * @param flags interrupt flags
 *
 */
@brief Program interrupt controller
This routine programs the interrupt controller with the given vector
based on the given IRQ parameter.

Drivers call this routine instead of IRQ_CONNECT() when interrupts are
configured statically.

The Galileo board virtualizes IRQs as follows.

- The first CONFIG_IOAPIC_NUM_RTES IRQs are provided by the IOAPIC so the
IOAPIC is programmed for these IRQs
- The remaining IRQs are provided by the LOAPIC and hence the LOAPIC is
programmed.

@param vector the vector number
@param irq the virtualized IRQ
@param flags interrupt flags
@brief Program interrupt controller This routine programs the interrupt controller with the given vector based on the given IRQ parameter . Drivers call this routine instead of IRQ_CONNECT () when interrupts are configured statically . The Galileo board virtualizes IRQs as follows . - The first CONFIG_IOAPIC_NUM_RTES IRQs are provided by the IOAPIC so the IOAPIC is programmed for these IRQs - The remaining IRQs are provided by the LOAPIC and hence the LOAPIC is programmed . @param vector the vector number @param irq the virtualized IRQ @param flags interrupt flags
void __irq_controller_irq_config(unsigned int vector, unsigned int irq,
				 u32_t flags)
{
	__ASSERT(irq >= 0 && irq <= HARDWARE_IRQ_LIMIT, "invalid irq line");
	if (IS_IOAPIC_IRQ(irq)) {
		_ioapic_irq_set(irq, vector, flags);
	} else {
		_loapic_int_vec_set(irq - LOAPIC_IRQ_BASE, vector);
	}
}
void __irq_controller_irq_config ( unsigned int vector , unsigned int irq , u32_t flags ) { __ASSERT ( irq >= 0 && irq <= HARDWARE_IRQ_LIMIT , " " ) ; if ( IS_IOAPIC_IRQ ( irq ) ) { _ioapic_irq_set ( irq , vector , flags ) ; } else { _loapic_int_vec_set ( irq - LOAPIC_IRQ_BASE , vector ) ; } }
@brief Program interrupt controller
 This routine programs the interrupt controller with the given vector
 based on the given IRQ parameter.
@brief Program interrupt controller This routine programs the interrupt controller with the given vector based on the given IRQ parameter .