|
|
@ -57,18 +57,13 @@ void SetupMainThread(Core::System& system, KProcess& owner_process, u32 priority
|
|
|
|
thread->GetContext64().cpu_registers[0] = 0;
|
|
|
|
thread->GetContext64().cpu_registers[0] = 0;
|
|
|
|
thread->GetContext32().cpu_registers[1] = thread_handle;
|
|
|
|
thread->GetContext32().cpu_registers[1] = thread_handle;
|
|
|
|
thread->GetContext64().cpu_registers[1] = thread_handle;
|
|
|
|
thread->GetContext64().cpu_registers[1] = thread_handle;
|
|
|
|
thread->DisableDispatch();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto& kernel = system.Kernel();
|
|
|
|
if (system.DebuggerEnabled()) {
|
|
|
|
// Threads by default are dormant, wake up the main thread so it runs when the scheduler fires
|
|
|
|
thread->RequestSuspend(SuspendType::Debug);
|
|
|
|
{
|
|
|
|
|
|
|
|
KScopedSchedulerLock lock{kernel};
|
|
|
|
|
|
|
|
thread->SetState(ThreadState::Runnable);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (system.DebuggerEnabled()) {
|
|
|
|
|
|
|
|
thread->RequestSuspend(SuspendType::Debug);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Run our thread.
|
|
|
|
|
|
|
|
void(thread->Run());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // Anonymous namespace
|
|
|
|
} // Anonymous namespace
|
|
|
|
|
|
|
|
|
|
|
|