Ignore:
Timestamp:
Sep 12, 2007, 3:16:38 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
fc57b7b2
Parents:
ec1d0b9d
Message:

2007-09-12 Joel Sherrill <joel.sherrill@…>

PR 1257/bsps

  • irq/irq_init.c: Code outside of cpukit should use the public API for rtems_interrupt_disable/rtems_interrupt_enable. By bypassing the public API and directly accessing _CPU_ISR_Disable and _CPU_ISR_Enable, they were bypassing the compiler memory barrier directive which could lead to problems. This patch also changes the type of the variable passed into these routines and addresses minor style issues.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/virtex/irq/irq_init.c

    rec1d0b9d r764b72e  
    144144int BSP_install_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    145145{
    146   unsigned int level;
     146  rtems_interrupt_level level;
     147
    147148  /*
    148149   * check for valid irq name
     
    157158   * disable interrupts
    158159   */
    159   _CPU_ISR_Disable(level);
     160  rtems_interrupt_disable(level);
    160161  /*
    161162   * check, that default handler is installed now
    162163   */
    163164  if (rtemsIrqTbl[irq->name].hdl != BSP_rtems_irq_config->defaultEntry.hdl) {
    164     _CPU_ISR_Enable(level);
     165    rtems_interrupt_enable(level);
    165166    printk("IRQ vector %d already connected\n",irq->name);
    166167    return 0;
     
    184185   * reenable interrupts
    185186   */
    186   _CPU_ISR_Enable(level);
     187  rtems_interrupt_enable(level);
    187188
    188189  return 1;
     
    191192int BSP_get_current_rtems_irq_handler   (rtems_irq_connect_data* irq)
    192193{
    193   unsigned int level;
     194  rtems_interrupt_level level;
    194195 
    195196  /*
     
    199200    return 0;
    200201  }
    201   _CPU_ISR_Disable(level);
     202  rtems_interrupt_disable(level);
    202203  /*
    203204   * return current IRQ entry
    204205   */
    205206  *irq = rtemsIrqTbl[irq->name];
    206   _CPU_ISR_Enable(level);
     207  rtems_interrupt_enable(level);
    207208  return 1;
    208209}
     
    210211int BSP_remove_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    211212{
    212   unsigned int level;
     213  rtems_interrupt_level level;
    213214 
    214215  /*
     
    218219    return 0;
    219220  }
    220   _CPU_ISR_Disable(level);
     221  rtems_interrupt_disable(level);
    221222  /*
    222223   * check, that specified handler is really connected now
    223224   */
    224225  if (rtemsIrqTbl[irq->name].hdl != irq->hdl) {
    225     _CPU_ISR_Enable(level);
     226    rtems_interrupt_enable(level);
    226227    return 0;
    227228  }
     
    244245   * reenable interrupts
    245246   */
    246   _CPU_ISR_Enable(level);
     247  rtems_interrupt_enable(level);
    247248
    248249  return 1;
     
    267268int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
    268269{
    269   int i;
    270   unsigned int level;
    271 
    272   _CPU_ISR_Disable(level);
     270  int                    i;
     271  rtems_interrupt_level level;
     272
     273  rtems_interrupt_disable(level);
    273274  /*
    274275   * store given configuration
     
    310311    }
    311312  }
    312   _CPU_ISR_Enable(level);
     313  rtems_interrupt_enable(level);
    313314  return 1;
    314315}
Note: See TracChangeset for help on using the changeset viewer.