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,451件の閲覧回数
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,024件の閲覧回数
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,024件の閲覧回数
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,025件の閲覧回数
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 件の賞賛
返信