FPU: Rename fpuThreadDelete to fpuRelease

It's not only used when deleting a thread any more.

Swapping fpuRelease and dissociateVCPUTCB makes no practical
difference as they are independent, but it simplifies
verification slightly.

Signed-off-by: Indan Zupancic <indan@nul.nu>
This commit is contained in:
Indan Zupancic 2024-09-18 22:06:08 +01:00 committed by Gerwin Klein
parent c4501d5ed4
commit 8502701926
9 changed files with 15 additions and 15 deletions

View file

@ -14,7 +14,7 @@
#ifdef CONFIG_HAVE_FPU
/* Perform any actions required for the deletion of the given thread. */
void fpuThreadDelete(tcb_t *thread);
void fpuRelease(tcb_t *thread);
void switchLocalFpuOwner(tcb_t *new_owner);

View file

@ -612,14 +612,14 @@ exception_t Arch_decodeInvocation(word_t invLabel, word_t length, cptr_t cptr,
void
Arch_prepareThreadDelete(tcb_t * thread) {
#ifdef CONFIG_HAVE_FPU
fpuThreadDelete(thread);
#endif
#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT
if (thread->tcbArch.tcbVCPU) {
dissociateVCPUTCB(thread->tcbArch.tcbVCPU, thread);
}
#endif /* CONFIG_ARM_HYPERVISOR_SUPPORT */
#ifdef CONFIG_HAVE_FPU
fpuRelease(thread);
#endif
}

View file

@ -535,13 +535,13 @@ exception_t Arch_decodeInvocation(word_t label, word_t length, cptr_t cptr,
void
Arch_prepareThreadDelete(tcb_t * thread) {
#ifdef CONFIG_HAVE_FPU
fpuThreadDelete(thread);
#endif
#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT
if (thread->tcbArch.tcbVCPU) {
dissociateVCPUTCB(thread->tcbArch.tcbVCPU, thread);
}
#endif /* CONFIG_ARM_HYPERVISOR_SUPPORT */
#ifdef CONFIG_HAVE_FPU
fpuRelease(thread);
#endif
}

View file

@ -304,7 +304,7 @@ exception_t Arch_decodeInvocation(
void Arch_prepareThreadDelete(tcb_t *thread)
{
#ifdef CONFIG_HAVE_FPU
fpuThreadDelete(thread);
fpuRelease(thread);
#endif
}

View file

@ -542,7 +542,7 @@ exception_t Arch_decodeInvocation(
void Arch_prepareThreadDelete(tcb_t *thread)
{
/* Notify the lazy FPU module about this thread's deletion. */
fpuThreadDelete(thread);
fpuRelease(thread);
}
void Arch_postCapDeletion(cap_t cap)

View file

@ -123,7 +123,7 @@ void clearCurrentVCPU(void)
vcpu->launched = false;
ARCH_NODE_STATE(x86KSCurrentVCPU) = NULL;
if (vcpu->fpu_active && vcpu->vcpuTCB) {
fpuThreadDelete(vcpu->vcpuTCB);
fpuRelease(vcpu->vcpuTCB);
vcpu->fpu_active = false;
}
}

View file

@ -307,7 +307,7 @@ 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);
fpuRelease(tptr);
}
#endif
}

View file

@ -39,7 +39,7 @@ void switchFpuOwner(tcb_t *new_owner, word_t cpu)
}
/* Prepare for the deletion of the given thread. */
void fpuThreadDelete(tcb_t *thread)
void fpuRelease(tcb_t *thread)
{
/* If the thread being deleted currently owns the FPU, switch away from it
* so that 'ksCurFPUOwner' doesn't point to invalid memory. */

View file

@ -804,7 +804,7 @@ static void invokeSetFlags(tcb_t *thread, word_t clear, word_t set, bool_t call)
#ifdef CONFIG_HAVE_FPU
/* Save current FPU state before disabling FPU: */
if (flags & seL4_TCBFlag_fpuDisabled) {
fpuThreadDelete(thread);
fpuRelease(thread);
}
#endif
if (call) {