Kernel: APs now start their idle threads when scheduler is started
This commit is contained in:
@@ -15,6 +15,7 @@ namespace Kernel
|
||||
extern "C" [[noreturn]] void continue_thread(uintptr_t rsp, uintptr_t rip);
|
||||
|
||||
static Scheduler* s_instance = nullptr;
|
||||
static BAN::Atomic<bool> s_started { false };
|
||||
|
||||
ALWAYS_INLINE static void load_temp_stack()
|
||||
{
|
||||
@@ -40,12 +41,17 @@ namespace Kernel
|
||||
{
|
||||
ASSERT(Processor::get_interrupt_state() == InterruptState::Disabled);
|
||||
m_lock.lock();
|
||||
ASSERT(!m_active_threads.empty());
|
||||
s_started = true;
|
||||
advance_current_thread();
|
||||
execute_current_thread_locked();
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
bool Scheduler::is_started()
|
||||
{
|
||||
return s_started;
|
||||
}
|
||||
|
||||
Thread& Scheduler::current_thread()
|
||||
{
|
||||
auto* current = Processor::get_current_thread();
|
||||
|
||||
Reference in New Issue
Block a user