mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-30 07:02:21 -05:00
Move solution and projects to src
This commit is contained in:
8
src/Ryujinx.HLE/HOS/Services/Pm/IBootModeInterface.cs
Normal file
8
src/Ryujinx.HLE/HOS/Services/Pm/IBootModeInterface.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Ryujinx.HLE.HOS.Services.Pm
|
||||
{
|
||||
[Service("pm:bm")]
|
||||
class IBootModeInterface : IpcService
|
||||
{
|
||||
public IBootModeInterface(ServiceCtx context) { }
|
||||
}
|
||||
}
|
||||
49
src/Ryujinx.HLE/HOS/Services/Pm/IDebugMonitorInterface.cs
Normal file
49
src/Ryujinx.HLE/HOS/Services/Pm/IDebugMonitorInterface.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Ryujinx.HLE.HOS.Ipc;
|
||||
using Ryujinx.HLE.HOS.Kernel;
|
||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||
using Ryujinx.Horizon.Common;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Pm
|
||||
{
|
||||
[Service("pm:dmnt")]
|
||||
class IDebugMonitorInterface : IpcService
|
||||
{
|
||||
public IDebugMonitorInterface(ServiceCtx context) { }
|
||||
|
||||
[CommandCmif(4)]
|
||||
// GetProgramId() -> sf::Out<ncm::ProgramId> out_process_id
|
||||
public ResultCode GetApplicationProcessId(ServiceCtx context)
|
||||
{
|
||||
// TODO: Not correct as it shouldn't be directly using kernel objects here
|
||||
foreach (KProcess process in context.Device.System.KernelContext.Processes.Values)
|
||||
{
|
||||
if (process.IsApplication)
|
||||
{
|
||||
context.ResponseData.Write(process.Pid);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
|
||||
return ResultCode.ProcessNotFound;
|
||||
}
|
||||
|
||||
[CommandCmif(65000)]
|
||||
// AtmosphereGetProcessInfo(os::ProcessId process_id) -> sf::OutCopyHandle out_process_handle, sf::Out<ncm::ProgramLocation> out_loc, sf::Out<cfg::OverrideStatus> out_status
|
||||
public ResultCode GetProcessInfo(ServiceCtx context)
|
||||
{
|
||||
ulong pid = context.RequestData.ReadUInt64();
|
||||
|
||||
KProcess process = KernelStatic.GetProcessByPid(pid);
|
||||
|
||||
if (context.Process.HandleTable.GenerateHandle(process, out int processHandle) != Result.Success)
|
||||
{
|
||||
throw new System.Exception("Out of handles!");
|
||||
}
|
||||
|
||||
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(processHandle);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
27
src/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs
Normal file
27
src/Ryujinx.HLE/HOS/Services/Pm/IInformationInterface.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Pm
|
||||
{
|
||||
[Service("pm:info")]
|
||||
class IInformationInterface : IpcService
|
||||
{
|
||||
public IInformationInterface(ServiceCtx context) { }
|
||||
|
||||
[CommandCmif(0)]
|
||||
// GetProgramId(os::ProcessId process_id) -> sf::Out<ncm::ProgramId> out
|
||||
public ResultCode GetProgramId(ServiceCtx context)
|
||||
{
|
||||
ulong pid = context.RequestData.ReadUInt64();
|
||||
|
||||
// TODO: Not correct as it shouldn't be directly using kernel objects here
|
||||
if (context.Device.System.KernelContext.Processes.TryGetValue(pid, out KProcess process))
|
||||
{
|
||||
context.ResponseData.Write(process.TitleId);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
return ResultCode.ProcessNotFound;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
src/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs
Normal file
21
src/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace Ryujinx.HLE.HOS.Services.Pm
|
||||
{
|
||||
[Service("pm:shell")]
|
||||
class IShellInterface : IpcService
|
||||
{
|
||||
public IShellInterface(ServiceCtx context) { }
|
||||
|
||||
[CommandCmif(6)]
|
||||
// GetApplicationPid() -> u64
|
||||
public ResultCode GetApplicationPid(ServiceCtx context)
|
||||
{
|
||||
// FIXME: This is wrong but needed to make hb loader works
|
||||
// TODO: Change this when we will have a way to process via a PM like interface.
|
||||
ulong pid = context.Process.Pid;
|
||||
|
||||
context.ResponseData.Write(pid);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
17
src/Ryujinx.HLE/HOS/Services/Pm/ResultCode.cs
Normal file
17
src/Ryujinx.HLE/HOS/Services/Pm/ResultCode.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Ryujinx.HLE.HOS.Services.Pm
|
||||
{
|
||||
enum ResultCode
|
||||
{
|
||||
ModuleId = 15,
|
||||
ErrorCodeShift = 9,
|
||||
|
||||
Success = 0,
|
||||
|
||||
ProcessNotFound = (1 << ErrorCodeShift) | ModuleId,
|
||||
AlreadyStarted = (2 << ErrorCodeShift) | ModuleId,
|
||||
NotTerminated = (3 << ErrorCodeShift) | ModuleId,
|
||||
DebugHookInUse = (4 << ErrorCodeShift) | ModuleId,
|
||||
ApplicationRunning = (5 << ErrorCodeShift) | ModuleId,
|
||||
InvalidSize = (6 << ErrorCodeShift) | ModuleId,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user