Add support for multiple work queues

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5081 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-09-04 00:54:09 +00:00
parent 612735d392
commit d593a95d5a
28 changed files with 475 additions and 176 deletions
+2 -2
View File
@@ -521,7 +521,7 @@ static int ads7843e_schedule(FAR struct ads7843e_dev_s *priv)
*/
DEBUGASSERT(priv->work.worker == NULL);
ret = work_queue(&priv->work, ads7843e_worker, priv, 0);
ret = work_queue(HPWORK, &priv->work, ads7843e_worker, priv, 0);
if (ret != 0)
{
illdbg("Failed to queue work: %d\n", ret);
@@ -1179,7 +1179,7 @@ int ads7843e_register(FAR struct spi_dev_s *dev,
* availability conditions.
*/
ret = work_queue(&priv->work, ads7843e_worker, priv, 0);
ret = work_queue(HPWORK, &priv->work, ads7843e_worker, priv, 0);
if (ret != 0)
{
idbg("Failed to queue work: %d\n", ret);
+1 -1
View File
@@ -195,7 +195,7 @@ static int stmpe811_interrupt(int irq, FAR void *context)
* action should be required to protect the work queue.
*/
ret = work_queue(&priv->work, stmpe811_worker, priv, 0);
ret = work_queue(HPWORK, &priv->work, stmpe811_worker, priv, 0);
if (ret != 0)
{
illdbg("Failed to queue work: %d\n", ret);
+1 -1
View File
@@ -783,7 +783,7 @@ static void stmpe811_timeout(int argc, uint32_t arg1, ...)
* action should be required to protect the work queue.
*/
ret = work_queue(&priv->timeout, stmpe811_timeoutworker, priv, 0);
ret = work_queue(HPWORK, &priv->timeout, stmpe811_timeoutworker, priv, 0);
if (ret != 0)
{
illdbg("Failed to queue work: %d\n", ret);
+2 -2
View File
@@ -775,7 +775,7 @@ static int tsc2007_interrupt(int irq, FAR void *context)
*/
DEBUGASSERT(priv->work.worker == NULL);
ret = work_queue(&priv->work, tsc2007_worker, priv, 0);
ret = work_queue(HPWORK, &priv->work, tsc2007_worker, priv, 0);
if (ret != 0)
{
illdbg("Failed to queue work: %d\n", ret);
@@ -1316,7 +1316,7 @@ int tsc2007_register(FAR struct i2c_dev_s *dev,
* availability conditions.
*/
ret = work_queue(&priv->work, tsc2007_worker, priv, 0);
ret = work_queue(HPWORK, &priv->work, tsc2007_worker, priv, 0);
if (ret != 0)
{
idbg("Failed to queue work: %d\n", ret);
+1 -1
View File
@@ -1509,7 +1509,7 @@ static int enc_interrupt(int irq, FAR void *context)
* a good thing to do in any event.
*/
return work_queue(&priv->work, enc_worker, (FAR void *)priv, 0);
return work_queue(HPWORK, &priv->work, enc_worker, (FAR void *)priv, 0);
#endif
}
+2 -2
View File
@@ -328,7 +328,7 @@ void pm_update(int16_t accum)
/* The work will be performed on the worker thread */
DEBUGASSERT(g_pmglobals.work.worker == NULL);
(void)work_queue(&g_pmglobals.work, pm_worker, (FAR void*)((intptr_t)accum), 0);
(void)work_queue(HPWORK, &g_pmglobals.work, pm_worker, (FAR void*)((intptr_t)accum), 0);
}
#endif /* CONFIG_PM */
#endif /* CONFIG_PM */
+2 -2
View File
@@ -213,7 +213,7 @@ static void rwb_wrstarttimeout(FAR struct rwbuffer_s *rwb)
*/
int ticks = (CONFIG_FS_WRDELAY + CLK_TCK/2) / CLK_TCK;
(void)work_queue(&rwb->work, rwb_wrtimeout, (FAR void *)rwb, ticks);
(void)work_queue(LPWORK, &rwb->work, rwb_wrtimeout, (FAR void *)rwb, ticks);
}
/****************************************************************************
@@ -222,7 +222,7 @@ static void rwb_wrstarttimeout(FAR struct rwbuffer_s *rwb)
static inline void rwb_wrcanceltimeout(struct rwbuffer_s *rwb)
{
(void)work_cancel(&rwb->work);
(void)work_cancel(LPWORK, &rwb->work);
}
/****************************************************************************
+1 -1
View File
@@ -1674,7 +1674,7 @@ static int usbhost_disconnected(struct usbhost_class_s *class)
*/
DEBUGASSERT(priv->work.worker == NULL);
(void)work_queue(&priv->work, usbhost_destroy, priv, 0);
(void)work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0);
}
return OK;
+3 -3
View File
@@ -1,8 +1,8 @@
/****************************************************************************
* drivers/usbhost/usbhost_skeleton.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -1015,7 +1015,7 @@ static int usbhost_disconnected(struct usbhost_class_s *class)
uvdbg("Queuing destruction: worker %p->%p\n", priv->work.worker, usbhost_destroy);
DEBUGASSERT(priv->work.worker == NULL);
(void)work_queue(&priv->work, usbhost_destroy, priv, 0);
(void)work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0);
}
else
{
+1 -1
View File
@@ -1786,7 +1786,7 @@ static int usbhost_disconnected(struct usbhost_class_s *class)
uvdbg("Queuing destruction: worker %p->%p\n", priv->work.worker, usbhost_destroy);
DEBUGASSERT(priv->work.worker == NULL);
(void)work_queue(&priv->work, usbhost_destroy, priv, 0);
(void)work_queue(HPWORK, &priv->work, usbhost_destroy, priv, 0);
}
else
{