aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/k_thread.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2023-01-27 15:06:09 -0800
committerGitHub <noreply@github.com>2023-01-27 15:06:09 -0800
commit32b2a72e7b68427c619d2dae4daef963a826bb9e (patch)
tree50129dff54c382ab8dfe7bd1c0af803dcc9cf851 /src/core/hle/kernel/k_thread.h
parente54d08fc1fa79f6c0e66f2e2ef06f21ca36cf881 (diff)
parent693cad8e9b45cb61370bbc05e8e0022ea42044f9 (diff)
Merge pull request #9666 from liamwhite/wait-for-me
kernel: fix incorrect locking order in suspension
Diffstat (limited to 'src/core/hle/kernel/k_thread.h')
-rw-r--r--src/core/hle/kernel/k_thread.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h
index 7cd94a340..9d771de0e 100644
--- a/src/core/hle/kernel/k_thread.h
+++ b/src/core/hle/kernel/k_thread.h
@@ -214,8 +214,6 @@ public:
void Continue();
- void WaitUntilSuspended();
-
constexpr void SetSyncedIndex(s32 index) {
synced_index = index;
}
@@ -607,13 +605,30 @@ public:
return address_key_value;
}
- void SetAddressKey(VAddr key) {
+ [[nodiscard]] bool GetAddressKeyIsKernel() const {
+ return address_key_is_kernel;
+ }
+
+ //! NB: intentional deviation from official kernel.
+ //
+ // Separate SetAddressKey into user and kernel versions
+ // to cope with arbitrary host pointers making their way
+ // into things.
+
+ void SetUserAddressKey(VAddr key) {
address_key = key;
+ address_key_is_kernel = false;
}
- void SetAddressKey(VAddr key, u32 val) {
+ void SetUserAddressKey(VAddr key, u32 val) {
address_key = key;
address_key_value = val;
+ address_key_is_kernel = false;
+ }
+
+ void SetKernelAddressKey(VAddr key) {
+ address_key = key;
+ address_key_is_kernel = true;
}
void ClearWaitQueue() {
@@ -772,6 +787,7 @@ private:
bool debug_attached{};
s8 priority_inheritance_count{};
bool resource_limit_release_hint{};
+ bool address_key_is_kernel{};
StackParameters stack_parameters{};
Common::SpinLock context_guard{};