Changeset ec1d0b9d in rtems for c/src/lib/libbsp/powerpc/ep1a


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

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

PR 1257/bsps

  • irq/irq.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/ep1a
Files:
2 edited

Legend:

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

    rdc7271f rec1d0b9d  
     12007-09-12      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        PR 1257/bsps
     4        * irq/irq.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-08-01      Joel Sherrill <joel.sherrill@oarcorp.com>
    213
  • c/src/lib/libbsp/powerpc/ep1a/irq/irq.c

    rdc7271f rec1d0b9d  
    101101int BSP_install_rtems_shared_irq_handler  (const rtems_irq_connect_data* irq)
    102102{
    103     unsigned int level;
     103    rtems_interrupt_level  level;
    104104    rtems_irq_connect_data* vchain;
    105105
     
    110110    printk("Install Shared interrupt %d\n", irq->name);
    111111
    112     _CPU_ISR_Disable(level);
     112    rtems_interrupt_disable(level);
    113113
    114114    if ( (int)rtems_hdl_tbl[irq->name].next_handler  == -1 ) {
    115       _CPU_ISR_Enable(level);
     115      rtems_interrupt_enable(level);
    116116      printk("IRQ vector %d already connected to an unshared handler\n",irq->name);
    117117      return 0;
     
    157157    irq->on(irq);
    158158   
    159     _CPU_ISR_Enable(level);
     159    rtems_interrupt_enable(level);
    160160
    161161    return 1;
     
    169169int BSP_install_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    170170{
    171     unsigned int level;
     171    rtems_interrupt_level      level;
    172172
    173173    if (!isValidInterrupt(irq->name)) {
     
    182182     * to get the previous handler before accepting to disconnect.
    183183     */
    184     _CPU_ISR_Disable(level);
     184    rtems_interrupt_disable(level);
    185185    if (rtems_hdl_tbl[irq->name].hdl != default_rtems_entry.hdl) {
    186       _CPU_ISR_Enable(level);
     186      rtems_interrupt_enable(level);
    187187      printk("IRQ vector %d already connected\n",irq->name);
    188188      return 0;
     
    219219    irq->on(irq);
    220220   
    221     _CPU_ISR_Enable(level);
     221    rtems_interrupt_enable(level);
    222222
    223223    return 1;
     
    227227int BSP_get_current_rtems_irq_handler   (rtems_irq_connect_data* irq)
    228228{
    229      unsigned int level;
    230 
    231      if (!isValidInterrupt(irq->name)) {
    232       return 0;
    233      }
    234      _CPU_ISR_Disable(level);
    235      *irq = rtems_hdl_tbl[irq->name];
    236      _CPU_ISR_Enable(level);
    237      return 1;
     229    rtems_interrupt_level      level;
     230
     231    if (!isValidInterrupt(irq->name)) {
     232      return 0;
     233    }
     234    rtems_interrupt_disable(level);
     235      *irq = rtems_hdl_tbl[irq->name];
     236    rtems_interrupt_enable(level);
     237    return 1;
    238238}
    239239
    240240int BSP_remove_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    241241{
    242    rtems_irq_connect_data *pchain= NULL, *vchain = NULL;
    243     unsigned int level;
     242    rtems_irq_connect_data *pchain= NULL, *vchain = NULL;
     243    rtems_interrupt_level  level;
    244244 
    245245    if (!isValidInterrupt(irq->name)) {
     
    253253     * to get the previous handler before accepting to disconnect.
    254254     */
    255     _CPU_ISR_Disable(level);
     255    rtems_interrupt_disable(level);
    256256    if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) {
    257       _CPU_ISR_Enable(level);
     257      rtems_interrupt_enable(level);
    258258      return 0;
    259259    }
     
    275275       if( !found )
    276276       {
    277           _CPU_ISR_Enable(level);
     277          rtems_interrupt_enable(level);
    278278          return 0;
    279279       }
     
    283283       if (rtems_hdl_tbl[irq->name].hdl != irq->hdl)
    284284       {
    285           _CPU_ISR_Enable(level);
     285          rtems_interrupt_enable(level);
    286286         return 0;
    287287       }
     
    336336    }
    337337
    338     _CPU_ISR_Enable(level);
     338    rtems_interrupt_enable(level);
    339339
    340340    return 1;
     
    347347int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
    348348{
    349     int i;
    350     unsigned int level;
    351    /*
    352     * Store various code accelerators
    353     */
     349    int                    i;
     350    rtems_interrupt_level  level;
     351
     352    /*
     353     * Store various code accelerators
     354     */
    354355    internal_config             = config;
    355356    default_rtems_entry         = config->defaultEntry;
     
    357358    return 1; 
    358359
    359     _CPU_ISR_Disable(level);
     360    rtems_interrupt_disable(level);
    360361    /*
    361362     * set up internal tables used by rtems interrupt prologue
     
    429430      }
    430431    }
    431     _CPU_ISR_Enable(level);
     432    rtems_interrupt_enable(level);
    432433    return 1;
    433434}
Note: See TracChangeset for help on using the changeset viewer.