[Cbe-oss-dev] [PATCH 5/9]MARS: Fix task queue error check

Yuji Mano yuji.mano at am.sony.com
Sat Oct 18 10:28:56 EST 2008


This fixes a bug in the error checking where task queue push/pop calls would
return MARS_ERROR_FORMAT for having no context save area even for the *_try
calls which do not require a context save area.

Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>

---
 src/mpu/lib/task_queue.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/src/mpu/lib/task_queue.c
+++ b/src/mpu/lib/task_queue.c
@@ -139,7 +139,7 @@ static int push(uint64_t queue_ea, const
 	task = (struct mars_task_context *)mars_get_workload();
 
 	/* make sure task context has a context save area */
-	if (!task->context_save_area_ea)
+	if (!task->context_save_area_ea && !try)
 		return MARS_ERROR_FORMAT;
 
 	mars_mutex_lock_get(queue_ea, (struct mars_mutex *)&queue);
@@ -284,7 +284,7 @@ static int pop(uint64_t queue_ea, void *
 	task = (struct mars_task_context *)mars_get_workload();
 
 	/* make sure task context has a context save area */
-	if (!task->context_save_area_ea)
+	if (!task->context_save_area_ea && !try)
 		return MARS_ERROR_FORMAT;
 
 	mars_mutex_lock_get(queue_ea, (struct mars_mutex *)&queue);






More information about the cbe-oss-dev mailing list