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:
parent
cd48576f58
commit
15d1cc806b
68 changed files with 3678 additions and 3570 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue