1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:27:45 +00:00

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.
This commit is contained in:
Andreas Kling 2021-08-22 15:35:54 +02:00
parent 8000e8a080
commit 05e1b196e9
2 changed files with 2 additions and 5 deletions

View file

@ -392,10 +392,7 @@ public:
return read_gs_ptr(__builtin_offsetof(Processor, m_in_critical)); return read_gs_ptr(__builtin_offsetof(Processor, m_in_critical));
} }
ALWAYS_INLINE const FPUState& clean_fpu_state() const ALWAYS_INLINE static FPUState const& clean_fpu_state() { return s_clean_fpu_state; }
{
return s_clean_fpu_state;
}
static void smp_enable(); static void smp_enable();
bool smp_process_pending_messages(); bool smp_process_pending_messages();

View file

@ -1231,7 +1231,7 @@ RefPtr<Thread> Thread::from_tid(ThreadID tid)
void Thread::reset_fpu_state() 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 bool Thread::should_be_stopped() const