aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcThreadSync.cs
diff options
context:
space:
mode:
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))