diff options
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/k_thread.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_thread.h | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index ab9ce6a86..940334f59 100644 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp | |||
| @@ -198,6 +198,10 @@ ResultCode KThread::Initialize(KThreadFunction func, uintptr_t arg, VAddr user_s | |||
| 198 | resource_limit_release_hint = false; | 198 | resource_limit_release_hint = false; |
| 199 | cpu_time = 0; | 199 | cpu_time = 0; |
| 200 | 200 | ||
| 201 | // Set debug context. | ||
| 202 | stack_top = user_stack_top; | ||
| 203 | argument = arg; | ||
| 204 | |||
| 201 | // Clear our stack parameters. | 205 | // Clear our stack parameters. |
| 202 | std::memset(static_cast<void*>(std::addressof(GetStackParameters())), 0, | 206 | std::memset(static_cast<void*>(std::addressof(GetStackParameters())), 0, |
| 203 | sizeof(StackParameters)); | 207 | sizeof(StackParameters)); |
diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h index 60ae0da78..f4d83f99a 100644 --- a/src/core/hle/kernel/k_thread.h +++ b/src/core/hle/kernel/k_thread.h | |||
| @@ -660,6 +660,14 @@ public: | |||
| 660 | void IfDummyThreadTryWait(); | 660 | void IfDummyThreadTryWait(); |
| 661 | void IfDummyThreadEndWait(); | 661 | void IfDummyThreadEndWait(); |
| 662 | 662 | ||
| 663 | [[nodiscard]] uintptr_t GetArgument() const { | ||
| 664 | return argument; | ||
| 665 | } | ||
| 666 | |||
| 667 | [[nodiscard]] VAddr GetUserStackTop() const { | ||
| 668 | return stack_top; | ||
| 669 | } | ||
| 670 | |||
| 663 | private: | 671 | private: |
| 664 | static constexpr size_t PriorityInheritanceCountMax = 10; | 672 | static constexpr size_t PriorityInheritanceCountMax = 10; |
| 665 | union SyncObjectBuffer { | 673 | union SyncObjectBuffer { |
| @@ -791,6 +799,8 @@ private: | |||
| 791 | std::vector<KSynchronizationObject*> wait_objects_for_debugging; | 799 | std::vector<KSynchronizationObject*> wait_objects_for_debugging; |
| 792 | VAddr mutex_wait_address_for_debugging{}; | 800 | VAddr mutex_wait_address_for_debugging{}; |
| 793 | ThreadWaitReasonForDebugging wait_reason_for_debugging{}; | 801 | ThreadWaitReasonForDebugging wait_reason_for_debugging{}; |
| 802 | uintptr_t argument; | ||
| 803 | VAddr stack_top; | ||
| 794 | 804 | ||
| 795 | public: | 805 | public: |
| 796 | using ConditionVariableThreadTreeType = ConditionVariableThreadTree; | 806 | using ConditionVariableThreadTreeType = ConditionVariableThreadTree; |