summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-06-01 16:54:44 +0200
committerLiam <byteslice@airmail.cc>2022-06-02 03:25:32 +0200
commit07922abffc3f0c98fc47ca9f8fe340a22c8d20e0 (patch)
tree546994b941940af0f6a897b25d38ec576bcfbad7 /src/core/hle
parentMerge pull request #8402 from liamwhite/better-step (diff)
downloadyuzu-07922abffc3f0c98fc47ca9f8fe340a22c8d20e0.tar
yuzu-07922abffc3f0c98fc47ca9f8fe340a22c8d20e0.tar.gz
yuzu-07922abffc3f0c98fc47ca9f8fe340a22c8d20e0.tar.bz2
yuzu-07922abffc3f0c98fc47ca9f8fe340a22c8d20e0.tar.lz
yuzu-07922abffc3f0c98fc47ca9f8fe340a22c8d20e0.tar.xz
yuzu-07922abffc3f0c98fc47ca9f8fe340a22c8d20e0.tar.zst
yuzu-07922abffc3f0c98fc47ca9f8fe340a22c8d20e0.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/kernel/k_thread.cpp4
-rw-r--r--src/core/hle/kernel/k_thread.h10
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
resource_limit_release_hint = false;
cpu_time = 0;
+ // Set debug context.
+ stack_top = user_stack_top;
+ argument = arg;
+
// Clear our stack parameters.
std::memset(static_cast<void*>(std::addressof(GetStackParameters())), 0,
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:
void IfDummyThreadTryWait();
void IfDummyThreadEndWait();
+ [[nodiscard]] uintptr_t GetArgument() const {
+ return argument;
+ }
+
+ [[nodiscard]] VAddr GetUserStackTop() const {
+ return stack_top;
+ }
+
private:
static constexpr size_t PriorityInheritanceCountMax = 10;
union SyncObjectBuffer {
@@ -791,6 +799,8 @@ private:
std::vector<KSynchronizationObject*> wait_objects_for_debugging;
VAddr mutex_wait_address_for_debugging{};
ThreadWaitReasonForDebugging wait_reason_for_debugging{};
+ uintptr_t argument;
+ VAddr stack_top;
public:
using ConditionVariableThreadTreeType = ConditionVariableThreadTree;