diff options
Diffstat (limited to 'c/src/lib/libcpu/arm/at91rm9200/irq/irq.c')
-rw-r--r-- | c/src/lib/libcpu/arm/at91rm9200/irq/irq.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/c/src/lib/libcpu/arm/at91rm9200/irq/irq.c b/c/src/lib/libcpu/arm/at91rm9200/irq/irq.c index d8255cd233..416c63125b 100644 --- a/c/src/lib/libcpu/arm/at91rm9200/irq/irq.c +++ b/c/src/lib/libcpu/arm/at91rm9200/irq/irq.c @@ -2,7 +2,7 @@ * Atmel AT91RM9200 Interrupt handler * * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com> - * + * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * @@ -34,52 +34,52 @@ static int isValidInterrupt(int irq) int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq) { rtems_interrupt_level level; - + if (!isValidInterrupt(irq->name)) { return 0; } - + /* - * Check if default handler is actually connected. If not, issue - * an error. Note: irq->name is a number corresponding to the - * sources PID (see the at91rm9200_pid for this mapping). We - * convert it to a long word offset to get source's vector register + * Check if default handler is actually connected. If not, issue + * an error. Note: irq->name is a number corresponding to the + * sources PID (see the at91rm9200_pid for this mapping). We + * convert it to a long word offset to get source's vector register */ if (AIC_SVR_REG(irq->name * 4) != (uint32_t) default_int_handler) { return 0; } - + rtems_interrupt_disable(level); - + /* * store the new handler */ AIC_SVR_REG(irq->name * 4) = (uint32_t) irq->hdl; - + /* * unmask interrupt */ AIC_CTL_REG(AIC_IECR) = 1 << irq->name; - + /* * Enable interrupt on device */ if(irq->on) { irq->on(irq); } - + rtems_interrupt_enable(level); - + return 1; } -/* +/* * Remove and interrupt handler */ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq) { rtems_interrupt_level level; - + if (!isValidInterrupt(irq->name)) { return 0; } @@ -96,7 +96,7 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq) * mask interrupt */ AIC_CTL_REG(AIC_IDCR) = 1 << irq->name; - + /* * Disable interrupt on device */ @@ -108,7 +108,7 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq) * restore the default irq value */ AIC_SVR_REG(irq->name * 4) = (uint32_t) default_int_handler; - + rtems_interrupt_enable(level); return 1; |