summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-08-22 15:35:54 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-23 00:02:09 +0200
commit05e1b196e9999ccd67c73c877acd786468d167c5 (patch)
treee0f3b5dc253cf006de86ef417c6ab2c967507a8e
parent8000e8a0808230f092f0e5aa9ec18c204c954f77 (diff)
downloadserenity-05e1b196e9999ccd67c73c877acd786468d167c5.zip
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.
-rw-r--r--Kernel/Arch/x86/Processor.h5
-rw-r--r--Kernel/Thread.cpp2
2 files changed, 2 insertions, 5 deletions
diff --git a/Kernel/Arch/x86/Processor.h b/Kernel/Arch/x86/Processor.h
index eeb304ff18..57abb54514 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 31bff2ec58..9d5c8c7489 100644
--- a/Kernel/Thread.cpp
+++ b/Kernel/Thread.cpp
@@ -1231,7 +1231,7 @@ RefPtr<Thread> 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