kernel: A bit of refactoring and fix GetThreadContext3 correctness (#3042)

* Start refactoring kernel a bit and import some changes from kernel decoupling PR

* kernel: Put output always at the start in Syscall functions

* kernel: Rewrite GetThreadContext3 to use a structure and to be accurate

* kernel: make KernelTransfer use generic types and simplify

* Fix some warning and do not use getters on MemoryInfo

* Address gdkchan's comment

* GetThreadContext3: use correct pause flag
This commit is contained in:
Mary 2022-01-29 22:18:03 +01:00 committed by GitHub
parent c52158b733
commit 20ce37dee6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 386 additions and 321 deletions

View file

@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
public KAddressArbiter AddressArbiter { get; private set; }
public long[] RandomEntropy { get; private set; }
public ulong[] RandomEntropy { get; private set; }
public KThread[] PinnedThreads { get; private set; }
private bool _signaled;
@ -102,7 +102,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
Capabilities = new KProcessCapabilities();
RandomEntropy = new long[KScheduler.CpuCoresCount];
RandomEntropy = new ulong[KScheduler.CpuCoresCount];
PinnedThreads = new KThread[KScheduler.CpuCoresCount];
// TODO: Remove once we no longer need to initialize it externally.
@ -868,12 +868,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
public bool IsCpuCoreAllowed(int core)
{
return (Capabilities.AllowedCpuCoresMask & (1L << core)) != 0;
return (Capabilities.AllowedCpuCoresMask & (1UL << core)) != 0;
}
public bool IsPriorityAllowed(int priority)
{
return (Capabilities.AllowedThreadPriosMask & (1L << priority)) != 0;
return (Capabilities.AllowedThreadPriosMask & (1UL << priority)) != 0;
}
public override bool IsSignaled()