diff options
| author | Tobias <thm.frey@gmail.com> | 2018-06-10 06:36:07 +0200 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-06-10 01:36:07 -0300 |
| commit | 7b7dbdcc6ab122faffec487b797fb6cc7a5585c9 (patch) | |
| tree | fa2571d5fd0515083656b694755caf748988867d /Ryujinx.Core/OsHle/Kernel/SvcThread.cs | |
| parent | 49fd76db0fee72870e0b7fee73e6b6380fa00823 (diff) | |
Add stubs for Nfp and Acc + SvcGetThreadCoreMask implementation (#133)
* Stubs for NFP
* Stubs for ACC
* Implement SvcGetThreadCoreMask
* Fixup
* Fixup 2
* Fixup 3
* Address Cyuubi's feedback
Diffstat (limited to 'Ryujinx.Core/OsHle/Kernel/SvcThread.cs')
| -rw-r--r-- | Ryujinx.Core/OsHle/Kernel/SvcThread.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Ryujinx.Core/OsHle/Kernel/SvcThread.cs b/Ryujinx.Core/OsHle/Kernel/SvcThread.cs index 11841758..c0d1bbd8 100644 --- a/Ryujinx.Core/OsHle/Kernel/SvcThread.cs +++ b/Ryujinx.Core/OsHle/Kernel/SvcThread.cs @@ -139,6 +139,28 @@ namespace Ryujinx.Core.OsHle.Kernel } } + private void SvcGetThreadCoreMask(AThreadState ThreadState) + { + int Handle = (int)ThreadState.X2; + + Ns.Log.PrintDebug(LogClass.KernelSvc, "Handle = " + Handle.ToString("x8")); + + KThread Thread = GetThread(ThreadState.Tpidr, Handle); + + if (Thread != null) + { + ThreadState.X0 = 0; + ThreadState.X1 = (ulong)Thread.IdealCore; + ThreadState.X2 = (ulong)Thread.CoreMask; + } + else + { + Ns.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!"); + + ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle); + } + } + private void SvcSetThreadCoreMask(AThreadState ThreadState) { //FIXME: This is wrong, but the "correct" way to handle |
