aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Core/OsHle/Svc
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2018-02-25 19:58:16 +0100
committergdkchan <gab.dark.100@gmail.com>2018-02-25 15:58:16 -0300
commite174100474fcfe484cc8e93c4db447886096615d (patch)
tree062d3437e791e173c86788dcbf58875c293ca3c8 /Ryujinx.Core/OsHle/Svc
parentfba0bf873257c4ac17f4584036661be08a1694d3 (diff)
Implement many objects, improve logging. (#42)
* Implement many objects, improve logging. Change and rename folders of Services Add Logging of IpcMessage. Add "lm" Log Service. Parse Errors of SetTerminateResult Add Svc Calls. Add many object implementations. * Corrections Forgotten Debug Conf * Corrections 2 * Corrections 3 * Corrections 4
Diffstat (limited to 'Ryujinx.Core/OsHle/Svc')
-rw-r--r--Ryujinx.Core/OsHle/Svc/SvcHandler.cs3
-rw-r--r--Ryujinx.Core/OsHle/Svc/SvcThread.cs39
2 files changed, 42 insertions, 0 deletions
diff --git a/Ryujinx.Core/OsHle/Svc/SvcHandler.cs b/Ryujinx.Core/OsHle/Svc/SvcHandler.cs
index 60af1e11..c5b6da04 100644
--- a/Ryujinx.Core/OsHle/Svc/SvcHandler.cs
+++ b/Ryujinx.Core/OsHle/Svc/SvcHandler.cs
@@ -30,6 +30,8 @@ namespace Ryujinx.Core.OsHle.Svc
{ 0x09, SvcStartThread },
{ 0x0b, SvcSleepThread },
{ 0x0c, SvcGetThreadPriority },
+ { 0x0d, SvcSetThreadPriority },
+ { 0x0f, SvcSetThreadCoreMask },
{ 0x13, SvcMapSharedMemory },
{ 0x14, SvcUnmapSharedMemory },
{ 0x15, SvcCreateTransferMemory },
@@ -44,6 +46,7 @@ namespace Ryujinx.Core.OsHle.Svc
{ 0x1f, SvcConnectToNamedPort },
{ 0x21, SvcSendSyncRequest },
{ 0x22, SvcSendSyncRequestWithUserBuffer },
+ { 0x25, SvcGetThreadId },
{ 0x26, SvcBreak },
{ 0x27, SvcOutputDebugString },
{ 0x29, SvcGetInfo }
diff --git a/Ryujinx.Core/OsHle/Svc/SvcThread.cs b/Ryujinx.Core/OsHle/Svc/SvcThread.cs
index a635edb1..cc0f980b 100644
--- a/Ryujinx.Core/OsHle/Svc/SvcThread.cs
+++ b/Ryujinx.Core/OsHle/Svc/SvcThread.cs
@@ -81,5 +81,44 @@ namespace Ryujinx.Core.OsHle.Svc
//TODO: Error codes.
}
+
+ private void SvcSetThreadPriority(AThreadState ThreadState)
+ {
+ int Handle = (int)ThreadState.X1;
+ int Prio = (int)ThreadState.X0;
+
+ HThread Thread = Ns.Os.Handles.GetData<HThread>(Handle);
+
+ if (Thread != null)
+ {
+ Thread.Priority = Prio;
+
+ ThreadState.X0 = (int)SvcResult.Success;
+ }
+
+ //TODO: Error codes.
+ }
+
+ private void SvcSetThreadCoreMask(AThreadState ThreadState)
+ {
+ ThreadState.X0 = (int)SvcResult.Success;
+
+ //TODO: Error codes.
+ }
+
+ private void SvcGetThreadId(AThreadState ThreadState)
+ {
+ int Handle = (int)ThreadState.X0;
+
+ HThread Thread = Ns.Os.Handles.GetData<HThread>(Handle);
+
+ if (Thread != null)
+ {
+ ThreadState.X1 = (ulong)Thread.ThreadId;
+ ThreadState.X0 = (int)SvcResult.Success;
+ }
+
+ //TODO: Error codes.
+ }
}
} \ No newline at end of file