x86: remove dynamic interrupts and exceptions
Change-Id: I7e9756e9a0735a7d8257ee2142d5759e883e12cc Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
05e3d7f893
commit
c545e19a00
19 changed files with 103 additions and 1393 deletions
|
@ -30,77 +30,6 @@
|
|||
#include <irq.h>
|
||||
|
||||
|
||||
/* forward declarations */
|
||||
|
||||
static int __LocalIntVecAlloc(unsigned int irq, unsigned int priority);
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Allocate interrupt vector
|
||||
*
|
||||
* This routine is used by the x86's irq_connect_dynamic(). It performs the
|
||||
* following functions:
|
||||
*
|
||||
* a) Allocates a vector satisfying the requested priority. The utility
|
||||
* routine _IntVecAlloc() provided by the nanokernel will be used to
|
||||
* perform the the allocation since the local APIC prioritizes interrupts
|
||||
* as assumed by _IntVecAlloc().
|
||||
* b) If an interrupt vector can be allocated, the IOAPIC redirection table
|
||||
* (RED) or the LOAPIC local vector table (LVT) will be updated with the
|
||||
* allocated interrupt vector.
|
||||
*
|
||||
* The board virtualizes IRQs as follows:
|
||||
*
|
||||
* - The first CONFIG_IOAPIC_NUM_RTES IRQs are provided by the IOAPIC
|
||||
* - The remaining IRQs are provided by the LOAPIC.
|
||||
*
|
||||
* Thus, for example, if the IOAPIC supports 24 IRQs:
|
||||
*
|
||||
* - IRQ0 to IRQ23 map to IOAPIC IRQ0 to IRQ23
|
||||
* - IRQ24 to IRQ29 map to LOAPIC LVT entries as follows:
|
||||
*
|
||||
* IRQ24 -> LOAPIC_TIMER
|
||||
* IRQ25 -> LOAPIC_THERMAL
|
||||
* IRQ26 -> LOAPIC_PMC
|
||||
* IRQ27 -> LOAPIC_LINT0
|
||||
* IRQ28 -> LOAPIC_LINT1
|
||||
* IRQ29 -> LOAPIC_ERROR
|
||||
*
|
||||
* @param irq virtualized IRQ
|
||||
* @param priority get vector from <priority> group
|
||||
* @param flags Interrupt flags
|
||||
*
|
||||
* @return the allocated interrupt vector
|
||||
*
|
||||
* @internal
|
||||
* For debug kernels, this routine will return -1 if there are no vectors
|
||||
* remaining in the specified <priority> level, or if the <priority> or <irq>
|
||||
* parameters are invalid.
|
||||
* @endinternal
|
||||
*/
|
||||
int _SysIntVecAlloc(
|
||||
unsigned int irq, /* virtualized IRQ */
|
||||
unsigned int priority, /* get vector from <priority> group */
|
||||
uint32_t flags /* interrupt flags */
|
||||
)
|
||||
{
|
||||
int vector;
|
||||
|
||||
__ASSERT(priority < 14, "invalid priority");
|
||||
__ASSERT(irq >= 0 && irq <= HARDWARE_IRQ_LIMIT, "invalid irq line");
|
||||
|
||||
vector = __LocalIntVecAlloc(irq, priority);
|
||||
|
||||
/*
|
||||
* Set up the appropriate interrupt controller to generate the allocated
|
||||
* interrupt vector for the specified IRQ
|
||||
*/
|
||||
__ASSERT(vector != -1, "bad vector id");
|
||||
_SysIntVecProgram(vector, irq, flags);
|
||||
|
||||
return vector;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Program interrupt controller
|
||||
|
@ -130,13 +59,6 @@ void _SysIntVecProgram(unsigned int vector, unsigned int irq, uint32_t flags)
|
|||
} else {
|
||||
_loapic_int_vec_set(irq - LOAPIC_IRQ_BASE, vector);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_MVIC
|
||||
#if (ALL_DYN_IRQ_STUBS > 0) && defined(CONFIG_DEVICE_POWER_MANAGEMENT)
|
||||
_irq_to_interrupt_vector[irq] = vector;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -185,54 +107,3 @@ void _arch_irq_disable(unsigned int irq)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef FIXED_HARDWARE_IRQ_TO_VEC_MAPPING
|
||||
static inline int handle_fixed_mapping(int irq, int *vector)
|
||||
{
|
||||
/*
|
||||
* On this board Hardware IRQs are fixed and not programmable.
|
||||
*/
|
||||
*vector = FIXED_HARDWARE_IRQ_TO_VEC_MAPPING(irq);
|
||||
|
||||
/* mark vector as allocated */
|
||||
_IntVecMarkAllocated(*vector);
|
||||
|
||||
return *vector;
|
||||
}
|
||||
#else
|
||||
static inline int handle_fixed_mapping(int irq, int *vector)
|
||||
{
|
||||
ARG_UNUSED(irq);
|
||||
ARG_UNUSED(vector);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Local allocate interrupt vector.
|
||||
*
|
||||
* @returns The allocated interrupt vector
|
||||
*
|
||||
*/
|
||||
static int __LocalIntVecAlloc(
|
||||
unsigned int irq, /* virtualized IRQ */
|
||||
unsigned int priority /* get vector from <priority> group */
|
||||
)
|
||||
{
|
||||
int vector;
|
||||
|
||||
if (handle_fixed_mapping(irq, &vector)) {
|
||||
return vector;
|
||||
}
|
||||
|
||||
/*
|
||||
* Use the nanokernel utility function _IntVecAlloc(). A value of
|
||||
* -1 will be returned if there are no free vectors in the requested
|
||||
* priority.
|
||||
*/
|
||||
|
||||
vector = _IntVecAlloc(priority);
|
||||
__ASSERT(vector != -1, "No free vectors in the requested priority");
|
||||
|
||||
return vector;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue