LM32: Ooops.. last version still in editor
This commit is contained in:
parent
145ee2e6f1
commit
ddd8716189
@ -63,30 +63,47 @@
|
||||
|
||||
uint32_t *lm32_decodeirq(uint32_t *regs)
|
||||
{
|
||||
uint32_t im;
|
||||
uint32_t intstat;
|
||||
int irq;
|
||||
|
||||
/* Read the interrupt acknowledge register and get the interrupt ID */
|
||||
/* Read the pending interrupts */
|
||||
/* REVISIT: How do I get the interupt status */
|
||||
#warning Missing logic
|
||||
intstat = 0;
|
||||
|
||||
im = getreg32(GIC_ICCIAR);
|
||||
irq = (im & GIC_ICCIAR_INTID_MASK) >> GIC_ICCIAR_INTID_SHIFT;
|
||||
/* REVIST: Do I need to mask the interrupt status with the IM? */
|
||||
|
||||
irqinfo("intstat=%08lx\n", (unsigned long)intstat);
|
||||
|
||||
/* Decode and dispatch interrupts */
|
||||
|
||||
for (irq = 0; irq < NR_IRQS & instat != 0; i++)
|
||||
{
|
||||
uint32_t bit = (1 << irq);
|
||||
|
||||
/* Is this interrupt pending? */
|
||||
|
||||
if ((instat & bit) != 0)
|
||||
{
|
||||
/* Yes.. Dispatch the interrupt */
|
||||
/* REVIST: Do I need to acknowledge the interrupt first? */
|
||||
|
||||
irqinfo("irq=%d\n", irq);
|
||||
regs = lm32_doirq(irq, regs);
|
||||
|
||||
/* Ignore spurions IRQs. ICCIAR will report 1023 if there is no pending
|
||||
* interrupt.
|
||||
/* Clear the bit in the interrupt status copy so that maybe we can
|
||||
* break out of the loop early.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(irq < NR_IRQS || irq == 1023);
|
||||
if (irq < NR_IRQS)
|
||||
{
|
||||
/* Dispatch the interrupt */
|
||||
|
||||
regs = lm32_doirq(irq, regs);
|
||||
instat &= ~bit;
|
||||
}
|
||||
}
|
||||
|
||||
/* Write to the end-of-interrupt register */
|
||||
/* Return the final task register save area. This will typically be the
|
||||
* same as the value of regs on input. In the event of a context switch,
|
||||
* however, it will differ. It will refere to the register save are in the
|
||||
* TCB of the new thread.
|
||||
*/
|
||||
|
||||
putreg32(im, GIC_ICCEOIR);
|
||||
return regs;
|
||||
}
|
||||
|
@ -51,22 +51,6 @@
|
||||
#include "group/group.h"
|
||||
#include "lm32.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user