mirror of
https://github.com/yuzu-emu/yuzu-mainline.git
synced 2024-12-12 17:44:26 +01:00
Support InfoType_MesosphereCurrentProcess
This commit is contained in:
parent
b321c39371
commit
48737a4bb2
@ -692,6 +692,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);
|
||||
@ -914,6 +917,17 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
|
||||
*result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime();
|
||||
return ResultSuccess;
|
||||
}
|
||||
case GetInfoType::MesosphereCurrentProcess: {
|
||||
R_UNLESS(handle == InvalidHandle, ResultInvalidHandle);
|
||||
R_UNLESS(info_sub_id == 0, ResultInvalidCombination);
|
||||
|
||||
KProcess* const current_process = system.Kernel().CurrentProcess();
|
||||
Handle process_handle{};
|
||||
R_TRY(current_process->GetHandleTable().Add(&process_handle, current_process));
|
||||
|
||||
*result = process_handle;
|
||||
return ResultSuccess;
|
||||
}
|
||||
default:
|
||||
LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id);
|
||||
return ResultInvalidEnumValue;
|
||||
|
Loading…
Reference in New Issue
Block a user