remove Arch_migrateTCB()

It does the same on all architectures, so the contents can be moved
into the generic code.

Signed-off-by: Axel Heider <axelheider@gmx.de>
This commit is contained in:
Axel Heider 2023-06-20 02:35:01 +02:00 committed by Kent McLeod
parent 7354779dde
commit 3c180701ee
5 changed files with 9 additions and 38 deletions

View file

@ -223,10 +223,6 @@ word_t CONST Arch_decodeTransfer(word_t flags);
exception_t CONST Arch_performTransfer(word_t arch, tcb_t *tcb_src,
tcb_t *tcb_dest);
#ifdef ENABLE_SMP_SUPPORT
void Arch_migrateTCB(tcb_t *thread);
#endif /* ENABLE_SMP_SUPPORT */
#ifdef CONFIG_DEBUG_BUILD
void setThreadName(tcb_t *thread, const char *name);
#endif /* CONFIG_DEBUG_BUILD */

View file

@ -21,15 +21,3 @@ exception_t CONST Arch_performTransfer(word_t arch, tcb_t *tcb_src, tcb_t *tcb_d
{
return EXCEPTION_NONE;
}
#ifdef ENABLE_SMP_SUPPORT
void Arch_migrateTCB(tcb_t *thread)
{
#ifdef CONFIG_HAVE_FPU
/* check if thread owns its current core FPU */
if (nativeThreadUsingFPU(thread)) {
switchFpuOwner(NULL, thread->tcbAffinity);
}
#endif /* CONFIG_HAVE_FPU */
}
#endif /* ENABLE_SMP_SUPPORT */

View file

@ -21,14 +21,3 @@ exception_t CONST Arch_performTransfer(word_t arch, tcb_t *tcb_src, tcb_t *tcb_d
{
return EXCEPTION_NONE;
}
#ifdef ENABLE_SMP_SUPPORT
void Arch_migrateTCB(tcb_t *thread)
{
#ifdef CONFIG_HAVE_FPU
if (nativeThreadUsingFPU(thread)) {
switchFpuOwner(NULL, thread->tcbAffinity);
}
#endif
}
#endif

View file

@ -80,13 +80,3 @@ exception_t decodeSetEPTRoot(cap_t cap)
return performSetEPTRoot(TCB_PTR(cap_thread_cap_get_capTCBPtr(cap)), dc_ret.cap, rootSlot);
}
#endif
#ifdef ENABLE_SMP_SUPPORT
void Arch_migrateTCB(tcb_t *thread)
{
/* check if thread owns its current core FPU */
if (nativeThreadUsingFPU(thread)) {
switchFpuOwner(NULL, thread->tcbAffinity);
}
}
#endif /* ENABLE_SMP_SUPPORT */

View file

@ -15,7 +15,15 @@ void migrateTCB(tcb_t *tcb, word_t new_core)
#ifdef CONFIG_DEBUG_BUILD
tcbDebugRemove(tcb);
#endif
Arch_migrateTCB(tcb);
#ifdef CONFIG_HAVE_FPU
/* If the thread owns the FPU of the core it is currently running on (which
* is not necessarily the core, that we are now running on), then release
* this cores's FPU.
*/
if (nativeThreadUsingFPU(thread)) {
switchFpuOwner(NULL, thread->tcbAffinity);
}
#endif /* CONFIG_HAVE_FPU */
tcb->tcbAffinity = new_core;
#ifdef CONFIG_DEBUG_BUILD
tcbDebugAppend(tcb);