aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Kernel/SvcHandler.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-09-18 20:36:43 -0300
committerGitHub <noreply@github.com>2018-09-18 20:36:43 -0300
commitb8133c19971c7a2026af803003fafedbdb70488e (patch)
tree84f4630e897ccd3f77b86051241a22a6cf45193d /Ryujinx.HLE/HOS/Kernel/SvcHandler.cs
parent33e2810ef36fe0cf613aecd4c609f425aed02539 (diff)
Thread scheduler rewrite (#393)
* Started to rewrite the thread scheduler * Add a single core-like scheduling mode, enabled by default * Clear exclusive monitor on context switch * Add SetThreadActivity, misc fixes * Implement WaitForAddress and SignalToAddress svcs, misc fixes * Misc fixes (on SetActivity and Arbiter), other tweaks * Rebased * Add missing null check * Rename multicore key on config, fix UpdatePriorityInheritance * Make scheduling data MLQs private * nit: Ordering
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