summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_thread.h
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-01-24 02:31:03 +0100
committerLiam <byteslice@airmail.cc>2023-01-24 02:31:03 +0100
commit693cad8e9b45cb61370bbc05e8e0022ea42044f9 (patch)
tree7a64dd5d228f3d1611f6df381504ace9a9bf863a /src/core/hle/kernel/k_thread.h
parentkernel: fix incorrect locking order in suspension (diff)
downloadyuzu-693cad8e9b45cb61370bbc05e8e0022ea42044f9.tar
yuzu-693cad8e9b45cb61370bbc05e8e0022ea42044f9.tar.gz
yuzu-693cad8e9b45cb61370bbc05e8e0022ea42044f9.tar.bz2
yuzu-693cad8e9b45cb61370bbc05e8e0022ea42044f9.tar.lz
yuzu-693cad8e9b45cb61370bbc05e8e0022ea42044f9.tar.xz
yuzu-693cad8e9b45cb61370bbc05e8e0022ea42044f9.tar.zst
yuzu-693cad8e9b45cb61370bbc05e8e0022ea42044f9.zip
Diffstat (limited to 'src/core/hle/kernel/k_thread.h')
-rw-r--r--src/core/hle/kernel/k_thread.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h
index 083f4962d..9d771de0e 100644
--- a/src/core/hle/kernel/k_thread.h
+++ b/src/core/hle/kernel/k_thread.h
@@ -605,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() {
@@ -770,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{};