aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThreadSync.cs
diff options
context:
space:
mode:
authorThog <me@thog.eu>2020-01-19 23:21:53 +0100
committergdkchan <gab.dark.100@gmail.com>2020-01-19 19:21:53 -0300
commitd0f15cb0b124fb88fbecd0014e7a2020e5f93bb2 (patch)
tree9b57e5fc9e1d3cb7f33eef5b2fc86467ba7fb569 /Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThreadSync.cs
parent81cca88bcdadf7b565010c22f347460002aa3f0b (diff)
Update 32 bits syscalls to match 64 bits implementation (#892)
* Implement 32 bits syscalls Co-authored-by: riperiperi <rhy3756547@hotmail.com> Implement all 32 bits counterparts of the 64 bits syscalls we currently have. * Add FlushProcessDataCache32 * Address jd's comments
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThreadSync.cs')
-rw-r--r--Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThreadSync.cs56
1 files changed, 56 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThreadSync.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThreadSync.cs
index 5eeecd93..4adbdd62 100644
--- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThreadSync.cs
+++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThreadSync.cs
@@ -12,6 +12,18 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return WaitSynchronization(handlesPtr, handlesCount, timeout, out handleIndex);
}
+ public KernelResult WaitSynchronization32(
+ [R(0)] uint timeoutLow,
+ [R(1)] uint handlesPtr,
+ [R(2)] int handlesCount,
+ [R(3)] uint timeoutHigh,
+ [R(1)] out int handleIndex)
+ {
+ long timeout = (long)(timeoutLow | ((ulong)timeoutHigh << 32));
+
+ return WaitSynchronization(handlesPtr, handlesCount, timeout, out handleIndex);
+ }
+
private KernelResult WaitSynchronization(ulong handlesPtr, int handlesCount, long timeout, out int handleIndex)
{
handleIndex = 0;
@@ -45,6 +57,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return CancelSynchronization(handle);
}
+ public KernelResult CancelSynchronization32([R(0)] int handle)
+ {
+ return CancelSynchronization(handle);
+ }
+
private KernelResult CancelSynchronization(int handle)
{
KThread thread = _process.HandleTable.GetKThread(handle);
@@ -64,6 +81,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return ArbitrateLock(ownerHandle, mutexAddress, requesterHandle);
}
+ public KernelResult ArbitrateLock32([R(0)] int ownerHandle, [R(1)] uint mutexAddress, [R(2)] int requesterHandle)
+ {
+ return ArbitrateLock(ownerHandle, mutexAddress, requesterHandle);
+ }
+
private KernelResult ArbitrateLock(int ownerHandle, ulong mutexAddress, int requesterHandle)
{
if (IsPointingInsideKernel(mutexAddress))
@@ -86,6 +108,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return ArbitrateUnlock(mutexAddress);
}
+ public KernelResult ArbitrateUnlock32([R(0)] uint mutexAddress)
+ {
+ return ArbitrateUnlock(mutexAddress);
+ }
+
private KernelResult ArbitrateUnlock(ulong mutexAddress)
{
if (IsPointingInsideKernel(mutexAddress))
@@ -112,6 +139,18 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return WaitProcessWideKeyAtomic(mutexAddress, condVarAddress, handle, timeout);
}
+ public KernelResult WaitProcessWideKeyAtomic32(
+ [R(0)] uint mutexAddress,
+ [R(1)] uint condVarAddress,
+ [R(2)] int handle,
+ [R(3)] uint timeoutLow,
+ [R(4)] uint timeoutHigh)
+ {
+ long timeout = (long)(timeoutLow | ((ulong)timeoutHigh << 32));
+
+ return WaitProcessWideKeyAtomic(mutexAddress, condVarAddress, handle, timeout);
+ }
+
private KernelResult WaitProcessWideKeyAtomic(
ulong mutexAddress,
ulong condVarAddress,
@@ -142,6 +181,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return SignalProcessWideKey(address, count);
}
+ public KernelResult SignalProcessWideKey32([R(0)] uint address, [R(1)] int count)
+ {
+ return SignalProcessWideKey(address, count);
+ }
+
private KernelResult SignalProcessWideKey(ulong address, int count)
{
KProcess currentProcess = _system.Scheduler.GetCurrentProcess();
@@ -156,6 +200,13 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return WaitForAddress(address, type, value, timeout);
}
+ public KernelResult WaitForAddress32([R(0)] uint address, [R(1)] ArbitrationType type, [R(2)] int value, [R(3)] uint timeoutLow, [R(4)] uint timeoutHigh)
+ {
+ long timeout = (long)(timeoutLow | ((ulong)timeoutHigh << 32));
+
+ return WaitForAddress(address, type, value, timeout);
+ }
+
private KernelResult WaitForAddress(ulong address, ArbitrationType type, int value, long timeout)
{
if (IsPointingInsideKernel(address))
@@ -199,6 +250,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
return SignalToAddress(address, type, value, count);
}
+ public KernelResult SignalToAddress32([R(0)] uint address, [R(1)] SignalType type, [R(2)] int value, [R(3)] int count)
+ {
+ return SignalToAddress(address, type, value, count);
+ }
+
private KernelResult SignalToAddress(ulong address, SignalType type, int value, int count)
{
if (IsPointingInsideKernel(address))