summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-12 01:44:53 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:47 +0200
commite6f8bde74b9476dced103c6c54ab81616d34b97e (patch)
tree488d71b9de2368944b99b0a188adb84826f1167a /src
parentKernel: Rewind on SVC change. (diff)
downloadyuzu-e6f8bde74b9476dced103c6c54ab81616d34b97e.tar
yuzu-e6f8bde74b9476dced103c6c54ab81616d34b97e.tar.gz
yuzu-e6f8bde74b9476dced103c6c54ab81616d34b97e.tar.bz2
yuzu-e6f8bde74b9476dced103c6c54ab81616d34b97e.tar.lz
yuzu-e6f8bde74b9476dced103c6c54ab81616d34b97e.tar.xz
yuzu-e6f8bde74b9476dced103c6c54ab81616d34b97e.tar.zst
yuzu-e6f8bde74b9476dced103c6c54ab81616d34b97e.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/core_timing.cpp1
-rw-r--r--src/core/hle/kernel/kernel.cpp15
-rw-r--r--src/core/hle/kernel/thread.cpp8
-rw-r--r--src/yuzu/bootmanager.cpp6
4 files changed, 25 insertions, 5 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index c91ae9975..3438f79ce 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -61,6 +61,7 @@ void CoreTiming::Initialize(std::function<void(void)>&& on_thread_init_) {
void CoreTiming::Shutdown() {
paused = true;
shutting_down = true;
+ pause_event.Set();
event.Set();
timer_thread->join();
ClearPendingEvents();
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 2a1b91752..24da4367e 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -119,6 +119,7 @@ struct KernelCore::Impl {
void Initialize(KernelCore& kernel) {
Shutdown();
+ RegisterHostThread();
InitializePhysicalCores();
InitializeSystemResourceLimit(kernel);
@@ -135,6 +136,19 @@ struct KernelCore::Impl {
next_user_process_id = Process::ProcessIDMin;
next_thread_id = 1;
+ for (std::size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) {
+ if (suspend_threads[i]) {
+ suspend_threads[i].reset();
+ }
+ }
+
+ for (std::size_t i = 0; i < cores.size(); i++) {
+ cores[i].Shutdown();
+ }
+ cores.clear();
+
+ registered_core_threads.reset();
+
process_list.clear();
current_process = nullptr;
@@ -154,6 +168,7 @@ struct KernelCore::Impl {
cores.clear();
exclusive_monitor.reset();
+ host_thread_ids.clear();
}
void InitializePhysicalCores() {
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 1c32552b1..6f8e7a070 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -56,10 +56,12 @@ void Thread::Stop() {
Signal();
kernel.GlobalHandleTable().Close(global_handle);
- owner_process->UnregisterThread(this);
+ if (owner_process) {
+ owner_process->UnregisterThread(this);
- // Mark the TLS slot in the thread's page as free.
- owner_process->FreeTLSRegion(tls_address);
+ // Mark the TLS slot in the thread's page as free.
+ owner_process->FreeTLSRegion(tls_address);
+ }
}
global_handle = 0;
}
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 468dde782..6fad01d50 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -89,8 +89,10 @@ void EmuThread::run() {
}
running_guard = false;
- was_active = true;
- emit DebugModeEntered();
+ if (!stop_run) {
+ was_active = true;
+ emit DebugModeEntered();
+ }
} else if (exec_step) {
UNIMPLEMENTED();
} else {