aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Kernel/SvcHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/SvcHandler.cs')
-rw-r--r--Ryujinx.HLE/HOS/Kernel/SvcHandler.cs32
1 files changed, 24 insertions, 8 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/SvcHandler.cs b/Ryujinx.HLE/HOS/Kernel/SvcHandler.cs
index fcb72c14..a12a0ba0 100644
--- a/Ryujinx.HLE/HOS/Kernel/SvcHandler.cs
+++ b/Ryujinx.HLE/HOS/Kernel/SvcHandler.cs
@@ -1,11 +1,10 @@
using ChocolArm64.Events;
using ChocolArm64.Memory;
using ChocolArm64.State;
+using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.Logging;
using System;
-using System.Collections.Concurrent;
using System.Collections.Generic;
-using System.Threading;
namespace Ryujinx.HLE.HOS.Kernel
{
@@ -17,9 +16,28 @@ namespace Ryujinx.HLE.HOS.Kernel
private Switch Device;
private Process Process;
+ private Horizon System;
private AMemory Memory;
- private ConcurrentDictionary<KThread, AutoResetEvent> SyncWaits;
+ private struct HleIpcMessage
+ {
+ public KThread Thread { get; private set; }
+ public KSession Session { get; private set; }
+ public IpcMessage Message { get; private set; }
+ public long MessagePtr { get; private set; }
+
+ public HleIpcMessage(
+ KThread Thread,
+ KSession Session,
+ IpcMessage Message,
+ long MessagePtr)
+ {
+ this.Thread = Thread;
+ this.Session = Session;
+ this.Message = Message;
+ this.MessagePtr = MessagePtr;
+ }
+ }
private const uint SelfThreadHandle = 0xffff8000;
private const uint SelfProcessHandle = 0xffff8001;
@@ -69,14 +87,14 @@ namespace Ryujinx.HLE.HOS.Kernel
{ 0x2d, SvcUnmapPhysicalMemory },
{ 0x32, SvcSetThreadActivity },
{ 0x33, SvcGetThreadContext3 },
- { 0x34, SvcWaitForAddress }
+ { 0x34, SvcWaitForAddress },
+ { 0x35, SvcSignalToAddress }
};
this.Device = Device;
this.Process = Process;
+ this.System = Process.Device.System;
this.Memory = Process.Memory;
-
- SyncWaits = new ConcurrentDictionary<KThread, AutoResetEvent>();
}
static SvcHandler()
@@ -96,8 +114,6 @@ namespace Ryujinx.HLE.HOS.Kernel
Func(ThreadState);
- Process.Scheduler.Reschedule(Process.GetThread(ThreadState.Tpidr));
-
Device.Log.PrintDebug(LogClass.KernelSvc, $"{Func.Method.Name} ended.");
}
else