diff options
author | bunnei <bunneidev@gmail.com> | 2016-10-05 05:01:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-05 05:01:56 +0200 |
commit | 09c3e444d42856ca0978153dcabcb5c3884877b9 (patch) | |
tree | 89732a2264868d7dddc8f4c8355c0afac62b108c /src/core | |
parent | Merge pull request #2106 from wwylele/delete-recursive (diff) | |
parent | move ResetType to kernel.h (diff) | |
download | yuzu-09c3e444d42856ca0978153dcabcb5c3884877b9.tar yuzu-09c3e444d42856ca0978153dcabcb5c3884877b9.tar.gz yuzu-09c3e444d42856ca0978153dcabcb5c3884877b9.tar.bz2 yuzu-09c3e444d42856ca0978153dcabcb5c3884877b9.tar.lz yuzu-09c3e444d42856ca0978153dcabcb5c3884877b9.tar.xz yuzu-09c3e444d42856ca0978153dcabcb5c3884877b9.tar.zst yuzu-09c3e444d42856ca0978153dcabcb5c3884877b9.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/event.h | 6 | ||||
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 4 | ||||
-rw-r--r-- | src/core/hle/kernel/kernel.h | 9 | ||||
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 4 | ||||
-rw-r--r-- | src/core/hle/kernel/thread.h | 5 | ||||
-rw-r--r-- | src/core/hle/kernel/timer.h | 1 | ||||
-rw-r--r-- | src/core/hle/svc.cpp | 4 |
7 files changed, 26 insertions, 7 deletions
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.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<SharedPtr<Thread>>& 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..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() {} @@ -149,6 +155,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<SharedPtr<Thread>>& GetWaitingThreads() const; + private: /// Threads waiting for this object to become available std::vector<SharedPtr<Thread>> 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<SharedPtr<Thread>>& 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<SharedPtr<Thread>>& GetThreadList(); + } // namespace 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 { 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 = 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, 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<Event> evt = Event::Create(static_cast<Kernel::ResetType>(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 = Timer::Create(static_cast<Kernel::ResetType>(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, |