Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions arch/arm/include/lpc2378/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ extern "C"
#define EXTERN extern
#endif

#ifndef CONFIG_VECTORED_INTERRUPTS
void up_attach_vector(int irq, int priority, vic_vector_t handler);
void up_detach_vector(int vector);
#endif

#undef EXTERN
#ifdef __cplusplus
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/src/lpc2378/lpc2378.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
* Pre-processor Definitions
****************************************************************************/

/* #define CONFIG_VECTORED_INTERRUPTS */

/****************************************************************************
* Public Function Prototypes
****************************************************************************/
Expand Down
35 changes: 22 additions & 13 deletions arch/arm/src/lpc2378/lpc23xx_decodeirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@
*
****************************************************************************/

#ifndef CONFIG_VECTORED_INTERRUPTS
uint32_t *arm_decodeirq(uint32_t *regs)
#else
static uint32_t *lpc23xx_decodeirq(uint32_t *regs)
#endif
{
struct tcb_s *tcb = this_task();

Expand Down Expand Up @@ -144,22 +140,35 @@ static uint32_t *lpc23xx_decodeirq(uint32_t *regs)
#endif
}

#ifdef CONFIG_VECTORED_INTERRUPTS
uint32_t *arm_decodeirq(uint32_t *regs)
{
vic_vector_t vector = (vic_vector_t) vic_getreg(VIC_ADDRESS_OFFSET);
#ifdef CONFIG_SUPPRESS_INTERRUPTS
err("ERROR: Unexpected IRQ\n");
PANIC();
#else

/* Check which IRQ fires */

/* Acknowledge the interrupt */
uint32_t irqbits = vic_getreg(VIC_IRQSTATUS_OFFSET) & 0xffffffff;
unsigned int irq;

arm_ack_irq(irq);
for (irq = 0; irq < NR_IRQS; irq++)
{
if (irqbits & (uint32_t) (1 << irq))
{
break;
}
}

/* Valid Interrupt */
/* Verify that the resulting IRQ number is valid */

if (vector != NULL)
if (irq < NR_IRQS)
{
(vector)(regs);
/* Deliver the IRQ */

regs = arm_doirq(irq, regs);
}
#endif

return NULL; /* Return not used in this architecture */
return regs;
}
#endif
6 changes: 0 additions & 6 deletions arch/arm/src/lpc2378/lpc23xx_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,7 @@ void arm_ack_irq(int irq)
/* Clear interrupt */

vic_putreg((1 << irq), VIC_SOFTINTCLEAR_OFFSET);
#ifdef CONFIG_VECTORED_INTERRUPTS
vic_putreg(0, VIC_ADDRESS_OFFSET); /* dummy write to clear VICADDRESS */
#endif
}

/****************************************************************************
Expand Down Expand Up @@ -230,7 +228,6 @@ int up_prioritize_irq(int irq, int priority)
*
****************************************************************************/

#ifndef CONFIG_VECTORED_INTERRUPTS
void up_attach_vector(int irq, int vector, vic_vector_t handler)
{
/* Verify that the IRQ number and vector number are within range */
Expand All @@ -255,7 +252,6 @@ void up_attach_vector(int irq, int vector, vic_vector_t handler)
leave_critical_section(flags);
}
}
#endif

/****************************************************************************
* Name: up_detach_vector
Expand All @@ -265,7 +261,6 @@ void up_attach_vector(int irq, int vector, vic_vector_t handler)
*
****************************************************************************/

#ifdef CONFIG_VECTORED_INTERRUPTS
void up_detach_vector(int vector)
{
/* Verify that the vector number is within range */
Expand All @@ -278,4 +273,3 @@ void up_detach_vector(int vector)
vic_putreg(0, (VIC_VECTADDR0_OFFSET + offset));
}
}
#endif
10 changes: 0 additions & 10 deletions arch/arm/src/lpc2378/lpc23xx_timerisr.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@
*
****************************************************************************/

#ifdef CONFIG_VECTORED_INTERRUPTS
static int lpc23xx_timerisr(uint32_t * regs)
#else
static int lpc23xx_timerisr(int irq, uint32_t * regs, void *arg)
#endif
{
static uint32_t tick;

Expand All @@ -109,11 +105,9 @@ static int lpc23xx_timerisr(int irq, uint32_t * regs, void *arg)

/* Reset the VIC as well */

#ifdef CONFIG_VECTORED_INTERRUPTS
/* write any value to VICAddress to acknowledge the interrupt */

vic_putreg(0, VIC_ADDRESS_OFFSET);
#endif

if (tick++ > 100)
{
Expand Down Expand Up @@ -186,11 +180,7 @@ void up_timer_initialize(void)

/* Attach the timer interrupt vector */

#ifdef CONFIG_VECTORED_INTERRUPTS
up_attach_vector(IRQ_SYSTIMER, ???, (vic_vector_t) lpc23xx_timerisr);
#else
irq_attach(IRQ_SYSTIMER, (xcpt_t)lpc23xx_timerisr, NULL);
#endif

/* And enable the system timer interrupt */

Expand Down
Loading