Compare commits

..

No commits in common. "1f03d23daec075e3da90c13b2fcd5cc7bbecf1a1" and "ed82a18e2aab203e80bce433d74e07a63c6db58b" have entirely different histories.

1 changed files with 6 additions and 10 deletions

View File

@ -223,7 +223,6 @@ namespace Kernel
{ {
case Thread::State::Terminated: case Thread::State::Terminated:
remove_node_from_most_loaded(m_current); remove_node_from_most_loaded(m_current);
if (&PageTable::current() != &PageTable::kernel())
PageTable::kernel().load(); PageTable::kernel().load();
delete m_current->thread; delete m_current->thread;
delete m_current; delete m_current;
@ -256,7 +255,6 @@ namespace Kernel
if (m_current->thread->state() != Thread::State::Terminated) if (m_current->thread->state() != Thread::State::Terminated)
break; break;
remove_node_from_most_loaded(m_current); remove_node_from_most_loaded(m_current);
if (&PageTable::current() != &PageTable::kernel())
PageTable::kernel().load(); PageTable::kernel().load();
delete m_current->thread; delete m_current->thread;
delete m_current; delete m_current;
@ -265,7 +263,6 @@ namespace Kernel
if (m_current == nullptr) if (m_current == nullptr)
{ {
if (&PageTable::current() != &PageTable::kernel())
PageTable::kernel().load(); PageTable::kernel().load();
*interrupt_stack = m_idle_thread->interrupt_stack(); *interrupt_stack = m_idle_thread->interrupt_stack();
*interrupt_registers = m_idle_thread->interrupt_registers(); *interrupt_registers = m_idle_thread->interrupt_registers();
@ -279,7 +276,6 @@ namespace Kernel
auto* thread = m_current->thread; auto* thread = m_current->thread;
auto& page_table = thread->has_process() ? thread->process().page_table() : PageTable::kernel(); auto& page_table = thread->has_process() ? thread->process().page_table() : PageTable::kernel();
if (&PageTable::current() != &page_table)
page_table.load(); page_table.load();
if (thread->state() == Thread::State::NotStarted) if (thread->state() == Thread::State::NotStarted)
@ -411,10 +407,10 @@ namespace Kernel
uint32_t least_max_load_threads = static_cast<uint32_t>(-1); uint32_t least_max_load_threads = static_cast<uint32_t>(-1);
for (uint8_t i = 0; i < Processor::count(); i++) for (uint8_t i = 0; i < Processor::count(); i++)
{ {
const auto processor_id = Processor::id_from_index(i); auto processor_id = Processor::id_from_index(i);
if (processor_id == Processor::current_id()) if (processor_id == Processor::current_id())
continue; continue;
const auto& info = s_processor_infos[processor_id.as_u32()]; const auto& info = s_processor_infos[i];
if (info.idle_time_ns < most_idle_ns || info.max_load_threads > least_max_load_threads) if (info.idle_time_ns < most_idle_ns || info.max_load_threads > least_max_load_threads)
continue; continue;
least_loaded_id = processor_id; least_loaded_id = processor_id;