[Cbe-oss-dev] [PATCH 21/22]MARS/task: module switch asm fix
Yuji Mano
yuji.mano at am.sony.com
Fri Mar 20 07:54:58 EST 2009
This patch fixes the task module module/task switch code.
Need to reserve 16 bytes for global __module_stack and __task_stack storage.
Put __module_stack and __task_stack in .bss since its uninitialized data.
Replace incorrect lqr instructin with lqa instruction.
Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>
---
task/src/mpu/module/task_switch.S | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/task/src/mpu/module/task_switch.S
+++ b/task/src/mpu/module/task_switch.S
@@ -35,19 +35,19 @@
* LIBRARY OR THE USE OR OTHER DEALINGS IN THE LIBRARY.
*/
-.data
+.section .bss
/* void *__module_stack */
.align 4
.globl __module_stack
__module_stack:
-.space 4
+.space 16
/* void *__task_stack */
.align 4
.globl __task_stack
__task_stack:
-.space 4
+.space 16
.text
@@ -118,7 +118,7 @@ task_restore:
brsl $LR, __task_restore /* call task restore body */
brsl $LR, __registers_restore /* restore registers */
- lqr $SP, __task_stack /* restore task stack */
+ lqa $SP, __task_stack /* restore task stack */
sync /* sync before execution */
ai $SP, $SP, 48 /* pop task_save stack frame */
@@ -169,7 +169,7 @@ __registers_restore:
shlqbyi INST_MASK, INST_MASK, 15 /* shift to correct position */
body:
- lqr STACK_PTR, __task_stack /* load task stack pointer */
+ lqa STACK_PTR, __task_stack /* load task stack pointer */
il TEMP, -NUM_REGS * 16 /* size of reg save area */
a REGS_PTR, STACK_PTR, TEMP /* set reg load addr pointer */
ai CODE_PTR, REGS_PTR, -2 * 16 /* set code load addr pointer */
More information about the cbe-oss-dev
mailing list