mirror of
https://github.com/apache/nuttx.git
synced 2026-08-18 20:18:17 +00:00
xtesa: fix lost save & restore states caused by merge code
this is caused by:
35c8c80a00
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
1fb4f8f50e
commit
a9df7f0d1e
1 changed files with 18 additions and 1 deletions
|
|
@ -59,7 +59,24 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
|
|||
{
|
||||
/* Are we in an interrupt handler? */
|
||||
|
||||
if (!up_current_regs())
|
||||
if (up_current_regs())
|
||||
{
|
||||
/* Yes, then we have to do things differently.
|
||||
* Just copy the current_regs into the OLD rtcb.
|
||||
*/
|
||||
|
||||
xtensa_savestate(rtcb->xcp.regs);
|
||||
|
||||
/* Then switch contexts. Any necessary address environment
|
||||
* changes will be made when the interrupt returns.
|
||||
*/
|
||||
|
||||
xtensa_restorestate(tcb->xcp.regs);
|
||||
}
|
||||
|
||||
/* No, then we will need to perform the user context switch */
|
||||
|
||||
else
|
||||
{
|
||||
/* Switch context to the context of the task at the head of the
|
||||
* ready to run list.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue