Changeset 2f8f951b in rtems


Ignore:
Timestamp:
Jan 23, 2017, 1:51:27 PM (4 years ago)
Author:
Kevin Kirspel <kevin-kirspel@…>
Branches:
5, master
Children:
dc9b704
Parents:
c0151e6
git-author:
Kevin Kirspel <kevin-kirspel@…> (01/23/17 13:51:27)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/24/17 06:09:55)
Message:

bsp/lpc32xx: Fix interrupt controller suppport

Enable/Disable? vector routines now check for a valid vector. Without
these guards, the Enable/Disable? vector routines will not work with the
interrupt server.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/lpc32xx/irq/irq.c

    • Property mode changed from 100644 to 100755
    rc0151e6 r2f8f951b  
    268268rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
    269269{
    270   rtems_interrupt_level level;
    271 
    272   rtems_interrupt_disable(level);
    273   lpc32xx_irq_set_bit_in_register(vector, LPC32XX_IRQ_OFFSET_ER);
    274   lpc32xx_irq_set_bit_in_field(vector, &lpc32xx_irq_enable);
    275   rtems_interrupt_enable(level);
     270  if (lpc32xx_irq_is_valid(vector)) {
     271    rtems_interrupt_level level;
     272
     273    rtems_interrupt_disable(level);
     274    lpc32xx_irq_set_bit_in_register(vector, LPC32XX_IRQ_OFFSET_ER);
     275    lpc32xx_irq_set_bit_in_field(vector, &lpc32xx_irq_enable);
     276    rtems_interrupt_enable(level);
     277  }
    276278
    277279  return RTEMS_SUCCESSFUL;
     
    280282rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
    281283{
    282   rtems_interrupt_level level;
    283 
    284   rtems_interrupt_disable(level);
    285   lpc32xx_irq_clear_bit_in_field(vector, &lpc32xx_irq_enable);
    286   lpc32xx_irq_clear_bit_in_register(vector, LPC32XX_IRQ_OFFSET_ER);
    287   rtems_interrupt_enable(level);
     284  if (lpc32xx_irq_is_valid(vector)) {
     285    rtems_interrupt_level level;
     286
     287    rtems_interrupt_disable(level);
     288    lpc32xx_irq_clear_bit_in_field(vector, &lpc32xx_irq_enable);
     289    lpc32xx_irq_clear_bit_in_register(vector, LPC32XX_IRQ_OFFSET_ER);
     290    rtems_interrupt_enable(level);
     291  }
    288292
    289293  return RTEMS_SUCCESSFUL;
Note: See TracChangeset for help on using the changeset viewer.