summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-03-29 22:12:02 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2019-10-15 17:55:09 +0200
commitb8b7ebcece955316680a09eb68b891e0acff9fcc (patch)
treeaa91993f95efbd8d44ef00bd535260cc32feebd1 /src
parentCorrect Supervisor Calls to work with the new scheduler, (diff)
downloadyuzu-b8b7ebcece955316680a09eb68b891e0acff9fcc.tar
yuzu-b8b7ebcece955316680a09eb68b891e0acff9fcc.tar.gz
yuzu-b8b7ebcece955316680a09eb68b891e0acff9fcc.tar.bz2
yuzu-b8b7ebcece955316680a09eb68b891e0acff9fcc.tar.lz
yuzu-b8b7ebcece955316680a09eb68b891e0acff9fcc.tar.xz
yuzu-b8b7ebcece955316680a09eb68b891e0acff9fcc.tar.zst
yuzu-b8b7ebcece955316680a09eb68b891e0acff9fcc.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/gdbstub/gdbstub.cpp32
-rw-r--r--src/core/hle/kernel/process.cpp5
-rw-r--r--src/yuzu/debugger/wait_tree.cpp5
3 files changed, 15 insertions, 27 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp
index db51d722f..20bb50868 100644
--- a/src/core/gdbstub/gdbstub.cpp
+++ b/src/core/gdbstub/gdbstub.cpp
@@ -202,13 +202,11 @@ void RegisterModule(std::string name, VAddr beg, VAddr end, bool add_elf_ext) {
}
static Kernel::Thread* FindThreadById(s64 id) {
- for (u32 core = 0; core < Core::NUM_CPU_CORES; core++) {
- const auto& threads = Core::System::GetInstance().Scheduler(core).GetThreadList();
- for (auto& thread : threads) {
- if (thread->GetThreadID() == static_cast<u64>(id)) {
- current_core = core;
- return thread.get();
- }
+ const auto& threads = Core::System::GetInstance().GlobalScheduler().GetThreadList();
+ for (auto& thread : threads) {
+ if (thread->GetThreadID() == static_cast<u64>(id)) {
+ current_core = thread->GetProcessorID();
+ return thread.get();
}
}
return nullptr;
@@ -647,11 +645,9 @@ static void HandleQuery() {
SendReply(buffer.c_str());
} else if (strncmp(query, "fThreadInfo", strlen("fThreadInfo")) == 0) {
std::string val = "m";
- for (u32 core = 0; core < Core::NUM_CPU_CORES; core++) {
- const auto& threads = Core::System::GetInstance().Scheduler(core).GetThreadList();
- for (const auto& thread : threads) {
- val += fmt::format("{:x},", thread->GetThreadID());
- }
+ const auto& threads = Core::System::GetInstance().GlobalScheduler().GetThreadList();
+ for (const auto& thread : threads) {
+ val += fmt::format("{:x},", thread->GetThreadID());
}
val.pop_back();
SendReply(val.c_str());
@@ -661,13 +657,11 @@ static void HandleQuery() {
std::string buffer;
buffer += "l<?xml version=\"1.0\"?>";
buffer += "<threads>";
- for (u32 core = 0; core < Core::NUM_CPU_CORES; core++) {
- const auto& threads = Core::System::GetInstance().Scheduler(core).GetThreadList();
- for (const auto& thread : threads) {
- buffer +=
- fmt::format(R"*(<thread id="{:x}" core="{:d}" name="Thread {:x}"></thread>)*",
- thread->GetThreadID(), core, thread->GetThreadID());
- }
+ const auto& threads = Core::System::GetInstance().GlobalScheduler().GetThreadList();
+ for (const auto& thread : threads) {
+ buffer +=
+ fmt::format(R"*(<thread id="{:x}" core="{:d}" name="Thread {:x}"></thread>)*",
+ thread->GetThreadID(), thread->GetProcessorID(), thread->GetThreadID());
}
buffer += "</threads>";
SendReply(buffer.c_str());
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index e80a12ac3..12a900bcc 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -213,10 +213,7 @@ void Process::PrepareForTermination() {
}
};
- stop_threads(system.Scheduler(0).GetThreadList());
- stop_threads(system.Scheduler(1).GetThreadList());
- stop_threads(system.Scheduler(2).GetThreadList());
- stop_threads(system.Scheduler(3).GetThreadList());
+ stop_threads(system.GlobalScheduler().GetThreadList());
FreeTLSRegion(tls_region_address);
tls_region_address = 0;
diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp
index cd8180f8b..c5b9aa08f 100644
--- a/src/yuzu/debugger/wait_tree.cpp
+++ b/src/yuzu/debugger/wait_tree.cpp
@@ -66,10 +66,7 @@ std::vector<std::unique_ptr<WaitTreeThread>> WaitTreeItem::MakeThreadItemList()
};
const auto& system = Core::System::GetInstance();
- add_threads(system.Scheduler(0).GetThreadList());
- add_threads(system.Scheduler(1).GetThreadList());
- add_threads(system.Scheduler(2).GetThreadList());
- add_threads(system.Scheduler(3).GetThreadList());
+ add_threads(system.GlobalScheduler().GetThreadList());
return item_list;
}