mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:27:45 +00:00
Kernel: Remove duplicate Processor::restore_in_critical
There is already Processor::restore_critical, which does exactly the same thing.
This commit is contained in:
parent
b18a7297c5
commit
ac788a2c8e
2 changed files with 2 additions and 7 deletions
|
@ -1493,7 +1493,7 @@ extern "C" void context_first_init([[maybe_unused]] Thread* from_thread, [[maybe
|
||||||
|
|
||||||
auto in_critical = to_thread->saved_critical();
|
auto in_critical = to_thread->saved_critical();
|
||||||
VERIFY(in_critical > 0);
|
VERIFY(in_critical > 0);
|
||||||
Processor::restore_in_critical(in_critical);
|
Processor::restore_critical(in_critical);
|
||||||
|
|
||||||
// Since we got here and don't have Scheduler::context_switch in the
|
// Since we got here and don't have Scheduler::context_switch in the
|
||||||
// call stack (because this is the first time we switched into this
|
// call stack (because this is the first time we switched into this
|
||||||
|
@ -1554,7 +1554,7 @@ extern "C" void enter_thread_context(Thread* from_thread, Thread* to_thread)
|
||||||
|
|
||||||
auto in_critical = to_thread->saved_critical();
|
auto in_critical = to_thread->saved_critical();
|
||||||
VERIFY(in_critical > 0);
|
VERIFY(in_critical > 0);
|
||||||
Processor::restore_in_critical(in_critical);
|
Processor::restore_critical(in_critical);
|
||||||
|
|
||||||
if (has_xsave_avx_support)
|
if (has_xsave_avx_support)
|
||||||
asm volatile("xrstor %0" ::"m"(to_thread->fpu_state()), "a"(static_cast<u32>(SIMD::StateComponent::AVX | SIMD::StateComponent::SSE | SIMD::StateComponent::X87)), "d"(0u));
|
asm volatile("xrstor %0" ::"m"(to_thread->fpu_state()), "a"(static_cast<u32>(SIMD::StateComponent::AVX | SIMD::StateComponent::SSE | SIMD::StateComponent::X87)), "d"(0u));
|
||||||
|
|
|
@ -318,11 +318,6 @@ public:
|
||||||
return read_gs_ptr(__builtin_offsetof(Processor, m_in_irq));
|
return read_gs_ptr(__builtin_offsetof(Processor, m_in_irq));
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE static void restore_in_critical(u32 critical)
|
|
||||||
{
|
|
||||||
write_gs_ptr(__builtin_offsetof(Processor, m_in_critical), critical);
|
|
||||||
}
|
|
||||||
|
|
||||||
ALWAYS_INLINE static void enter_critical()
|
ALWAYS_INLINE static void enter_critical()
|
||||||
{
|
{
|
||||||
write_gs_ptr(__builtin_offsetof(Processor, m_in_critical), in_critical() + 1);
|
write_gs_ptr(__builtin_offsetof(Processor, m_in_critical), in_critical() + 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue