Changeset 764b72e in rtems


Ignore:
Timestamp:
Sep 12, 2007, 3:16:38 PM (12 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.
Location:
c/src/lib/libbsp/powerpc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/gen83xx/ChangeLog

    rec1d0b9d r764b72e  
     12007-09-12      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        PR 1257/bsps
     4        * irq/irq_init.c: Code outside of cpukit should use the public API for
     5        rtems_interrupt_disable/rtems_interrupt_enable. By bypassing the
     6        public API and directly accessing _CPU_ISR_Disable and
     7        _CPU_ISR_Enable, they were bypassing the compiler memory barrier
     8        directive which could lead to problems. This patch also changes the
     9        type of the variable passed into these routines and addresses minor
     10        style issues.
     11
    1122007-09-11      Joel Sherrill <joel.sherrill@OARcorp.com>
    213
  • c/src/lib/libbsp/powerpc/gen83xx/irq/irq_init.c

    rec1d0b9d r764b72e  
    137137int BSP_install_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    138138{
    139   unsigned int level;
     139  rtems_interrupt_level level;
     140
    140141  /*
    141142   * check for valid irq name
     
    150151   * disable interrupts
    151152   */
    152   _CPU_ISR_Disable(level);
     153  rtems_interrupt_disable(level);
    153154  /*
    154155   * check, that default handler is installed now
    155156   */
    156157  if (rtemsIrqTbl[irq->name].hdl != BSP_rtems_irq_config->defaultEntry.hdl) {
    157     _CPU_ISR_Enable(level);
     158    rtems_interrupt_enable(level);
    158159    printk("IRQ vector %d already connected\n",irq->name);
    159160    return 0;
     
    177178   * reenable interrupts
    178179   */
    179   _CPU_ISR_Enable(level);
     180  rtems_interrupt_enable(level);
    180181
    181182  return 1;
     
    184185int BSP_get_current_rtems_irq_handler   (rtems_irq_connect_data* irq)
    185186{
    186   unsigned int level;
     187  rtems_interrupt_level level;
    187188 
    188189  /*
     
    192193    return 0;
    193194  }
    194   _CPU_ISR_Disable(level);
     195  rtems_interrupt_disable(level);
    195196  /*
    196197   * return current IRQ entry
    197198   */
    198199  *irq = rtemsIrqTbl[irq->name];
    199   _CPU_ISR_Enable(level);
     200  rtems_interrupt_enable(level);
    200201  return 1;
    201202}
     
    203204int BSP_remove_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    204205{
    205   unsigned int level;
     206  rtems_interrupt_level level;
    206207 
    207208  /*
     
    211212    return 0;
    212213  }
    213   _CPU_ISR_Disable(level);
     214  rtems_interrupt_disable(level);
    214215  /*
    215216   * check, that specified handler is really connected now
    216217   */
    217218  if (rtemsIrqTbl[irq->name].hdl != irq->hdl) {
    218     _CPU_ISR_Enable(level);
     219    rtems_interrupt_enable(level);
    219220    return 0;
    220221  }
     
    237238   * reenable interrupts
    238239   */
    239   _CPU_ISR_Enable(level);
     240  rtems_interrupt_enable(level);
    240241
    241242  return 1;
     
    260261int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
    261262{
    262   int i;
    263   unsigned int level;
    264 
    265   _CPU_ISR_Disable(level);
     263  int                    i;
     264  rtems_interrupt_level level;
     265
     266  rtems_interrupt_disable(level);
    266267  /*
    267268   * store given configuration
     
    303304    }
    304305  }
    305   _CPU_ISR_Enable(level);
     306  rtems_interrupt_enable(level);
    306307  return 1;
    307308}
  • c/src/lib/libbsp/powerpc/virtex/ChangeLog

    rec1d0b9d r764b72e  
     12007-09-12      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        PR 1257/bsps
     4        * irq/irq_init.c: Code outside of cpukit should use the public API for
     5        rtems_interrupt_disable/rtems_interrupt_enable. By bypassing the
     6        public API and directly accessing _CPU_ISR_Disable and
     7        _CPU_ISR_Enable, they were bypassing the compiler memory barrier
     8        directive which could lead to problems. This patch also changes the
     9        type of the variable passed into these routines and addresses minor
     10        style issues.
     11
    1122007-09-11      Joel Sherrill <joel.sherrill@OARcorp.com>
    213
  • 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.