Do I need to save the FPRs in mpc8306 when saving state for task switching?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Do I need to save the FPRs in mpc8306 when saving state for task switching?

跳至解决方案
2,444 次查看
maojiu
Contributor I

Do I need to save the FPRs in mpc8306 when saving state for task switching? If yes, how to save them? I tried the statement "stfd f1, 80(r1)"  and it made an error while the address 80+(r1) was safe to write.

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
2,017 次查看
LPP
NXP Employee
NXP Employee

When a task context has to be saved in exception handler, keep in mind that MSR[FP] is cleared automatically when the core enters interrupt handler. Prior using FP load/store instructions, the handler's code should restore MSR[FP].

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,017 次查看
scottwood
NXP Employee
NXP Employee

You need to save anything that is used.  This includes floating point registers, unless at least one of the tasks has the floating point unit disabled.  Do you really mean switching tasks (e.g. going from one userspace task to another userspace task), or do you mean entering the kernel (as in your previous questions)?  If the kernel does not use the floating point unit, then you don't need to save the floating point registers when you enter the kernel (but you will need to save them later if you switch to another userspace task).

What error are you getting?  Is MSR[FP] set?

2,018 次查看
LPP
NXP Employee
NXP Employee

When a task context has to be saved in exception handler, keep in mind that MSR[FP] is cleared automatically when the core enters interrupt handler. Prior using FP load/store instructions, the handler's code should restore MSR[FP].

0 项奖励
回复