mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
Kernel/SMP: Don't process SMP messages in non-SMP mode
Processing SMP messages outside of non-SMP mode is a waste of time, and now that we don't rely on the side effects of calling the message processing function, let's stop calling it entirely. :^)
This commit is contained in:
parent
a971de89d3
commit
74e6a70958
Notes:
sideshowbarker
2024-07-18 07:11:17 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/74e6a709583
|
@ -205,7 +205,8 @@ public:
|
|||
ALWAYS_INLINE static void wait_check()
|
||||
{
|
||||
Processor::pause();
|
||||
Processor::current().smp_process_pending_messages();
|
||||
if (Processor::is_smp_enabled())
|
||||
Processor::current().smp_process_pending_messages();
|
||||
}
|
||||
|
||||
[[noreturn]] static void halt();
|
||||
|
@ -252,6 +253,8 @@ public:
|
|||
|
||||
ALWAYS_INLINE ProcessorInfo& info() { return *m_info; }
|
||||
|
||||
static bool is_smp_enabled();
|
||||
|
||||
ALWAYS_INLINE static Processor& current()
|
||||
{
|
||||
return *(Processor*)read_gs_ptr(__builtin_offsetof(Processor, m_self));
|
||||
|
|
|
@ -42,6 +42,11 @@ extern "C" void context_first_init(Thread* from_thread, Thread* to_thread, TrapF
|
|||
extern "C" void enter_thread_context(Thread* from_thread, Thread* to_thread) __attribute__((used));
|
||||
extern "C" FlatPtr do_init_context(Thread* thread, u32 flags) __attribute__((used));
|
||||
|
||||
bool Processor::is_smp_enabled()
|
||||
{
|
||||
return s_smp_enabled;
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT static void sse_init()
|
||||
{
|
||||
write_cr0((read_cr0() & 0xfffffffbu) | 0x2);
|
||||
|
@ -807,6 +812,8 @@ void Processor::smp_cleanup_message(ProcessorMessage& msg)
|
|||
|
||||
bool Processor::smp_process_pending_messages()
|
||||
{
|
||||
VERIFY(s_smp_enabled);
|
||||
|
||||
bool did_process = false;
|
||||
u32 prev_flags;
|
||||
enter_critical(prev_flags);
|
||||
|
|
Loading…
Reference in a new issue