From 05e1b196e9999ccd67c73c877acd786468d167c5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 22 Aug 2021 15:35:54 +0200 Subject: [PATCH] Kernel: Make Processor::clean_fpu_state() static This function returns the same identical FPU state for all CPU's, so there's no point requiring a Processor instance. --- Kernel/Arch/x86/Processor.h | 5 +---- Kernel/Thread.cpp | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Kernel/Arch/x86/Processor.h b/Kernel/Arch/x86/Processor.h index eeb304ff18e..57abb54514c 100644 --- a/Kernel/Arch/x86/Processor.h +++ b/Kernel/Arch/x86/Processor.h @@ -392,10 +392,7 @@ public: return read_gs_ptr(__builtin_offsetof(Processor, m_in_critical)); } - ALWAYS_INLINE const FPUState& clean_fpu_state() const - { - return s_clean_fpu_state; - } + ALWAYS_INLINE static FPUState const& clean_fpu_state() { return s_clean_fpu_state; } static void smp_enable(); bool smp_process_pending_messages(); diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index 31bff2ec58d..9d5c8c7489d 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -1231,7 +1231,7 @@ RefPtr Thread::from_tid(ThreadID tid) void Thread::reset_fpu_state() { - memcpy(&m_fpu_state, &Processor::current().clean_fpu_state(), sizeof(FPUState)); + memcpy(&m_fpu_state, &Processor::clean_fpu_state(), sizeof(FPUState)); } bool Thread::should_be_stopped() const