mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 18:27:40 +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
2 changed files with 11 additions and 1 deletions
|
@ -205,6 +205,7 @@ public:
|
||||||
ALWAYS_INLINE static void wait_check()
|
ALWAYS_INLINE static void wait_check()
|
||||||
{
|
{
|
||||||
Processor::pause();
|
Processor::pause();
|
||||||
|
if (Processor::is_smp_enabled())
|
||||||
Processor::current().smp_process_pending_messages();
|
Processor::current().smp_process_pending_messages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,6 +253,8 @@ public:
|
||||||
|
|
||||||
ALWAYS_INLINE ProcessorInfo& info() { return *m_info; }
|
ALWAYS_INLINE ProcessorInfo& info() { return *m_info; }
|
||||||
|
|
||||||
|
static bool is_smp_enabled();
|
||||||
|
|
||||||
ALWAYS_INLINE static Processor& current()
|
ALWAYS_INLINE static Processor& current()
|
||||||
{
|
{
|
||||||
return *(Processor*)read_gs_ptr(__builtin_offsetof(Processor, m_self));
|
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" void enter_thread_context(Thread* from_thread, Thread* to_thread) __attribute__((used));
|
||||||
extern "C" FlatPtr do_init_context(Thread* thread, u32 flags) __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()
|
UNMAP_AFTER_INIT static void sse_init()
|
||||||
{
|
{
|
||||||
write_cr0((read_cr0() & 0xfffffffbu) | 0x2);
|
write_cr0((read_cr0() & 0xfffffffbu) | 0x2);
|
||||||
|
@ -807,6 +812,8 @@ void Processor::smp_cleanup_message(ProcessorMessage& msg)
|
||||||
|
|
||||||
bool Processor::smp_process_pending_messages()
|
bool Processor::smp_process_pending_messages()
|
||||||
{
|
{
|
||||||
|
VERIFY(s_smp_enabled);
|
||||||
|
|
||||||
bool did_process = false;
|
bool did_process = false;
|
||||||
u32 prev_flags;
|
u32 prev_flags;
|
||||||
enter_critical(prev_flags);
|
enter_critical(prev_flags);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue