From f69a543110703e09adc830bbc65e3c39be0cc52b Mon Sep 17 00:00:00 2001 From: wwylele Date: Fri, 8 Apr 2016 19:28:54 +0300 Subject: implement wait tree widget --- src/core/hle/kernel/kernel.cpp | 4 ++++ src/core/hle/kernel/kernel.h | 3 +++ src/core/hle/kernel/thread.cpp | 4 ++++ src/core/hle/kernel/thread.h | 5 +++++ 4 files changed, 16 insertions(+) (limited to 'src/core/hle') diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 9a2c8ce05..9e1795927 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -40,6 +40,10 @@ void WaitObject::WakeupAllWaitingThreads() { HLE::Reschedule(__func__); } +const std::vector>& WaitObject::GetWaitingThreads() const { + return waiting_threads; +} + HandleTable::HandleTable() { next_generation = 1; Clear(); diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 0e95f7ff0..40c78b436 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -149,6 +149,9 @@ public: /// Wake up all threads waiting on this object void WakeupAllWaitingThreads(); + /// Get a const reference to the waiting threads list for debug use + const std::vector>& GetWaitingThreads() const; + private: /// Threads waiting for this object to become available std::vector> waiting_threads; diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 4486a812c..c4eeeee56 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -665,4 +665,8 @@ void ThreadingShutdown() { ready_queue.clear(); } +const std::vector>& GetThreadList() { + return thread_list; +} + } // namespace diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index f63131716..e0ffcea8a 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -236,4 +236,9 @@ void ThreadingInit(); */ void ThreadingShutdown(); +/** + * Get a const reference to the thread list for debug use + */ +const std::vector>& GetThreadList(); + } // namespace -- cgit v1.2.3 From 1c0179ad1b60a4f4da590760f9e7d61f211801bf Mon Sep 17 00:00:00 2001 From: wwylele Date: Fri, 8 Apr 2016 21:53:37 +0300 Subject: name objects --- src/core/hle/svc.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core/hle') diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 02b397eba..c6b80dc50 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -576,6 +576,7 @@ static ResultCode CreateMutex(Handle* out_handle, u32 initial_locked) { using Kernel::Mutex; SharedPtr mutex = Mutex::Create(initial_locked != 0); + mutex->name = Common::StringFromFormat("mutex-%08x", Core::g_app_core->GetReg(14)); CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(mutex))); LOG_TRACE(Kernel_SVC, "called initial_locked=%s : created handle=0x%08X", @@ -646,6 +647,7 @@ static ResultCode CreateSemaphore(Handle* out_handle, s32 initial_count, s32 max using Kernel::Semaphore; CASCADE_RESULT(SharedPtr semaphore, Semaphore::Create(initial_count, max_count)); + semaphore->name = Common::StringFromFormat("semaphore-%08x", Core::g_app_core->GetReg(14)); CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(semaphore))); LOG_TRACE(Kernel_SVC, "called initial_count=%d, max_count=%d, created handle=0x%08X", @@ -702,6 +704,7 @@ static ResultCode CreateEvent(Handle* out_handle, u32 reset_type) { using Kernel::Event; SharedPtr evt = Event::Create(static_cast(reset_type)); + evt->name = Common::StringFromFormat("event-%08x", Core::g_app_core->GetReg(14)); CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(evt))); LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", reset_type, @@ -748,6 +751,7 @@ static ResultCode CreateTimer(Handle* out_handle, u32 reset_type) { using Kernel::Timer; SharedPtr timer = Timer::Create(static_cast(reset_type)); + timer->name = Common::StringFromFormat("timer-%08x", Core::g_app_core->GetReg(14)); CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(timer))); LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", reset_type, -- cgit v1.2.3 From 85a83158fbee48f9281f7e3c60c461d7f73c3a1b Mon Sep 17 00:00:00 2001 From: wwylele Date: Wed, 25 May 2016 13:36:15 +0300 Subject: move ResetType to kernel.h --- src/core/hle/kernel/event.h | 6 ------ src/core/hle/kernel/kernel.h | 6 ++++++ src/core/hle/kernel/timer.h | 1 - 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/core/hle') diff --git a/src/core/hle/kernel/event.h b/src/core/hle/kernel/event.h index 6fe74065d..8dcd23edb 100644 --- a/src/core/hle/kernel/event.h +++ b/src/core/hle/kernel/event.h @@ -9,12 +9,6 @@ namespace Kernel { -enum class ResetType { - OneShot, - Sticky, - Pulse, -}; - class Event final : public WaitObject { public: /** diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 40c78b436..6b8dbecff 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -53,6 +53,12 @@ enum { DEFAULT_STACK_SIZE = 0x4000, }; +enum class ResetType { + OneShot, + Sticky, + Pulse, +}; + class Object : NonCopyable { public: virtual ~Object() {} diff --git a/src/core/hle/kernel/timer.h b/src/core/hle/kernel/timer.h index 59a77aad3..18ea0236b 100644 --- a/src/core/hle/kernel/timer.h +++ b/src/core/hle/kernel/timer.h @@ -5,7 +5,6 @@ #pragma once #include "common/common_types.h" -#include "core/hle/kernel/event.h" #include "core/hle/kernel/kernel.h" namespace Kernel { -- cgit v1.2.3