Domain: Save FPU state when changing domain
Co-authored-by: Corey Lewis <corlewis@gmail.com> Signed-off-by: Indan Zupancic <indan@nul.nu>
This commit is contained in:
parent
f1517d51d1
commit
35ec2554b9
3 changed files with 12 additions and 0 deletions
|
|
@ -189,6 +189,7 @@ void schedule(void);
|
|||
void chooseThread(void);
|
||||
void switchToThread(tcb_t *thread);
|
||||
void switchToIdleThread(void);
|
||||
void prepareSetDomain(tcb_t *tptr, dom_t dom);
|
||||
void setDomain(tcb_t *tptr, dom_t dom);
|
||||
void setPriority(tcb_t *tptr, prio_t prio);
|
||||
void setMCPriority(tcb_t *tptr, prio_t mcp);
|
||||
|
|
|
|||
|
|
@ -301,6 +301,16 @@ void doNBRecvFailedTransfer(tcb_t *thread)
|
|||
setRegister(thread, badgeRegister, 0);
|
||||
}
|
||||
|
||||
void prepareSetDomain(tcb_t *tptr, dom_t dom)
|
||||
{
|
||||
#ifdef CONFIG_HAVE_FPU
|
||||
if (ksCurDomain != dom) {
|
||||
/* Save FPU state now to avoid touching cross-domain state later */
|
||||
fpuThreadDelete(tptr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void prepareNextDomain(void)
|
||||
{
|
||||
#ifdef CONFIG_HAVE_FPU
|
||||
|
|
|
|||
|
|
@ -1613,6 +1613,7 @@ exception_t decodeDomainInvocation(word_t invLabel, word_t length, word_t *buffe
|
|||
}
|
||||
|
||||
setThreadState(NODE_STATE(ksCurThread), ThreadState_Restart);
|
||||
prepareSetDomain(TCB_PTR(cap_thread_cap_get_capTCBPtr(tcap)), domain);
|
||||
setDomain(TCB_PTR(cap_thread_cap_get_capTCBPtr(tcap)), domain);
|
||||
return EXCEPTION_NONE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue