Tiva Ethernet: When calling into the stack from the worker thread, it is necessary to have the stack locked

This commit is contained in:
Gregory Nutt 2015-01-18 16:58:11 -06:00
parent a386319013
commit bbafb8f2fe
2 changed files with 24 additions and 0 deletions

View File

@ -2050,12 +2050,15 @@ static inline void tiva_interrupt_process(FAR struct tiva_ethmac_s *priv)
static void tiva_interrupt_work(FAR void *arg)
{
FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg;
net_lock_t state;
DEBUGASSERT(priv);
/* Process pending Ethernet interrupts */
state = net_lock();
tiva_interrupt_process(priv);
net_unlock(state);
/* Re-enable Ethernet interrupts at the NVIC */
@ -2198,10 +2201,13 @@ static inline void tiva_txtimeout_process(FAR struct tiva_ethmac_s *priv)
static void tiva_txtimeout_work(FAR void *arg)
{
FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg;
net_lock_t state;
/* Process pending Ethernet interrupts */
state = net_lock();
tiva_txtimeout_process(priv);
net_unlock(state);
}
#endif
@ -2347,10 +2353,13 @@ static inline void tiva_poll_process(FAR struct tiva_ethmac_s *priv)
static void tiva_poll_work(FAR void *arg)
{
FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg;
net_lock_t state;
/* Perform the poll */
state = net_lock();
tiva_poll_process(priv);
net_unlock(state);
}
#endif
@ -2553,10 +2562,13 @@ static inline void tiva_txavail_process(FAR struct tiva_ethmac_s *priv)
static void tiva_txavail_work(FAR void *arg)
{
FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg;
net_lock_t state;
/* Perform the poll */
state = net_lock();
tiva_txavail_process(priv);
net_unlock(state);
}
#endif

View File

@ -463,10 +463,13 @@ static inline void skel_interrupt_process(FAR struct skel_driver_s *skel)
static void skel_interrupt_work(FAR void *arg)
{
FAR struct skel_driver_s *skel = (FAR struct skel_driver_s *)arg;
net_lock_t state;
/* Process pending Ethernet interrupts */
state = net_lock();
skel_interrupt_process(skel);
net_unlock(state);
/* Re-enable Ethernet interrupts */
@ -583,10 +586,13 @@ static inline void skel_txtimeout_process(FAR struct skel_driver_s *skel)
static void skel_txtimeout_work(FAR void *arg)
{
FAR struct skel_driver_s *skel = (FAR struct skel_driver_s *)arg;
net_lock_t state;
/* Process pending Ethernet interrupts */
state = net_lock();
skel_txtimeout_process(skel);
net_unlock(state);
}
#endif
@ -693,10 +699,13 @@ static inline void skel_poll_process(FAR struct skel_driver_s *skel)
static void skel_poll_work(FAR void *arg)
{
FAR struct skel_driver_s *skel = (FAR struct skel_driver_s *)arg;
net_lock_t state;
/* Perform the poll */
state = net_lock();
skel_poll_process(skel);
net_unlock(state);
}
#endif
@ -884,10 +893,13 @@ static int inline skel_txavail_process(FAR struct skel_driver_s *skel)
static void skel_txavail_work(FAR void *arg)
{
FAR struct skel_driver_s *skel = (FAR struct skel_driver_s *)arg;
net_lock_t state;
/* Perform the poll */
state = net_lock();
skel_txavail_process(skel);
net_unlock(state);
}
#endif