early-access version 2750

This commit is contained in:
pineappleEA
2022-06-01 20:08:41 +02:00
parent 4c2b55bc80
commit de45c3e604
32 changed files with 1661 additions and 69 deletions

View File

@@ -64,6 +64,10 @@ void SetupMainThread(Core::System& system, KProcess& owner_process, u32 priority
{
KScopedSchedulerLock lock{kernel};
thread->SetState(ThreadState::Runnable);
if (system.DebuggerEnabled()) {
thread->RequestSuspend(SuspendType::Debug);
}
}
}
} // Anonymous namespace

View File

@@ -100,6 +100,12 @@ enum class ThreadWaitReasonForDebugging : u32 {
Suspended, ///< Thread is waiting due to process suspension
};
enum class StepState : u32 {
NotStepping, ///< Thread is not currently stepping
StepPending, ///< Thread will step when next scheduled
StepPerformed, ///< Thread has stepped, waiting to be scheduled again
};
[[nodiscard]] KThread* GetCurrentThreadPointer(KernelCore& kernel);
[[nodiscard]] KThread& GetCurrentThread(KernelCore& kernel);
[[nodiscard]] s32 GetCurrentCoreId(KernelCore& kernel);
@@ -267,6 +273,14 @@ public:
void SetState(ThreadState state);
[[nodiscard]] StepState GetStepState() const {
return step_state;
}
void SetStepState(StepState state) {
step_state = state;
}
[[nodiscard]] s64 GetLastScheduledTick() const {
return last_scheduled_tick;
}
@@ -769,6 +783,7 @@ private:
std::shared_ptr<Common::Fiber> host_context{};
bool is_single_core{};
ThreadType thread_type{};
StepState step_state{};
std::mutex dummy_wait_lock;
std::condition_variable dummy_wait_cv;