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

@ -4,20 +4,20 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
{
class KAutoObject
{
protected Horizon System;
protected KernelContext KernelContext;
private int _referenceCount;
public KAutoObject(Horizon system)
public KAutoObject(KernelContext context)
{
System = system;
KernelContext = context;
_referenceCount = 1;
}
public virtual KernelResult SetName(string name)
{
if (!System.AutoObjectNames.TryAdd(name, this))
if (!KernelContext.AutoObjectNames.TryAdd(name, this))
{
return KernelResult.InvalidState;
}
@ -25,9 +25,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
return KernelResult.Success;
}
public static KernelResult RemoveName(Horizon system, string name)
public static KernelResult RemoveName(KernelContext context, string name)
{
if (!system.AutoObjectNames.TryRemove(name, out _))
if (!context.AutoObjectNames.TryRemove(name, out _))
{
return KernelResult.NotFound;
}
@ -35,9 +35,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
return KernelResult.Success;
}
public static KAutoObject FindNamedObject(Horizon system, string name)
public static KAutoObject FindNamedObject(KernelContext context, string name)
{
if (system.AutoObjectNames.TryGetValue(name, out KAutoObject obj))
if (context.AutoObjectNames.TryGetValue(name, out KAutoObject obj))
{
return obj;
}