[Cbe-oss-dev] [PATCH 19/23]MARS/task: module registers

Yuji Mano yuji.mano at am.sony.com
Sat Mar 14 12:19:03 EST 2009


This patch updates the task module registers_save/registers_restore function to
save/load registers to/from the function parameter address passed in.

Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>
---
 task/src/mpu/module/task_module.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/task/src/mpu/module/task_module.c
+++ b/task/src/mpu/module/task_module.c
@@ -108,7 +108,7 @@ static void dma_context(uint32_t low_siz
 	dma_wait();
 }
 
-static void registers_save(void)
+static void registers_save(void *ptr)
 {
 	/* push non-volatile registers on to the workload stack */
 	asm volatile (
@@ -160,10 +160,10 @@ static void registers_save(void)
 		"stqd	$125, -736(%[ptr]);"
 		"stqd	$126, -752(%[ptr]);"
 		"stqd	$127, -768(%[ptr]);"
-		: : [ptr] "r" (__task_stack));
+		: : [ptr] "r" (ptr));
 }
 
-static void registers_restore(void)
+static void registers_restore(void *ptr)
 {
 	/* pop non-volatile registers from saved workload stack */
 	asm volatile (
@@ -215,13 +215,13 @@ static void registers_restore(void)
 		"lqd	$125, -736(%[ptr]);"
 		"lqd	$126, -752(%[ptr]);"
 		"lqd	$127, -768(%[ptr]);"
-		: : [ptr] "r" (__task_stack));
+		: : [ptr] "r" (ptr));
 }
 
 static void __attribute__((noinline)) context_save(void *task_heap)
 {
 	/* save registers state */
-	registers_save();
+	registers_save(__task_stack);
 
 	/* save workload stack pointer */
 	task->stack = (uint32_t)__task_stack;
@@ -253,7 +253,7 @@ static void __attribute__((noinline)) co
 	__task_stack = (void *)task->stack;
 
 	/* restore registers state */
-	registers_restore();
+	registers_restore(__task_stack);
 }
 
 static void __attribute__((noinline)) context_wait(void *task_heap)






More information about the cbe-oss-dev mailing list