Move kernel state out of the Horizon class (#1107)

* Move kernel state from Horizon to KernelContext

* Merge syscalls partial classes, split 32 and 64-bit variants

* Sort usings
This commit is contained in:
gdkchan 2020-05-04 00:41:29 -03:00 committed by GitHub
parent cd48576f58
commit 15d1cc806b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
68 changed files with 3678 additions and 3570 deletions

View file

@ -17,31 +17,31 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
// services implementation to work with the new IPC system.
public IpcService Service { get; set; }
public KClientSession(Horizon system, KSession parent) : base(system)
public KClientSession(KernelContext context, KSession parent) : base(context)
{
_parent = parent;
State = ChannelState.Open;
CreatorProcess = system.Scheduler.GetCurrentProcess();
CreatorProcess = context.Scheduler.GetCurrentProcess();
CreatorProcess.IncrementReferenceCount();
}
public KernelResult SendSyncRequest(ulong customCmdBuffAddr = 0, ulong customCmdBuffSize = 0)
{
KThread currentThread = System.Scheduler.GetCurrentThread();
KThread currentThread = KernelContext.Scheduler.GetCurrentThread();
KSessionRequest request = new KSessionRequest(currentThread, customCmdBuffAddr, customCmdBuffSize);
System.CriticalSection.Enter();
KernelContext.CriticalSection.Enter();
currentThread.SignaledObj = null;
currentThread.ObjSyncResult = KernelResult.Success;
KernelResult result = _parent.ServerSession.EnqueueRequest(request);
System.CriticalSection.Leave();
KernelContext.CriticalSection.Leave();
if (result == KernelResult.Success)
{