aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs43
1 files changed, 37 insertions, 6 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs b/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs
index 69bb3708..d5dabb2d 100644
--- a/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs
+++ b/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs
@@ -1,4 +1,5 @@
using Ryujinx.Common.Logging;
+using Ryujinx.HLE.Exceptions;
using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Kernel;
using Ryujinx.HLE.HOS.Kernel.Common;
@@ -36,7 +37,8 @@ namespace Ryujinx.HLE.HOS.Services.Sm
_commonServer = new ServerBase(context, "CommonServer");
}
- [Command(0)]
+ [CommandHipc(0)]
+ [CommandTipc(0)] // 12.0.0+
// Initialize(pid, u64 reserved)
public ResultCode Initialize(ServiceCtx context)
{
@@ -45,7 +47,8 @@ namespace Ryujinx.HLE.HOS.Services.Sm
return ResultCode.Success;
}
- [Command(1)]
+ [CommandHipc(1)]
+ [CommandTipc(1)] // 12.0.0+
// GetService(ServiceName name) -> handle<move, session>
public ResultCode GetService(ServiceCtx context)
{
@@ -111,9 +114,9 @@ namespace Ryujinx.HLE.HOS.Services.Sm
return ResultCode.Success;
}
- [Command(2)]
- // RegisterService(ServiceName name, u8, u32 maxHandles) -> handle<move, port>
- public ResultCode RegisterService(ServiceCtx context)
+ [CommandHipc(2)]
+ // RegisterService(ServiceName name, u8 isLight, u32 maxHandles) -> handle<move, port>
+ public ResultCode RegisterServiceHipc(ServiceCtx context)
{
if (!_isInitialized)
{
@@ -130,6 +133,33 @@ namespace Ryujinx.HLE.HOS.Services.Sm
int maxSessions = context.RequestData.ReadInt32();
+ return RegisterService(context, name, isLight, maxSessions);
+ }
+
+ [CommandTipc(2)] // 12.0.0+
+ // RegisterService(ServiceName name, u32 maxHandles, u8 isLight) -> handle<move, port>
+ public ResultCode RegisterServiceTipc(ServiceCtx context)
+ {
+ if (!_isInitialized)
+ {
+ return ResultCode.NotInitialized;
+ }
+
+ long namePosition = context.RequestData.BaseStream.Position;
+
+ string name = ReadName(context);
+
+ context.RequestData.BaseStream.Seek(namePosition + 8, SeekOrigin.Begin);
+
+ int maxSessions = context.RequestData.ReadInt32();
+
+ bool isLight = (context.RequestData.ReadInt32() & 1) != 0;
+
+ return RegisterService(context, name, isLight, maxSessions);
+ }
+
+ private ResultCode RegisterService(ServiceCtx context, string name, bool isLight, int maxSessions)
+ {
if (string.IsNullOrEmpty(name))
{
return ResultCode.InvalidName;
@@ -154,7 +184,8 @@ namespace Ryujinx.HLE.HOS.Services.Sm
return ResultCode.Success;
}
- [Command(3)]
+ [CommandHipc(3)]
+ [CommandTipc(3)] // 12.0.0+
// UnregisterService(ServiceName name)
public ResultCode UnregisterService(ServiceCtx context)
{