Changeset 509040f0 in rtems


Ignore:
Timestamp:
Apr 14, 2014, 3:11:12 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
598f39cd
Parents:
c5831a3f
git-author:
Sebastian Huber <sebastian.huber@…> (04/14/14 15:11:12)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/15/14 08:43:05)
Message:

bsps/powerpc: SMP support for one TSEC driver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c

    rc5831a3f r509040f0  
    6464  rtems_irq_number irq_num_err;
    6565
     66  rtems_interrupt_lock lock;
     67
    6668  /*
    6769   * BD management
     
    141143                            | TSEC_IEVENT_XFUN   )
    142144
    143 #define TSEC_IMASK_SET(reg,mask,val) {  \
    144   rtems_interrupt_level level;                  \
    145                                                 \
    146   rtems_interrupt_disable(level);               \
    147   (reg) = (((reg) & ~(mask)) |                  \
    148            ((val) &  (mask)));                  \
    149   rtems_interrupt_enable(level);                \
     145static void TSEC_IMASK_SET(struct tsec_struct *sc, uint32_t mask, uint32_t val)
     146{
     147  volatile uint32_t *reg = &sc->reg_ptr->imask;
     148  rtems_interrupt_lock_context lock_context;
     149
     150  rtems_interrupt_lock_acquire(&sc->lock, &lock_context);
     151  *reg = (*reg & ~mask) | (val & mask);
     152  rtems_interrupt_lock_release(&sc->lock, &lock_context);
    150153}
    151154
     
    506509  * enable Rx interrupts, make sure this is not interrupted :-)
    507510  */
    508  TSEC_IMASK_SET(sc->reg_ptr->imask,IEVENT_RXALL,~0);
     511 TSEC_IMASK_SET(sc,IEVENT_RXALL,~0);
    509512
    510513 /*
     
    877880  * enable Tx interrupts, make sure this is not interrupted :-)
    878881  */
    879  TSEC_IMASK_SET(sc->reg_ptr->imask,IEVENT_TXALL,~0);
     882 TSEC_IMASK_SET(sc,IEVENT_TXALL,~0);
    880883
    881884 /*
     
    11571160   * disable tx interrupts
    11581161   */
    1159   TSEC_IMASK_SET(sc->reg_ptr->imask,IEVENT_TXALL,0);
     1162  TSEC_IMASK_SET(sc,IEVENT_TXALL,0);
    11601163
    11611164#if defined(CLREVENT_IN_IRQ)
     
    12011204   * disable rx interrupts
    12021205   */
    1203   TSEC_IMASK_SET(sc->reg_ptr->imask,IEVENT_RXALL,0);
     1206  TSEC_IMASK_SET(sc,IEVENT_RXALL,0);
    12041207#if defined(CLREVENT_IN_IRQ)
    12051208  /*
     
    13071310    (struct tsec_struct *)(irq_conn_data->handle);
    13081311
    1309   TSEC_IMASK_SET(sc->reg_ptr->imask,
     1312  TSEC_IMASK_SET(sc,
    13101313                       tsec_irq_mask(irq_conn_data->name,sc),
    13111314                       ~0);
     
    13341337    (struct tsec_struct *)irq_conn_data->handle;
    13351338
    1336   TSEC_IMASK_SET(sc->reg_ptr->imask,
     1339  TSEC_IMASK_SET(sc,
    13371340                       tsec_irq_mask(irq_conn_data->name,sc),
    13381341                       0);
Note: See TracChangeset for help on using the changeset viewer.