Changeset ec1d0b9d in rtems


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
Files:
12 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}
  • c/src/lib/libbsp/powerpc/gen5200/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-09-05      Joel Sherrill <joel.sherrill@oarcorp.com>
    213
  • c/src/lib/libbsp/powerpc/gen5200/irq/irq.c

    rdc7271f rec1d0b9d  
    491491int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
    492492  {
    493   unsigned int level;
     493  rtems_interrupt_level level;
    494494
    495495  if(!isValidInterrupt(irq->name))
     
    514514    }
    515515
    516   _CPU_ISR_Disable(level);
     516  rtems_interrupt_disable(level);
    517517
    518518  /*
     
    559559  irq->on(irq);
    560560
    561   _CPU_ISR_Enable(level);
     561  rtems_interrupt_enable(level);
    562562
    563563  return 1;
     
    590590int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
    591591  {
    592   unsigned int level;
     592  rtems_interrupt_level level;
    593593
    594594  if(!isValidInterrupt(irq->name))
     
    611611    }
    612612
    613   _CPU_ISR_Disable(level);
     613  rtems_interrupt_disable(level);
    614614
    615615  if(is_siu_irq(irq->name))
     
    640640  rtems_hdl_tbl[irq->name] = default_rtems_entry;
    641641
    642   _CPU_ISR_Enable(level);
     642  rtems_interrupt_enable(level);
    643643
    644644  return 1;
     
    656656int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
    657657  {
    658   int i;
    659   unsigned int level;
     658  int                   i;
     659  rtems_interrupt_level level;
    660660
    661661 /*
    662662  * Store various code accelerators
    663663  */
    664   internal_config               = config;
     664  internal_config       = config;
    665665  default_rtems_entry   = config->defaultEntry;
    666   rtems_hdl_tbl                 = config->irqHdlTbl;
    667 
    668   _CPU_ISR_Disable(level);
     666  rtems_hdl_tbl         = config->irqHdlTbl;
     667
     668  rtems_interrupt_disable(level);
    669669
    670670  /*
     
    712712    }
    713713
    714     _CPU_ISR_Enable(level);
     714    rtems_interrupt_enable(level);
    715715    return 1;
    716716
  • c/src/lib/libbsp/powerpc/mbx8xx/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-07-12      Joel Sherrill <joel.sherrill@OARcorp.com>
    213
  • c/src/lib/libbsp/powerpc/mbx8xx/irq/irq.c

    rdc7271f rec1d0b9d  
    198198int BSP_install_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    199199{
    200     unsigned int level;
     200    rtems_interrupt_level      level;
    201201
    202202    if (!isValidInterrupt(irq->name)) {
     
    214214    }
    215215
    216     _CPU_ISR_Disable(level);
     216    rtems_interrupt_disable(level);
    217217
    218218    /*
     
    246246    irq->on(irq);
    247247
    248     _CPU_ISR_Enable(level);
     248    rtems_interrupt_enable(level);
    249249
    250250    return 1;
     
    262262int BSP_remove_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    263263{
    264     unsigned int level;
     264    rtems_interrupt_level      level;
    265265
    266266    if (!isValidInterrupt(irq->name)) {
     
    277277      return 0;
    278278    }
    279     _CPU_ISR_Disable(level);
     279    rtems_interrupt_disable(level);
    280280
    281281    if (is_cpm_irq(irq->name)) {
     
    307307    rtems_hdl_tbl[irq->name] = default_rtems_entry;
    308308
    309     _CPU_ISR_Enable(level);
     309    rtems_interrupt_enable(level);
    310310
    311311    return 1;
     
    318318int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
    319319{
    320     int i;
    321     unsigned int level;
    322    /*
    323     * Store various code accelerators
    324     */
     320    int                    i;
     321    rtems_interrupt_level  level;
     322
     323    /*
     324     * Store various code accelerators
     325     */
    325326    internal_config             = config;
    326327    default_rtems_entry         = config->defaultEntry;
    327328    rtems_hdl_tbl               = config->irqHdlTbl;
    328329
    329     _CPU_ISR_Disable(level);
     330    rtems_interrupt_disable(level);
    330331    /*
    331332     * start with CPM IRQ
     
    377378      }
    378379    }
    379     _CPU_ISR_Enable(level);
     380    rtems_interrupt_enable(level);
    380381    return 1;
    381382}
  • c/src/lib/libbsp/powerpc/mpc8260ads/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-07-10      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
    213
  • c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq.c

    rdc7271f rec1d0b9d  
    246246int BSP_install_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    247247{
    248         unsigned int level;
     248        rtems_interrupt_level level;
    249249
    250250        if (!isValidInterrupt(irq->name)) {
     
    264264        }
    265265
    266         _CPU_ISR_Disable(level);
     266        rtems_interrupt_disable(level);
    267267
    268268        /*
     
    292292        irq->on(irq);
    293293
    294         _CPU_ISR_Enable(level);
     294        rtems_interrupt_enable(level);
    295295
    296296        /*
     
    311311int BSP_remove_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    312312{
    313         unsigned int level;
     313        rtems_interrupt_level level;
    314314
    315315        if (!isValidInterrupt(irq->name)) {
     
    326326          return 0;
    327327        }
    328         _CPU_ISR_Disable(level);
     328        rtems_interrupt_disable(level);
    329329
    330330        if (is_cpm_irq(irq->name)) {
     
    351351        rtems_hdl_tbl[irq->name] = default_rtems_entry;
    352352
    353         _CPU_ISR_Enable(level);
     353        rtems_interrupt_enable(level);
    354354
    355355        return 1;
     
    362362int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
    363363{
    364         int i;
    365         unsigned int level;
     364        int                   i;
     365        rtems_interrupt_level level;
     366
    366367        /*
    367368         * Store various code accelerators
     
    374375        compute_SIU_IvectMask_from_prio();
    375376
    376         _CPU_ISR_Disable(level);
     377        rtems_interrupt_disable(level);
    377378        /*
    378379         * start with CPM IRQ
     
    399400        }
    400401
    401         _CPU_ISR_Enable(level);
     402        rtems_interrupt_enable(level);
    402403        return 1;
    403404}
  • c/src/lib/libbsp/powerpc/psim/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-07-06      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
    213
  • c/src/lib/libbsp/powerpc/psim/irq/irq.c

    rdc7271f rec1d0b9d  
    115115int BSP_install_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    116116{
    117     unsigned int level;
     117    rtems_interrupt_level      level;
    118118 
    119119    if (!isValidInterrupt(irq->name)) {
     
    128128     * to get the previous handler before accepting to disconnect.
    129129     */
    130     _CPU_ISR_Disable(level);
     130    rtems_interrupt_disable(level);
    131131    if (rtems_hdl_tbl[irq->name].hdl != default_rtems_entry.hdl) {
    132       _CPU_ISR_Enable(level);
     132      rtems_interrupt_enable(level);
    133133      printk("IRQ vector %d already connected\n",irq->name);
    134134      return 0;
     
    155155    irq->on(irq);
    156156   
    157     _CPU_ISR_Enable(level);
     157    rtems_interrupt_enable(level);
    158158
    159159    return 1;
     
    163163int BSP_get_current_rtems_irq_handler   (rtems_irq_connect_data* irq)
    164164{
    165      unsigned int level;
    166 
    167      if (!isValidInterrupt(irq->name)) {
    168       return 0;
    169      }
    170      _CPU_ISR_Disable(level);
    171      *irq = rtems_hdl_tbl[irq->name];
    172      _CPU_ISR_Enable(level);
    173      return 1;
     165    rtems_interrupt_level      level;
     166
     167    if (!isValidInterrupt(irq->name)) {
     168      return 0;
     169    }
     170    rtems_interrupt_disable(level);
     171      *irq = rtems_hdl_tbl[irq->name];
     172    rtems_interrupt_enable(level);
     173    return 1;
    174174}
    175175
    176176int BSP_remove_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    177177{
    178    rtems_irq_connect_data *pchain= NULL, *vchain = NULL;
    179     unsigned int level;
     178    rtems_irq_connect_data *pchain= NULL, *vchain = NULL;
     179    rtems_interrupt_level  level;
    180180 
    181181    if (!isValidInterrupt(irq->name)) {
     
    189189     * to get the previous handler before accepting to disconnect.
    190190     */
    191     _CPU_ISR_Disable(level);
     191    rtems_interrupt_disable(level);
    192192    if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) {
    193       _CPU_ISR_Enable(level);
     193      rtems_interrupt_enable(level);
    194194      return 0;
    195195    }
     
    211211       if( !found )
    212212       {
    213           _CPU_ISR_Enable(level);
     213          rtems_interrupt_enable(level);
    214214          return 0;
    215215       }
     
    219219       if (rtems_hdl_tbl[irq->name].hdl != irq->hdl)
    220220       {
    221           _CPU_ISR_Enable(level);
     221         rtems_interrupt_enable(level);
    222222         return 0;
    223223       }
     
    263263    }
    264264
    265     _CPU_ISR_Enable(level);
     265    rtems_interrupt_enable(level);
    266266
    267267    return 1;
  • c/src/lib/libbsp/powerpc/score603e/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-07-10      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
    213
  • c/src/lib/libbsp/powerpc/score603e/irq/irq.c

    rdc7271f rec1d0b9d  
    8787int BSP_install_rtems_shared_irq_handler  (const rtems_irq_connect_data* irq)
    8888{
    89     unsigned int level;
     89    rtems_interrupt_level  level;
    9090    rtems_irq_connect_data* vchain;
    9191
     
    9595    }
    9696
    97     _CPU_ISR_Disable(level);
     97    rtems_interrupt_disable(level);
    9898
    9999    if ( (int)rtems_hdl_tbl[irq->name].next_handler  == -1 ) {
    100       _CPU_ISR_Enable(level);
     100      rtems_interrupt_enable(level);
    101101      printk("IRQ vector %d already connected to an unshared handler\n",irq->name);
    102102      return 0;
     
    132132    irq->on(irq);
    133133
    134     _CPU_ISR_Enable(level);
     134    rtems_interrupt_enable(level);
    135135
    136136    return 1;
     
    143143int BSP_install_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    144144{
    145     unsigned int level;
     145    rtems_interrupt_level      level;
    146146
    147147    if (!isValidInterrupt(irq->name)) {
     
    156156     * to get the previous handler before accepting to disconnect.
    157157     */
    158     _CPU_ISR_Disable(level);
     158    rtems_interrupt_disable(level);
    159159    if (rtems_hdl_tbl[irq->name].hdl != default_rtems_entry.hdl) {
    160       _CPU_ISR_Enable(level);
     160      rtems_interrupt_enable(level);
    161161      printk("IRQ vector %d already connected\n",irq->name);
    162162      return 0;
     
    186186    irq->on(irq);
    187187
    188     _CPU_ISR_Enable(level);
     188    rtems_interrupt_enable(level);
    189189
    190190    return 1;
     
    193193int BSP_get_current_rtems_irq_handler   (rtems_irq_connect_data* irq)
    194194{
    195      unsigned int level;
    196 
    197      if (!isValidInterrupt(irq->name)) {
    198       return 0;
    199      }
    200      _CPU_ISR_Disable(level);
    201      *irq = rtems_hdl_tbl[irq->name];
    202      _CPU_ISR_Enable(level);
    203      return 1;
     195    rtems_interrupt_level      level;
     196
     197    if (!isValidInterrupt(irq->name)) {
     198      return 0;
     199    }
     200    rtems_interrupt_disable(level);
     201      *irq = rtems_hdl_tbl[irq->name];
     202    rtems_interrupt_enable(level);
     203    return 1;
    204204}
    205205
    206206int BSP_remove_rtems_irq_handler  (const rtems_irq_connect_data* irq)
    207207{
    208    rtems_irq_connect_data *pchain= NULL, *vchain = NULL;
    209     unsigned int level;
     208    rtems_irq_connect_data *pchain= NULL, *vchain = NULL;
     209    rtems_interrupt_level      level;
    210210
    211211    if (!isValidInterrupt(irq->name)) {
     
    219219     * to get the previous handler before accepting to disconnect.
    220220     */
    221     _CPU_ISR_Disable(level);
     221    rtems_interrupt_disable(level);
    222222    if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) {
    223       _CPU_ISR_Enable(level);
     223      rtems_interrupt_enable(level);
    224224      return 0;
    225225    }
     
    241241       if( !found )
    242242       {
    243           _CPU_ISR_Enable(level);
     243          rtems_interrupt_enable(level);
    244244          return 0;
    245245       }
     
    249249       if (rtems_hdl_tbl[irq->name].hdl != irq->hdl)
    250250       {
    251           _CPU_ISR_Enable(level);
     251          rtems_interrupt_enable(level);
    252252         return 0;
    253253       }
     
    296296    }
    297297
    298     _CPU_ISR_Enable(level);
     298    rtems_interrupt_enable(level);
    299299
    300300    return 1;
     
    307307int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
    308308{
    309     int i;
    310     unsigned int level;
    311    /*
    312     * Store various code accelerators
    313     */
     309    int                    i;
     310    rtems_interrupt_level  level;
     311
     312    /*
     313     * Store various code accelerators
     314     */
    314315    internal_config             = config;
    315316    default_rtems_entry         = config->defaultEntry;
    316317    rtems_hdl_tbl               = config->irqHdlTbl;
    317318
    318     _CPU_ISR_Disable(level);
     319    rtems_interrupt_disable(level);
    319320    /*
    320321     * set up internal tables used by rtems interrupt prologue
     
    379380      }
    380381    }
    381     _CPU_ISR_Enable(level);
     382    rtems_interrupt_enable(level);
    382383    return 1;
    383384}
Note: See TracChangeset for help on using the changeset viewer.