summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-06-27 22:05:07 +0200
committerGitHub <noreply@github.com>2022-06-27 22:05:07 +0200
commitc78f6d4f209b08d16d9220c0884a04e110a5373d (patch)
treec8380e8a2d7434a7a3cdfc97207bcef3c8952c3c
parentMerge pull request #8475 from liamwhite/x18 (diff)
parentRe-add missing `case` and braces, and trim whitespace (diff)
downloadyuzu-c78f6d4f209b08d16d9220c0884a04e110a5373d.tar
yuzu-c78f6d4f209b08d16d9220c0884a04e110a5373d.tar.gz
yuzu-c78f6d4f209b08d16d9220c0884a04e110a5373d.tar.bz2
yuzu-c78f6d4f209b08d16d9220c0884a04e110a5373d.tar.lz
yuzu-c78f6d4f209b08d16d9220c0884a04e110a5373d.tar.xz
yuzu-c78f6d4f209b08d16d9220c0884a04e110a5373d.tar.zst
yuzu-c78f6d4f209b08d16d9220c0884a04e110a5373d.zip
-rw-r--r--src/core/hle/kernel/svc.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 2b34fc19d..71ed17790 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -691,6 +691,9 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
// 6.0.0+
TotalPhysicalMemoryAvailableWithoutSystemResource = 21,
TotalPhysicalMemoryUsedWithoutSystemResource = 22,
+
+ // Homebrew only
+ MesosphereCurrentProcess = 65001,
};
const auto info_id_type = static_cast<GetInfoType>(info_id);
@@ -913,6 +916,27 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
*result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime();
return ResultSuccess;
}
+ case GetInfoType::MesosphereCurrentProcess: {
+ // Verify the input handle is invalid.
+ R_UNLESS(handle == InvalidHandle, ResultInvalidHandle);
+
+ // Verify the sub-type is valid.
+ R_UNLESS(info_sub_id == 0, ResultInvalidCombination);
+
+ // Get the handle table.
+ KProcess* current_process = system.Kernel().CurrentProcess();
+ KHandleTable& handle_table = current_process->GetHandleTable();
+
+ // Get a new handle for the current process.
+ Handle tmp;
+ R_TRY(handle_table.Add(&tmp, current_process));
+
+ // Set the output.
+ *result = tmp;
+
+ // We succeeded.
+ return ResultSuccess;
+ }
default:
LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id);
return ResultInvalidEnumValue;