private void SvcSetThreadPriority(AThreadState ThreadState) { int Handle = (int)ThreadState.X0; int Priority = (int)ThreadState.X1; Device.Log.PrintDebug(LogClass.KernelSvc, "Handle = 0x" + Handle.ToString("x8") + ", " + "Priority = 0x" + Priority.ToString("x8")); //TODO: NPDM check. KThread Thread = Process.HandleTable.GetKThread(Handle); if (Thread == null) { Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!"); ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle); return; } Thread.SetPriority(Priority); ThreadState.X0 = 0; }
private void SvcSetThreadPriority(CpuThreadState threadState) { int handle = (int)threadState.X0; int priority = (int)threadState.X1; Logger.PrintDebug(LogClass.KernelSvc, "Handle = 0x" + handle.ToString("x8") + ", " + "Priority = 0x" + priority.ToString("x8")); //TODO: NPDM check. KThread thread = _process.HandleTable.GetKThread(handle); if (thread == null) { Logger.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{handle:x8}!"); threadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle); return; } thread.SetPriority(priority); threadState.X0 = 0; }
private void SvcSetThreadPriority(AThreadState ThreadState) { int Handle = (int)ThreadState.X0; int Priority = (int)ThreadState.X1; Device.Log.PrintDebug(LogClass.KernelSvc, "Handle = 0x" + Handle.ToString("x8") + ", " + "Priority = 0x" + Priority.ToString("x8")); KThread Thread = GetThread(ThreadState.Tpidr, Handle); if (Thread != null) { Thread.SetPriority(Priority); ThreadState.X0 = 0; } else { Device.Log.PrintWarning(LogClass.KernelSvc, $"Invalid thread handle 0x{Handle:x8}!"); ThreadState.X0 = MakeError(ErrorModule.Kernel, KernelErr.InvalidHandle); } }