Implement SvcGetThreadCoreMask
This commit is contained in:
parent
874957f220
commit
ea5dd0b281
2 changed files with 23 additions and 0 deletions
|
@ -47,6 +47,7 @@ namespace Ryujinx.Core.OsHle.Kernel
|
||||||
{ 0x0b, SvcSleepThread },
|
{ 0x0b, SvcSleepThread },
|
||||||
{ 0x0c, SvcGetThreadPriority },
|
{ 0x0c, SvcGetThreadPriority },
|
||||||
{ 0x0d, SvcSetThreadPriority },
|
{ 0x0d, SvcSetThreadPriority },
|
||||||
|
{ 0x0e, SvcGetThreadCoreMask },
|
||||||
{ 0x0f, SvcSetThreadCoreMask },
|
{ 0x0f, SvcSetThreadCoreMask },
|
||||||
{ 0x10, SvcGetCurrentProcessorNumber },
|
{ 0x10, SvcGetCurrentProcessorNumber },
|
||||||
{ 0x12, SvcClearEvent },
|
{ 0x12, SvcClearEvent },
|
||||||
|
|
|
@ -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)
|
private void SvcSetThreadCoreMask(AThreadState ThreadState)
|
||||||
{
|
{
|
||||||
//FIXME: This is wrong, but the "correct" way to handle
|
//FIXME: This is wrong, but the "correct" way to handle
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue