summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_handle_table.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2022-11-22 19:43:53 +0100
committerLioncash <mathew1800@gmail.com>2022-11-22 19:58:42 +0100
commit8d99aae45b04f1a70cad90e6fdc7ff91aee57edc (patch)
tree4a004b735d08ee3181a478a33facc7bb87887643 /src/core/hle/kernel/k_handle_table.cpp
parentMerge pull request #9292 from Morph1984/amiibo-web-service (diff)
downloadyuzu-8d99aae45b04f1a70cad90e6fdc7ff91aee57edc.tar
yuzu-8d99aae45b04f1a70cad90e6fdc7ff91aee57edc.tar.gz
yuzu-8d99aae45b04f1a70cad90e6fdc7ff91aee57edc.tar.bz2
yuzu-8d99aae45b04f1a70cad90e6fdc7ff91aee57edc.tar.lz
yuzu-8d99aae45b04f1a70cad90e6fdc7ff91aee57edc.tar.xz
yuzu-8d99aae45b04f1a70cad90e6fdc7ff91aee57edc.tar.zst
yuzu-8d99aae45b04f1a70cad90e6fdc7ff91aee57edc.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/k_handle_table.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_handle_table.cpp b/src/core/hle/kernel/k_handle_table.cpp
index 1c7a766c8..3535ddc0c 100644
--- a/src/core/hle/kernel/k_handle_table.cpp
+++ b/src/core/hle/kernel/k_handle_table.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/kernel/k_handle_table.h"
+#include "core/hle/kernel/k_process.h"
namespace Kernel {
@@ -82,6 +83,22 @@ Result KHandleTable::Add(Handle* out_handle, KAutoObject* obj) {
R_SUCCEED();
}
+KScopedAutoObject<KAutoObject> KHandleTable::GetObjectForIpc(Handle handle,
+ KThread* cur_thread) const {
+ // Handle pseudo-handles.
+ ASSERT(cur_thread != nullptr);
+ if (handle == Svc::PseudoHandle::CurrentProcess) {
+ auto* const cur_process = cur_thread->GetOwnerProcess();
+ ASSERT(cur_process != nullptr);
+ return cur_process;
+ }
+ if (handle == Svc::PseudoHandle::CurrentThread) {
+ return cur_thread;
+ }
+
+ return GetObjectForIpcWithoutPseudoHandle(handle);
+}
+
Result KHandleTable::Reserve(Handle* out_handle) {
KScopedDisableDispatch dd{m_kernel};
KScopedSpinLock lk(m_lock);