diff options
| author | Mary <me@thog.eu> | 2021-04-14 00:01:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-14 00:01:24 +0200 |
| commit | 0746b83edf49d1fd668dd337264e942f361b675c (patch) | |
| tree | 37b71396036206252cdc42715d6a3046ee81c795 /Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs | |
| parent | faa654dbaf7cd5262c78c0961a5aa72b1ce8ac33 (diff) | |
Initial support for the new 12.x IPC system (#2182)
* Rename CommandAttribute as CommandHIpcAttribute to prepare for 12.x changes
* Implement inital support for TIPC and adds SM command ids
* *Ipc to *ipc
* Missed a ref in last commit...
* CommandAttributeTIpc to CommandAttributeTipc
* Addresses comment and fixes some bugs around
TIPC doesn't have any padding requirements as buffer C isn't a thing
Fix for RegisterService inverting two argument only on TIPC
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs | 43 |
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) { |
