From 20ce37dee6158ede18ad699338ecea083728423b Mon Sep 17 00:00:00 2001 From: Mary Date: Sat, 29 Jan 2022 22:18:03 +0100 Subject: 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 --- Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs') diff --git a/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs b/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs index 3fd07f90..f53b43b3 100644 --- a/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs +++ b/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs @@ -35,7 +35,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading KProcess currentProcess = KernelStatic.GetCurrentProcess(); - if (!KernelTransfer.UserToKernelInt32(_context, mutexAddress, out int mutexValue)) + if (!KernelTransfer.UserToKernel(out int mutexValue, mutexAddress)) { _context.CriticalSection.Leave(); @@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading KernelResult result = KernelResult.Success; - if (!KernelTransfer.KernelToUserInt32(_context, mutexAddress, mutexValue)) + if (!KernelTransfer.KernelToUser(mutexAddress, mutexValue)) { result = KernelResult.InvalidMemState; } @@ -123,9 +123,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading (int mutexValue, _) = MutexUnlock(currentThread, mutexAddress); - KernelTransfer.KernelToUserInt32(_context, condVarAddress, 1); + KernelTransfer.KernelToUser(condVarAddress, 1); - if (!KernelTransfer.KernelToUserInt32(_context, mutexAddress, mutexValue)) + if (!KernelTransfer.KernelToUser(mutexAddress, mutexValue)) { _context.CriticalSection.Leave(); @@ -201,7 +201,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading if (!_condVarThreads.Any(x => x.CondVarAddress == address)) { - KernelTransfer.KernelToUserInt32(_context, address, 0); + KernelTransfer.KernelToUser(address, 0); } _context.CriticalSection.Leave(); @@ -290,7 +290,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading currentThread.SignaledObj = null; currentThread.ObjSyncResult = KernelResult.TimedOut; - if (!KernelTransfer.UserToKernelInt32(_context, address, out int currentValue)) + if (!KernelTransfer.UserToKernel(out int currentValue, address)) { _context.CriticalSection.Leave(); @@ -363,7 +363,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading KProcess currentProcess = KernelStatic.GetCurrentProcess(); - if (!KernelTransfer.UserToKernelInt32(_context, address, out int currentValue)) + if (!KernelTransfer.UserToKernel(out int currentValue, address)) { _context.CriticalSection.Leave(); -- cgit v1.2.3